how to recover database with incremental backup rman


You can also restore the control file to any location that you choose other than the CONTROL_FILES locations, by using the form RESTORE CONTROLFILE TO 'filename': You can perform this operation with the database in NOMOUNT, MOUNT, or OPEN states, because you are not overwriting any of the control files currently in use. To recover the database with a control file autobackup in NOCATALOG mode: Start RMAN and connect to a target database. For example, enter the following command: If you lose the server parameter file, then RMAN can restore it to its default location or to a location of your choice. ###############################################TAKE LEVEL 0 BACKUP ON SOURCE SERVER###############################################C:\Users\farhat>rman target /, Recovery Manager: Release 11.2.0.3.0 Production on Tue Dec 3 11:00:33 2013. The current format is specified in the initialization parameter file used to start the instance (or all instances in an Oracle RAC configuration). Run the following query in SQL*Plus: Write the RMAN restore and recovery script. To perform a disaster recovery, you must have the following: All archived redo logs generated after the creation time of the oldest backup that you intend to restore. RMAN uses the autobackup format and DBID to hunt for control file autobackups. Example 20-3 Restoring a Database on a New Host. For example, run: If you want to specify files individually, then you can execute a CATALOG command as follows: Start a SQL*Plus session on the new database and query the database file names recorded in the control file.

Run recovery process. Copyright (c) 1982, 2011, Oracle. To restore the server parameter file to a nondefault location, specify the TO clause or TO PFILE clause on the RESTORE SPFILE command. To terminate the restore operation if you do not find the autobackup in the current day (or specified day), set MAXDAYS 1 on the RESTORE command.

Its backup information will be used while recovering database upto level of incremental level 1. If the autobackups were not produced with the default format (%F), then use the SET CONTROLFILE AUTOBACKUP FOR DEVICE TYPE command to specify the format in effect when the autobackup was performed. However, you must be connected to hostb either locally or through a net service name. This will significantly reduce restore time.Following steps are involved. You have one tape drive containing backups of all the data files and archived redo logs through log 1124, and autobackups of the control file and server parameter file. The following example deletes the database files: Because you did not perform the restore and recovery operation when connected to the recovery catalog, the recovery catalog contains no records for any of the restored files or the procedures performed during the test.

Recover the data files. standby dba

Otherwise, RMAN returns an error. Perform a complete restore and recovery as described in "Performing Complete Database Recovery". The instance may continue operating, although you must shut it down and restart it after restoring the server parameter file. The main differences are: Only consistent backups can be used in restoring a database in NOARCHIVELOG mode. RMAN uses the autobackup format and DBID to determine where to hunt for the control file autobackup. Catalog any backups not recorded in the repository with the CATALOG command.

