Oracle RAC One Node convert to RAC
操作步骤
CopyRight By Jieyancai
环境说明:
Redhat 6.3x64+oracle11.2.0.3 racone+asm
数据库名:zxm 应用服务名:app
目标转换为 RAC zxm1,zxm2
以下操作均用 oracle 用户操作。
1.
转换操作
srvctl stop database -d zxm
srvctl convert database -d zxm -c RAC
2.
移除原来的服务和实例
移除服务:
srvctl remove service -d zxm -s app
移除实例:
srvctl remove instance -d zxm -i zxm_1
srvctl remove instance -d zxm -i zxm_2
查看原来的实例及服务名称:
srvctl config service -d zxm
srvctl config database -d zxm
oracle@rac01:/home/oracle(jyc1)>srvctl config database -d zxm -a
Database unique name: zxm
Database name: zxm
Oracle home: /home/oracle/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/zxm/spfilezxm.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: zxm
Database instances:
Disk Groups: DATA,RECO
Mount point paths:
Services: app
Type: RACOneNode
Online relocation timeout: 30
Instance name prefix: zxm
Candidate servers: rac01,rac02
Database is enabled
Database is administrator managed
oracle@rac02:/home/oracle(jyc2)>srvctl config service -d zxm
Service name: app
Service is enabled
Server pool: zxm
Cardinality: 1
Disconnect: false
Service role: PRIMARY
Management policy: AUTOMATIC
DTP transaction: false
AQ HA notifications: false
Failover type: NONE
Failover method: NONE
TAF failover retries: 0
TAF failover delay: 0
Connection Load Balancing Goal: LONG
Runtime Load Balancing Goal: NONE
TAF policy specification: BASIC
Edition:
Preferred instances: zxm_2
Available instances:
3.
添加实例
srvctl add instance -d zxm -i zxm1 -n rac01
srvctl add instance -d zxm -i zxm2 -n rac02
crsctl stat res -t
oracle@rac01:/home/oracle(jyc1)>srvctl modify instance -d zxm -i zxm1 -s +ASM1
Warning:-s option has been deprecated and will be ignored.
oracle@rac01:/home/oracle(jyc1)>srvctl modify instance -d zxm -i zxm2 -s +ASM2
Warning:-s option has been deprecated and will be ignored.
4.
重建
spflie
参数
原参数:
srvoracle@rac01:/home/oracle(zxm1)>srvctl status asm
ASM is running on rac02,rac01
oracle@rac01:/home/oracle(zxm1)>sqlplus /nolog
SQL*Plus: Release 11.2.0.3.0 Production on Wed Sep 19 12:14:08 2012
Copyright (c) 1982, 2011, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected to an idle instance.
SQL> create pfile='/home/oracle/1.txt' from spfile='+DATA/zxm/spfilezxm.ora';
File created.
SQL> !more 1.txt
zxm_1.__db_cache_size=587202560
zxm_2.__db_cache_size=587202560
zxm_1.__java_pool_size=4194304
zxm_2.__java_pool_size=4194304
zxm_1.__large_pool_size=4194304
zxm_2.__large_pool_size=4194304
zxm_1.__oracle_base='/home/oracle'#ORACLE_BASE set from environment
zxm_2.__oracle_base='/home/oracle'#ORACLE_BASE set from environment
zxm_1.__pga_aggregate_target=369098752
zxm_2.__pga_aggregate_target=369098752
zxm_1.__sga_target=905969664
zxm_2.__sga_target=905969664
zxm_1.__shared_io_pool_size=0
zxm_2.__shared_io_pool_size=0
zxm_1.__shared_pool_size=297795584
zxm_2.__shared_pool_size=297795584
zxm_1.__streams_pool_size=0
zxm_2.__streams_pool_size=0
*.audit_file_dest='/home/oracle/admin/zxm/adump'
*.audit_trail='NONE'
*.cluster_database=true
*.compatible='11.2.0.0.0'
*.control_files='+DATA/zxm/controlfile/current.272.793985953','+RECO/zxm/controlfile/current.261.7939
85953'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_name='zxm'
*.db_recovery_file_dest='+RECO'
*.db_recovery_file_dest_size=5218762752
*.diagnostic_dest='/home/oracle'
*.nls_language='SIMPLIFIED CHINESE'
*.nls_territory='CHINA'
*.open_cursors=300
*.pga_aggregate_target=368435456
*.processes=150
*.remote_listener='mycrs-scan:1521'
*.remote_login_passwordfile='exclusive'
*.sga_target=905306368
新参数:
zxm1.__db_cache_size=683671552
zxm2.__db_cache_size=683671552
zxm1.__java_pool_size=4194304
zxm2.__java_pool_size=4194304
zxm1.__large_pool_size=4194304
zxm2.__large_pool_size=4194304
zxm1.__pga_aggregate_target=343932928
zxm2.__pga_aggregate_target=343932928
zxm1.__sga_target=1031798784
zxm2.__sga_target=1031798784
zxm1.__shared_io_pool_size=0
zxm2.__shared_io_pool_size=0
zxm1.__shared_pool_size=327155712
zxm2.__shared_pool_size=327155712
zxm1.__streams_pool_size=0
zxm2.__streams_pool_size=0
*.audit_file_dest='/home/oracle/admin/zxm/adump'
*.audit_trail='NONE'
*.cluster_database=true
*.compatible='11.2.0.0.0'
*.control_files='+DATA/zxm/controlfile/current.272.793985953','+RECO/zxm/controlfile/current.261.7939
85953'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_name='zxm'
*.db_recovery_file_dest='+RECO'
*.db_recovery_file_dest_size=5218762752
*.diagnostic_dest='/home/oracle'
zxm2.instance_number=2
zxm1.instance_number=1
*.nls_language='SIMPLIFIED CHINESE'
*.nls_territory='CHINA'
*.open_cursors=300
*.pga_aggregate_target=342884352
*.processes=150
*.remote_listener='mycrs-scan:1521'
*.remote_login_passwordfile='exclusive'
*.sga_target=1029701632
zxm2.thread=2
zxm1.thread=1
zxm2.undo_tablespace='UNDOTBS2'
zxm1.undo_tablespace='UNDOTBS1'
cd $ORACLE_HOME/dbs
more initzxm1.ora
SPFILE='+DATA/zxm/spfilezxm.ora' # line added by Agent
create spfile='+DATA/zxm/spfilezxm.ora' from pfile='/home/oracle/1.txt';
5.
修改两节点
.bash_profile
的
ORACLE_SID
# .bash_profile
# Get the aliases and functions
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
ORACLE_BASE=/home/oracle;export ORACLE_BASE
ORA_CRS_HOME=/grid/11.2.0;export ORA_CRS_HOME
ORACLE_HOME=/home/oracle/11.2.0/db_1;export ORACLE_HOME