backup database keep forever logs
If you want to keep some backups forever, you maybe tried
RMAN> backup database keep forever logs; Starting backup at 13.04.2007 13:58:04 ... backup will never be obsolete archived logs required to recover from this backup will expire when this backup expires ... Finished backup at 13.04.2007 13:58:23
but the problem is that the archivelogs to recover this backup at any time after the backup will NEVER be obsolete.
You could well try the NOLOGS option, but this requires you to take the database in the MOUNT state.
RMAN> backup database keep forever nologs; Starting backup at 13.04.2007 14:06:36 ... backup will never be obsolete archived logs required to recover from this backup will not be kept ... Finished backup at 13.04.2007 14:07:25
This is fine if you can stop your database. But you probably wants online backup. What’s next?
Ok, here is the way to go. You do your online backup, then you mark what you want to keep !
First I backup the old archivelogs, because I do not need to keep those yet.
RMAN> backup archivelog all; Starting backup at 13.04.2007 14:10:00 ... Finished backup at 13.04.2007 14:10:08
Now I do a backup plus archivelog (with a tag for simplicity)
RMAN> backup database tag backuplsc plus archivelog tag backuplsc; Starting backup at 13.04.2007 14:10:42 ... Finished backup at 13.04.2007 14:11:00
Now I can mark my backup as keep
RMAN> change backup tag backuplsc keep forever; ... keep attributes for the backup are changed backup will never be obsolete backup set key=405 RECID=116 STAMP=619798257 keep attributes for the backup are changed backup will never be obsolete backup set key=406 RECID=117 STAMP=619798260
Now if I do a delete obsolete, it will never delete my backup.
RMAN> backup database plus archivelog Starting backup at 13.04.2007 14:16:46 ... Finished backup at 13.04.2007 14:17:10 RMAN> delete noprompt obsolete; RMAN retention policy will be applied to the command RMAN retention policy is set to redundancy 1 ... Deleting the following obsolete backups and copies: ... Deleted 7 objects RMAN> list backup summary; List of Backups =============== Key TY LV S Device Type Completion Time ------- -- -- - ----------- ------------------- #Pieces #Copies Compressed Tag ------- ------- ---------- --- ... 405 B F A DISK 13.04.2007 14:10:57 1 1 YES BACKUPLSC 406 B F A DISK 13.04.2007 14:11:00 1 1 YES BACKUPLSC ...
April 17th, 2007 at 15:56
Or you could use the Archiving feature of the Backup prOxy Server (BOS) solution and avoid all those headaches
April 18th, 2007 at 09:20
is it related to RMAN?
April 26th, 2007 at 00:20
This doesn’t appear to work; RMAN won’t mark a copy that includes archive logs KEEP.
April 26th, 2007 at 13:13
with which version did you try?
May 1st, 2007 at 15:59
I’ve tried this in 10.2.0.3.0. It produces the following error: -
RMAN> change backup tag LNACBP01_20070430_110744 keep forever;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found “;”: expecting one of: “consistent, logs, nologs”
RMAN-01007: at line 1 column 56 file: standard input
RMAN> change backup tag LNACBP01_20070430_110744 keep forever nologs;
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=89 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of KEEP command at 05/01/2007 15:54:31
RMAN-06530: CHANGE … KEEP not supported for backup set which contains archive logs
RMAN>
This is a real pain, as I know that the backup set contains enough redo to make for a consistent restore which will give me my month end position.
May 4th, 2007 at 14:04
this is strange, either I made a copy paste error or there is something magic in the site where I tried, but it seems it works with NOLOGS.
Ok, here I try again
so the KEEP FOREVER NOLOGS seems to work with backup of archivelogs
May 23rd, 2007 at 16:02
How do you restore that backup once you’ve taken other backups sometime later?
May 23rd, 2007 at 18:12
something like
restore database until sequence 14 thread 1
recover database until sequence 14 thread 1
where 13 is your highest saved redo log.
should work
June 13th, 2007 at 13:50
Another quick question as I can’t find the answer. Anyway to change the actual tag name of the backup? I.E. change TAG20070613T000231 to something like BKUP_06132007_KEEP_30?
June 13th, 2007 at 17:08
backup database tag BKUP_06132007_KEEP_30
?
June 27th, 2007 at 13:22
No, I meant for a backup that is already completed. Backups run nightly, and sometimes the next day, the proj mgr wants to keep the previous nights backup and rename it.
June 28th, 2007 at 16:04
Sorry, I do not know how to change the tag
February 18th, 2008 at 23:55
Starting backup at 13.04.2007 13:58:04
How do you get RMAN to include the time ? (like you have)
I only get the date in “Starting backup at 13.04.2007″ !…
Thank you,
February 19th, 2008 at 09:32
NLS_DATE_FORMAT=’YYYY-MM-DD HH24:MI:SS’
either OS variable or registry entry depending on your os
August 5th, 2008 at 23:49
There must be something magical at the site you did this, because it most definitely does not work for me on 10.2.0.3 either:
My brief trip to the Backup and Recovery Advanced User’s Guide seems to indicate that the only way to accomplish this is from the consistent mount state: Keeping a Long-Term Backup: Example