If you must use a recovery catalog because the control file is not large enough to contain the RMAN repository data on all of the backups that you must restore, then use Oracle Data Pump to export the catalog and import it into a different schema or database. The command file should do the following: Restore a control file autobackup (see "Performing Recovery with a Backup Control File and No Recovery Catalog"). As shown in Example 20-2, you must first set the DBID for your database, and then use the RESTORE CONTROLFILE FROM AUTOBACKUP command. If an SBT channel created the control file autobackup, then allocate one or more SBT channels. Restore incremental level 0 backup on destination server (Just restore database, Dont recover database). If you do not set the CONTROL_FILES initialization parameter, then the database uses the same rules to determine the destination for the restored control file that it uses when creating a control file if the CONTROL_FILES parameter is not set. The RMAN metadata missing from the backup control file is available from the recovery catalog. Thus, you must configure the media management software so that hostb is a media manager client and can read the backup sets created on hosta. Because no recovery catalog is available, you cannot use preconfigured channels. The script must include the following steps: For each data file on the destination host that is restored to a different path than it had on the source host, use a SET NEWNAME command to specify the new path on the destination host. If RMAN is not connected to a recovery catalog, then use SET DBID to set the DBID for the target database. RMAN restores the control file to whatever locations you specified in the CONTROL_FILES initialization parameter. Start RMAN and connect to a target database and recovery catalog. Move newly taken incremental level 1 backup on destination server. For example, start RMAN as follows: Specify the DBID for the target database with the SET DBID command, as described in "Restoring the Server Parameter File". When the server parameter file is not available, RMAN starts the instance with a dummy parameter file. When you are restoring the control file, the default destination is all of the locations defined in the CONTROL_FILES initialization parameter. This procedure uses the RESTORE and RECOVER commands. If all copies of the current control file are lost or damaged, then you must restore and mount a backup control file. If you do not perform either of the preceding actions, then RMAN assumes that you are restoring the production database and deletes flashback logs from the fast recovery area because they are considered unusable. Ensure that backups used for the restore operation are accessible on the restore host. To move the database to a new host by using data file copies or backup sets on disk, you must transfer the files manually to the new host. You can also obtain it by inspecting saved RMAN log files, querying the catalog, or looking at the file names of control file autobackup. For example, enter the following command to view data file copies: For example, enter the following command to view control file backups: The piece name of the autobackup must use the %F substitution variable, so the autobackup piece name includes the string c-IIIIIIIIII-YYYYMMDD-QQ, where IIIIIIIIII stands for the DBID, YYYYMMDD is a time stamp in the Gregorian calendar of the day the backup is generated, and QQ is the sequence in hexadecimal. When the instance is started with a client-side initialization parameter file, RMAN restores the server parameter file to the default location if the TO clause is not used in the restore command. Because you are not connected to a recovery catalog, the RMAN repository contains only information about available backups at the time of the control file backup. If volume names have changed, then run SET NEWNAME commands before the restore operation and perform a switch after the restore operation to update the control file with the new locations for the data files, as shown in the following example. This scenario assumes that you want to test whether you can restore your database to a new host. After logging in to hostb with administrator privileges, edit the /etc/group file so that you are included in the DBA group: Set the ORACLE_SID environment variable on hostb to the same value used on hosta: Start RMAN on hostb and connect to the target database without connecting to the recovery catalog. document.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() ); RESTORING INCREMENTAL RMAN BACKUP TO SAVE RESTORETIME. You do not use a recovery catalog with the database. The commands for restoring a control file are the same whether or not the database uses a fast recovery area. For example, create a file /tmp/init.ora which contains the single line: You can use the following RMAN command to restart the instance with the restored server parameter file: If you have configured control file autobackups, then the server parameter file is backed up with the control file whenever an autobackup is taken. For example, if you are restoring your control file after a disk failure made some but not all CONTROL_FILES locations unusable, you can change CONTROL_FILES to replace references to the failed disk with path names pointing to another disk, and then run RESTORE CONTROLFILE with no arguments. Change), You are commenting using your Facebook account. ###################################################RESTORE CONTROLFILE FROM LATEST INCREMENTAL LEVEL BACKUP###################################################This step very important. Great and V Good explanation. It will just restore newly added datafile. If you are restoring an autobackup that has a nondefault format, then use the SET CONTROLFILE AUTOBACKUP FORMAT command to indicate the format. For example, start RMAN to connect to the target database and run the @ command: Open the restored database with the RESETLOGS option. Likewise, the control file of the trgta database is completely unaffected by the test.

