In the process of building a logical repository based on physical standby, we run:
ALTER DATABASE recover to logical standby READDB;
stuck, and alert does not have an error message, extremely depressed, consulted others, chat records such as the following:
Our business is a passport application that cannot be stopped or stopped very troublesome, in short, the medicine can not stop.
After groping, we get an experience: it is necessary to wait until the MRP application log is consistent with the main library, at which point the command will not hang.
The detailed process is probably this:
1. Turn on the real-time log app
ALTER database RECOVER MANAGED STANDBY database USING current LOGFILE DISCONNECT from SESSION
In this process, we are able to view the log application and run the following command in the repository:
SELECT sequence#,applied from V$archived_log ORDER by sequence#;
until the primary and standby logs are consistent, infer SQL such as the following:
Run in Main library:
Archive Log List
running in the Standby library:
Select Max (sequence#) from V$archived_log;
based on these 2 values, you can infer whether the log is consistent
2. Next, we need to stop the MRP process in the repository:
ALTER DATABASE recover managed standby database cancel;
Note that this assumes an error, such as the following see, can not care, because our main log is consistent, MRP can be idle
ERROR at line 1:ora-16136:managed Standby Recovery not active
3. We can then generate the data dictionary in the main library
exec dbms_logstdby.build;
we need to have the data dictionary transferred to the repository, so we still need to log:
Alter system archive log current;
4. Finally, you are done:-)
ALTER DATABASE recover to logical standby READDB;
Good luck!
Oracle DG Troubleshooting A: ALTER DATABASE recover to logical standby new_logical_dbname stuck