oracle 11g ADG做(switchover)切换测试

来源:互联网 发布:大型企业网络设计方案 编辑:程序博客网 时间:2024/05/29 12:56

  1. --primary 做如下操作  
  2.   
  3. SQL> alter database commit to switchover to physical standby;  
  4.   
  5. Database altered.  
  6.   
  7. SQL> shutdown immediate  
  8. ORA-01012: not logged on  
  9. SQL> conn / as sysdba  
  10. Connected to an idle instance.  
  11.   
  12. SQL> startup    
  13. ORACLE instance started.  
  14.   
  15. Total System Global Area 1188511744 bytes  
  16. Fixed Size                  1364228 bytes  
  17. Variable Size             754978556 bytes  
  18. Database Buffers          419430400 bytes  
  19. Redo Buffers               12738560 bytes  
  20. Database mounted.  
  21. Database opened.  
  22.   
  23. SQL> alter database recover managed standby database disconnect from session;  
  24.   
  25. Database altered.  
  26.   
  27. SQL>  select database_role,switchover_status from v$database;  
  28.   
  29. DATABASE_ROLE    SWITCHOVER_STATUS  
  30. ---------------- --------------------  
  31. PHYSICAL STANDBY TO PRIMARY  
  32.   
  33. SQL>   
  34.   
  35. --standby 端做如下操作  
  36.   
  37. SQL> alter database commit to switchover to primary;  
  38.   
  39. Database altered.  
  40.   
  41. SQL> shutdown immediate  
  42. ORA-01109: database not open  
  43.   
  44.   
  45. Database dismounted.  
  46. ORACLE instance shut down.  
  47.   
  48. SQL> startup  
  49. ORACLE instance started.  
  50.   
  51. Total System Global Area 1188511744 bytes  
  52. Fixed Size                  1364228 bytes  
  53. Variable Size             754978556 bytes  
  54. Database Buffers          419430400 bytes  
  55. Redo Buffers               12738560 bytes  
  56. Database mounted.  
  57. Database opened.  
  58.   
  59. SQL> alter system switch logfile;  
  60.   
  61. System altered.  
  62.   
  63. SQL>  select database_role,switchover_status from v$database;  
  64.   
  65. DATABASE_ROLE    SWITCHOVER_STATUS  
  66. ---------------- --------------------  
  67. PRIMARY          SESSIONS ACTIVE  
如果切换过程中发生ora-01093的错误,请参考
http://blog.csdn.net/yanfalee/article/details/50886570
0 0
原创粉丝点击