[20160222]Oracle 11G Data Guard Failover
[20160222]Oracle 11G Data Guard Failover-flush redo.txt
--連結: http://blog.csdn.net/tianlesoftware/article/details/6256542
在Oracle 11g裡,Data Guard 切換多了一個新的功能:flush redo。
Flush 能把沒有傳送的redo 從主庫傳送到standby庫。 只要主庫能啟動到mount 狀態,那麼Flush 就可以把沒有傳送的歸檔和current
online redo 傳送到備庫。
Flush語法:
SQL> ALTER SYSTEM FLUSH REDO TO target_db_name;
這裡的target_db_name 是我們在主庫的db_unique_name 名稱。 也就是在tnsnames.ora 檔案配置的。 Flush 會將未傳送的redo 從主庫
傳到備庫,並且等待redo 在standby 庫上apply 之後返回成功。 所以只要Flush成功,那麼Failover 就沒有主句丟失。
--自己測試看看:
1.主庫:
SYS@test> show parameter unique
NAME TYPE VALUE
--------------- ------- -------
db_unique_name string test
--關閉資料庫使用shutdown abort關閉。
SYS@test> shutdown abort ;
ORACLE instance shut down.
SYS@test> startup mount
ORACLE instance started.
Total System Global Area 1603411968 bytes
Fixed Size 2228784 bytes
Variable Size 973082064 bytes
Database Buffers 620756992 bytes
Redo Buffers 7344128 bytes
Database mounted.
2.在備庫執行:
SYS@testdg> ALTER SYSTEM FLUSH REDO TO 'test';
System altered.
--注意test要加引號,不然報錯:
SYS@testdg> ALTER SYSTEM FLUSH REDO TO test;
ALTER SYSTEM FLUSH REDO TO test
*
ERROR at line 1:
ORA-00922: missing or invalid option
$ oerr ora 922
00922, 00000, "missing or invalid option"
// *Cause:
// *Action:
--檢查alert*.log發現:
ALTER SYSTEM FLUSH REDO TO 'test' CONFIRM APPLY
Flush redo operation not allowed on a physical standby
--估計dg開在open read only模式,在active data guard狀態。啟動到mount狀態繼續測試:
SYS@testdg> shutdown immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@testdg> startup mount
ORACLE instance started.
Total System Global Area 1603411968 bytes
Fixed Size 2228784 bytes
Variable Size 905973200 bytes
Database Buffers 687865856 bytes
Redo Buffers 7344128 bytes
Database mounted.
SYS@testdg> ALTER SYSTEM FLUSH REDO TO 'test';
System altered.
--檢查alert*.log發現:
Mon Feb 22 16:37:01 2016
ALTER SYSTEM FLUSH REDO TO 'test' CONFIRM APPLY
Flush redo operation not allowed on a physical standby
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Using STANDBY_ARCHIVE_DEST parameter default value as /u01/app/oracle11g/archivelog
ALTER SYSTEM SET log_archive_trace=0 SCOPE=BOTH SID='testdg';
ALTER SYSTEM SET log_archive_format='%t_%s_%r.dbf' SCOPE=SPFILE SID='testdg';
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH ALL SWITCHOVER DISCONNECT USING CURRENT LOGFILE
Attempt to start background Managed Standby Recovery process (testdg)
Mon Feb 22 16:37:04 2016
MRP0 started with pid=29, OS id=1006
MRP0: Background Managed Standby Recovery process started (testdg)
started logmerger process
Mon Feb 22 16:37:09 2016
Managed Standby Recovery starting Real Time Apply
Parallel Media Recovery started with 4 slaves
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Recovery of Online Redo Log: Thread 1 Group 5 Seq 4815 Reading mem 0
Mem# 0: /u01/app/oracle11g/oradata/test/redostb02.log
Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH ALL SWITCHOVER DISCONNECT USING CURRENT LOGFILE
--注意看~,感覺還是不對。
3.感覺應該在主庫執行:
SYS@test> ALTER SYSTEM FLUSH REDO TO 'testdg';
System altered.
--檢查備庫的alert*.log:
Mon Feb 22 16:43:48 2016
Standby switchover readiness check: Checking whether recoveryapplied all redo..
Physical Standby applied all the redo from the primary.
--如果備庫開啟read only:
SYS@test> ALTER SYSTEM FLUSH REDO TO 'testdg';
ALTER SYSTEM FLUSH REDO TO 'testdg'
*
ERROR at line 1:
ORA-16447: Redo apply was not active at the target standby database
SYS@test> ALTER SYSTEM FLUSH REDO TO testdg;
ALTER SYSTEM FLUSH REDO TO testdg
*
ERROR at line 1:
ORA-00922: missing or invalid option
--必須加引號。
--說明原連結的介紹存在問題。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-1992583/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle Data Guard Failover(activate)OracleAI
- Oracle 11g Data guard 物理備庫應急切換(failover)流程OracleAI
- Oracle 11g Data GuardOracle
- In Data Guard,choose switchover or failover?AI
- data guard failover on solaris 10AI
- Oracle 11g Data Guard Enabling Active Data GuardOracle
- Data Guard Switchover and Failover Best PracticesAI
- 20160223Oracle 11G Data Guard Failover2OracleAI
- oracle 11g data guard維護Oracle
- ORACLE 11G Data Guard 角色轉換Oracle
- 【DataGuard】物理Data Guard之Failover轉換AI
- DATA GUARD物理STANDBY的FAILOVER切換AI
- Oracle 11g RAC Data Guard 物理standby 建立Oracle
- 搭建Oracle Data Guard 11g(物理備用)Oracle
- oracle data guard!!Oracle
- Oracle 11g Data Guard 使用duplicate from active databaseOracleDatabase
- data guard failover時最小化資料丟失 - 11g flush redo - 2AI
- data guard failover時最小化資料丟失 - 11g flush redo - 1AI
- Oracle Data Guard快速啟動故障切換 - fast-start failover(FSFO)OracleASTAI
- Oracle 12c Data guard 物理備庫應急切換(failover)流程OracleAI
- oracle10g data guard role transition_physical_logical_switchover_failoverOracleAI
- 11g data guard 新特性
- 介紹ORACLE DATA GUARD——DATA GUARD概念和管理Oracle
- Oracle Data Guard配置Oracle
- Data Guard Broker系列之六:Fast-Start FailoverASTAI
- Oracle 11g Data Guard (physical standby - active dataguard) [final]Oracle
- 總結11g 物理data guard
- How to configure Client Failover after Data Guard Switchover or Failover [ID 316740.1]clientAI
- Oracle 11g Data guard 物理備庫應急切換(failover)後原有主庫的重建(通過RMAN恢復)OracleAI
- oracle9i(9204)data guard(dg)_logical standby_failover操作指南OracleAI
- Oracle Data Guard Broker元件Oracle元件
- Oracle Data Guard簡介Oracle
- Oracle Data Guard 介紹Oracle
- ORACLE Data Guard--IOracle
- Data Guard中快速Switchover,Failover的一些建議AI
- [Data Guard]Oracle10g Data Guard學習筆記(一)Oracle筆記
- [Data Guard]Oracle10g Data Guard學習筆記(二)Oracle筆記
- [Data Guard]Oracle10g Data Guard學習筆記(三)Oracle筆記