Change any location-specific parameters, for example, those ending in _DEST, to reflect the new directory structure. Take another incremental level 1 backup on source DB. connected to target database (not started)Oracle instance started. It also assumes that you enabled the control file autobackup feature for the target database and can restore an autobackup of the control file. Change), You are commenting using your Twitter account. For example, run: Write an RMAN command file to restore the autobackup control file and perform recovery. RMAN> restore controlfile from D:\oracle\backupROQJ719_1_1; Starting restore at 03-DEC-13allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=128 device type=DISK, Starting restore at 03-DEC-13Starting implicit crosscheck backup at 03-DEC-13allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=128 device type=DISKCrosschecked 12 objectsFinished implicit crosscheck backup at 03-DEC-13, skipping datafile 1; already restored to file D:\ORACLE\ORADATA\SYSTEM01.DBFskipping datafile 2; already restored to file D:\ORACLE\ORADATA\SYSAUX01.DBFskipping datafile 3; already restored to file D:\ORACLE\ORADATA\UNDOTBS01.DBFskipping datafile 4; already restored to file D:\ORACLE\ORADATA\USERS01.DBFskipping datafile 5; already restored to file D:\ORACLE\ORADATA\SDE.DBFskipping datafile 6; already restored to file D:\ORACLE\ORADATA\FLASHBACK.DBFchannel ORA_DISK_1: starting datafile backup set restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_DISK_1: restoring datafile 00007 to D:\ORACLE\ORADATA\INCTEST.DBFchannel ORA_DISK_1: reading from backup piece D:\ORACLE\BACKUPQOQJ6U8_1_1channel ORA_DISK_1: piece handle=D:\ORACLE\BACKUPQOQJ6U8_1_1 tag=TAG20131203T121048channel ORA_DISK_1: restored backup piece 1channel ORA_DISK_1: restore complete, elapsed time: 00:00:15Finished restore at 03-DEC-13, Starting recover at 03-DEC-13using channel ORA_DISK_1channel ORA_DISK_1: starting incremental datafile backup set restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00001: D:\ORACLE\ORADATA\SYSTEM01.DBFdestination for restore of datafile 00002: D:\ORACLE\ORADATA\SYSAUX01.DBFdestination for restore of datafile 00003: D:\ORACLE\ORADATA\UNDOTBS01.DBFdestination for restore of datafile 00004: D:\ORACLE\ORADATA\USERS01.DBFdestination for restore of datafile 00005: D:\ORACLE\ORADATA\SDE.DBFdestination for restore of datafile 00006: D:\ORACLE\ORADATA\FLASHBACK.DBFchannel ORA_DISK_1: reading from backup piece D:\ORACLE\BACKUPKOQJ5TC_1_1channel ORA_DISK_1: piece handle=D:\ORACLE\BACKUPKOQJ5TC_1_1 tag=TAG20131203T115315channel ORA_DISK_1: restored backup piece 1channel ORA_DISK_1: restore complete, elapsed time: 00:00:01channel ORA_DISK_1: starting incremental datafile backup set restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setdestination for restore of datafile 00001: D:\ORACLE\ORADATA\SYSTEM01.DBFdestination for restore of datafile 00002: D:\ORACLE\ORADATA\SYSAUX01.DBFdestination for restore of datafile 00003: D:\ORACLE\ORADATA\UNDOTBS01.DBFdestination for restore of datafile 00004: D:\ORACLE\ORADATA\USERS01.DBFdestination for restore of datafile 00005: D:\ORACLE\ORADATA\SDE.DBFdestination for restore of datafile 00006: D:\ORACLE\ORADATA\FLASHBACK.DBFchannel ORA_DISK_1: reading from backup piece D:\ORACLE\BACKUPQOQJ6U8_1_1channel ORA_DISK_1: piece handle=D:\ORACLE\BACKUPQOQJ6U8_1_1 tag=TAG20131203T121048channel ORA_DISK_1: restored backup piece 1channel ORA_DISK_1: restore complete, elapsed time: 00:00:01, unable to find archived logarchived log thread=1 sequence=9RMAN-00571: ===========================================================RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============RMAN-00571: ===========================================================RMAN-03002: failure of recover command at 12/03/2013 12:22:49RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 9 and starting SCN of 3165567379. If you know that RMAN never produces more than n autobackups each day, then you can set the RESTORE SPFILE FROM AUTOBACKUP MAXSEQ parameter to n to reduce the search time. Otherwise, RMAN records metadata about the restored data files in the recovery catalog. To learn how to determine the correct value for autobackup_format, see the description of CONFIGURE CONTROLFILE AUTOBACKUP FORMAT in the entry for the CONFIGURE command in Oracle Database Backup and Recovery Reference. This chapter contains the following topics: Recovering a NOARCHIVELOG Database with Incremental Backups, Performing Recovery with a Backup Control File. As a result, the restored control file has a complete and accurate record of all backups in the recovery area and any other backups known to the control file at the time of the backup. ############################################################RESTORE INCREMENTAL LEVEL 1 BACKUP ON DESTINATION SERVER############################################################Copy newly taken level 1 backup to destination server.Start database in nomount state. This example assumes that RMAN is using a recovery catalog. You can also restore the server parameter file as a client-side initialization parameter file with the TO PFILE 'filename' clause. You want to test the restore and recovery of trgta on hostb, while keeping database trgta up and running on hosta. RMAN replicates the control file to all CONTROL_FILES locations automatically. See "Determining the DBID of the Database" to learn how to determine your DBID. Whenever RMAN cannot find online redo logs and you did not specify an UNTIL time, RMAN reports errors similar to the following: In this case, you must use the CATALOG command to manually add the required redo logs to the repository so that recovery can proceed. When the server parameter file is not available, RMAN attempts to start the instance with a dummy server parameter file. Set the DBID and start the database instance without mounting the database. The DUPLICATE command assigns a new DBID to the database it creates, enabling it to be registered in the same recovery catalog as the original database. Restore database. Shut down the database instance and restart it without mounting the database. If possible, restore or re-create all relevant network files such as tnsnames.ora and listener.ora and a password file. Example 20-2 Setting the DBID and Restoring the Control File from Autobackup. If you are restoring the database to a new host, then you should also review the considerations described in "Restoring a Database on a New Host". The only exception is if the database name is not unique in the catalog, in which case you must use SET DBID command before restoring the control file. We will delete old controlfile from oradata folder and restore controlfile included in level 1 backup. If the most recent autobackup was not created today, then use SET UNTIL to specify the date from which to start the search. If restoring from disk, then RMAN uses the default disk channel. Restoring a database running in NOARCHIVELOG mode is similar to restoring a database in ARCHIVELOG mode. If recovery was successful, then open the database and reset the online logs: Disaster recovery includes the restoration and recovery of the target database after the loss of the entire target database, the recovery catalog database, all current control files, all online redo log files, and all parameter files. Depending on the situation, you may need to execute multiple commands in the RUN command. The incremental backups must be consistent, like all backups of a database run in NOARCHIVELOG mode, so you cannot make backups of the database when it is open. All rights reserved.

