Dataguard的switchover和failover
2008-10-06 10:06:26 来源:WEB开发网一.Switchovers的过程:
1. 检查主库目前的状态:
SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;
SWITCHOVER_STATUS
--------------------
TO STANDBY
2.将主库置为standby role
SQL>alterdatabasecommittoswitchovertophysicalstandby;
Databasealtered.
SQL>shutdownimmediate;
ORA-01507:databasenotmounted
ORACLEinstanceshutdown.
SQL>startupmount;
ORACLEinstancestarted.
TotalSystemGlobalArea218103808bytes
FixedSize1260984bytes
VariableSize117441096bytes
DatabaseBuffers96468992bytes
RedoBuffers2932736bytes
Databasemounted.
2. standby库转为primary
SQL>selectNAME,DB_UNIQUE_NAME,open_mode,DATABASE_ROLEfromv$database;
SQL>SELECTSWITCHOVER_STATUSFROMV$DATABASE;
SWITCHOVER_STATUS
--------------------
TOPRIMARY
SQL>alterdatabasecommittoswitchovertoprimary;
Databasealtered.
SQL>alterdatabaseopen;
Databasealtered.
SQL>selectNAME,DB_UNIQUE_NAME,open_mode,DATABASE_ROLEfromv$database;
NAMEDB_UNIQUE_NAMEOPEN_MODEDATABASE_ROLE
--------------------------------------------------------------------------
MAINDBstandbREADWRITEPRIMARY
主库上:
SQL>alterdatabaserecovermanagedstandbydatabasedisconnectfromsession;
Databasealtered.
SQL>selectNAME,DB_UNIQUE_NAME,open_mode,DATABASE_ROLEfromv$database;
NAMEDB_UNIQUE_NAMEOPEN_MODEDATABASE_ROLE
--------------------------------------------------------------------------
MAINDBmaindbMOUNTEDPHYSICALSTANDBY
Tags:Dataguard switchover failover
编辑录入:爽爽 [复制链接] [打 印]更多精彩
赞助商链接