11gR2 RAC手动添加节点数据库实例
发表于:2025-02-05 作者:千家信息网编辑
千家信息网最后更新 2025年02月05日,两台服务器构成的Oracle 11gR2 RAC环境中,其中rac1服务器的私有网卡需要更换,所以在rac2服务器上使用dbca创建数据库的时候只创建了本节点的数据库实例(oracledb1)。当ra
千家信息网最后更新 2025年02月05日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> startupORA-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 ProductionWith 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=60263759872oracledb1.__java_pool_size=134217728oracledb1.__large_pool_size=134217728oracledb1.__pga_aggregate_target=39728447488oracledb1.__sga_target=68719476736oracledb1.__shared_io_pool_size=0oracledb1.__shared_pool_size=7784628224oracledb1.__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=1oracledb2.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=68719476736oracledb1.thread=1oracledb2.thread=2oracledb1.undo_tablespace='UNDOTBS1'oracledb2.undo_tablespace='UNDOTBS2'~"/tmp/opfile.txt" 34L, 1103C written
上面加红的部分是新增加的内容。
SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL> create spfile='+DATA/oracledb/spfileoracledb.ora' from pfile='/tmp/opfile.txt';
File created.SQL> startupORACLE instance started.
Total System Global Area 6.8413E+10 bytesFixed Size 2245480 bytesVariable Size 8053066904 bytesDatabase Buffers 6.0264E+10 bytesRedo Buffers 93609984 bytesDatabase 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> startupORACLE instance started.
Total System Global Area 6.8413E+10 bytesFixed Size 2245480 bytesVariable Size 6979325080 bytesDatabase Buffers 6.1338E+10 bytesRedo Buffers 93609984 bytesORA-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 oracledbInstance oracledb2 is not running on node rac1Instance oracledb1 is running on node rac2[oracle@rac1 ~]$ srvctl start instance -d oracledb -i oracledb2[oracle@rac1 ~]$ srvctl status database -d oracledbInstance oracledb2 is running on node rac1Instance 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 oracledb1Remove instance from the database oracledb? (y/[n]) y[oracle@rac1 ~]$ srvctl remove instance -d oracledb -i oracledb2Remove 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 oracledbInstance oracledb1 is running on node rac1Instance oracledb2 is running on node rac2[oracle@rac1 ~]$ srvctl enable database -d oracledbPRCC-1010 : oracledb was already enabledPRCR-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--
两台服务器构成的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> startupORA-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 ProductionWith 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=60263759872oracledb1.__java_pool_size=134217728oracledb1.__large_pool_size=134217728oracledb1.__pga_aggregate_target=39728447488oracledb1.__sga_target=68719476736oracledb1.__shared_io_pool_size=0oracledb1.__shared_pool_size=7784628224oracledb1.__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=1oracledb2.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=68719476736oracledb1.thread=1oracledb2.thread=2oracledb1.undo_tablespace='UNDOTBS1'oracledb2.undo_tablespace='UNDOTBS2'~"/tmp/opfile.txt" 34L, 1103C written
上面加红的部分是新增加的内容。
SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL> create spfile='+DATA/oracledb/spfileoracledb.ora' from pfile='/tmp/opfile.txt';
File created.SQL> startupORACLE instance started.
Total System Global Area 6.8413E+10 bytesFixed Size 2245480 bytesVariable Size 8053066904 bytesDatabase Buffers 6.0264E+10 bytesRedo Buffers 93609984 bytesDatabase 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> startupORACLE instance started.
Total System Global Area 6.8413E+10 bytesFixed Size 2245480 bytesVariable Size 6979325080 bytesDatabase Buffers 6.1338E+10 bytesRedo Buffers 93609984 bytesORA-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 oracledbInstance oracledb2 is not running on node rac1Instance oracledb1 is running on node rac2[oracle@rac1 ~]$ srvctl start instance -d oracledb -i oracledb2[oracle@rac1 ~]$ srvctl status database -d oracledbInstance oracledb2 is running on node rac1Instance 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 oracledb1Remove instance from the database oracledb? (y/[n]) y[oracle@rac1 ~]$ srvctl remove instance -d oracledb -i oracledb2Remove 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 oracledbInstance oracledb1 is running on node rac1Instance oracledb2 is running on node rac2[oracle@rac1 ~]$ srvctl enable database -d oracledbPRCC-1010 : oracledb was already enabledPRCR-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--
实例
节点
运行
服务器
服务
数据
数据库
文章
步骤
面的
参考
调整
成功
内容
参数
命令
网卡
尝试
私有
手动
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
arm架构服务器产品规格
c语言底层嵌入式软件开发
公安部网络安全局通报
上门维修电脑网络技术员
财政局网络安全应急演练情况
惠敏软件开发
网络安全泄漏事故案例
软件开发主要是什么
数据库教学设计案例分析
武安软件开发系统
能挣钱的小游戏软件开发
视频会议软件开发哪家好市场
网络安全周弘毅
网络安全理论doc
征信解析数据库
树莓派做服务器可以吗
阿里云安装git服务器
数据库时间戳好用吗
软件开发技校院校
网络安全法条文释义
软件开发企业的资质有哪些
刚租的服务器怎么放
数据库 time
阿里云服务器流量计费价格表
俄罗斯苹果服务器在哪里
维普数据库领域导航在哪里
软件开发清单文档
数据库中查看表的字段名
网络技术试题百度云
网络安全利益