Sunday 26 February 2017

Specification does not match any archived log in the repository



In my case, after enabling the archivelog mode i forgot to open the database. So during the full backup i got a message saying below and it cancelled the backup.

Before:

specification does not match any archived log in the repository
backup cancelled because there are no files to backup

RMAN Backup did not complete as expected check file

FIX : Please check whether your database is in open mode or not, it should be open.


After :


channel ch11: backup set complete, elapsed time: 00:00:01
Finished backup at 27-FEB-17

released channel: ch11

Recovery Manager complete.
+++++++++++++++++++++++++++++++++++++++++
RMAN Command successful completion..
+++++++++++++++++++++++++++++++++++++++++
RMAN Backup did not complete as expected check file




Monday 20 February 2017



How to  correctly purge old RMAN backups when storage runs out of space 
Do not use rm to remove files 
as I did this blunder once and got escalated :P
You must do it via RMAN.
$ export NLS_DATE_FORMAT='DD-MM-YY HH24:MI'

$ rman target / NOCATALOG

RMAN > crosscheck backupset;
This command will verify whether backup file is still on media.
If it is unavailable, RMAN will mark it as UNAVAILABLE or EXPIRED.

RAMN > delete expired backupset;
or
RMAN > delete expired backup;
Note : If you manually rename or zip RMAN backup files, 
you must manually remove it from disk since RMAN
does not recognize them.
RMAN > report obsolete;
The command lists all backups rendered obsolete based on rentention policy.
Current Retention Policy is 'Recovery WINDOW OF 30 DAYS'.

RMAN > delete obsolete;

RMAN > list backup summary;
It will show all backupset info kept in RMAN repository.
If you want to see what RMAN keeps in each backupset, 
run 'list backupset N' where N is Backupset ID.

RMAN > delete backupset N;
or
RMAN > delete backupset; (to delete all backups)

Once fair amount of space is reclaimed, do full backup.
Not sure how much full back space is needed but not less than 20G.

RMAN > backup database;

RMAN > list backup;
Full backup may have more than one backupset.
Look for last backupsets. It will list backup db files.

RMAN > delete obsolete;
Rerun this command to delete unwanted existing backupsets
 (if have) after completed full backup.