WEB开发网
开发学院数据库MSSQL Server Dataguard的switchover和failover 阅读

Dataguard的switchover和failover

 2008-10-06 10:06:26 来源:WEB开发网   
核心提示: 一.Switchovers的过程:1. 检查主库目前的状态:SQL> SELECT SWITCHOVER_STATUS FROM V$DATABASE;SWITCHOVER_STATUSTO STANDBY2.将主库置为standby roleSQL>alterdatabase

一.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

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接