Dataguard的switchover和failover
2008-10-06 10:06:26 来源:WEB开发网二.Failovers的过程:
查询没有应用的日志:
SQL> SELECT THREAD#, LOW_SEQUENCE#, HIGH_SEQUENCE# FROM V$ARCHIVE_GAP;
THREAD# LOW_SEQUENCE# HIGH_SEQUENCE#
Cp过来并register
SQL> ALTER DATABASE REGISTER PHYSICAL LOGFILE 'filespec1';
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH FORCE;
SQL> ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY;
SQL> ALTER DATABASE OPEN;
一旦主数据故障无法使用,就可以迅速激活镜像备份:
1、如果可能,归档主服务器当前重做日志,传送到镜像服务器;
2、使用主服务器的归档日志文件做恢复:
SQL>recover standby database;
3、激活并打开数据库:
SQL>alterdatabaseactivatestandbydatabase;
SQL>alterdatabasemount;
SQL>alterdatabaseopen;
三.将Failover之后的老的主库 flashback成新primary的standby库:
1. 在新主库查出failover时的SCN:
SQL>SELECTTO_CHAR(STANDBY_BECAME_PRIMARY_SCN)FROMV$DATABASE;
TO_CHAR(STANDBY_BECAME_PRIMARY_SCN)
----------------------------------------
172313
2. 在old primary库上:
SQL>SHUTDOWNIMMEDIATE;
SQL>STARTUPMOUNT;
SQL>FLASHBACKDATABASETOSCN172313;
SQL>ALTERDATABASECONVERTTOPHYSICALSTANDBY;
SQL>SHUTDOWNIMMEDIATE;
SQL>STARTUPMOUNT;
SQL>ALTERDATABASERECOVERMANAGEDSTANDBYDATABASE
USINGCURRENTLOGFILEDISCONNECT;
Tags:Dataguard switchover failover
编辑录入:爽爽 [复制链接] [打 印]更多精彩
赞助商链接