How to open read/write mode no longer be physical standby db(active standby)?
如果primary db 丢失或不再需要的physical standby ,想把这些库(standby)利用起来,logical standby 本来就可以write open,11g ADG也可以APPLY LOG时open,但是read only,下面演示如果把off-line standby 转为primary,open read/write mode. 也就是激活standby database.
1. Open standby database in mount state :
shutdown immediate; startup mount
2. recover if there is any archive log
alter database recover managed standby database cancel; recover standby database; cancel
3. finished the recover process
alter database recover managed standby database finish;
Note: Do not use the ALTER DATABASE ACTIVATE STANDBY DATABASE statement to failover because it causes data loss. Instead, use the following best practices: For physical standby databases, use the ALTER DATABASE RECOVER MANAGED STANDBY DATABASE statement with the FINISH keyword to perform the role transition as quickly as possible with little or no data loss and without rendering other standby databases unusable. If the error condition cannot be resolved, a failover can still be performed (with some data loss) by issuing the following SQL statement on the target standby database, For logical standby databases, use the ALTER DATABASE PREPARE TO SWITCHOVER and ALTER DATABASE COMMIT TO SWITCHOVER statements.
After this command, this standby database will NOT be able to go back to standby database any more.
4. activate standby database
idle>select database_role,log_mode,protection_mode,open_mode,db_unique_name from v$database; DATABASE_ROLE LOG_MODE PROTECTION_MODE OPEN_MODE DB_UNIQUE_NAME ---------------- ------------ -------------------- -------------------- ------------------------------ PHYSICAL STANDBY ARCHIVELOG MAXIMUM PERFORMANCE MOUNTED stdby idle>alter database activate standby database; Database altered. idle>select database_role,log_mode,protection_mode,open_mode,db_unique_name from v$database; DATABASE_ROLE LOG_MODE PROTECTION_MODE OPEN_MODE DB_UNIQUE_NAME ---------------- ------------ -------------------- -------------------- ------------------------------ PRIMARY ARCHIVELOG MAXIMUM PERFORMANCE MOUNTED stdby idle>alter database open; Database altered. idle>select database_role,log_mode,protection_mode,open_mode,db_unique_name from v$database; DATABASE_ROLE LOG_MODE PROTECTION_MODE OPEN_MODE DB_UNIQUE_NAME ---------------- ------------ -------------------- -------------------- ------------------------------ PRIMARY ARCHIVELOG MAXIMUM PERFORMANCE READ WRITE stdby
ok.
对不起,这篇文章暂时关闭评论。