oracle 10g物理data guard 操作

imlihj2007發表於2008-09-03

       oracle10R2 DATA GUARD 角色切換的簡單操作
主庫操作:
1.檢查是否支援SWITCHOVER操作:
SQL> select SWITCHOVER_STATUS from v$database;
SWITCHOVER_STATUS
--------------------
SESSIONS ACTIVE --狀態是ACTIVE或to standby 都是可以的。
2.將主庫轉換為從庫的角色:
SQL> alter database commit to switchover to physical standby(WITH SESSION SHUTDOWN);
Database altered.
3.關閉主庫然後啟動到MOUNT狀態,這時候原來的主庫變成了從庫。
SQL> shutdown immediate;
ORA-01507: database not mounted

ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1279120 bytes
Variable Size 100666224 bytes
Database Buffers 62914560 bytes
Redo Buffers 2912256 bytes
Database mounted.
SQL>

從庫操作:
4.檢查從庫是否支援switchover操作:
SQL> select SWITCHOVER_STATUS from v$database;
SWITCHOVER_STATUS
--------------------
TO PRIMARY --OK,支援
5.原來的從庫轉換到主庫:
SQL> alter database commit to switchover to primary;
Database altered.
6.開啟主庫:
SQL> alter database open;
Database altered.
7.驗證:
SQL> alter system switch logfile;
System altered.
--觀察從庫的告警日誌發現並沒有應用主庫的歸檔日誌。原因是從庫的日誌應用還沒有開啟,在從庫開啟日誌應用:
SQL> alter database recover managed standby database disconnect from session;


Database altered.

[@more@]

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

相關文章