ITPub博客

首页 > 数据库 > Oracle > dg切换操作文档

dg切换操作文档

原创 Oracle 作者:zhanghongni 时间:2019-06-15 23:29:15 0 删除 编辑

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/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2018-08-09

  • 博文量
    3
  • 访问量
    1269