dg切換操作文件

zhanghongni發表於2019-06-15

SQL> SELECT TO_CHAR(STANDBY_BECAME_PRIMARY_SCN) FROM V$DATABASE;

TO_CHAR(STANDBY_BECAME_PRIMARY_SCN)

----------------------------------------


SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';

Session altered.


SQL> select oldest_flashback_scn,oldest_flashback_time from v$flashback_database_log;


OLDEST_FLASHBACK_SCN OLDEST_FLASHBACK_TI

-------------------- -------------------

    1202090 2019-05-05 04:01:45


SQL> recover managed standby database cancel;

Media recovery complete.

SQL> 

SQL> 

SQL> recover managed standby database finish force;

Media recovery complete.

SQL> select database_role from v$database;


DATABASE_ROLE

----------------

PHYSICAL STANDBY


SQL> select open_mode,database_role,protection_mode,protection_level,switchover_status from v$database;


OPEN_MODE     DATABASE_ROLE    PROTECTION_MODE   PROTECTION_LEVEL SWITCHOVER_STATUS

-------------------- ---------------- -------------------- -------------------- --------------------

READ ONLY     PHYSICAL STANDBY MAXIMUM PERFORMANCE  MAXIMUM PERFORMANCE TO PRIMARY


SQL> alter database commit to switchover to primary;

Database altered


SQL> 

SQL> select open_mode,database_role,protection_mode,protection_level,switchover_status from v$database;


OPEN_MODE     DATABASE_ROLE    PROTECTION_MODE   PROTECTION_LEVEL SWITCHOVER_STATUS

-------------------- ---------------- -------------------- -------------------- --------------------

MOUNTED     PRIMARY      MAXIMUM PERFORMANCE  UNPROTECTED NOT ALLOWED


SQL> SELECT TO_CHAR(STANDBY_BECAME_PRIMARY_SCN) FROM V$DATABASE;


TO_CHAR(STANDBY_BECAME_PRIMARY_SCN)

----------------------------------------

1330559


SQL> alter database open;


Database altered.


SQL> select open_mode,database_role,protection_mode,protection_level,switchover_status from v$database;


OPEN_MODE     DATABASE_ROLE    PROTECTION_MODE   PROTECTION_LEVEL SWITCHOVER_STATUS

-------------------- ---------------- -------------------- -------------------- --------------------

READ WRITE     PRIMARY      MAXIMUM PERFORMANCE  MAXIMUM PERFORMANCE NOT ALLOWED


SQL> SELECT TO_CHAR(STANDBY_BECAME_PRIMARY_SCN) FROM V$DATABASE;

TO_CHAR(STANDBY_BECAME_PRIMARY_SCN)

----------------------------------------

1330559


SQL> 


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31549397/viewspace-2647771/,如需轉載,請註明出處,否則將追究法律責任。

相關文章