Oracle數(shù)據(jù)庫(kù) DGbroker三種保護(hù)模式的切換
1.三種保護(hù)模式
– Maximum protection
在Maximum protection下, 可以保證從庫(kù)和主庫(kù)數(shù)據(jù)完全一樣,做到zero data loss.事務(wù)同時(shí)在主從兩邊提交完成,才算事務(wù)完成。如果從庫(kù)宕機(jī)或者網(wǎng)絡(luò)出現(xiàn)問題,主從庫(kù)不能通訊,主庫(kù)也立即宕機(jī)。在這種方式下,具有最高的保護(hù)等級(jí)。但是這種模式對(duì)主庫(kù)性能影響很大,要求高速的網(wǎng)絡(luò)連接。
– Maximum availability
在Maximum availability模式下,如果和從庫(kù)的連接正常,運(yùn)行方式等同Maximum protection模式,事務(wù)也是主從庫(kù)同時(shí)提交。如果從庫(kù)和主庫(kù)失去聯(lián)系,則主庫(kù)自動(dòng)切換到Maximum performance模式下運(yùn)行,保證主庫(kù)具有最大的可用性。
– Maximum performance
在Maximum performance,主庫(kù)把歸檔的 archived log通過arch進(jìn)程傳遞給從庫(kù),在這種方式下,主庫(kù)運(yùn)行性能最高,但是不能保證數(shù)據(jù)不丟失,且丟失的數(shù)據(jù)受redo log的大小影響。在redo log過大的情況下,可能一天都沒有歸檔一個(gè)日志,可以通過手工切換日志的方式來(lái)減小數(shù)據(jù)的丟失。
2.模式切換(Maximum performance切換至Maximum availability)
a.查看保護(hù)的模式
DGbroker查看:
DGMGRL> show configuration verbose; Configuration - dgc Protection Mode: MaxPerformance Databases: atest1 - Primary database atest2 - Physical standby database Properties: FastStartFailoverThreshold = '30' OperationTimeout = '30' FastStartFailoverLagLimit = '30' CommunicationTimeout = '180' ObserverReconnect = '0' FastStartFailoverAutoReinstate = 'TRUE' FastStartFailoverPmyShutdown = 'TRUE' BystandersFollowRoleChange = 'ALL' ObserverOverride = 'FALSE' ExternalDestination1 = '' ExternalDestination2 = '' PrimaryLostWriteAction = 'CONTINUE' Fast-Start Failover: DISABLED Configuration Status: SUCCESS
sqlplus查看:
SQL> select database_role,protection_mode,protection_level from v$database; DATABASE_ROLE PROTECTION_MODE PROTECTION_LEVEL ---------------- -------------------- -------------------- PRIMARY MAXIMUM PERFORMANCE MAXIMUM PERFORMANCE
b.查看備庫(kù)的日志傳輸模式(參數(shù)LogXptMode(sync:同步傳輸/async:異步傳輸))
DGMGRL> show database verbose 'atest2'; Database - atest2 Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 0 seconds (computed 1 second ago) Apply Lag: 0 seconds (computed 1 second ago) Apply Rate: 97.00 KByte/s Real Time Query: ON Instance(s): atest Properties: DGConnectIdentifier = 'atest2' ObserverConnectIdentifier = '' LogXptMode = 'sync' DelayMins = '0' Binding = 'optional' MaxFailure = '0' MaxConnections = '1' ReopenSecs = '300' NetTimeout = '30' RedoCompression = 'DISABLE' LogShipping = 'ON' PreferredApplyInstance = '' ApplyInstanceTimeout = '0' ApplyParallel = 'AUTO' StandbyFileManagement = 'AUTO' ArchiveLagTarget = '0' LogArchiveMaxProcesses = '4' LogArchiveMinSucceedDest = '1' DbFileNameConvert = '' LogFileNameConvert = '' FastStartFailoverTarget = '' InconsistentProperties = '(monitor)' InconsistentLogXptProps = '(monitor)' SendQEntries = '(monitor)' LogXptStatus = '(monitor)' RecvQEntries = '(monitor)' ApplyLagThreshold = '0' TransportLagThreshold = '0' TransportDisconnectedThreshold = '30' SidName = 'atest' StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=vijay02.database.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=atest2_DGMGRL)(INSTANCE_NAME=atest)(SERVER=DEDICATED)))' StandbyArchiveLocation = '/u01/app/oracle/oradata/ATEST/archivelog' AlternateLocation = '' LogArchiveTrace = '0' LogArchiveFormat = '%t_%s_%r.dbf' TopWaitEvents = '(monitor)' Database Status: SUCCESS
c.如果LogXptMode的值為async,就要將其修改為sync
DGMGRL> edit database atest1 set property logxptmode=sync; Property "logxptmode" updated
d.修改完之后再次確認(rèn)LogXptMode的值,如步驟b
e.切換模式(如果切換失敗,則再次去確認(rèn)備庫(kù)LogXptMode的值)
DGMGRL> edit configuration set protection mode as maxavailability; Succeeded.
f. 確認(rèn)數(shù)據(jù)庫(kù)的的保護(hù)模式,如步驟a
g.需要注意的是,步驟c中修改的sync是備庫(kù)的值,切記!
3.個(gè)人小結(jié):
a.三種模式在可以在DGbroker中自由切換(使用步驟2的方式)(在測(cè)試庫(kù)中),正常情況下,數(shù)據(jù)庫(kù)能迅速反應(yīng)過來(lái)(查看保護(hù)模式的時(shí)候)。
b.使用Maximum performance的時(shí)候,參數(shù)(備庫(kù))LogXptMode設(shè)置為async就好/
c.使用Maximum protection或者M(jìn)aximum availability的時(shí)候,參數(shù)(備庫(kù))LogXptMode要設(shè)置為sync。
d.(經(jīng)測(cè)試)使用Maximum protection時(shí),當(dāng)備庫(kù)出現(xiàn)異常(如網(wǎng)絡(luò)問題,數(shù)據(jù)庫(kù)宕機(jī)),主庫(kù)會(huì)掛起(告警日志會(huì)報(bào)如下錯(cuò)誤),當(dāng)備庫(kù)恢復(fù)正常之后,主庫(kù)也會(huì)恢復(fù)。
LGWR: Error 1034 attaching to RFS for reconnect
e.使用Maximum protection時(shí),在當(dāng)備庫(kù)出現(xiàn)異常的情況下,當(dāng)主庫(kù)掛起時(shí),(主庫(kù))可以強(qiáng)制切換到 Maximum performance,但當(dāng)重新切回Maximum protection(在備庫(kù)恢復(fù)時(shí)),主庫(kù)需重啟。
DGMGRL> edit configuration set protection mode as maxprotection; Operation requires shutdown of instance "atest" on database "atest1" Shutting down instance "atest"... Unable to connect to database ORA-12545: Connect failed because target host or object does not exist Failed. Warning: You are no longer connected to ORACLE. Please complete the following steps to finish the operation: shut down instance "atest" of database "atest1" start up instance "atest" of database "atest1"
以上內(nèi)容是小編給大家分享的Oracle數(shù)據(jù)庫(kù) DGbroker三種保護(hù)模式的切換的相關(guān)內(nèi)容,希望大家喜歡,同時(shí)也感謝大家一直以來(lái)對(duì)腳本之家網(wǎng)站的支持與厚愛。
相關(guān)文章
oracle生成動(dòng)態(tài)前綴且自增號(hào)碼的函數(shù)分享
這篇文章主要介紹了oracle生成動(dòng)態(tài)前綴且自增號(hào)碼的函數(shù),需要的朋友可以參考下2014-04-04
自動(dòng)備份Oracle數(shù)據(jù)庫(kù)
自動(dòng)備份Oracle數(shù)據(jù)庫(kù)...2007-03-03
Oracle單實(shí)例升級(jí)補(bǔ)丁全過程記錄
這篇文章主要介紹了Oracle單實(shí)例升級(jí)補(bǔ)丁,oracle19.3升級(jí)補(bǔ)丁到19.18,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2023-08-08
SQL?錯(cuò)誤?[1722]?[42000]:?ORA-01722:?無(wú)效數(shù)字解決辦法
這篇文章主要給大家介紹了關(guān)于SQL?錯(cuò)誤?[1722]?[42000]:?ORA-01722:?無(wú)效數(shù)字的解決辦法,ORA-01722是一個(gè)錯(cuò)誤代碼,當(dāng)試圖將一個(gè)字符串轉(zhuǎn)換為數(shù)字,但字符串無(wú)法轉(zhuǎn)換為數(shù)字時(shí)會(huì)出現(xiàn)這個(gè)錯(cuò)誤,需要的朋友可以參考下2024-06-06
Oracle分區(qū)表超詳細(xì)講解(Oracle?Partitioned?Tables)
這篇文章主要給大家介紹了掛不同意Oracle分區(qū)表超詳細(xì)講解(Oracle?Partitioned?Tables)的相關(guān)資料,ORACLE的分區(qū)是一種處理超大型表、索引等的技術(shù),文中通過代碼介紹的非常詳細(xì),需要的朋友可以參考下2024-01-01
關(guān)于Oracle存儲(chǔ)過程和調(diào)度器實(shí)現(xiàn)自動(dòng)對(duì)數(shù)據(jù)庫(kù)過期數(shù)據(jù)清除的問題
這篇文章主要介紹了Oracle存儲(chǔ)過程和調(diào)度器實(shí)現(xiàn)自動(dòng)對(duì)數(shù)據(jù)庫(kù)過期數(shù)據(jù)清除,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2021-01-01
使用Oracle命令進(jìn)行數(shù)據(jù)庫(kù)備份與還原
本文詳細(xì)講解了使用Oracle命令進(jìn)行數(shù)據(jù)庫(kù)備份與還原的方法,文中通過示例代碼介紹的非常詳細(xì)。對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧<BR>2021-12-12
ip修改后orcale服務(wù)無(wú)法啟動(dòng)問題解決
今天配置虛擬機(jī)中設(shè)計(jì)了下ip,使虛擬機(jī)和主機(jī)處在同一網(wǎng)段,然后使用webservice就成功了就來(lái)了,oracle連接不上了,接下來(lái)講提供詳細(xì)的解決方法2012-11-11

