DGMGRL> show database verbose 'PROD1';
Database - PROD1
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
PROD1
Properties:
DGConnectIdentifier = 'prod1'
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 = '30'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = 'SBDB1, PROD1'
LogFileNameConvert = 'SBDB1, PROD1'
FastStartFailoverTarget = 'SBDB1'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
SidName = 'PROD1'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lfdz1.example.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=PROD1_DGMGRL)(INSTANCE_NAME=PROD1)(SERVER=DEDICATED)))'
StandbyArchiveLocation = '/home/oracle/flash'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
TopWaitEvents = '(monitor)'
Database Status:
SUCCESS
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 = '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 = '30'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = 'PROD1, SBDB1'
LogFileNameConvert = 'PROD1, SBDB1'
FastStartFailoverTarget = 'PROD1'
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
SidName = 'SBDB1'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lfdz2.example.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=SBDB1_DGMGRL)(INSTANCE_NAME=SBDB1)(SERVER=DEDICATED)))'
StandbyArchiveLocation = '/home/oracle/flash'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.arc'
TopWaitEvents = '(monitor)'
Database Status:
SUCCESS
DGMGRL> switchover to 'SBDB1';
Performing switchover NOW, please wait...
Error: ORA-16552: error occurred while generating directives for client
Error: ORA-16501: the Data Guard broker operation failed
Failed.
Unable to switchover, primary database is still "PROD1"
DGMGRL> show configuration;
Error:
Configuration - dgtest
Protection Mode: MaxAvailability
Databases:
SBDB1 - Primary database
PROD1 - (*) Physical standby database
Fast-Start Failover: ENABLED
Configuration Status:
ORA-16570: database needs restart
ORA-06512: at "SYS.DBMS_DRS", line 157
ORA-06512: at line 1
DGM-17017: unable to determine configuration status
SYS@PROD1> startup
ORACLE instance started.
Total System Global Area 523108352 bytes
Fixed Size 1346052 bytes
Variable Size 331351548 bytes
Database Buffers 184549376 bytes
Redo Buffers 5861376 bytes
Database mounted.
Database opened.
SYS@PROD1> select database_role,open_mode from v$database;
DATABASE_ROLE OPEN_MODE
---------------- --------------------
PHYSICAL STANDBY READ ONLY WITH APPLY
SYS@SBDB1> select database_role,open_mode from v$database;
DATABASE_ROLE OPEN_MODE
---------------- --------------------
PRIMARY READ WRITE
DGMGRL> exit
[oracle@lfdz1 ~]$
[oracle@lfdz1 ~]$ 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
Password:
Connected.
DGMGRL> show configuration;
Configuration - dgtest
Protection Mode: MaxAvailability
Databases:
SBDB1 - Primary database
PROD1 - (*) Physical standby database
Fast-Start Failover: ENABLED
Configuration Status:
SUCCESS
回切:prod1为主库
DGMGRL> switchover to 'PROD1';
Performing switchover NOW, please wait...
New primary database "PROD1" is opening...
Operation requires shutdown of instance "SBDB1" on database "SBDB1"
Shutting down instance "SBDB1"...
ORACLE instance shut down.
Operation requires startup of instance "SBDB1" on database "SBDB1"
Starting instance "SBDB1"...
Unable to connect to database
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Failed.
Warning: You are no longer connected to ORACLE.
Please complete the following steps to finish switchover:
start up instance "SBDB1" of database "SBDB1"
[oracle@lfdz2 ~]$ sql
SQL*Plus: Release 11.2.0.3.0 Production on Wed May 11 13:27:42 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SYS@SBDB1> startup
ORACLE instance started.
Total System Global Area 523108352 bytes
Fixed Size 1346052 bytes
Variable Size 331351548 bytes
Database Buffers 184549376 bytes
Redo Buffers 5861376 bytes
Database mounted.
Database opened.
SYS@SBDB1> select database_role,open_mode from v$database;
DATABASE_ROLE OPEN_MODE
---------------- --------------------
PHYSICAL STANDBY READ ONLY WITH APPLY
SYS@PROD1> select database_role,open_mode from v$database;
DATABASE_ROLE OPEN_MODE
---------------- --------------------
PRIMARY READ WRITE
DGMGRL> show configuration;
Configuration - dgtest
Protection Mode: MaxAvailability
Databases:
PROD1 - Primary database
SBDB1 - (*) Physical standby database
Fast-Start Failover: ENABLED
Configuration Status:
SUCCESS
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30192548/viewspace-2121489/
,如需转载,请注明出处,否则将追究法律责任。