NOTE:469493.1 - Step By Step Guide To Create Physical Standby Database Using RMAN Backup and Restore
NOTE:1075908.1 - Step by Step Guide on Creating Physical Standby Using RMAN DUPLICATE…FROM ACTIVE DATABASE
NOTE:838828.1 - Step-By-Step Guide To Create Physical Standby On Normal File System For ASM Primary using RMAN
NOTE:837102.1 - Step By Step Guide On Creating Physical Standby Using RMAN Duplicate In ASM Filesystem For ASM Primary
搭建环境
----------------------------------------------------------------PRIMARY---------------------------------------------------------------------
Clusterware及DB的版本 :11.2.0.2
Cluster Nodes report1 report2 (2-node RAC)
SCAN web-scan
SCAN listener Host/port SCAN VIPs 1521
DB_UNIQUE_NAME dg
DB_NAME zykrac
DB Instances zykrac1 zykrac2
DB LISTENER
DB Listener Host/port
DB STORAGE ASM
File Management MANUAL
ASM diskgroup for DB files DATA2DG DATADG
ASM Diskgroup for Recovery Files FRADG
OS version linux 5.7
-----------------------------------------------------------------STANDBY-------------------------------------------------------------------
Clusterware及DB的版本 :11.2.0.2
Cluster Nodes zyk-1 zyk-2 (2-node RAC)
SCAN zyk-cluster
SCAN listener Host/port SCAN VIPs 1521
DB_UNIQUE_NAME repdg
DB_NAME zykrac
DB Instances repdg1 repdg2
DB LISTENER
DB Listener Host/port
DB STORAGE ASM
File Management MANUAL
ASM diskgroup for DB files DATA2DG DATADG
ASM Diskgroup for Recovery Files FRADG
OS version linux 5.7
注意:grid及oracle的软件及patch已安装
一、步骤:
PRIMARY:Prepare Primary RAC database for DR configuration:
Enable Force Logging
Modify init Parameters
Enable Archivelog Mode
Create the SLRs (Standby Redo Logs)
Backup the Database for Standby
Create pfile for standby database
Update the tnsnames.ora
1、Enable Force Logging:
SQL>select log_mode,force_logging from v$database;
SQL>alter database force logging;
SQL> select log_mode,force_logging from v$database;
LOG_MODE FOR
ARCHIVELOG YES
2、Modify Dataguard related init Parameters:(* 代表必须,#可选)
*The db_unique_name parameter has already been set to the appropriate {译:英 [ə’prəʊprɪət]恰当的} value during the initial {译 英 [ɪ’nɪʃəl] } creation of the RAC database. *
*The log_archive_dest_state_n and remote_login_passwordfile have default values set to ENABLE and EXCLUSIVE respectively. *
*So, only below mentioned parameter needed to be changed here.
*
*报表库上参数查询结果
set linesize 500 pages 0
col value for a90
col name for a50
select name, value
from v$parameter
where name in (‘db_name’,
‘db_unique_name’,
‘log_archive_config’,
‘log_archive_dest_1’,
‘log_archive_dest_2’,
‘log_archive_dest_state_1’,
‘log_archive_dest_state_2’,
‘remote_login_passwordfile’,
‘log_archive_format’,
‘log_archive_max_processes’,
‘fal_server’,
‘db_file_name_convert’,
‘log_file_name_convert’,
‘standby_file_management’);
DB_NAME=zykrac
DB_UNIQUE_NAME=dg
3、Enable Archivelog Mode:
srvctl stop database –d usa
startup mount (only one instance)
alter database archivelog
alter database open
srvctl start database –d usa ß This will start the remaining Instances on the cluster.
4、Create the Standby Redo Logs (SRLs) on Primary
ASMCMD> mkdir +fra/usa/STANDBYLOG ß (connected as grid user using asmcmd)
alter system set standby_file_management=manual scope=both sid=’*’;
alter database add standby logfile thread 1 group 7 ‘+fra/usa/standbylog/standby_group_07.log’ size 52M;
alter database add standby logfile thread 1 group 8 ‘+fra/usa/standbylog/standby_group_07.log’ size 52M;
alter database add standby logfile thread 1 group 9 ‘+fra/usa/standbylog/standby_group_07.log’ size 52M;
alter database add standby logfile thread 2 group 10 ‘+fra/usa/standbylog/standby_group_10.log’ size 52M;
alter database add standby logfile thread 2 group 11 ‘+fra/usa/standbylog/standby_group_11.log’ size 52M;
alter database add standby logfile thread 2 group 12 ‘+fra/usa/standbylog/standby_group_12.log’ size 52M;
alter database add standby logfile thread 3 group 13 ‘+fra/usa/standbylog/standby_group_13.log’ size 52M;
alter database add standby logfile thread 3 group 14 ‘+fra/usa/standbylog/standby_group_14.log’ size 52M;
alter database add standby logfile thread 3 group 15 ‘+fra/usa/standbylog/standby_group_15.log’ size 52M;
5、Backup The Primary Database For Standby.
rman target / msglog=KaTeX parse error: Double subscript at position 22: …_PATH/log/bak_0_̲BACK_DATE.log <
allocate channel c1 type disk;
allocate channel c2 type disk;
crosscheck archivelog all;
crosscheck backup;
backup as compressed backupset incremental level 0 tag ‘dbk_level_0’ format ‘KaTeX parse error: Double subscript at position 28: …data/df_level_0_̲%d_%T_%s' datab…BACKUP_PATH/archbk/arch_level_0_%d_%T_%s’ archivelog all;
backup current controlfile for standby format ‘$BACKUP_PATH/data/ctl_0_%d_%T_%s’;
release channel c1;
release channel c2;
}
6、Create pfile For Standby and edit pfile
create pfile=‘pfile_for_standby.txt’ from spfile=’+DATADG/dg/PARAMETERFILE/spfilerepdg.ora’;
*.audit_file_dest=’/oracle/app/oracle/admin/repdg/adump’
*.audit_trail=‘NONE’
*.cluster_database=true
*.compatible=‘11.2.0.2.0’
*.control_files=’+DATADG/repdg/controlfile/control01.ctl’,’+DATADG/repdg/controlfile/control02.ctl’
*.db_block_size=8192
*.db_create_online_log_dest_1=’+DATADG’
*.db_create_online_log_dest_2=’+FRADG’
*.db_domain=’’
*.db_name=‘zykrac’
*.db_recovery_file_dest=’+FRADG’
*.db_recovery_file_dest_size=510000M
*.db_unique_name=‘repdg’
*.diagnostic_dest=’/oracle/app/oracle’
*.dispatchers=’(PROTOCOL=TCP) (SERVICE=zykracXDB)’
*.fal_server=‘zykrac’
*.LOG_FILE_NAME_CONVERT=’+DATADG/dg/’,’+DATADG/repdg/’,’+FRADG/dg/’,’+FRADG/repdg/’,’+DATA2DG/dg/’,’+DATA2DG/repdg/’
*.DB_FILE_NAME_CONVERT=’+DATADG/dg/’,’+DATADG/repdg/’,’+FRADG/dg/’,’+FRADG/repdg/’,’+DATA2DG/dg/’,’+DATA2DG/repdg/’
repdg1.instance_number=1
repdg2.instance_number=2
repdg1.local_listener=‘LISTENER_REPDG1’
repdg2.local_listener=‘LISTENER_REPDG2’
*.log_archive_config=‘DG_CONFIG=(dg,repdg)’
*.log_archive_dest_1=‘LOCATION=+FRADG VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=repdg’
*.log_archive_dest_2=‘SERVICE=zykrac LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=dg’
*.log_archive_format=’%t_%s_%r.arc’
*.log_archive_max_processes=8
*.sga_max_size=75G
*.sga_target=75G
*.open_cursors=500
*.processes=1500
*.pga_aggregate_target=10240M
*.remote_listener=‘zyk-cluster:1521’
*.remote_login_passwordfile=‘exclusive’
*.service_names=‘zykrac’,‘repdg’
*.standby_file_management=‘AUTO’
repdg2.thread=2
repdg1.thread=1
repdg1.undo_tablespace=‘UNDOTBS1’
repdg2.undo_tablespace=‘UNDOTBS2’
7、Update TNSNAMES.ora
Copy the tnsnames.ora on all the instances under $ORACLE_HOME/network/admin to keep the same tnsnames.ora on all the instances.
Add the tns alias for each of the instances of the primary database.
zykrac =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =xxxxxxx )(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zykrac)
)
)
zykrac1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxxxx)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zykrac)
(SID = zykrac1)
)
)
zykrac2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxxxx)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zykrac)
(SID = zykrac2)
)
)
LISTENER_REPDG1=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxxx)(PORT = 1521)))
LISTENER_REPDG2=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxxxx)(PORT = 1521)))
步骤二、
Prepare Standby Site for Dataguard Configuration
Copy the RMAN backup and pfile_for_standby.txt.
Copy the password file.
Create required directories for Standby Instance.
Modify the pfile.
Copy the tnsnames.ora from Primary and add the TNS Alias for the standby database instances
Create the ASM directories under the DATA and FRA diskgroup.
1、scp密码文件
scp O R A C L E H O M E / d b s / o r a p w b h a v i n 1 d r − n o d e 1 : ORACLE_HOME/dbs/orapwbhavin1 dr-node1: ORACLEHOME/dbs/orapwbhavin1dr−node1:ORACLE_HOME/dbs/orapwbhavin1
scp O R A C L E H O M E / d b s / o r a p w b h a v i n 1 d r − n o d e 2 : ORACLE_HOME/dbs/orapwbhavin1 dr-node2: ORACLEHOME/dbs/orapwbhavin1dr−node2:ORACLE_HOME/dbs/orapwbhavin2
Copy the tnsnames.ora from Primary and add the TNS Alias for the standby database instances
tnsnames.ora Network Configuration File: /oracle/app/oracle/product/11.2/db_1/network/admin/tnsnames.ora
Generated by Oracle configuration tools.
LISTENER_REPDG2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxx)(PORT = 1521))
)
LISTENER_REPDG1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxx)(PORT = 1521))
)
ZYKRAC2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxxxx)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zykrac)
(SID = zykrac2)
)
)
ZYKRAC1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxxxx)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zykrac)
(SID = zykrac1)
)
)
LKREP =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxxx)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = lkrep)
)
)
ZYKRAC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxxxx)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zykrac)
)
)
LKREPDG =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxxxxxxx)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = zykrac)
)
)
将编辑好的pfile放到指定目录
2、建立目标库所需目录结构
rm -rf O R A C L E B A S E / d i a g / r d b m s / ORACLE_BASE/diag/rdbms/ ORACLEBASE/diag/rdbms/ORACLE_SID
mkdir -p O R A C L E B A S E / d i a g / r d b m s / ORACLE_BASE/diag/rdbms/ ORACLEBASE/diag/rdbms/ORACLE_SID/$ORACLE_SID/alert
mkdir -p O R A C L E B A S E / d i a g / r d b m s / ORACLE_BASE/diag/rdbms/ ORACLEBASE/diag/rdbms/ORACLE_SID/$ORACLE_SID/cdump
mkdir -p O R A C L E B A S E / d i a g / r d b m s / ORACLE_BASE/diag/rdbms/ ORACLEBASE/diag/rdbms/ORACLE_SID/$ORACLE_SID/hm
mkdir -p O R A C L E B A S E / d i a g / r d b m s / ORACLE_BASE/diag/rdbms/ ORACLEBASE/diag/rdbms/ORACLE_SID/$ORACLE_SID/incident
mkdir -p O R A C L E B A S E / d i a g / r d b m s / ORACLE_BASE/diag/rdbms/ ORACLEBASE/diag/rdbms/ORACLE_SID/$ORACLE_SID/incpkg
mkdir -p O R A C L E B A S E / d i a g / r d b m s / ORACLE_BASE/diag/rdbms/ ORACLEBASE/diag/rdbms/ORACLE_SID/$ORACLE_SID/ir
mkdir -p O R A C L E B A S E / d i a g / r d b m s / ORACLE_BASE/diag/rdbms/ ORACLEBASE/diag/rdbms/ORACLE_SID/$ORACLE_SID/lck
mkdir -p O R A C L E B A S E / d i a g / r d b m s / ORACLE_BASE/diag/rdbms/ ORACLEBASE/diag/rdbms/ORACLE_SID/$ORACLE_SID/metadata
mkdir -p O R A C L E B A S E / d i a g / r d b m s / ORACLE_BASE/diag/rdbms/ ORACLEBASE/diag/rdbms/ORACLE_SID/$ORACLE_SID/stage
mkdir -p O R A C L E B A S E / d i a g / r d b m s / ORACLE_BASE/diag/rdbms/ ORACLEBASE/diag/rdbms/ORACLE_SID/$ORACLE_SID/sweep
mkdir -p O R A C L E B A S E / d i a g / r d b m s / ORACLE_BASE/diag/rdbms/ ORACLEBASE/diag/rdbms/ORACLE_SID/$ORACLE_SID/trace
chmod -R 750 O R A C L E B A S E / d i a g / r d b m s / ORACLE_BASE/diag/rdbms/ ORACLEBASE/diag/rdbms/ORACLE_SID
3、
Create the ASM directories
Connect to the asmcmd as a grid Operating System user and create the below directories.
ASMCMD> mkdir data/INDIA
ASMCMD> cd data/india
ASMCMD> mkdir PARAMETERFILE DATAFILE CONTROLFILE TEMPFILE ONLINELOG
ASMCMD> mkdir fra/INDIA
ASMCMD> cd fra/india
ASMCMD> mkdir ARCHIVELOG CONTROLFILE ONLINELOG STANDBYLOG
4、将备份scp到standby database
步骤三、Create the Physical Standby Database
1、Start the Instance in NOMOUNT using the p.txt.
Connect to the zyk-1 as oracle user and start the Instance repdp1 using the p.txt parameter file.
export ORACLE_SID=repdp1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/db11201
export PATH= P A T H : PATH: PATH:ORACLE_HOME/bin:.
sqlplus / as sysdba
startup nomount pfile=’/home/oracle/work/p.txt’
2、
如果在参数文件中 添加如下两个参数,不需要rename,但是data磁盘组考虑好空间,若不够,需要将部分数据文件set newname到较大磁盘组
*db_file_name_convert
*log_file_name_convert
alter database rename file ‘+DATADG/dg/onlinelog/group_1.257.817465135’ to ‘+DATADG/repdg/onlinelog/group_1.257.817465135’;
alter database rename file ‘+FRADG/dg/onlinelog/group_1.352.817465137’ to ‘+FRADG/repdg/onlinelog/group_1.352.817465137’ ;
alter database rename file ‘+DATADG/dg/onlinelog/group_2.291.817465139’ to ‘+DATADG/repdg/onlinelog/group_2.291.817465139’;
alter database rename file ‘+FRADG/dg/onlinelog/group_2.353.817465141’ to ‘+FRADG/repdg/onlinelog/group_2.353.817465141’;
alter database rename file ‘+DATADG/dg/onlinelog/group_5.258.817465151’ to ‘+DATADG/repdg/onlinelog/group_5.258.817465151’;
alter database rename file ‘+FRADG/dg/onlinelog/group_5.356.817465153’ to ‘+FRADG/repdg/onlinelog/group_5.356.817465153’;
alter database rename file ‘+DATADG/dg/onlinelog/group_3.271.817465143’ to ‘+DATADG/repdg/onlinelog/group_3.271.817465143’;
alter database rename file ‘+FRADG/dg/onlinelog/group_3.354.817465145’ to ‘+FRADG/repdg/onlinelog/group_3.354.817465145’;
alter database rename file ‘+DATADG/dg/onlinelog/group_4.266.817465147’ to ‘+DATADG/repdg/onlinelog/group_4.266.817465147’;
alter database rename file ‘+FRADG/dg/onlinelog/group_4.355.817465149’ to ‘+FRADG/repdg/onlinelog/group_4.355.817465149’;
alter database rename file ‘+DATADG/dg/onlinelog/group_6.290.817465155’ to ‘+DATADG/repdg/onlinelog/group_6.290.817465155’;
alter database rename file ‘+FRADG/dg/onlinelog/group_6.357.817465155’ to ‘+FRADG/repdg/onlinelog/group_6.357.817465155’;
alter database rename file ‘+FRADG/dg/onlinelog/group_7.395.817653781’ to ‘+FRADG/repdg/onlinelog/group_7.395.817653781’;
alter database rename file ‘+DATADG/dg/onlinelog/group_7.259.817653783’ to ‘+DATADG/repdg/onlinelog/group_7.259.817653783’;
alter database rename file ‘+FRADG/dg/onlinelog/group_8.396.817653789’ to ‘+FRADG/repdg/onlinelog/group_8.396.817653789’;
alter database rename file ‘+DATADG/dg/onlinelog/group_8.289.817653791’ to ‘+DATADG/repdg/onlinelog/group_8.289.817653791’;
alter database rename file ‘+FRADG/dg/onlinelog/group_9.397.817653793’ to ‘+FRADG/repdg/onlinelog/group_9.397.817653793’;
alter database rename file ‘+DATADG/dg/onlinelog/group_9.263.817653795’ to ‘+DATADG/repdg/onlinelog/group_9.263.817653795’;
alter database rename file ‘+FRADG/dg/onlinelog/group_10.398.817653795’ to ‘+FRADG/repdg/onlinelog/group_10.398.817653795’;
alter database rename file ‘+DATADG/dg/onlinelog/group_10.305.817653797’ to ‘+DATADG/repdg/onlinelog/group_10.305.817653797’;
alter database rename file ‘+FRADG/dg/onlinelog/group_11.399.817653799’ to ‘+FRADG/repdg/onlinelog/group_11.399.817653799’;
alter database rename file ‘+DATADG/dg/onlinelog/group_11.302.817653801’ to ‘+DATADG/repdg/onlinelog/group_11.302.817653801’;
alter database rename file ‘+FRADG/dg/onlinelog/group_12.400.817653803’ to ‘+FRADG/repdg/onlinelog/group_12.400.817653803’;
alter database rename file ‘+DATADG/dg/onlinelog/group_12.301.817653805’ to ‘+DATADG/repdg/onlinelog/group_12.301.817653805’;
alter database rename file ‘+FRADG/dg/onlinelog/group_13.401.817653809’ to ‘+FRADG/repdg/onlinelog/group_13.401.817653809’;
alter database rename file ‘+DATADG/dg/onlinelog/group_13.299.817653811’ to ‘+DATADG/repdg/onlinelog/group_13.299.817653811’;
run
{
set newname for datafile 1 to ‘+FRADG/repdg/datafile/system.274.817463937’;
set newname for datafile 2 to ‘+FRADG/repdg/datafile/sysaux.293.817464293’;
set newname for datafile 3 to ‘+FRADG/repdg/datafile/undotbs1.306.884199853’;
set newname for datafile 4 to ‘+FRADG/repdg/datafile/undotbs2.267.817464841’;
set newname for datafile 22 to ‘+FRADG/repdg/datafile/indx.282.866708417’;
set newname for datafile 23 to ‘+FRADG/repdg/datafile/users.281.867497495’;
set newname for datafile 26 to ‘+FRADG/repdg/datafile/users.277.868801177’;
set newname for datafile 27 to ‘+FRADG/repdg/datafile/users.304.875100537’;
set newname for datafile 33 to ‘+FRADG/repdg/datafile/monit_tbs.300.882189315’;
set newname for datafile 36 to ‘+FRADG/repdg/datafile/users.262.890780181’;
set newname for datafile 60 to ‘+FRADG/repdg/datafile/users.327.936551757’;
set newname for datafile 61 to ‘+FRADG/repdg/datafile/users.328.936552443’;
set newname for datafile 62 to ‘+FRADG/repdg/datafile/users.329.937133769’;
set newname for datafile 63 to ‘+FRADG/repdg/datafile/users.330.937133813’;
set newname for datafile 64 to ‘+FRADG/repdg/datafile/users.331.937916309’;
set newname for datafile 67 to ‘+FRADG/repdg/datafile/users.334.938894547’;
set newname for datafile 68 to ‘+FRADG/repdg/datafile/users.335.939256515’;
set newname for datafile 54 to ‘+FRADG/repdg/datafile/users.321.926671387’;
set newname for datafile 55 to ‘+FRADG/repdg/datafile/users.322.926969247’;
set newname for datafile 56 to ‘+FRADG/repdg/datafile/users.323.927448693’;
set newname for datafile 57 to ‘+FRADG/repdg/datafile/users.324.933912383’;
set newname for datafile 58 to ‘+FRADG/repdg/datafile/users.325.934071943’;
set newname for datafile 50 to ‘+FRADG/repdg/datafile/users.317.924589361’;
set newname for datafile 51 to ‘+FRADG/repdg/datafile/users.318.925030305’;
restore database;
switch datafile all;
}
3、
recover database;
4、
Start the Managed Recovery Process:
Start the Managed recovery process on dr-node1 and verify that the log transport and log application is happening. Alert log is a quick and easy way to see if things log transport/Gap resolution and log application is working as expected. Start the tail –f on alert logs on both the standby nodes before starting the MRP.
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE using current logfile DISCONNECT FROM SESSION;
Perform the log switch on the primary database so initiate the log Transport.
alter system switch logfile
步骤四、验证,及将相关资源注册到OCR中
1、Similar information can be verified by running below SQLs on standby database.
select * from vKaTeX parse error: Expected 'EOF', got '#' at position 54: …ocess, sequence#̲, status from vmanaged_standby;
select sequence#, first_time, next_time, applied from vKaTeX parse error: Expected 'EOF', got '#' at position 37: …archived_thread#̲, archived_seq#…archive_dest_status;
select thread#, max (sequence#) from vKaTeX parse error: Expected 'EOF', got '#' at position 28: …group by thread#̲; select thread…archived_log where APPLIED=‘YES’ group by thread#;
select thread#, max (sequence#) from v$archived_log group by thread#;
2、Create spfile from pfile:
create spfile=’+DATADG/repdg/PARAMETERFILE/spfilerepdg.ora’ from pfile=’/home/oracle/work/p.txt’;
After creating the spfile, create the below init.ora files under $ORACLE_HOME/dbs on both the dr nodes with the spfile entry so that the instance can start with the newly created spfile.
[oracle@zyk-1 dbs]$ cat initrepdg1.ora
spfile=’+DATADG/repdg/PARAMETERFILE/spfilerepdg.ora’
On zyk-2:
[oracle@zyk-2 dbs]$ cat initrepdg2.ora
spfile=’+DATADG/repdg/PARAMETERFILE/spfilerepdg.ora’
3、 Add Standby database and Instances to the OCR:
Add the standby database and its instances to the OCR so that it is managed by CRS.
执行
oracle用户执行
srvctl add database -d repdg -n zykrac -o /oracle/app/oracle/product/11.2/db_1 -p +DATADG/repdg/PARAMETERFILE/spfilerepdg.ora -r physical_standby -a DATA2DG,DATADG,FRADG
srvctl add instance -d repdg -i repdg1 -n zyk-1
srvctl add instance -d repdg -i repdg2 -n zyk-2
srvctl start database -d repdg
*[oracle@dg1 ~]$ srvctl add database -d cosp -n racdb -a “DATA,FRA” -r physical_standby -s mount -o /u01/app/oracle/product/11.2.0/dbhome_1 -p +DATA/COSP/spfilecosp.ora
*
*[oracle@dg1 ~]$ srvctl add instance -d cosp -i cosp1 -n dg1
*[oracle@dg1 ~]$ srvctl add instance -d cosp -i cosp2 -n dg2
*[oracle@dg1 ~]$ srvctl start database -d cosp
4、reStart the Managed Recovery Process: