11gR2 RAC手動新增節點資料庫例項
兩臺伺服器構成的Oracle 11gR2 RAC環境中,其中rac1伺服器的私有網路卡需要更換,所以在rac2伺服器上使用dbca建立資料庫的時候只建立了本節點的資料庫例項(oracledb1)。當rac1伺服器私有網路卡更換成功,在rac1伺服器執行dbca圖形化"add Instance"和執行dbca -silent命令新增例項,都收到下面的報錯:
[oracle@rac1 ~]$ dbca -silent -addInstance -gdbName oracledb -nodelist rac1 -instanceName oracledb2 -sysDBAUserName sys -sysDBAPassword oracle_Schic1
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/oracledb.log" for further details.
[oracle@rac1 ~]$ cat /u01/app/oracle/cfgtoollogs/dbca/oracledb.log
"Adding instance" operation on the admin managed database oracledb requires instance configured on local node. There is no instance configured on the local node "rac1".
該操作放在現有的RAC節點rac2上執行應該就可以了。不過下面我們繼續討論手動在rac1上新增oracledb2例項的步驟:
由於rac2執行著oracledb1例項,所以這裡先新增rac1的oracledb2例項,之後再做調整。
1.嘗試直接在rac1上啟動oracledb2例項。
[root@rac1 bin]# su - oracle
[oracle@rac1 ~]$ export ORACLE_SID=oracledb2
[oracle@rac1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Fri Nov 9 02:29:36 2012
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORA-29760: instance_number parameter not specified
instance_number的內容參考文章:http://space.itpub.net/23135684/viewspace-748572
2.確保rac1的ASM例項載入了相關磁碟組。
[root@rac2 bin]# ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ARCH.dg
OFFLINE OFFLINE rac1
ONLINE ONLINE rac2
ora.DATA.dg
OFFLINE OFFLINE rac1
ONLINE ONLINE rac2
......
ora.asm
ONLINE ONLINE rac1 Started
ONLINE ONLINE rac2 Started
......
ora.oracledb.db
1 ONLINE ONLINE rac2 Open
......
[root@rac2 bin]# ./srvctl start diskgroup -g data -n rac1
[root@rac2 bin]# ./srvctl start diskgroup -g arch -n rac1
[root@rac2 bin]# ./crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.ARCH.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
ora.DATA.dg
ONLINE ONLINE rac1
ONLINE ONLINE rac2
......
3.調整RAC引數檔案。
[root@rac2 bin]# su - oracle
[oracle@rac2 ~]$ export ORACLE_SID=oracledb1
[oracle@rac2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Fri Nov 9 02:34:18 2012
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> create pfile='/tmp/opfile.txt' from spfile='+DATA/oracledb/spfileoracledb.ora';
File created.
SQL> !vi /tmp/opfile.txt
oracledb1.__db_cache_size=60263759872
oracledb1.__java_pool_size=134217728
oracledb1.__large_pool_size=134217728
oracledb1.__pga_aggregate_target=39728447488
oracledb1.__sga_target=68719476736
oracledb1.__shared_io_pool_size=0
oracledb1.__shared_pool_size=7784628224
oracledb1.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/oracledb/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.0.0'
*.control_files='+DATA/oracledb/controlfile/current.260.798857565'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_name='oracledb'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=oracledbXDB)'
oracledb1.instance_number=1
oracledb2.instance_number=2
*.log_archive_dest_1='LOCATION=+arch'
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=300
*.pga_aggregate_target=39625687040
*.processes=5000
*.remote_listener='wstrac.scan.com:1521'
*.remote_login_passwordfile='exclusive'
*.sessions=5505
*.sga_target=68719476736
oracledb1.thread=1
oracledb2.thread=2
oracledb1.undo_tablespace='UNDOTBS1'
oracledb2.undo_tablespace='UNDOTBS2'
~
"/tmp/opfile.txt" 34L, 1103C written
上面加紅的部分是新增加的內容。
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> create spfile='+DATA/oracledb/spfileoracledb.ora' from pfile='/tmp/opfile.txt';
File created.
SQL> startup
ORACLE instance started.
Total System Global Area 6.8413E+10 bytes
Fixed Size 2245480 bytes
Variable Size 8053066904 bytes
Database Buffers 6.0264E+10 bytes
Redo Buffers 93609984 bytes
Database mounted.
Database opened.
增加的引數的含義也參考文章:http://space.itpub.net/23135684/viewspace-748572
4.確保建立了UNDOTBS2表空間。
SQL> select file_id,file_name from dba_data_files;
FILE_ID
----------
FILE_NAME
--------------------------------------------------------------------------------
4
+DATA/oracledb/datafile/users.259.798857305
3
+DATA/oracledb/datafile/undotbs1.258.798857305
2
+DATA/oracledb/datafile/sysaux.257.798857305
FILE_ID
----------
FILE_NAME
--------------------------------------------------------------------------------
1
+DATA/oracledb/datafile/system.256.798857305
5
+DATA/oracledb/datafile/undotbs2.266.798863859
5.再次嘗試啟動rac1上的oracledb2例項。
SQL> startup
ORACLE instance started.
Total System Global Area 6.8413E+10 bytes
Fixed Size 2245480 bytes
Variable Size 6979325080 bytes
Database Buffers 6.1338E+10 bytes
Redo Buffers 93609984 bytes
ORA-01618: redo thread 2 is not enabled - cannot mount
需要啟用 redo thread 2。
6.啟用redo thread 2。
以下的操作一定在現存的RAC節點例項上執行(在新增的節點上無法執行),也就是說在rac2節點的oracledb1例項上執行以下命令:
SQL> ALTER DATABASE
2 ADD LOGFILE THREAD 2 GROUP 4
3 ('+DATA') SIZE 256M;
Database altered.
SQL> ALTER DATABASE
2 ADD LOGFILE THREAD 2 GROUP 5
3 ('+DATA') SIZE 256M;
Database altered.
SQL> ALTER DATABASE
2 ADD LOGFILE THREAD 2 GROUP 6
3 ('+DATA') SIZE 256M;
Database altered.
SQL> alter database enable thread 2;
Database altered.
要啟動thread 2,必須先為thread 2建立好日誌組。
參考文章:http://space.itpub.net/7199859/viewspace-663572
7.載入rac1 oracledb2例項並開啟資料庫。
SQL> alter database mount;
Database altered.
SQL> alter database open;
Database altered.
經過以上的步驟,成功為rac1節點新增了oracledb2例項。
8.將例項資訊新增到OCR中。
[root@rac1 bin]# su - oracle
[oracle@rac1 ~]$ srvctl add instance -d oracledb -i oracledb2 -n rac1
[oracle@rac1 ~]$ srvctl status database -d oracledb
Instance oracledb2 is not running on node rac1
Instance oracledb1 is running on node rac2
[oracle@rac1 ~]$ srvctl start instance -d oracledb -i oracledb2
[oracle@rac1 ~]$ srvctl status database -d oracledb
Instance oracledb2 is running on node rac1
Instance oracledb1 is running on node rac2
9.調整OCR中例項執行節點。
經過上面的新增後,rac1執行著oracledb2例項,rac2執行著oracledb1例項,執行下面的步驟,使得rac1執行oracledb1例項,rac2執行oracledb2例項。
[oracle@rac1 ~]$ srvctl stop database -d oracledb
[oracle@rac1 ~]$ srvctl remove instance -d oracledb -i oracledb1
Remove instance from the database oracledb? (y/[n]) y
[oracle@rac1 ~]$ srvctl remove instance -d oracledb -i oracledb2
Remove instance from the database oracledb? (y/[n]) y
[oracle@rac1 ~]$ srvctl add instance -d oracledb -i oracledb1 -n rac1
[oracle@rac1 ~]$ srvctl add instance -d oracledb -i oracledb2 -n rac2
[oracle@rac1 ~]$ srvctl start database -d oracledb
[oracle@rac1 ~]$ srvctl status database -d oracledb
Instance oracledb1 is running on node rac1
Instance oracledb2 is running on node rac2
[oracle@rac1 ~]$ srvctl enable database -d oracledb
PRCC-1010 : oracledb was already enabled
PRCR-1002 : Resource ora.oracledb.db is already enabled
[oracle@rac1 ~]$ srvctl enable instance -d oracledb -i oracledb1
[oracle@rac1 ~]$ srvctl enable instance -d oracledb -i oracledb2
--end--
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26870952/viewspace-1209633/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【RAC】刪除RAC資料庫節點(一)——刪除資料庫例項資料庫
- RAC環境只啟動單例項資料庫單例資料庫
- Oracle RAC新增節點Oracle
- Oracle RAC 新增節點Oracle
- RAC資料庫恢復到單例項資料庫資料庫單例
- RAC資料庫只能啟動一個節點的故障資料庫
- RAC恢復到單例項節點上單例
- Oracle 10g RAC增加節點例項Oracle 10g
- 單例項資料庫expdp遷移到RAC庫單例資料庫
- WMB 使用Compute節點連線Oracle資料庫例項Oracle資料庫
- 【RAC】Oracle11g RAC新增新節點相關事項Oracle
- 3節點RAC資料庫夯故障分析資料庫
- asm例項自動dismount導致rac一個節點當機ASM
- ORACLE 11gR2 單例項資料庫自啟Oracle單例資料庫
- 【RAC】刪除RAC資料庫節點(二)——刪除ASM資料庫ASM
- 【RAC】刪除RAC資料庫節點(五)——刪除ONS資料庫
- jQuery新增節點___例_新增表格jQuery
- duplicate複製資料庫(rac-單例項)資料庫單例
- RAC資料庫啟用、禁用一個例項資料庫
- 恢復RAC資料庫到單例項(ASM)資料庫單例ASM
- Oracle RAC恢復成單節點資料庫Oracle資料庫
- 【RAC】刪除RAC資料庫節點(三)——刪除監聽資料庫
- [網摘] Oracle RAC新增節點Oracle
- 11gR2 手動建立資料庫(11.2.0.3)資料庫
- 11g RAC中手工新增刪除資料庫及例項等資訊到OCR資料庫
- 連線RAC資料庫中單個例項(一)資料庫
- 單例項恢復RAC資料庫步驟(三)單例資料庫
- 單例項恢復RAC資料庫步驟(二)單例資料庫
- 單例項恢復RAC資料庫步驟(一)單例資料庫
- 連線RAC資料庫中單個例項(二)資料庫
- 用srvctl 命令停止RAC 資料庫某個例項資料庫
- 【RAC】將單例項備份集恢復為rac資料庫單例資料庫
- 【RAC】將RAC備份集恢復為單例項資料庫單例資料庫
- oracle 12c RAC安裝,例項不能多節點同時啟動Oracle
- 【RAC】刪除RAC資料庫節點(四)——刪除資料庫軟體及ASM軟體資料庫ASM
- 3節點rac基礎上配置goldengate(單例項)Go單例
- oracle10g單例項遷移至3節點RACOracle單例
- oracle11g RAC新增節點Oracle