日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

11gR2 RAC手动添加节点数据库实例

發(fā)布時(shí)間:2025/3/8 数据库 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 11gR2 RAC手动添加节点数据库实例 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

兩臺(tái)服務(wù)器構(gòu)成的Oracle 11gR2 RAC環(huán)境中,其中rac1服務(wù)器的私有網(wǎng)卡需要更換,所以在rac2服務(wù)器上使用dbca創(chuàng)建數(shù)據(jù)庫(kù)的時(shí)候只創(chuàng)建了本節(jié)點(diǎn)的數(shù)據(jù)庫(kù)實(shí)例(oracledb1)。當(dāng)rac1服務(wù)器私有網(wǎng)卡更換成功,在rac1服務(wù)器執(zhí)行dbca圖形化"add Instance"和執(zhí)行dbca -silent命令添加實(shí)例,都收到下面的報(bào)錯(cuò):

[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".
? ? ? ? 該操作放在現(xiàn)有的RAC節(jié)點(diǎn)rac2上執(zhí)行應(yīng)該就可以了。不過下面我們繼續(xù)討論手動(dòng)在rac1上添加oracledb2實(shí)例的步驟:
? ? ? ? 由于rac2運(yùn)行著oracledb1實(shí)例,所以這里先添加rac1的oracledb2實(shí)例,之后再做調(diào)整。
1.嘗試直接在rac1上啟動(dòng)oracledb2實(shí)例。
[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的內(nèi)容參考文章:http://space.itpub.net/23135684/viewspace-748572
2.確保rac1的ASM實(shí)例加載了相關(guān)磁盤組。
[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.調(diào)整RAC參數(shù)文件。
[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
? ? ? ? 上面加紅的部分是新增加的內(nèi)容。

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.
增加的參數(shù)的含義也參考文章:http://space.itpub.net/23135684/viewspace-748572
4.確保創(chuàng)建了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.再次嘗試啟動(dòng)rac1上的oracledb2實(shí)例。
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。
? ? ? ? 以下的操作一定在現(xiàn)存的RAC節(jié)點(diǎn)實(shí)例上執(zhí)行(在添加的節(jié)點(diǎn)上無法執(zhí)行),也就是說在rac2節(jié)點(diǎn)的oracledb1實(shí)例上執(zhí)行以下命令:

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.
? ? ? ? 要啟動(dòng)thread 2,必須先為thread 2創(chuàng)建好日志組。
參考文章:http://space.itpub.net/7199859/viewspace-663572
7.加載rac1 oracledb2實(shí)例并打開數(shù)據(jù)庫(kù)。
SQL> alter database mount;?
Database altered.
SQL> alter database open;
Database altered.
? ? ? ? 經(jīng)過以上的步驟,成功為rac1節(jié)點(diǎn)添加了oracledb2實(shí)例。

8.將實(shí)例信息添加到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.調(diào)整OCR中實(shí)例運(yùn)行節(jié)點(diǎn)。
? ? ? ? 經(jīng)過上面的添加后,rac1運(yùn)行著oracledb2實(shí)例,rac2運(yùn)行著oracledb1實(shí)例,執(zhí)行下面的步驟,使得rac1運(yùn)行oracledb1實(shí)例,rac2運(yùn)行oracledb2實(shí)例。
[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--

總結(jié)

以上是生活随笔為你收集整理的11gR2 RAC手动添加节点数据库实例的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。