在今天的文章中,我们将学习使用 DGMGRL 更改数据保护模式。
1.我们正在查询当前的保护模式。
DGMGRL> show configuration
Configuration - Broker_Configuration
Protection Mode: MaxPerformance
Databases:
primary - Primary database
standby - Physical standby database
logical - Logical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
- 我们质疑主备侧的传输模式。
DGMGRL> show database verbose primary
Database - primary
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
primary1
primary2
Properties:
DGConnectIdentifier = 'primary'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
DelayMins = '0'
Binding = 'optional'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
LsbyASkipTxnCfgPr = '0,0,0'
LsbyDSkipTxnCfgPr = '0,0,0'
LsbyASkipCfgPr = ''
LsbyDSkipCfgPr = ''
LsbyASkipErrorCfgPr = ''
LsbyDSkipErrorCfgPr = ''
LsbyMaxEventsRecorded = '0'
LsbyPreserveCommitOrder = ''
LsbyRecordSkipErrors = ''
LsbyRecordSkipDdl = ''
LsbyRecordAppliedDdl = ''
StandbyFileManagement = 'AUTO'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '8'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = 'standby, primary'
LogFileNameConvert = 'standby, primary'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
LsbyParameters = '(monitor)'
LsbySkipTxnTable = '(monitor)'
LsbySkipTable = '(monitor)'
LsbyFailedTxnInfo = '(monitor)'
ApplyLagThreshold = '0'
TransportLagThreshold = '0'
TransportDisconnectedThreshold = '30'
SidName(*)
StaticConnectIdentifier(*)
StandbyArchiveLocation(*)
AlternateLocation(*)
LogArchiveTrace(*)
LogArchiveFormat(*)
LsbyMaxSga(*)
LsbyMaxServers(*)
TopWaitEvents(*)
(*) - Please check specific instance for the property value
Database Status:
SUCCESS
DGMGRL> show database verbose standby
Database - standby
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Apply Rate: 72.00 KByte/s
Real Time Query: ON
Instance(s):
primary1 (apply instance)
primary2
Properties:
DGConnectIdentifier = 'standby'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
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 = '8'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = 'primary, standby'
LogFileNameConvert = 'primary, standby'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
ApplyLagThreshold = '0'
TransportLagThreshold = '0'
TransportDisconnectedThreshold = '30'
SidName(*)
StaticConnectIdentifier(*)
StandbyArchiveLocation(*)
AlternateLocation(*)
LogArchiveTrace(*)
LogArchiveFormat(*)
TopWaitEvents(*)
(*) - Please check specific instance for the property value
Database Status:
SUCCESS
DGMGRL> show database verbose logical
Database - logical
Role: LOGICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 1 second ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Apply Rate: 0 Byte/s
Instance(s):
primary1
primary2 (apply instance)
Properties:
DGConnectIdentifier = 'logical'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
DelayMins = '0'
Binding = 'optional'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
LsbyASkipTxnCfgPr = '0,0,0'
LsbyDSkipTxnCfgPr = '0,0,0'
LsbyASkipCfgPr = ''
LsbyDSkipCfgPr = ''
LsbyASkipErrorCfgPr = ''
LsbyDSkipErrorCfgPr = ''
LsbyMaxEventsRecorded = '0'
LsbyPreserveCommitOrder = ''
LsbyRecordSkipErrors = ''
LsbyRecordSkipDdl = ''
LsbyRecordAppliedDdl = ''
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '8'
LogArchiveMinSucceedDest = '1'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
LsbyParameters = '(monitor)'
LsbySkipTxnTable = '(monitor)'
LsbySkipTable = '(monitor)'
LsbyFailedTxnInfo = '(monitor)'
ApplyLagThreshold = '0'
TransportLagThreshold = '0'
TransportDisconnectedThreshold = '30'
SidName(*)
StaticConnectIdentifier(*)
StandbyArchiveLocation(*)
AlternateLocation(*)
LogArchiveTrace(*)
LogArchiveFormat(*)
LsbyMaxSga(*)
LsbyMaxServers(*)
TopWaitEvents(*)
(*) - Please check specific instance for the property value
Database Status:
SUCCESS
- 我们更改了物理备用数据库和主数据库的重做传输模式。
DGMGRL> edit database primary set property 'LogXptMode'='SYNC';
Property "LogXptMode" updated
DGMGRL> edit database standby set property 'LogXptMode'='SYNC';
Property "LogXptMode" updated
[Primary-1]——>警报日志
Tue Jan 17 13:47:05 2017
ALTER SYSTEM SET log_archive_dest_2='service="standby"','LGWR SYNC AFFIRM delay=0 optional compression=disable max_failure=0 max_connections=1 reopen=300 db_unique_name="standby" net_timeout=30','valid_for=(all_logfiles,primary_role)' SCOPE=BOTH;
ALTER SYSTEM SWITCH ALL LOGFILE start (primary1)
Tue Jan 17 13:47:05 2017
NSS2 started with pid=53, OS id=5030
Tue Jan 17 13:47:08 2017
LGWR: Standby redo logfile selected for thread 1 sequence 582 for destination LOG_ARCHIVE_DEST_2
ALTER SYSTEM SWITCH ALL LOGFILE complete (primary1)
Thread 1 advanced to log sequence 582 (LGWR switch)
Current log# 2 seq# 582 mem# 0: +DATA/primary/onlinelog/group_2.262.932222811
Tue Jan 17 13:47:12 2017
LNS: Standby redo logfile selected for thread 1 sequence 582 for destination LOG_ARCHIVE_DEST_3
Tue Jan 17 13:47:13 2017
Archived Log entry 2314 added for thread 1 sequence 581 ID 0x697b7314 dest 1:
Tue Jan 17 13:47:13 2017
ARC6: Archive log rejected (thread 1 sequence 581) at host 'standby'
FAL[server, ARC6]: FAL archive failed, see trace file.
ARCH: FAL archive failed. Archiver continuing
ORACLE Instance primary1 - Archival Error. Archiver continuing.
- 我们将配置的保护模式设置为最大可用性。
DGMGRL> edit configuration set protection mode as maxavailability;
Succeeded.
[Primary-1]——>警报日志
Tue Jan 17 13:49:59 2017
ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE AVAILABILITY
Completed: ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE AVAILABILITY
ALTER SYSTEM ARCHIVE LOG
Tue Jan 17 13:50:00 2017
Thread 1 cannot allocate new log, sequence 583
Checkpoint not complete
Current log# 2 seq# 582 mem# 0: +DATA/primary/onlinelog/group_2.262.932222811
Destination LOG_ARCHIVE_DEST_2 is UNSYNCHRONIZED
******************************************************************
LGWR: Setting 'active' archival for destination LOG_ARCHIVE_DEST_2
******************************************************************
LGWR: Standby redo logfile selected to archive thread 1 sequence 583
LGWR: Standby redo logfile selected for thread 1 sequence 583 for destination LOG_ARCHIVE_DEST_2
Thread 1 advanced to log sequence 583 (LGWR switch)
Current log# 1 seq# 583 mem# 0: +DATA/primary/onlinelog/group_1.261.932222811
Tue Jan 17 13:50:05 2017
LNS: Standby redo logfile selected for thread 1 sequence 583 for destination LOG_ARCHIVE_DEST_3
Tue Jan 17 13:50:06 2017
Archived Log entry 2319 added for thread 1 sequence 582 ID 0x697b7314 dest 1:
Tue Jan 17 13:50:25 2017
Thread 1 cannot allocate new log, sequence 584
Checkpoint not complete
Current log# 1 seq# 583 mem# 0: +DATA/primary/onlinelog/group_1.261.932222811
Destination LOG_ARCHIVE_DEST_2 is SYNCHRONIZED
LGWR: Standby redo logfile selected to archive thread 1 sequence 584
LGWR: Standby redo logfile selected for thread 1 sequence 584 for destination LOG_ARCHIVE_DEST_2
Thread 1 advanced to log sequence 584 (LGWR switch)
Current log# 2 seq# 584 mem# 0: +DATA/primary/onlinelog/group_2.262.932222811
Tue Jan 17 13:50:28 2017
Archived Log entry 2322 added for thread 1 sequence 583 ID 0x697b7314 dest 1:
Tue Jan 17 13:50:28 2017
LNS: Standby redo logfile selected for thread 1 sequence 584 for destination LOG_ARCHIVE_DEST_3
5.我们正在查询保护模式和传输模式。
DGMGRL> show configuration
Configuration - Broker_Configuration
Protection Mode: MaxAvailability
Databases:
primary - Primary database
standby - Physical standby database
logical - Logical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DMGRL> show database verbose primary
Database - primary
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
primary1
primary2
Properties:
DGConnectIdentifier = 'primary'
ObserverConnectIdentifier = ''
LogXptMode = 'SYNC'
DelayMins = '0'
Binding = 'optional'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
LsbyASkipTxnCfgPr = '0,0,0'
LsbyDSkipTxnCfgPr = '0,0,0'
LsbyASkipCfgPr = ''
LsbyDSkipCfgPr = ''
LsbyASkipErrorCfgPr = ''
LsbyDSkipErrorCfgPr = ''
LsbyMaxEventsRecorded = '0'
LsbyPreserveCommitOrder = ''
LsbyRecordSkipErrors = ''
LsbyRecordSkipDdl = ''
LsbyRecordAppliedDdl = ''
StandbyFileManagement = 'AUTO'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '8'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = 'standby, primary'
LogFileNameConvert = 'standby, primary'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
LsbyParameters = '(monitor)'
LsbySkipTxnTable = '(monitor)'
LsbySkipTable = '(monitor)'
LsbyFailedTxnInfo = '(monitor)'
ApplyLagThreshold = '0'
TransportLagThreshold = '0'
TransportDisconnectedThreshold = '30'
SidName(*)
StaticConnectIdentifier(*)
StandbyArchiveLocation(*)
AlternateLocation(*)
LogArchiveTrace(*)
LogArchiveFormat(*)
LsbyMaxSga(*)
LsbyMaxServers(*)
TopWaitEvents(*)
(*) - Please check specific instance for the property value
Database Status:
SUCCESS
DGMGRL> show database verbose standby
Database - standby
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Apply Rate: 552.00 KByte/s
Real Time Query: ON
Instance(s):
primary1 (apply instance)
primary2
Properties:
DGConnectIdentifier = 'standby'
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 = '8'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = 'primary, standby'
LogFileNameConvert = 'primary, standby'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
ApplyLagThreshold = '0'
TransportLagThreshold = '0'
TransportDisconnectedThreshold = '30'
SidName(*)
StaticConnectIdentifier(*)
StandbyArchiveLocation(*)
AlternateLocation(*)
LogArchiveTrace(*)
LogArchiveFormat(*)
TopWaitEvents(*)
(*) - Please check specific instance for the property value
Database Status:
SUCCESS
DGMGRL> show database verbose standby
Database - standby
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Apply Rate: 552.00 KByte/s
Real Time Query: ON
Instance(s):
primary1 (apply instance)
primary2
Properties:
DGConnectIdentifier = 'standby'
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 = '8'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = 'primary, standby'
LogFileNameConvert = 'primary, standby'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
ApplyLagThreshold = '0'
TransportLagThreshold = '0'
TransportDisconnectedThreshold = '30'
SidName(*)
StaticConnectIdentifier(*)
StandbyArchiveLocation(*)
AlternateLocation(*)
LogArchiveTrace(*)
LogArchiveFormat(*)
TopWaitEvents(*)
(*) - Please check specific instance for the property value
Database Status:
SUCCESS
- 我们也从 SQLPLUS 查询保护模式。
[Primary-1] SQL> select protection_mode from v$database;
PROTECTION_MODE
--------------------
MAXIMUM AVAILABILITY
[Physical-1] SQL> select protection_mode from v$database;
PROTECTION_MODE
--------------------
MAXIMUM AVAILABILITY
[Logical-1] SQL> select protection_mode from v$database;
PROTECTION_MODE
--------------------
MAXIMUM PERFORMANCE
原文标题:Changing Data Protection Mode With DGMGRL
原文作者:Onur ARDAHANLI
原文地址:https://dbtut.com/index.php/2022/06/12/changing-data-protection-mode-with-dgmgrl/
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




