ora11_node_dg(3)ADG做failover切換(主庫當機,從庫升為主庫過程)

fjzcau發表於2015-12-31

  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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章