原因是主备库broker的配置文件不一致导致。
解决办法,删除主备库的broker的配置文件
具体步骤如下:
1.在主备库都执行以下命令:
SQL> alter system set dg_broker_start=false;
2.在主 备 库手工删除broker配置文件
SQL> show parameter brok
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/oracle/fast_recovery_
area/dr1prod1.dat
dg_broker_config_file2 string /u01/app/oracle/fast_recovery_
area/dr2prod1.dat
SQL> ! rm -fr /u01/app/oracle/fast_recovery_area/dr1prod1.dat /u01/app/oracle/fast_recovery_area/dr2prod1.dat
SQL> ! ls -ltr /u01/app/oracle/fast_recovery_area/dr1prod1.dat /u01/app/oracle/fast_recovery_area/dr2prod1.dat
ls: /u01/app/oracle/fast_recovery_area/dr1prod1.dat: No such file or directory
ls: /u01/app/oracle/fast_recovery_area/dr2prod1.dat: No such file or directory
3.在主备库都再执行以下命令
SQL> alter system set dg_broker_start=true;
4.连接到主库重新去配置broker
DGMGRL> connect sys/oracle@prod1
DGMGRL> CREATE CONFIGURATION cfgocm1 as PRIMARY DATABASE IS prod1 CONNECT IDENTIFIER IS prod1;
DGMGRL> ADD DATABASE sbdb1 as CONNECT IDENTIFIER IS sbdb1;
Database "sbdb1" added
DGMGRL> enable configuration;
Enabled.
DGMGRL> show configuration;
Configuration - cfgocm1
Protection Mode: MaxPerformance
Databases:
prod1 - Primary database
sbdb1 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
5.检查备库状态
DGMGRL> show database verbose sbdb1
Database - sbdb1
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds
Apply Lag: 0 seconds
Real Time Query: ON
Instance(s):
sbdb1
Properties:
DGConnectIdentifier = 'sbdb1'
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 = '4'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '/u01/app/oracle/oradata/prod1, /u01/app/oracle/oradata/sbdb1'
LogFileNameConvert = '/u01/app/oracle/oradata/prod1, /u01/app/oracle/oradata/sbdb1'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
SidName = 'sbdb1'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocm2.sztech.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=sbdb1_DGMGRL.example.com)(INSTANCE_NAME=sbdb1)(SERVER=DEDICATED)))'
StandbyArchiveLocation = 'USE_DB_RECOVERY_FILE_DEST'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.dbf'
TopWaitEvents = '(monitor)'
Database Status:
SUCCESS
6.进入备库
[oracle@ocm2 ~]$ dgmgrl
DGMGRL for Linux: Version 11.2.0.3.0 - Production
Copyright (c) 2000, 2009, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/oracle@sbdb1
Connected.
DGMGRL> show configuration;
Configuration - cfgocm1
Protection Mode: MaxPerformance
Databases:
prod1 - Primary database
sbdb1 - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
到此 问题已经解决。
|