环境:Windows(64bit) + 10.2.0.3 + bundle patch 21
Physical Standby创建过程
该环境使用Max performance,故不须要建standby redo log.
1.将库设为强制归档
alter database force logging;
2.mount database, create standby control file.
startup mount
alter database create standby controlfile as 'K:\control01.ctl';
shutdown immediate;
3.COPY datafiles, password file, spfile 到目的端.
4.recover standby database
startup mount;
alter database recover managed standby database disconnect from session;
5.open primary database.
Switchovers
1.primary
SELECT SWITCHOVER_STATUS FROM V$DATABASE;
--强制关闭所有session,switch to PHYSICAL STANDBY
ALTER DATABASE COMMIT TO SWITCHOVER TO PHYSICAL STANDBY with session shutdown;
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
alter database recover managed standby database disconnect from session;
2.standby
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
ALTER DATABASE OPEN;
ALTER SYSTEM SWITCH LOGFILE;
Failover
1.Identify and resolve any gaps in the archived redo log files.
2.Copy any other missing archived redo log files.
SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE# FROM V$ARCHIVE_GAP;
ALTER DATABASE REGISTER PHYSICAL LOGFILE 'filespec1';
3.Initiate a failover on the target physical standby database.
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH FORCE;
4.Convert the physical standby database to the primary role.
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
5.Finish the transition of the standby database to the primary database role.
ALTER DATABASE OPEN;
primary
=====================================================================
*.DB_UNIQUE_NAME='primary'
*.log_archive_config='DG_CONFIG=(primary,standby)'
*.LOG_ARCHIVE_FORMAT=log%t_%s_%r.arc
*.log_archive_dest_1='location=P:\arc\ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=primary'
*.LOG_ARCHIVE_DEST_2='SERVICE=standby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=standby'
*.LOG_ARCHIVE_DEST_STATE_1=ENABLE
*.LOG_ARCHIVE_DEST_STATE_2=ENABLE
*.FAL_SERVER=standby
*.FAL_CLIENT=primary
*.STANDBY_FILE_MANAGEMENT=AUTO
=====================================================================
standby
=====================================================================
*.DB_UNIQUE_NAME='standby'
*.log_archive_config='DG_CONFIG=(primary,standby)'
*.LOG_ARCHIVE_FORMAT=log%t_%s_%r.arc
*.log_archive_dest_1='location=P:\arc\ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=standby'
*.LOG_ARCHIVE_DEST_2='SERVICE=primary LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=primary'
*.LOG_ARCHIVE_DEST_STATE_1=ENABLE
*.LOG_ARCHIVE_DEST_STATE_2=ENABLE
*.FAL_SERVER=primary
*.FAL_CLIENT=standby
*.STANDBY_FILE_MANAGEMENT=AUTO
=====================================================================
阅读(1485) | 评论(0) | 转发(0) |