1、創建TNSNAME
2、copy spfile 密碼文件 注意:更改db_unique_name
3、startup nomount
4、change pro and sty
生产DB
--alter system set LOG_ARCHIVE_DEST_1='LOCATION=/data1/arch_log' scope=both;
alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(tjnonhp,sty_nonhp)' scope=both;
alter system set LOG_ARCHIVE_DEST_2='SERVICE=STY_TJNONHPDB LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=sty_nonhp' scope=both;
ALTER SYSTEM SET fal_client='pro_tjnonhpdb' SCOPE=BOTH;
ALTER SYSTEM SET fal_server='sty_tjnonhpdb' SCOPE=BOTH;
ALTER SYSTEM SET log_archive_dest_state_2='DEFER' SCOPE=BOTH;
ALTER SYSTEM SET log_archive_dest_state_2='ENABLE' SCOPE=BOTH;
connect target sys/sys_tjnonhpdb@pro_tjnonhpdb
connect auxiliary sys/sys_tjnonhpdb@sty_tjnonhpdb
duplicate target database for standby from active database nofilenamecheck;
备份DB
alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(tjnonhp,sty_nonhp)' scope=both;
alter system set LOG_ARCHIVE_DEST_2='SERVICE=PRO_TJNONHPDB LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=tjnonhp' scope=both;
ALTER SYSTEM SET fal_client='sty_tjnonhpdb' SCOPE=BOTH;
ALTER SYSTEM SET fal_server='pro_tjnonhpdb' SCOPE=BOTH;
alter system set LOG_ARCHIVE_MAX_PROCESSES=10 scope=both;
alter system set STANDBY_FILE_MANAGEMENT=AUTO scope=both;
备份DB
alter database recover managed standby database disconnect from session;
----------------------------------------------------------------------------
the last is consultation
standby 需要添加的參數
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
LOG_ARCHIVE_MAX_PROCESSES=10
STANDBY_FILE_MANAGEMENT=AUTO
STANDBY_ARCHIVE_DEST='/data/oradata/arch_psfc' ---11g取消該參數
FAL_SERVER=HZPSFC
FAL_CLIENT=sty_HZPSFC
LOG_ARCHIVE_CONFIG='DG_CONFIG=(hzpsfc,sty_psfc)'
LOG_ARCHIVE_DEST_2='SERVICE=sty_tjnvdb LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=sty_tjnv'
db_unique_name=sty_psfc
su - oracle -c 'lsnrctl start listener'
su - oracle -c "/home/oracle/product/11.2.3/db_1/bin/sqlplus /nolog <
connect sys/oracle@sty_msd2agile as sysdba;
startup mount;
alter database open read only;
alter database recover managed standby database disconnect from session;
exit
EOF"
阅读(1349) | 评论(0) | 转发(0) |