ITPub博客

首页 > 数据库 > Oracle > ora11_node_dg(3)ADG做failover切换(主库宕机,从库升为主库过程)

ora11_node_dg(3)ADG做failover切换(主库宕机,从库升为主库过程)

原创 Oracle 作者:fjzcau 时间:2015-12-31 16:39:36 0 删除 编辑

  1. # standby 节点检查状态

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

  3. # primary 节点 shutdown abort方式人工模拟primary奔溃。

  4. SQL> shutdown abort


  5. # standby 节点
  6. SQL> shutdown immediate
  7. SQL> startup mount;

  8. SQL> alter system flush redo to 'zzdb';

  9. SQL> alter database commit to switchover to primary;
  10. alter database commit to switchover to primary
  11. *
  12. ERROR at line 1:
  13. ORA-16139: media recovery required

  14. SQL> recover managed standby database disconnect from session;

  15. --查看gap,如果没有发现明显的gap现象,说明此次的failover不会有数据损失情况。
  16. SQL> select thread#, low_sequence#, high_sequence# from v$archive_gap;

  17. --停止redo应用
  18. SQL> alter database recover managed standby database cancel;

  19. --完成redo应用
  20. SQL> alter database recover managed standby database finish;

  21. SQL> alter database commit to switchover to primary;

  22. SQL> alter database open;

  23. Database altered.

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

  25. DB_UNIQUE_NAME DATABASE_ROLE PROTECTION_MODE PROTECTION_LEVEL OPEN_MODE SWITCHOVER_STATUS
  26. -------------------- ------------------------------ ---------------------------------------- ---------------------------------------- -------------------- ------------------------------
  27. ZZDB_DG PRIMARY MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE READ WRITE RESOLVABLE GAP

  28. SQL> archive log list;
  29. Database log mode Archive Mode
  30. Automatic archival Enabled
  31. Archive destination /oracle/archive
  32. Oldest online log sequence 1
  33. Next log sequence to archive 1
  34. Current log sequence 1

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22661144/viewspace-1969257/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2011-04-03

  • 博文量
    208
  • 访问量
    443416