1. Stop standby
Select process, status from V$managed_standby;---check if the repository is being restored in the application log
ALTER DATABASE recover managed standby database cancel;
Shutdown immediate;
2. Switch to read-only mode
-----switch from shutdown mode to read-only mode-------
Startup Nomount;
ALTER DATABASE mount standby database;
ALTER DATABASE open read only;
-----switch from Application log mode to read-only mode-------
ALTER DATABASE recover managed standby database cancel; --Cancel log application
ALTER DATABASE open read only;
3. Switch back to manage recovery mode
Startup Nomount;
ALTER DATABASE mount standby database;
ALTER DATABASE recover managed standby database disconnect from session; --Start log application
ALTER DATABASE recover managed standby database using current logfile disconnect from session;
4. Role switching between the main and standby libraries
4.1 Master Library switch to standby
ALTER DATABASE commit to switchover to physical standby;
ALTER DATABASE commit to switchover to physical the standby with session shutdown;--When the main library has a session connection
Shutdown immediate
Startup Nomount;
ALTER DATABASE mount standby database;
ALTER DATABASE recover managed standby database disconnect from session;
4.2 Switching from the library to the primary library
ALTER DATABASE commit to switchover to primary;
Shutdown immediate;
Startup
alter system switch logfile;
5. The repository is automatically restored using logs from the main library
ALTER DATABASE recover automatic standby database;
6. Change the protection mode
ALTER DATABASE set standby database to maximize protection;
ALTER DATABASE set standby database to maximize availability;
ALTER DATABASE set standby database to maximize Performancen;
7. Cancel Automatic recovery mode
ALTER DATABASE recover managed standby database cancel;
ALTER DATABASE recover managed standby database finish;
ALTER DATABASE recover managed standby database finish force;
This article is from the "Oracle World of Hunter" blog, please contact the author!
Oracle dataguard Daily Maintenance Command Summary