Oracle7 Enterprise Backup Utility Administrator's Guide | ![]() Library |
![]() Product |
![]() Contents |
![]() Index |
The following topics are covered:
$ obackup script_name
Example
restore database consistent with recovery to the most recent point in time
restore database consistent db_name = "PROD" oracle_sid = "PROD" parallel = 4 recover log = "/opt1/oracle/obackup/log/obkPROD.log"
Example
restore of tablespaces and control file without recovery
restore db_name = "PROD" oracle_sid = "PROD" control_file tablespace = "A","B"
Example
Datafile restore with remap option
restore db_name = "PROD" oracle_sid = "PROD" dbfile = "?/dbs/data1PROD.ora" remap = "?/dbs/data1PROD.ora" to "/opt1/newhome/data1PROD.ora"
Example
Point-in-time restore database with point-in-time recovery
restore database db_name = "PROD" oracle_sid = "PROD" to = "10/01/1996 12:00" recover = "10/01/1996 15:00"
Note: Although a consistent restore requires only minimal recovery operation, archived redo logs (if they exist) can be applied to a consistent restore to bring the restored database to a more recent point-in-time.
Unlike a consistent restore, an inconsistent restore may use files from a number of backups, resulting in a restored database that is inconsistent with a single point-in-time. However, an inconsistent restore can still be recovered to a consistent point-in-time by applying archived redo log files.
At times you may wish to restore and recover the database to some other point-in-time - to retrieve a table that was accidentally deleted, for example. This is called a point-in-time recovery. You must restore all database files when performing point in time recovery; you cannot restore only a subset.
If you perform a point-in-time restore and recovery, remember that you will erase all database transactions made since the recovery point.
This is not the same as using the remap specifier, which is discussed later in this chapter.
When restoring archived log files, the utility restores all the files that were backed up, starting with the oldest backup job included in the restore job. The files are restored to the same location from which they were backed up.
Note: If a file with the same name is already present in the destination directory, the utility skips that file and goes on to restoring the next file. The utility does not overwrite an existing archived log file.
If it is necessary to restore archived log files to a directory other than the one from which they came, you can do so by specifying that directory in the archivelog clause of the command script.
No archived log files are restored during a restore consistent, or when the archivelog=none specifier is used.
You can use restore archivelog [start_lsn] to restore the log files associated with an offline backup. Specifying a start_lsn tells the utility to restore all archived logs from all jobs, starting with the job in which the start_lsn is contained and ending with the most current backup.
Archived redo logs can also be restored to a different location, but not with the remap specifier. Restore archived redo log files to a new location by specifying the destination in the restore archivelog command script.
Note: The remap and recover specifiers are mutually exclusive. You cannot recover a database you restore with the remap option in release 2.1.
The Enterprise Backup Utility restores all copies of the control files. If none of the control files is present, the utility restores the control files as old_name.job_id, where old_name is the original control file name and job_id is the job ID number of the restore job. If no control files are present they are restored with the original file names.
If the control files are on raw devices, as with Oracle Parallel Server, the Enterprise Backup Utility always restores the control files to the $ORACLE_HOME/dbs directory as pseudo_device.job_id, where pseudo_device is the name of the device with slashes (/) replaced by underscores (_).
If you are restoring across different database configurations, be sure to use the control file that most closely reflects the target database structure to which you want to recover. This may not be the current control file if you are performing a point-in-time recovery.
Date/Time Job Initiated
Job ID
Begin / End Log Sequence Number
Backup Command
Files Backed Up
07/12/1996 17:01
81 82
1200 / 1200 1201 / 1202
offline database + online archivelog archdelete
a1, a2, a3, a4, b1, b2, b3 + archived log files LSN 1130 - 1202*
07/13/1996 17:01
83
1277 / 1278
online tablespace = A dbfile = b1 archdelete
a1, a2, a3, a4, b1 archived log files LSN 1202 - 1278
07/14/1996 17:01
84
1347 / 1350
online dbfile = a1, a2, b3 archdelete
a1, a2, b3 archived log files LSN 1278 - 1350
07/15/1996 17:01
85
1412 / 1414
online database archdelete
a1, a2, a3, a4, b1, b2, b3 archived log files LSN 1350 - 1414
07/16/1996 17:01
86
1490 / 1492
online tablespace = B dbfile = a1, a2
a1, a2, b1, b2, b3 archived log files LSN 1414 - 1492
07/17/1996 17:01
87
1565 / 1566
online dbfile = a3, a4, b1 archdelete
a3, a4, b1 archived log files LSN 1414 - 1566
07/18/1996 17:01
88
1656 / 1658
online tablespace = A archdelete
a1, a2, a3, a4 archived log files LSN 1566 - 1658
07/19/1996 17:01
89
1723 / 1723
offline database
a1, a2, a3, a4, b1, b2, b3
07/20/1996 17:01
90
1797 / 1801
online tablespace = A archdelete
a1, a2, a3, a4 archived log files LSN 1658 - 1801
07/21/1996 17:01
91
1886 / 1888
online dbfile = a1, b1, b2 archdelete
a1, b1, b2 archived log files LSN 1801 - 1888
* Assumes that the last backup job to include archived redo log files ended with LSN 1130.
Table 5 - 1. Sample Database Backup Scheme
Use Table 5 - 1 with the table of database restores .
Use Table 5 - 2 of database restores with the sample database backup scheme on 5 - 8. Assume that all restores are performed on 7/22/96.
Sample Database Restores
Restore Command
Files Restored
From Job
restore database consistent
a1, a2, a3, a4, b1, b2, b3
89
no archived log files restored
--
restore database consistent archivelog start_lsn = 1799
a1, a2, a3, a4, b1, b2, b3
89
archived logs: LSN 1658-1888
90, 91
restore tablespace = B
b1, b2
91
b3
89
archived logs: LSN 1658-1888
90, 91
restore database
a1, b1, b2
91
a2, a3, a4
90
b3
89
archived logs: LSN 1658-1888
90, 91
restore database to = 07/14/1996 23:00
a1, a2, b3
84
a3, a4, b1
83
b2
81
archived logs LSN: 1130-1414
82-85
restore database consistent to = 07/16/1996 15:00
a1, a2, a3, a4, b1, b2, b3
81
archived logs LSN: 1130-1492
82-86
restore to = 07/15/1996 02:30 dbfile = a1, a2, a4, b2
a1, a2
84
a4
83
b2
81
archived logs LSN: 1130-1888
82-88, 90, 91
Table 5 - 2. Sample Database Restores
Additional Information: See Also: Appendix B, "Command Script Examples", for sample EBU command scripts.
Under these conditions, you can restore part of the database and recover only the datafiles you need. You always need the SYSTEM tablespace and the rollback segment tablespace files, and you must restore them in order to open the database successfully.
The following steps help you perform this type of recovery.
Additional Information: For a complete step-by-step discussion of recovery processes, or more information on renaming datafiles, see the Oracle7 Server Administrator's Guide.
Recovery requires the user to connect to the Server with SYSDBA privileges, or as INTERNAL with the user being in the OSDBA group. See "Authorizing Database Recovery" for more information on the privileges required for recovery.
The following command script specifies point-in-time recovery:
restore database db_name = "PROD" oracle_sid = "PROD" recover = "10/01/1996 12:00"
Note: The time to which you want to recover must be entered in the format MM/DD/YYYY HH24:MI. This is a different format than used the SQL command RECOVER UNTIL.
Additional Information: See Also: Complete syntax for the recover option is described in Appendix A, "Command Script Syntax".
To perform incomplete recovery, you must restore the entire database to a time before the desired recovery point, then recover the database until the desired point in time or sequence change number (SCN).
You must open the database with the RESETLOGS option following an incomplete recovery in order to avoid confusion with the previously created log files that cover the period later than the recovery point.
EBU lets the user combine the restore, recovery, and OPEN RESETLOGS into a single command script. The following script, for instance, would perform incomplete recovery and open the database with the RESETLOGS option:
restore database oracle_sid= "PROD" db_name= "PROD" to= "01/23/1996 12:00:00" recover= "01/23/1996 15:30:00"
To perform minimal recovery and open a database following a restore database consistent, execute the following commands after connecting to the database in Server Manager:
SVRMGRL> STARTUP MOUNT; SVRMGRL> RECOVER DATABASE UNTIL CANCEL; SVRMGRL> CANCEL; SVRMGRL> ALTER DATABASE OPEN RESETLOGS;
If dropping the corrupted log file is not possible, perform a RESETLOGS operation to recreate the log files.
Regardless of what Server release you are running, you must update information in the backup catalog following an OPEN RESETLOGS.
EBU only tries to recover the database once following a restore job. If this initial attempt to recover the database is unsuccessful, the user must fix the recovery problem, then either perform manual recovery, or restart the entire restore/recovery job.
Additional Information: For more information on the following topics see the Oracle7 Server Administrator's Guide.
![]() ![]() Prev Next |
![]() Copyright © 1996 Oracle Corporation. All Rights Reserved. |
![]() Library |
![]() Product |
![]() Contents |
![]() Index |