Why ?
For
maintenance purpose in the standby server or primary server you will need to
stop Data Guard things prior reboot or do the activity in the server OS things
for example , thus; to avoid any issue
in the data sync between primary and stand by you should stop these shipping
data and it will be re-shipped once everything revert back to normal.
How ?
I
am assuming you already configure a Data guard broker and everything running
normally :
1- check current data guard status:
dgmgrl / as sysdba
DGMGRL> show configuration
Configuration - orcl_dg_config
Protection
Mode: MaxPerformance
Members:
Orcl_prim - Primary database
Orcl_stdby
- Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
(status updated 25 seconds ago)
2- Stop redo transport (stop sending data from primary to standby) :
DGMGRL> EDIT DATABASE '<primary_db>' SET
STATE='TRANSPORT-OFF';
3- Stop redo apply (stop
applying the received data in standby DB )
DGMGRL> EDIT DATABASE '<standby_db>' SET
STATE='APPLY-OFF';
4- Disable broker ( to avoid any failover/switchover during
the activity).
DGMGRL>
disable configuration
5- Shutdown database:
sqlplus / as sysdba
shutdown immediate;
quit
lsnrctl stop
6-Perform maintenance activities
7- Start database in the respective open_mode (read write
primary, or mounted standby) , In below case you will open standby DB in a read only; if you have an active data guard license .
sqlplus / as sysdba
startup open ;
quit
lsnrctl start
or first mount it and then open in read only mode :
SQL> startup nomount;
SQL> alter database mount;
SQL> ALTER DATABASE OPEN READ ONLY;
8- Enable broker
DGMGRL> enable configuration
9. Start redo apply
DGMGRL> EDIT DATABASE '<standby_db>' SET
STATE='APPLY-ON';
10. Start
redo transport
DGMGRL> EDIT DATABASE '<primary_db>' SET
STATE='TRANSPORT-ON';
10. Check
dataguard status
After a
while and things got recovered, you can check the status :
dgmgrl / as sysdba
DGMGRL> show configuration
Configuration - orcl_dg_config
Protection
Mode: MaxPerformance
Members:
Orcl_prim - Primary database
Orcl_stdby
- Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
(status updated 25 seconds ago)
No comments:
Post a Comment