當前位置:首頁 » 操作系統 » oracle多個資料庫

oracle多個資料庫

發布時間: 2022-05-30 08:50:57

❶ oracle10G怎麼里怎麼創建多個資料庫

一個資料庫創建多個實例
1. 先要關閉資料庫(進程和內存關閉)
[Oracle@oracle_2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Proction on TueNov 12 20:34:53 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release10.2.0.1.0 - Proction
With the Partitioning, OLAP and Data Mining options
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
2. 設置環境變數
[oracle@oracle_2 ~]$ vi .bash_profile
此時環境變數已經設置好了
3. 創建目錄
i. 創建相關文件
此時我們可以看見已經有了相關目錄,那是我們之前創建的實例ORCL的相關目錄
創建目錄是採用了批量創建目錄{a,b,c,u}mp
[oracle@oracle_2 ~]$ cd $ORACLE_BASE
[oracle@oracle_2 oracle]$ ls
admin flash_recovery_area oradata oraInventory proct
[oracle@oracle_2 oracle]$
[oracle@oracle_2 oracle]$ mkdir -p admin/ORA10G/{a,b,c,u}mp
[oracle@oracle_2 oracle]$ ls
admin flash_recovery_area oradata oraInventory proct
[oracle@oracle_2 oracle]$ cd admin/
[oracle@oracle_2 admin]$ ls
ORA10G ORCL
[oracle@oracle_2 admin]$ cd ORA10G/
[oracle@oracle_2 ORA10G]$ ls
amp bmp cmp ump
[oracle@oracle_2 ORA10G]$
[oracle@oracle_2 ORA10G]$ ls
amp bmp cmp ump
[oracle@oracle_2 ORA10G]$ cd ..
[oracle@oracle_2 admin]$ ls
ORA10G ORCL
[oracle@oracle_2 admin]$ cd ..
[oracle@oracle_2 oracle]$ ls
admin flash_recovery_area oradata oraInventory proct
[oracle@oracle_2 oracle]$ mkdir -p oradata/ORA10G
[oracle@oracle_2 oracle]$
ii. 創建密碼文件
創建密碼文件需要到ORACLE_HOME/dbs目錄下創建
[oracle@oracle_2 10.2.0]$ cd $ORACLE_HOME/dbs
[oracle@oracle_2 dbs]$ ls
hc_ORCL.dat initdw.ora init.ora lkORCL orapwORCL spfileORCL.ora
[oracle@oracle_2 dbs]$ orapwd
Usage: orapwd file=<fname>password=<password> entries=<users> force=<y/n>
where
file -name of password file (mand),
password- password for SYS (mand),
entries -maximum number of distinct DBA and force - whether to overwrite existing file (opt),
OPERs (opt),
There areno spaces around the equal-to (=) character.
[oracle@oracle_2 dbs]$ orapwd file=orapwORA10Gpassword=oracle entries=30
[oracle@oracle_2 dbs]$ ls
hc_ORCL.dat init.ora orapwORA10G spfileORCL.ora
initdw.ora lkORCL orapwORCL
[oracle@oracle_2 dbs]$
[oracle@oracle_2 dbs]$ cat init.ora |grep -v^#|grep -v ^$ >initORA10G.ora
[oracle@oracle_2 dbs]$ ls
hc_ORCL.dat init.ora lkORCL orapwORCL
initdw.ora initORA10G.ora orapwORA10G spfileORCL.ora
[oracle@oracle_2 dbs]$
[oracle@oracle_2 dbs]$ vi initORA10G.ora
將內容改的和下面的一樣
db_name=ORA10G
db_files = 80 # SMALL
db_file_multiblock_read_count = 8 #SMALL
log_checkpoint_interval = 10000
processes = 50 # SMALL
parallel_max_servers = 5 #SMALL
log_buffer = 32768 # SMALL
max_mp_file_size = 10240 # limit trace file size to 5 Meg each
global_names = false
control_files =(/u01/app/oracle/oradata/ORA10G/ora_control1.ctl,/u01/app/oracle/oradata/ORA10G/ora_control2.ctl)
sga_max_size=300m
sga_target=300m
4. 啟動實例為ORA10G的資料庫
[oracle@oracle_2 dbs]$ export $ORACLE_SID=ORA10G
[oracle@oracle_2 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Proction on TueNov 12 21:08:55 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SYS@ORA10G>
SYS@ORA10G>create spfile from pfile;
File created.
SYS@ORA10G>startup nomount;
ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed Size 1219184 bytes
Variable Size 96470416 bytes
Database Buffers 213909504 bytes
Redo Buffers 2973696 bytes
SYS@ORA10G>
SYS@ORA10G>show parameter undo
NAME TYPE VALUE
------------------------------------ -----------------------------------------
undo_management string MANUAL
undo_retention integer 900
undo_tablespace string
SYS@ORA10G>
修改參數,由於undo_management參數為靜態參數,所以需要加上scope=spfile
SYS@ORA10G>alter system set undo_management=autoscope=spfile;
System altered.
SYS@ORA10G>show parameter undo
NAME TYPE VALUE
------------------------------------ -----------------------------------------
undo_management string MANUAL
undo_retention integer 900
undo_tablespace string
SYS@ORA10G>shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
此時發現並沒有更改,是由於靜態參數需要重啟才有效
SYS@ORA10G>startup nomount;
ORACLE instance started.
Total System Global Area 314572800 bytes
Fixed Size 1219184 bytes
Variable Size 96470416 bytes
Database Buffers 213909504 bytes
Redo Buffers 2973696 bytes
SYS@ORA10G>
此時只是改了spfile的參數還需要改pfile的參數
SYS@ORA10G>create pfile from spfile;
File created.
SYS@ORA10G>
5. 多個實例的切換
i. 實例為ORCL啟動資料庫
[oracle@oracle_2 dbs]$ export ORACLE_SID=ORCL
[oracle@oracle_2 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Proction on TueNov 12 21:19:19 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SYS@ORCL>
ii. 實例為ORCL10G啟動資料庫
SYS@ORCL>exit
Disconnected
[oracle@oracle_2 dbs]$ export ORACLE_SID=ORA10G
[oracle@oracle_2 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Proction on TueNov 12 21:24:54 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release10.2.0.1.0 - Proction
With the Partitioning, OLAP and Data Mining options
SYS@ORA10G>

❷ oracle 一個實例下可以建多個資料庫么


通常情況下:一個實例對應一個資料庫

RAC集群:多個實例對應一個資料庫

oracle12C:一個實例可以對應多個資料庫

❸ oracle可以創建多個資料庫嗎

不管你是什麼操作系統,可以按照下列的方式創建多個Oracle資料庫
點擊[開始]->[程序]->[Oracle - OraHome92]->[Configuration and Migration Tools]->[Database Configuration Assistant],然後按照中文提示創建自己的資料庫!!
在這里祝你成功!
順便說明一下,Oracle和SQL不一樣,可以說是復雜的多,用慣了SQL的朋友真的是很難接受Oracle的操作方式,呵呵!

❹ 一個oracle是一個資料庫嗎一個oracle中能有多個資料庫嗎一個資料庫就是一個表空間嗎

一個資料庫應該可以包含多個用戶,每一個用戶都可以存在於各自的tablespace上,也可以共用1個,如果一個用戶就是一個資料庫,那麼這個資料庫最多隻是一個表空間而已,而實際上一個資料庫要包含多個表空間(system sysaux users temp ……)

❺ oracle伺服器上有多個資料庫嗎

可以的,只要伺服器資源夠用的話,隨你安裝幾個資料庫都可以,只是每個資料庫listener都必須不同,只有一個資料庫可以預設1521,其他資料庫需要改埠;
但是一般情況下伺服器上的資源都是有限的,內存多一點的安裝2~3資料庫沒啥問題。
生產環境沒人這么干,測試環境,開發環境倒是可以的。

❻ oracle 一個實例下可以建多個資料庫么

oracle 一個實例下可以建多個資料庫么?
:一 通常情況下:一個實例對應一個資料庫 二 RAC集群:多個實例對應一個資料庫 三oracle12C:一個實例可以對應多個資料庫

❼ 我的Oracle中創建了多個資料庫,我應該如何在資料庫之間進行切換呢

你只需要在登陸的時候選擇哪個資料庫登陸就行了,前提是每個資料庫的所有服務都已經啟動。每個資料庫不是都有個什麼系統標識符啊,就那個,登陸格式你去找找哈,

❽ 怎麼在一台機器上安裝兩個oracle資料庫

你要明白oracle是一個客戶端對應多個資料庫的,也就是說,同一個計算機室可以安裝多個資料庫的。你在安裝好客戶端後,點擊開始-所有程序-oracle客戶端,在裡面找到一個database開頭的程序,貌似叫DatabaseManager,進去後,你就知道了。

❾ 一台伺服器上如何安裝多個oracle資料庫

你可以在安裝軟體後再創建資料庫,這個數量可以是多個。安裝ORACLE時,如選擇僅安裝軟體,則安裝結束後無資料庫。你可以繼續創建資料庫。
實例是一個正在進行時的概念,每當啟動一個資料庫時,ORACLE會依照初始化參數文件spfile的記錄分配內存,啟動進程,查找相關文件,而當資料庫關閉後,實例的壽命也就終止了,再啟動就是一個新的實例,可以簡單理解為實例就是內存和進程的集合,與物理文件沒有關聯,你完全可以刪除實例,然後用oradmin來創建一個新實例,然後啟動資料庫,只要物理文件沒有問題。多個實例可對應一個資料庫,它們共同操作同一數據文件。但你要說多個資料庫,應該是指要創建不同的物理文件,而一個實例不能管理多個資料庫。

熱點內容
網易夢之國伺服器ip 發布:2024-05-05 14:06:11 瀏覽:34
如何設置一個通俗易懂的密碼 發布:2024-05-05 13:52:21 瀏覽:621
新網易我的世界伺服器 發布:2024-05-05 13:42:44 瀏覽:662
演算法題寫錯了 發布:2024-05-05 13:34:57 瀏覽:804
sql按小時分組 發布:2024-05-05 13:26:25 瀏覽:94
張藝謀我們一家訪問人 發布:2024-05-05 12:38:05 瀏覽:111
美版安卓系統怎麼安裝 發布:2024-05-05 12:37:18 瀏覽:920
qq郵箱緩存地址 發布:2024-05-05 12:37:16 瀏覽:986
電位演算法 發布:2024-05-05 12:36:01 瀏覽:727
我的世界清風斗羅大陸伺服器地址 發布:2024-05-05 12:35:50 瀏覽:453