backup and log should contain as much information as possible to restore the database and its configuration. are reused for new backups. Its possible? Control file will be backed up even if autobackup is set to off. If available, RMAN uses these backups for disaster recovery restore operations, but their purpose is to produce a snapshot of the database that can be restored on another system for testing or historical usage. Many environments inherit old backup configurations of old DBAs, then is very common to see set up long-term backup environments using backup database keep logs;. While here the backupped spfile is used as the spfile of the new database, I ran into some difficulty doing the same when restoring to a running database that already started with a spfile, or even with a closed database. Restore database validate will use the latest full or level 0 backup, regardless of its retention policy (long-term archival backup are exempted from the standard retention policy but can obviously be used to restore and recover the database). document.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() ); Enter your email address to subscribe to this blog. P.S: If you have a Long Term backup with KEEP FOREVER the Archivelogs Backups never will beobsolete. no problem here too. tag=MONTHLY_FULL_20160218, channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:00:01, archived log file name=+TSM/testdb/archivelog/2016_02_18/thread_1_seq_91.267.904150729 thread=1 sequence=91, channel default: deleting archived log(s), archived log file name=+TSM/testdb/archivelog/2016_02_18/thread_1_seq_91.267.904150729 RECID=834 STAMP=904150729, media recovery complete, elapsed time: 00:00:02, new incarnation of database registered in recovery catalog, How to migrate old fashion to new fashion to make long-term backup, Click to share on Facebook (Opens in new window), Click to share on Twitter (Opens in new window), Click to share on LinkedIn (Opens in new window), Click to email a link to a friend (Opens in new window), Click to share on Reddit (Opens in new window), Click to share on Tumblr (Opens in new window), Click to share on Pinterest (Opens in new window), Starting with Oracle In-Memory (aka IM) newFeature, https://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmbckba.htm#BRADV89551. A really useful 11G new feature are the archival backups optionally with restore points. 2> SET UNTIL RESTORE POINT BKP_MONTHLY_20160218_1556; channel ORA_SBT_TAPE_1: SID=225 device type=SBT_TAPE, channel ORA_SBT_TAPE_1: Data Protection for Oracle: version 126.96.36.199, channel ORA_DISK_1: SID=233 device type=DISK, channel ORA_SBT_TAPE_1: starting datafile backup set restore, channel ORA_SBT_TAPE_1: restoring control file, channel ORA_SBT_TAPE_1: reading from backup piece RMAN_MONTHLY_FULL_TESTDB_331_1_20160218_1, channel ORA_SBT_TAPE_1: piece handle=RMAN_MONTHLY_FULL_TESTDB_331_1_20160218_1 This type of backup is known as an archival backup. This will take some more time than point 1 and 2. This can be dangerous if not configured properly, RMAN will delete all archived logs that not satisfy retention policy. 2> ALLOCATE CHANNEL tape1 6) archival backup must not block, prevent or slow down any other ordinary rman backup (this requirement is strictly related to RPO). The biggest gain is that the archival backup is self contained, it contains all the files, database file backups AND archivelogs backups to recover this backup to a consistent state AND only the archivelog backups to recover this backup are flagged as to be kept. This is the code I use for the archival backup: You may have noticed thata sql script ( set_restorepoint.sql) is called by the backup code.. here it is: ============== RESTORE ============== The restore of an archival backup is usually done with the rman duplicate database command, having a connection to the original target database and the catalog, where the duplicatecommand creates a new database ( on the same or different host ) using the archival backup. 7) each archival backup must have its unique TAG, I will manually generate a tag. FireFox on the march 29%! With version 11.1 rman introduced archival backups ( see https://docs.oracle.com/cd/B28359_01/backup.111/b28270/wnbradv.htm#BRADV021 and restore datafile 1,2 validate or restore tablespace SYSTEM,SYSAUX validate. Change). This is the main topic, the reason which made me write down this note. SQL> select scn,guarantee_flashback_database,name from v$restore_point; SCN GUA NAME---------------- --- ------------------------------41435395 NO BEFORE_UPGRADE, RMAN Archival backups with restore points, backup as compressed backupset check logical database format '/u02/fast_recovery_area/SILVER/ARCHIVAL_%d_%U', SPFILE Included: Modification time: 26-SEP-13, Script to get info from the Auto Maintenance Gather Stats job, Using dbms_comparison to troubleshoot logical standby databases, Grant a "standard" DB user the possibility to unlock a user, Redo log management in physical standby database, Succeeding with online table redefinition, How to restore an RMAN cold backup on a new server. This example makes a database backup with tag Q107 and specifies that it should never be considered obsolete (partial sample output included). All rights reserved. Change). Use RESTORE POINT to easy therestore.RESTORE POINT clause that creates a normal restore point, which is a label for an SCN to which the backup must be recovered to be made consistent. Using the FRA to store archivelog will not conflict with these backups; recovery time would be shortened because rman will use archivelog in the FRA and with no need to restore them. This backup is not part of the disaster recovery strategy. Our starting point is RMANs documentation and some additional MOS note: This post will go through point 1-10; Ill discuss remaing topics in a part 2. These backups are retained only for a few days or weeks. Data preservation is related to data protection, but it serves a different purpose. a long post rman script will look like this: sql alter session set NLS_DATE_FORMAT=dd/mm/yyyy hh24:mi:ss ; Here you can find all the scripts. This will let us manage easily archival backup, i.e. ( sounds logic ) . After this time the backup is obsolete, regardless of the backup retention policy settings. In our world they need to be periodically monitored and tested to check their validity and to measure RTO. Change), You are commenting using your Facebook account. (recommended). I recently had to improve some backup scripts; since I did not find so much documentation about long-term archival backup I thought I could share my experience, because combining together different requirements is not always straightforward. -> Keep forever clause requires recovery catalog because backup records eventually age out of control file. comment=API Version 2.0,MMS Version 188.8.131.52, channel tape1: backup set complete, elapsed time: 00:01:25, backup will be obsolete on date Mar 24 2017 15:58:40, channel tape1: starting piece 1 at Feb 18 2016 15:58:41, channel tape1: finished piece 1 at Feb 18 2016 15:58:42, piece handle=RMAN_MONTHLY_FULL_TESTDB_329_1_20160218_1 tag=MONTHLY_FULL_20160218 Find all Backup of Archivelogs between 24h before and 24h after the backup with clause Keep was taken. -> We can only use this backup to recover to the point where the backup was taken. Here is a demo for you. Note down the lines in bold blue colors carefully. -> you can anytime change any backup piece to have a keep attribute. All Archivelogs Backups will be obsolete and RMAN will automaticaly deleted it. Note: You cannot use KEEP to override the retention policy for files stored in the flash recovery area. Long-Term Backups are archival backupswhich have longretention and often are stored only on tapes,usually these tapes are off-site or in safes. We do care about RPO, and we will schedule archivelog backup consequently.Since RMAN jobs can be run in parallel, we can schedule rman ordinary backups and rman archival backup without having to worry about overlapping schedules, as our archival backup will not block or prevent other rman jobs. With the target database closed it proved to be impossible to set a restorepoint within my rman restore script ( and you really need this restorepoint to restore the spfile! Years after you make the archival backup, you could restore and recover it to query the data as it appeared at the time of the backup. rman validate and rman crosscheck ). Harry Dragstra is Senior Oracle DBA. RMAN needs the current redo information to make the database consistent upon a database restoration. (p.396), RMAN backs up all the datafiles, archived redo logs, the control file, and the server parameter file. (p.396), RMAN backs up only those archived redo logs necessary to recover the database to a consistent state. (p.396), If you specify the optional restore point clause, the database will create a restore point that captures the SCN at the time RMAN backup completes. (p.396), The control file autobackup stores the restore point so RMAN can utilize it when you restore the control file. (p.396). Please note that rman will not only retain the archivelog needed to recover the backup: it will retaing all subsequent archivelog (or their backup). The primary purpose of short-term backup is to recover recent data or if a media failure or disaster occurs, then you can use it to restore your backups and bring your data available. If you specify CHECK LOGICAL on the BACKUP command, however, then RMAN tests data and index blocks for logical corruption, such as corruption of a row piece or index entry, and log them in the alert log located in the Automatic Diagnostic Repository (ADR).
And by automating + standardizing this archival backup and restore there is less risk of the mistakes every dba makes, once in a while. RMAN resynchronizes restore points with the recovery catalog and maintains the restore points as long as the backup exists. Allrightsreserved. Recovery Manager: Release 184.108.40.206.0 - Production on Thu Feb 18 15:56:59 2016. 8 9) we can accept backup job to run with a low degree of parallelism to reduce backup jobs overhead; however restore jobs must be able to use a proper, higher, degree of parallelism in order to guarantee an acceptable RTO. So I ended up with backing up the spfile as pfile, as an add-on to the archival backup check out the backup code I provided before -, and using this pfile to restore the original spfile, as part of the rman restore/recovery.