The command file should contain the following steps: Optionally, specify the most recent backup time stamp that RMAN can use when searching for a control file autobackup to restore. Sample output follows: Restore and edit the server parameter file. This scenario assumes that you want to test whether you can restore your database to a new host. If RMAN is not connected to a recovery catalog, then use SET DBID to set the DBID for the target database. It will apply changes from Incremental level 1 backup. If you do not care about using configured channels from your control file, then you can simply mount the database. One way to restore the control file to one or more new locations is to change the CONTROL_FILES initialization parameter, and then use the RESTORE CONTROLFILE command with no arguments to restore the control file to the default locations. Use the DROP DATABASE command to delete all files associated with the database automatically. Because you enabled the control file autobackup feature when making your backups, the server parameter file is included in the backup. You must then run the RECOVER command, even if no data files have been restored, and open the database with the RESETLOGS option. (LogOut/ 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. 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. For example, run: Write an RMAN command file to restore the autobackup control file and perform recovery. 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. If you know the location of other usable backup sets or image copies, then add them to the control file RMAN repository with the CATALOG command. Run the following query in SQL*Plus: Write the RMAN restore and recovery script. After restoring the control file to a new location, you can then update the CONTROL_FILES initialization parameter to include the new location. If you are restarting RMAN with a server parameter file in a nondefault location, then create an initialization parameter file with the line SPFILE=new_location, where new_location is the path name of the restored server parameter file. Its backup information will be used while recovering database upto level of incremental level 1. 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". Depending on the situation, you may need to execute multiple commands in the RUN command. Take another incremental level 1 backup on source DB. Example 20-1 Restoring the Server Parameter File from a Control File Autobackup. (LogOut/ 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. Any existing file named 'filename' is overwritten. connected to target database: TEST (DBID=2114642825), RMAN> run {2> allocate channel c1 device type disk format D:\oracle\backup\%U;3> backup incremental level 0 as compressed backupset database plus archivelog;4> }, using target database control file instead of recovery catalogallocated channel: c1channel c1: SID=130 device type=DISK, Starting backup at 03-DEC-13current log archivedchannel c1: starting compressed archived log backup setchannel c1: specifying archived log(s) in backup setinput archived log thread=1 sequence=254 RECID=178 STAMP=833188289input archived log thread=1 sequence=255 RECID=179 STAMP=833188289channel c1: starting piece 1 at 03-DEC-13channel c1: finished piece 1 at 03-DEC-13piece handle=D:\ORACLE\BACKUPEOQJ2TM_1_1 tag=TAG20131203T110213 comment=NONEchannel c1: backup set complete, elapsed time: 00:00:07channel c1: starting compressed archived log backup setchannel c1: specifying archived log(s) in backup setinput archived log thread=1 sequence=3 RECID=188 STAMP=833194933channel c1: starting piece 1 at 03-DEC-13channel c1: finished piece 1 at 03-DEC-13piece handle=D:\ORACLE\BACKUPFOQJ2TT_1_1 tag=TAG20131203T110213 comment=NONEchannel c1: backup set complete, elapsed time: 00:00:04Finished backup at 03-DEC-13, Starting backup at 03-DEC-13channel c1: starting compressed incremental level 0 datafile backup setchannel c1: specifying datafile(s) in backup setinput datafile file number=00003 name=D:\ORACLE\ORADATA\UNDOTBS01.DBFinput datafile file number=00006 name=D:\ORACLE\ORADATA\FLASHBACK.DBFinput datafile file number=00002 name=D:\ORACLE\ORADATA\SYSAUX01.DBFinput datafile file number=00001 name=D:\ORACLE\ORADATA\SYSTEM01.DBFinput datafile file number=00005 name=D:\ORACLE\ORADATA\SDE.DBFinput datafile file number=00004 name=D:\ORACLE\ORADATA\USERS01.DBFchannel c1: starting piece 1 at 03-DEC-13channel c1: finished piece 1 at 03-DEC-13piece handle=D:\ORACLE\BACKUPGOQJ2U1_1_1 tag=TAG20131203T110225 comment=NONEchannel c1: backup set complete, elapsed time: 00:00:55channel c1: starting compressed incremental level 0 datafile backup setchannel c1: specifying datafile(s) in backup setincluding current control file in backup setincluding current SPFILE in backup setchannel c1: starting piece 1 at 03-DEC-13channel c1: finished piece 1 at 03-DEC-13piece handle=D:\ORACLE\BACKUPHOQJ2VQ_1_1 tag=TAG20131203T110225 comment=NONEchannel c1: backup set complete, elapsed time: 00:00:01Finished backup at 03-DEC-13, Starting backup at 03-DEC-13current log archivedchannel c1: starting compressed archived log backup setchannel c1: specifying archived log(s) in backup setinput archived log thread=1 sequence=4 RECID=189 STAMP=833195007channel c1: starting piece 1 at 03-DEC-13channel c1: finished piece 1 at 03-DEC-13piece handle=D:\ORACLE\BACKUPIOQJ2VV_1_1 tag=TAG20131203T110327 comment=NONEchannel c1: backup set complete, elapsed time: 00:00:01Finished backup at 03-DEC-13released channel: c1#######################################################RESTORE INCREMENTAL LEVEL 0 BACKUP ON DESTINATION SERVER#######################################################, Recovery Manager: Release 11.2.0.3.0 Production on Tue Dec 3 12:10:49 2013, connected to target database (not started), Total System Global Area 730714112 bytes, Fixed Size 2258792 bytesVariable Size 411043992 bytesDatabase Buffers 310378496 bytesRedo Buffers 7032832 bytes. 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. 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. 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. If some copies of the current control file are usable, however, then you can follow the procedure in "Responding to the Loss of a Subset of the Current Control Files" and avoid the recovery and RESETLOGS operation. SQL> create tablespace inctest datafile d:\oracle\oradata\inctest.dbf size 500M; ######################################################TAKE INCREMENTAL LEVE 1 BACKUP ON SOURCE BACKUP######################################################, RMAN> run {2> allocate channel c1 device type disk format D:\oracle\backup\%U;3> backup incremental level 1 as compressed backupset database plus archivelog;4> }, allocated channel: c1channel c1: SID=130 device type=DISK, Starting backup at 03-DEC-13current log archivedchannel c1: starting compressed archived log backup setchannel c1: specifying archived log(s) in backup setinput archived log thread=1 sequence=3 RECID=188 STAMP=833194933input archived log thread=1 sequence=4 RECID=189 STAMP=833195007input archived log thread=1 sequence=5 RECID=190 STAMP=833197991channel c1: starting piece 1 at 03-DEC-13channel c1: finished piece 1 at 03-DEC-13piece handle=D:\ORACLE\BACKUPJOQJ5T7_1_1 tag=TAG20131203T115311 comment=NONEchannel c1: backup set complete, elapsed time: 00:00:03Finished backup at 03-DEC-13, Starting backup at 03-DEC-13channel c1: starting compressed incremental level 1 datafile backup setchannel c1: specifying datafile(s) in backup setinput datafile file number=00003 name=D:\ORACLE\ORADATA\UNDOTBS01.DBFinput datafile file number=00006 name=D:\ORACLE\ORADATA\FLASHBACK.DBFinput datafile file number=00002 name=D:\ORACLE\ORADATA\SYSAUX01.DBFinput datafile file number=00001 name=D:\ORACLE\ORADATA\SYSTEM01.DBFinput datafile file number=00005 name=D:\ORACLE\ORADATA\SDE.DBFinput datafile file number=00004 name=D:\ORACLE\ORADATA\USERS01.DBFchannel c1: starting piece 1 at 03-DEC-13channel c1: finished piece 1 at 03-DEC-13piece handle=D:\ORACLE\BACKUPKOQJ5TC_1_1 tag=TAG20131203T115315 comment=NONEchannel c1: backup set complete, elapsed time: 00:01:25channel c1: starting compressed incremental level 1 datafile backup setchannel c1: specifying datafile(s) in backup setincluding current control file in backup setincluding current SPFILE in backup setchannel c1: starting piece 1 at 03-DEC-13channel c1: finished piece 1 at 03-DEC-13piece handle=D:\ORACLE\BACKUPLOQJ602_1_1 tag=TAG20131203T115315 comment=NONEchannel c1: backup set complete, elapsed time: 00:00:01Finished backup at 03-DEC-13, Starting backup at 03-DEC-13current log archivedchannel c1: starting compressed archived log backup setchannel c1: specifying archived log(s) in backup setinput archived log thread=1 sequence=6 RECID=191 STAMP=833198087channel c1: starting piece 1 at 03-DEC-13channel c1: finished piece 1 at 03-DEC-13piece handle=D:\ORACLE\BACKUPMOQJ608_1_1 tag=TAG20131203T115447 comment=NONEchannel c1: backup set complete, elapsed time: 00:00:01Finished backup at 03-DEC-13released channel: c1. You do not use a recovery catalog with the database. To restore the control file from autobackup, the database must be in a NOMOUNT state. To restore the server parameter file from the control file autobackup, you must first set the DBID for your database and then use the RESTORE SPFILE FROM AUTOBACKUP command. If the autobackup is in a nondefault format, then first use the SET CONTROLFILE AUTOBACKUP FORMAT command to specify the format. This procedure assumes that you are not using a recovery catalog. See "Determining the DBID of the Database" for details on determining the DBID. 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. 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. 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". Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options. If you are restoring an autobackup that has a nondefault format, then use the SET CONTROLFILE AUTOBACKUP FORMAT command to indicate the format. Run the SWITCH DATAFILE ALL command so that the control file recognizes the new path names as the official new names of the data files. 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. To prepare for the restoration of the database to a new host, take the following steps: Record the DBID for your source database. Recover the data files. The procedure for disaster recovery is similar to the procedure for recovering the database with a backup control file in NOCATALOG mode. Change). Change), You are commenting using your Twitter account. Example 20-3 shows the RMAN script reco_test.rman that can perform the restore and recovery operation. The instance may continue operating, although you must shut it down and restart it after restoring the 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. In this scenario, you have two networked Linux hosts, hosta and hostb. Otherwise, the recovery catalog considers the restored database as the current target database. These rules are described in Oracle Database SQL Language Reference in the description of the CREATE CONTROLFILE statement. If the file systems on the destination system are set up to have the same paths as the source host, then do not use ALTER DATABASE RENAME FILE for those files restored to the same path as on the source host. It will just restore newly added datafile. Because the control file is from the trgta database, the recorded file names use the original hosta file names. Copy the backups to the new host with an operating system utility. ############################################################RESTORE INCREMENTAL LEVEL 1 BACKUP ON DESTINATION SERVER############################################################Copy newly taken level 1 backup to destination server.Start database in nomount state. This procedure uses the RESTORE and RECOVER commands. The file name that you specify should be on a file system accessible from the host where the RMAN client is running. 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. Restore the control file from an autobackup and then mount the database. The option OPEN RESETLOGS is always required after recovery with a backup control file, regardless of whether logs are available. Copy the file from the old host to a new host by using an operating system utility. You can also obtain it by inspecting saved RMAN log files, querying the catalog, or looking at the file names of control file autobackup. This metadata interferes with future attempts to restore and recover the primary database.
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. For example, enter the following command: Execute a RUN command to restore the server parameter file. Do not register a test database created in this way in the same recovery catalog as the source database. You can also restore the server parameter file as a client-side initialization parameter file with the TO PFILE 'filename' clause. Copyright (c) 1982, 2011, Oracle and/or its affiliates. RMAN restores the control file to whatever locations you specified in the CONTROL_FILES initialization parameter. Allocate a channel to the media manager, then restore the server parameter file as a client-side parameter file and use the SET command to indicate the location of the autobackup (in this example, the autobackup is in /tmp): Edit the restored initialization parameter file. An UNTIL clause is required to specify a target time, SCN, or log sequence number for the recovery before the first SCN of the online redo logs (otherwise, RMAN issues the RMAN-6054 error). If you are using tape backups, then you can restore and mount the control file, and optionally crosscheck the backups on tape, as shown in the following example: This section assumes that you have RMAN backups of the control file, but do not use a recovery catalog. Now, assume that the directory structure of hostb is different from hosta. If all copies of the current control file are lost or damaged, then you must restore and mount a backup control file. If you changed the archiving destination or format during recovery, or if you added new online log members after the backup of the control file, then RMAN may not be able to automatically catalog a needed online or archived log. Afterward, use the copied recovery catalog for the test restore. In the following example, the online redo log files have been lost, and the most recent archived redo log sequence number is 13243. The command file should do the following: Restore a control file autobackup (see "Performing Recovery with a Backup Control File and No Recovery Catalog"). 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. Ensure that backups used for the restore operation are accessible on the restore host. MAXSEQ is set to 255 by default, and RESTORE counts backward from MAXSEQ to find the last backup of the day. Restore the autobackup of the control file, optionally setting the maximum number of days backward that RMAN can search and the initial sequence number that it should use in its search for the first day. 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. You have tape backups of data files, control files, archived redo logs, and the server parameter file on a media manager accessible by both hosts. The default location is platform-specific, for example, ?/dbs/spfile.ora on Linux. 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. Start RMAN and connect to the target database instance. RMAN uses the autobackup format and DBID to determine where to hunt for the control file autobackup. Take incremental level 0 backup on source server. RMAN replicates the control file to all CONTROL_FILES locations automatically. When preparing your disaster recovery strategy, ensure that the backups of the data files, control files, and server parameter file are restorable on hostb. 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.
Codeigniter Count Rows, Avila University Softball, Windranger Build 2021, Nikon D7200 Underwater Housing, I Hate Happiness Without The H, Tv Tropes Strangled By The Red String, Marble Falls Volleyball, Heart Shaped Box Original, Concrete Patio With Retaining Wall, Samsung S10 Water Resistant,