Perform a SET UNTIL operation to limit recovery to the end of the archived redo logs. After restoring the control file to a new location, you can then update the CONTROL_FILES initialization parameter to include the new location. Unlike the loss of the control file, the loss of the server parameter file does not cause the instance to immediately stop. You can perform limited recovery of changes to a database running in NOARCHIVELOG mode by applying incremental backups. The scenarios in this chapter are less common or are more complicated than the basic scenarios. Note the following considerations: If restoring from tape, then use ALLOCATE CHANNEL to allocate an SBT channel manually. Change). If you are satisfied with the results, then you can open the database with RESETLOGS. If you do not know the DBID for your database, then see "Determining the DBID of the Database" to learn how to determine the DBID. To test disaster recovery, you must have a recoverable backup of the target database. To restore the control file from autobackup, the database must be in a NOMOUNT state. This procedure assumes that you are not using a recovery catalog. The ORACLE_SID for the trgta database is trgta and does not change for the restored database. Ensure that the backups of the target database are accessible on the new host. Restore the control file from an autobackup and then mount the database. The default location is platform-specific, for example, ?/dbs/spfile.ora on Linux. Note the following considerations when restoring the server parameter file: If the instance is already started with the server parameter file, then you cannot overwrite the existing server parameter file. RMAN> restore controlfile from d:\oracle\backupHOQJ2VQ_1_1; Starting restore at 03-DEC-13using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=128 device type=DISK, channel ORA_DISK_1: restoring control filechannel ORA_DISK_1: restore complete, elapsed time: 00:00:01output file name=D:\ORACLE\ORADATA\CONTROL01.CTLoutput file name=D:\ORACLE\ORADATA\CONTROL2.CTLFinished restore at 03-DEC-13, database mountedreleased channel: ORA_DISK_1, Starting restore at 03-DEC-13Starting implicit crosscheck backup at 03-DEC-13allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=128 device type=DISKCrosschecked 3 objectsFinished implicit crosscheck backup at 03-DEC-13, Starting implicit crosscheck copy at 03-DEC-13using channel ORA_DISK_1Finished implicit crosscheck copy at 03-DEC-13, searching for all files in the recovery areacataloging filesno files cataloged, channel ORA_DISK_1: starting datafile backup set restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_DISK_1: restoring datafile 00001 to D:\ORACLE\ORADATA\SYSTEM01.DBFchannel ORA_DISK_1: restoring datafile 00002 to D:\ORACLE\ORADATA\SYSAUX01.DBFchannel ORA_DISK_1: restoring datafile 00003 to D:\ORACLE\ORADATA\UNDOTBS01.DBFchannel ORA_DISK_1: restoring datafile 00004 to D:\ORACLE\ORADATA\USERS01.DBFchannel ORA_DISK_1: restoring datafile 00005 to D:\ORACLE\ORADATA\SDE.DBFchannel ORA_DISK_1: restoring datafile 00006 to D:\ORACLE\ORADATA\FLASHBACK.DBFchannel ORA_DISK_1: reading from backup piece D:\ORACLE\BACKUPGOQJ2U1_1_1channel ORA_DISK_1: piece handle=D:\ORACLE\BACKUPGOQJ2U1_1_1 tag=TAG20131203T110225channel ORA_DISK_1: restored backup piece 1channel ORA_DISK_1: restore complete, elapsed time: 00:02:25Finished restore at 03-DEC-13, database dismountedOracle instance shut down, ############################################################ADD A NEW DATAFILE ON SOURCE SERVER############################################################, SQL*Plus: Release 11.2.0.3.0 Production on Tue Dec 3 12:08:37 2013.