Some day to day commands for Datagaurd:
➤How to start log apply service in standby database?
SQL>Alter database recover managed standby database disconnect from session;
Here, "disconnect from session" to instruct the session to come out of the current SQL session else it will be hung until the recovery is completed
➤How to check the log apply service is working fine or not?
SQL>select process,status,sequence# from v$managed_standby;
Note: Never check the archive sync with the command "archive log list" , it may give the wrong details. Always check it using v$managed_standby view.
➤How to start log apply service in standby database?
SQL>Alter database recover managed standby database disconnect from session;
Here, "disconnect from session" to instruct the session to come out of the current SQL session else it will be hung until the recovery is completed
➤How to check the log apply service is working fine or not?
SQL>select process,status,sequence# from v$managed_standby;
Note: Never check the archive sync with the command "archive log list" , it may give the wrong details. Always check it using v$managed_standby view.
➤To stop the log apply service?
SQL>Alter database recover managed standby database cancel;
Verify it by running below command
SQL>select process,status,sequence# from v$managed_standby;
Alternatively, you can verify the mrp process.It will show no mrp process running for the instance.
ps -ef|grep mrp
Stop log apply using DGBROKER
DGMGRL>edit database <standby_dbname> set state=apply-off;
➤How to start the redo apply in real time in foreground?
SQL>alter database recover managed standby database;
Note: In above command delay attribute is ignored
If you want to start with delay, use below command:
SQL>alter database recover managed standby database using archived logfile disconnect;
Note:Delay attribute must be set at primary and standby database
Start using Broker
DGMGRL>edit database <standby_dbname> set state=apply-on;
Redo apply delay parameter
edit database <standby_dbname> set DelayMins=10;
➤ What happens when delay is mentioned?
#MRP waits for a specified time before it applies the redo
# can be used to protect corrupted data to be applied from primary to standby
# report will get generated until the apply is done with real time data
# set parmeter DELAY in log_archive_dest_n parameter
➤ How to opverride the delay service and apply redo:
SQL>alter database recover managed standby database nodelay;
Comments
Post a Comment