【DataGuard】10g物理standby主備switchover方式切換詳述
以下給大家展現一下10g物理standby主備之間透過switchover方式進行切換的詳細步驟,供參考。
1、主庫檢查是否為“TO STANDBY”狀態,若不是,需要重新啟動一下主庫(主庫ora10g操作)
sys@ora10g> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
SESSIONS ACTIVE
sys@ora10g> startup force ;
ORACLE instance started.
Total System Global Area 104857600 bytes
Fixed Size 1266056 bytes
Variable Size 83889784 bytes
Database Buffers 16777216 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.
sys@ora10g> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
TO STANDBY
2.將primary轉換為standby角色(主庫ora10g操作)
sys@ora10g> alter database commit to switchover to physical standby;
Database altered.
3.原主庫重啟動到mount狀態(原主庫ora10g操作)
NotConnected@> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.
NotConnected@>
NotConnected@> startup mount;
ORACLE instance started.
Total System Global Area 104857600 bytes
Fixed Size 1266056 bytes
Variable Size 88084088 bytes
Database Buffers 12582912 bytes
Redo Buffers 2924544 bytes
Database mounted.
4.檢查原備庫是否為“TO PRIMARY”狀態,如果為“SWITCHOVER PENDING”狀態,需要先進行一下恢復再切換 (待切換備庫ora10gdg操作)
ora10g@linux5 /home/oracle$ export ORACLE_SID=ora10gdg
ora10gdg@linux5 /home/oracle$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sat Mar 28 08:26:53 2009
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Data Mining and Real Application Testing options
NotConnected@> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
SWITCHOVER PENDING
NotConnected@> alter database commit to switchover to primary;
alter database commit to switchover to primary
*
ERROR at line 1:
ORA-16139: media recovery required
NotConnected@> alter database recover managed standby database disconnect from session;
Database altered.
NotConnected@> alter database recover managed standby database cancel;
Database altered.
NotConnected@> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
TO PRIMARY
5.原備庫轉換角色到primary (待切換備庫ora10gdg操作)
NotConnected@> alter database commit to switchover to primary;
Database altered.
6.主備切換完成,open新的primary資料庫 (待切換備庫ora10gdg操作)
NotConnected@> alter database open;
Database altered.
7.最後驗證階段
1).新的primary庫在sec使用者建立一個新表test_new
sec@ora10g> create table test_new (a int);
Table created.
sec@ora10g> insert into test_new values ( 100 );
1 row created.
sec@ora10g> commit;
Commit complete.
sec@ora10g> select * from test_new;
A
----------
100
sec@ora10g> conn / as sysdba
Connected.
sys@ora10g> alter system switch logfile;
System altered.
sys@ora10g> select max(sequence#) from v$archived_log;
MAX(SEQUENCE#)
--------------
69
2).檢視新standby庫,驗證切換是否成功
ora10gdg@linux5 /home/oracle$ export ORACLE_SID=ora10g
ora10g@linux5 /home/oracle$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sat Mar 28 08:55:09 2009
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Data Mining and Real Application Testing options
NotConnected@> alter database recover managed standby database disconnect from session;
Database altered.
NotConnected@> select max(sequence#) from v$archived_log;
MAX(SEQUENCE#)
--------------
69
NotConnected@> alter database recover managed standby database cancel;
Database altered.
NotConnected@> alter database open read only;
Database altered.
NotConnected@> conn sec/sec
Connected.
sec@ora10g> select * from test_new;
A
----------
100
OK!到此主備之間的switchover方式切換成功。
secooler
09.03.27
-- The End --
1、主庫檢查是否為“TO STANDBY”狀態,若不是,需要重新啟動一下主庫(主庫ora10g操作)
sys@ora10g> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
SESSIONS ACTIVE
sys@ora10g> startup force ;
ORACLE instance started.
Total System Global Area 104857600 bytes
Fixed Size 1266056 bytes
Variable Size 83889784 bytes
Database Buffers 16777216 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.
sys@ora10g> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
TO STANDBY
2.將primary轉換為standby角色(主庫ora10g操作)
sys@ora10g> alter database commit to switchover to physical standby;
Database altered.
3.原主庫重啟動到mount狀態(原主庫ora10g操作)
NotConnected@> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.
NotConnected@>
NotConnected@> startup mount;
ORACLE instance started.
Total System Global Area 104857600 bytes
Fixed Size 1266056 bytes
Variable Size 88084088 bytes
Database Buffers 12582912 bytes
Redo Buffers 2924544 bytes
Database mounted.
4.檢查原備庫是否為“TO PRIMARY”狀態,如果為“SWITCHOVER PENDING”狀態,需要先進行一下恢復再切換 (待切換備庫ora10gdg操作)
ora10g@linux5 /home/oracle$ export ORACLE_SID=ora10gdg
ora10gdg@linux5 /home/oracle$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sat Mar 28 08:26:53 2009
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Data Mining and Real Application Testing options
NotConnected@> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
SWITCHOVER PENDING
NotConnected@> alter database commit to switchover to primary;
alter database commit to switchover to primary
*
ERROR at line 1:
ORA-16139: media recovery required
NotConnected@> alter database recover managed standby database disconnect from session;
Database altered.
NotConnected@> alter database recover managed standby database cancel;
Database altered.
NotConnected@> select switchover_status from v$database;
SWITCHOVER_STATUS
--------------------
TO PRIMARY
5.原備庫轉換角色到primary (待切換備庫ora10gdg操作)
NotConnected@> alter database commit to switchover to primary;
Database altered.
6.主備切換完成,open新的primary資料庫 (待切換備庫ora10gdg操作)
NotConnected@> alter database open;
Database altered.
7.最後驗證階段
1).新的primary庫在sec使用者建立一個新表test_new
sec@ora10g> create table test_new (a int);
Table created.
sec@ora10g> insert into test_new values ( 100 );
1 row created.
sec@ora10g> commit;
Commit complete.
sec@ora10g> select * from test_new;
A
----------
100
sec@ora10g> conn / as sysdba
Connected.
sys@ora10g> alter system switch logfile;
System altered.
sys@ora10g> select max(sequence#) from v$archived_log;
MAX(SEQUENCE#)
--------------
69
2).檢視新standby庫,驗證切換是否成功
ora10gdg@linux5 /home/oracle$ export ORACLE_SID=ora10g
ora10g@linux5 /home/oracle$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Sat Mar 28 08:55:09 2009
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Data Mining and Real Application Testing options
NotConnected@> alter database recover managed standby database disconnect from session;
Database altered.
NotConnected@> select max(sequence#) from v$archived_log;
MAX(SEQUENCE#)
--------------
69
NotConnected@> alter database recover managed standby database cancel;
Database altered.
NotConnected@> alter database open read only;
Database altered.
NotConnected@> conn sec/sec
Connected.
sec@ora10g> select * from test_new;
A
----------
100
OK!到此主備之間的switchover方式切換成功。
secooler
09.03.27
-- The End --
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-580380/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 10g DataGuard物理主備切換-switchover與failoverOracle 10gAI
- DataGuard---->物理StandBy的角色切換之switchover
- Dataguard物理Standby Switchover 角色轉換
- DATA GUARD物理STANDBY的 SWITCHOVER切換
- 【DATAGUARD】物理dg的switchover切換(五)
- Oracle DataGuard 主備切換 (switchover) oracle11gOracle
- DATA GUARD物理STANDBY的 SWITCHOVER切換[zt]
- dataguard之物理standby 日誌切換
- RAC環境的物理STANDBY的 SWITCHOVER切換
- dataguard之物理standby庫failover 切換AI
- DATA GUARD物理備庫的SWITCHOVER切換
- dataguard主備switchover互切實驗及理解
- 備庫的切換狀態為SWITCHOVER PENDING時進行dataguard主備庫角色切換
- 【DataGuard】Oracle 11g DataGuard 角色轉換(一)物理備庫SwitchoverOracle
- Oracle 12c Data guard 物理主備庫正常切換(switchover)流程Oracle
- Oracle 11g Data guard 物理主備庫正常切換(switchover)流程Oracle
- 物理dataguard 正常切換 角色轉換,switchover_status 狀態改變
- 【DG】Data Guard主備庫Switchover切換
- oracle 9iDATA GUARD物理STANDBY的 SWITCHOVER切換步驟Oracle
- DataGuard:Physical Standby Switchover
- 物理dataguard 正常切換 腳色轉換,switchover_status 狀態改變
- DataGuard主備庫切換步驟
- data guard物理備份方式中的switchover轉換
- 再次使用DGbroker做switchover主備切換
- oracle 之dataguard standby 切換Oracle
- RAC環境STANDBY的SWITCHOVER切換
- Oracle DataGuard switchover切換一例Oracle
- Oracle10G Dataguard 多個備庫 - 主庫和物理備庫的切換Oracle
- DataGuard:Logical Standby Switchover
- 【DATAGUARD】Oracle Dataguard物理備庫切換最佳實踐(sqlplus)OracleSQL
- openGauss主備切換之switchover與failoverAI
- 10g Data Guard physical standby的主備庫角色轉換測試(switchover & failover)AI
- 【DataGuard】使用Grid Control對Oracle物理Data Guard進行Switchover切換Oracle
- 【DATAGUARD】 將11g物理備庫轉換為Snapshot Standby
- DG物理standby,switchover步驟
- RAC環境LOGICAL STANDBY的SWITCHOVER切換
- 盛哥學習 Data Guard 第三篇《物理standby之switchover 無損切換》
- oracle 之dataguard主庫系統崩潰之物理備庫切主庫Oracle