日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

dg oracle 切换模式_Oracle数据库 DGbroker三种保护模式的切换

發布時間:2025/3/8 数据库 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 dg oracle 切换模式_Oracle数据库 DGbroker三种保护模式的切换 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.三種保護模式

– Maximum protection

在Maximum protection下, 可以保證從庫和主庫數據完全一樣,做到zero data loss.事務同時在主從兩邊提交完成,才算事務完成。如果從庫宕機或者網絡出現問題,主從庫不能通訊,主庫也立即宕機。在這種方式下,具有最高的保護等級。但是這種模式對主庫性能影響很大,要求高速的網絡連接。

– Maximum availability

在Maximum availability模式下,如果和從庫的連接正常,運行方式等同Maximum protection模式,事務也是主從庫同時提交。如果從庫和主庫失去聯系,則主庫自動切換到Maximum performance模式下運行,保證主庫具有最大的可用性。

– Maximum performance

在Maximum performance,主庫把歸檔的 archived log通過arch進程傳遞給從庫,在這種方式下,主庫運行性能最高,但是不能保證數據不丟失,且丟失的數據受redo log的大小影響。在redo log過大的情況下,可能一天都沒有歸檔一個日志,可以通過手工切換日志的方式來減小數據的丟失。

2.模式切換(Maximum performance切換至Maximum availability)

a.查看保護的模式

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.查看備庫的日志傳輸模式(參數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.修改完之后再次確認LogXptMode的值,如步驟b

e.切換模式(如果切換失敗,則再次去確認備庫LogXptMode的值)

DGMGRL> edit configuration set protection mode as maxavailability;

Succeeded.

f. 確認數據庫的的保護模式,如步驟a

g.需要注意的是,步驟c中修改的sync是備庫的值,切記!

3.個人小結:

a.三種模式在可以在DGbroker中自由切換(使用步驟2的方式)(在測試庫中),正常情況下,數據庫能迅速反應過來(查看保護模式的時候)。

b.使用Maximum performance的時候,參數(備庫)LogXptMode設置為async就好/

c.使用Maximum protection或者Maximum availability的時候,參數(備庫)LogXptMode要設置為sync。

d.(經測試)使用Maximum protection時,當備庫出現異常(如網絡問題,數據庫宕機),主庫會掛起(告警日志會報如下錯誤),當備庫恢復正常之后,主庫也會恢復。

LGWR: Error 1034 attaching to RFS for reconnect

e.使用Maximum protection時,在當備庫出現異常的情況下,當主庫掛起時,(主庫)可以強制切換到 Maximum performance,但當重新切回Maximum protection(在備庫恢復時),主庫需重啟。

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"

以上內容是小編給大家分享的Oracle數據庫 DGbroker三種保護模式的切換的相關內容,希望大家喜歡,同時也感謝大家一直以來對腳本之家網站的支持與厚愛。

創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的dg oracle 切换模式_Oracle数据库 DGbroker三种保护模式的切换的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。