3

Due to reasons outside the scope of this question, we had to flashback our Logical Standby Database (at the VM level) to the previous day.

So, now i'm trying to resolve gaps in missing archivelogs between the primary and the Logical Standby Databases.

Standby:

SQL> select * from gv$logstdby_process where status_code != 16116;
READER  ORA-16240: Waiting for log file (thread# 1, sequence# 54888)

Sequence 54888 no longer exists in the Logical Standby (due to the flashback), and since we take a nightly archive log backup, this sequence no longer exists as an archived log on the Primary. However, I verified that this sequence is in the archived log backup on the Primary.

Primary:

RMAN> list backup of archivelog sequence 54888;

  List of Archived Logs in backup set 6236
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  1    54888   42289020451 30-MAR-16 42290599951 30-MAR-16

Therefore, I copied the archive log backup to the Logical Standby and issued the following on the Logical Standby database:

RMAN> catalog start with 'L:\oracle\backups'; 
RMAN> shutdown immediate;
RMAN> startup mount;
RMAN> recover database;
RMAN> alter database open;
RMAN> list backup of archivelog scn between 42289020451 and 42289020451;

Thrd Seq     Low SCN    Low Time   Next SCN    Next Time
1    54888   42289020451 30-MAR-16 42290599951 30-MAR-16

RMAN> list backup of archivelog sequence 54888;

specification does not match any backup in the repository

SQL> alter database start logical standby apply immediate;
SQL> select * from gv$logstdby_process where status_code != 16116;

READER  ORA-16240: Waiting for log file (thread# 1, sequence# 54888)

So I have 2 questions:

1) Even though I can see the archivelog backup of sequence 54888 on the Logical Standby Database when performing a list backup of archivelog scn, why does the list backup of archivelog sequence 54888 return no records?

2) How can I get the log apply process to pick up sequence 54888 from the archivelog backup?

  • 1
    Restore archive log file from backup set and store in standby archive destination. Once all the archive log files are there you can use RECOVER AUTOMATIC statement on standby. – JSapkota Mar 31 '16 at 16:48
  • 2
    You may have to register the logfile ... alter database register logfile '/full/path/of/your/restored/log/file'; – Raj Mar 31 '16 at 17:49
  • @JSapkota Perfect, on Primary RMAN> restore archivelog from sequence 54888; move files to standby SQL> alter database register logfile '<full path>'; Worked for me... thank you, I knew I had to be missing something basic... – Kris Johnston Mar 31 '16 at 19:04
  • @Raj Also, thank you for the alter database register logfile '<full path>'; part... I don't do this enough to remember that step... – Kris Johnston Mar 31 '16 at 19:13
1

If you can see the backup file in the directory, try cataloging it:

RMAN> catalog starts with '/path/to/archive/directory';

It will list the backup and ask you if you want to catalog it. Following which you should be able to continue with your gap recovery:

alter database recover managed standby database cancel;
recover standby database;
#after all existing logs are applied put standby database to recover managed 
mode
recover managed standby database

If you don't have the archived logs anymore, you can do an incremental backup with:

"backup incremental <from scn> until scn"
  • As mentioned in my question, I did catalog the archivelog backup. RMAN did catalog the archivelog backup, but didn't unpackage the archivelogs from the archivelog backup (not mentioned in my question, however). Also, alter database recover managed standby database applies to physical standby databases, not logical standby databases. – Kris Johnston Mar 31 '16 at 19:18
  • It makes me wonder if the reason I couldn't simply catalog the archive log backup or the archive logs directly (which I tried after I unpackaged them from the archive log backup) is because of the differences between Logical Standby and Physical Standby... rather annoying to have to register each and every logfile, but oh well... – Kris Johnston Apr 1 '16 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.