Register Login

Archivelog is available on standby database but not applied on standby.

Updated Dec 31, 2024

Hello Experts,

If some archivelogs are available on the standby database but have not been applied yet, how can they be applied? Please help.

Solution

Archive logs that are available on the standby database but have not yet been applied can be applied using the procedures listed below. Make sure you have the necessary authorizations and adhere to the usual database administration procedures of your company.

Steps to Apply Archivelogs on Standby Database

1) Check for Archive Logs Not Applied: Please use the following query in order toto identify the logs that are available on the standby database but not applied:

SELECT THREAD#, SEQUENCE#, APPLIED 
FROM V$ARCHIVED_LOG
WHERE APPLIED = 'NO';

2. Manually Register the Archive Logs (if necessary): If the archive logs are present on disk but not registered with the standby database, they can be manually registered with the help of the following query:

ALTER DATABASE REGISTER LOGFILE '<full_path_to_archive_log>';

Replace <full_path_to_archive_log> with the actual path of the archive log file.

3. Apply the Logs: To apply the logs, switch the standby database to managed recovery mode:

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

This will automatically apply the available logs but not yet applied.

4. Apply Logs Manually (if necessary): If for some reason the logs are not being applied automatically, you can apply them manually:

RECOVER STANDBY DATABASE UNTIL CANCEL;

The system will prompt you for the path to the next archive log. Provide the required archive log paths until all logs are applied, then cancel the recovery.

CANCEL;

5. Verify Logs Applied: Re-run the query to check which logs are applied:

SELECT THREAD#, SEQUENCE#, APPLIED 
FROM V$ARCHIVED_LOG
ORDER BY SEQUENCE#;

6. Restart Managed Recovery: Once all required logs are applied, restart managed recovery to ensure the standby database continues to receive and apply logs automatically:

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT FROM SESSION;

Common Issues and Resolutions

  • Log Not Found: Ensure the archive log file exists in the correct location. If not, transfer it from the primary database.
  • Corrupt Archive Log: Re-transfer the log from the primary database.
  • Standby Database in Incorrect State: Make sure the standby database is in the correct mode (MOUNTED but not OPEN).

Notes

  • Always monitor the alert.log file for errors or issues during recovery.
  • It’s recommended to take a backup of the standby database before performing manual recovery operations.

Let me know if you encounter specific errors during the process!


Comments

  • 22 Jun 2017 9:26 am Guest

    Oracle 10g

    SQL> alter database recover managed standby database disconnect from session;

    Database altered.

    As I said earlier when I do

    ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

    ERROR at line 1:

    ORA-16136: Managed Standby Recovery not active


×