Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: reset database
Oracle8i Recovery Manager User's Guide and Reference Release 2 (8.1.6) Part Number A76990-01 |
|
Recovery Manager Command Syntax, 36 of 50
To create a new database incarnation record in the recovery catalog. RMAN considers the new incarnation as the current incarnation of the database. All subsequent backups and redo log archiving operations performed by the target database will be associated with the new database incarnation.
to incarnation primary_key |
changes the incarnation that RMAN considers to be current to an older incarnation. This option is useful in the rare circumstance in which you want to undo the effects of a RESETLOGS by restoring backups of a prior incarnation of the database. Specify the primary key of the DBINC record for the database incarnation. Obtain the key value using the list incarnation of databasecommand. After you issue the reset database to incarnation command, issue restore and recover commands to restore the database files from the prior incarnation and recover them. |
The following example resets a database after performing incomplete media recovery:
run { allocate channel dev1 type disk; set until logseq 1234 thread 1; restore database skip tablespace readonly; recover database; sql "ALTER DATABASE OPEN RESETLOGS"; release channel dev1; } reset database;
The following command makes an old incarnation of database PROD1 current again:
# obtain primary key of old incarnation list incarnation of database prod1; List of Database Incarnations DB Key Inc Key DB Name DB ID CUR Reset SCN Reset Time ------- ------- ------- ------ --- ---------- ---------- 1 2 PROD1 1224038686 NO 1 02-JUL-98 1 582 PROD1 1224038686 YES 59727 10-JUL-98 shutdown immediate; # reset database to old incarnation reset database to incarnation 2; # recover it run { allocate channel dev1 type disk; restore controlfile; startup mount; restore database; recover database; sql "ALTER DATABASE OPEN RESETLOGS"; release channel dev1; }
Hi,Please can someone explain the consequences of "reset database" in rman?? Does this mean all the previous backups are lost??Is there a way around ??Any help/advice would be greatly appreciated...RgdsFawzia
**********************************************************************
Information in this email is confidential and may be privileged.
It is intended for the addressee only. If you have received it in error,
please notify the sender immediately and delete it from your system.
You should not otherwise copy it, retransmit it or use or disclose its
contents to anyone.
Thank you for your co-operation.
**********************************************************************
-- /regards Peter Gram Mobil : +45 2527 7107 Fax : +45 4466 8856 Miracle A/S Kratvej 2 2760 Måløv http://miracleas.dk /* The process of preparing programs for a digital computer is especially attractive, not only because it can be economically and scientifically rewarding, but also because it can be an aesthetic experience much like composing poetry or music Donald Knuth */
The previous attachment was filtered out by the ListGuru mailing
software at fatcity.com because binary attachments are not appropriate
for mailing lists. If you want a copy of the attachment which was
removed, contact the sender directly and ask for it to be sent to
you by private E-mail.
This warning is inserted into all messages containing binary attachments which have been removed by ListGuru. If you have questions about this message, contact Postmaster_at_fatcity.com for clarification.
Oracle Documentation Library, Release 8.1.7 |
Contacting Oracle Support Services and Ordering Printed Books
Please visit the following web addresses for Oracle product support and ordering information:
We Want to Hear From You
We are always trying to improve the content and delivery of our online documentation, so we invite you to tell us what you think. Each document in this distribution includes a reader's comment form, with an appropriate e-mail address for submitting comments on that document.
If you have general comments about the documentation library or this CD-ROM, please send them to doc_talk@us.oracle.com. Please note that this address is only for documentation feedback. For assistance with installation or software problems, please contact Oracle Support Services using the URLs listed above.
Copyright © 1996-2000 Oracle Corporation
500 Oracle Parkway, Redwood City, CA 94065
The previous attachment was filtered out by the ListGuru mailing software at fatcity.com because binary attachments are not appropriate for mailing lists. If you want a copy of the attachment which was removed, contact the sender directly and ask for it to be sent to you by private E-mail.
This warning is inserted into all messages containing binary attachments which have been removed by ListGuru. If you have questions about this message, contact Postmaster_at_fatcity.com for clarification.
Oracle8i Server and SQL*Plus | Library |
Administration, Concepts, and Reference |
||
|
HTML | |
|
HTML | |
|
HTML | |
|
HTML | |
|
HTML | |
|
HTML | |
|
HTML | |
|
HTML | |
|
HTML | |
|
HTML | |
|
HTML | |
|
HTML | |
Backup and Recovery |
||
|
HTML | |
|
HTML | |
|
HTML | |
|
HTML | |
SQL*Plus |
||
|
HTML | |
|
HTML | |
|
HTML | |
Data Warehousing |
||
|
HTML | |
Distributed Databases and Replication |
||
|
HTML | |
|
HTML | |
|
HTML |
The previous attachment was filtered out by the ListGuru mailing software at fatcity.com because binary attachments are not appropriate for mailing lists. If you want a copy of the attachment which was removed, contact the sender directly and ask for it to be sent to you by private E-mail.
This warning is inserted into all messages containing binary attachments which have been removed by ListGuru. If you have questions about this message, contact Postmaster_at_fatcity.com for clarification.
Oracle8i Recovery Manager User's Guide and Reference Release 2 (8.1.6) Part Number A76990-01 |
|
|
Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|
The previous attachment was filtered out by the ListGuru mailing software at fatcity.com because binary attachments are not appropriate for mailing lists. If you want a copy of the attachment which was removed, contact the sender directly and ask for it to be sent to you by private E-mail.
This warning is inserted into all messages containing binary attachments which have been removed by ListGuru. If you have questions about this message, contact Postmaster_at_fatcity.com for clarification.
Oracle8i Recovery Manager User's Guide and Reference Release 2 (8.1.6) Part Number A76990-01 |
|
A B C D E F G H I J K L M N O P Q R S T U V W
|
Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|
The previous attachment was filtered out by the ListGuru mailing software at fatcity.com because binary attachments are not appropriate for mailing lists. If you want a copy of the attachment which was removed, contact the sender directly and ask for it to be sent to you by private E-mail.
This warning is inserted into all messages containing binary attachments which have been removed by ListGuru. If you have questions about this message, contact Postmaster_at_fatcity.com for clarification.
Oracle8i Recovery Manager User's Guide and Reference Release 2 (8.1.6) Part Number A76990-01 |
|
Recovery Manager Command Syntax, 35 of 50
To perform detailed analyses of the RMAN repository. Oracle writes the output from the report command to standard output or the message log file (see "connect").
Use the report command to answer questions such as the following:
need backup |
lists all datafiles in need of a new backup. The report assumes that you will use the most recent backup for restore operations. |
|
|
incremental integer |
specifies a threshold number of incremental backups. If complete recovery of a datafile requires more than the specified number of incremental backups, then the datafile requires a new full backup. The report command, like the recover command, uses the lowest level of incremental backup whenever there is a choice. This is the same strategy that RMAN would use if the file were actually being recovered by the recover command. Note: Files for which no backups exist will not appear in this list: issue the report need backup redundancy command to display them. |
|
days integer |
specifies a threshold number of days of redo log files that need application during recovery of this file. For example, report need backup days 7 database shows the datafiles whose recovery requires more than one week's worth of archived redo logs. If the target database control file is mounted and current, RMAN makes the following optimizations to this report:
|
|
redundancy integer |
specifies the minimum number of backups or copies that must exist for a datafile to be considered not in need of a backup. In other words, a datafile needs a backup if there are fewer than integer backups or copies of this file. For example, redundancy 2 means that if there are fewer than two copies or backups of a datafile, then it needs a new backup. |
unrecoverable |
lists all unrecoverable datafiles. A datafile is considered unrecoverable if an unrecoverable operation has been performed against an object residing in the datafile since the last backup of the datafile. Note: The non-existence of any backup of a datafile is not sufficient reason to consider it unrecoverable. Such datafiles can be recovered through the use of the CREATE DATAFILE command, provided that redo logs starting from when the file was created still exist. |
|
reportObject clause |
specifies the datafiles to be included in the report. The report can include the entire database (optionally skipping certain tablespaces), a list of tablespaces, or a list of datafiles. |
|
|
lists the specified datafiles. RMAN reports on backups or datafile copies that contain at least one of the specified datafiles. |
|
|
tablespace tablespace_name |
lists datafiles in the specified tablespace. RMAN reports on backups or datafile copies that include at least one datafile from a specified tablespace. |
|
database |
lists backups or datafile copies of all files in the current database. |
|
skip tablespace tablespace_name |
excludes the specified tablespaces from the database specification. |
obsolete |
lists full backups and datafile copies recorded in the RMAN repository that can be deleted because they are no longer needed. If you do not specify further parameters, redundancy defaults to 1. If you use this option in conjunction with device type, RMAN only considers backups and copies on the specified type. |
|
|
redundancy integer |
specifies the minimum level of redundancy considered necessary for a backup or copy to be obsolete. A datafile copy is obsolete if there are at least integer more recent backups or image copies of this file; a datafile backup set is obsolete if there are at least integer more recent backups or image copies of each file contained in the backup set. For example, redundancy 2 means that there must be at least two more recent backups or copies of a datafile for any other backup or copy to be obsolete. |
|
specifies that no backup or copy will be considered obsolete if there are at least n (where n is the value for redundancy) backups or copies that are more recent but do not contain changes later than the specified time, SCN, or log sequence number. For example, obsolete redundancy 2 until 'SYSDATE-7' means that a backup or copy is obsolete if there are at least two backups or copies that are more recent and those copies were checkpointed more than a week ago. This clause is useful if the database must be recoverable to non-current time, SCN, or log sequence number. See "untilClause". |
|
|
orphan |
specifies as obsolete those backups and copies that are unusable because they belong to incarnations of the database that are not direct ancestors of the current incarnation. Note that report obsolete orphan displays orphaned backups in addition to the normal display of obsolete backups. For an explanation of orphaned backups, see "Reporting on Orphaned Backups". |
schema |
lists the names of all datafiles and tablespaces at the specified point in time. |
|
atClause |
specifies a point in time as a time, an SCN, or a log sequence number. |
|
|
at time date_string |
specifies a date. The NLS_LANG and NLS_DATE_FORMAT environment variables specify the format for the time. |
|
at scn integer |
specifies an SCN. |
|
at logseq integer |
specifies a log sequence number for a specified redo thread. The integer indicates the time when the specified log and thread were first opened. |
specifies the type of storage device. RMAN only considers backups and copies available on the specified device for its report. See "deviceSpecifier". |
The fields in each report are described below:
Column | Indicates |
FILE |
the absolute datafile number of a datafile with less than n redundant backups. |
#BKPS |
the number of backups that exist for this file. |
NAME |
the name of the file. |
This example reports the names of all datafiles and tablespaces in the database one week ago:
report schema at time 'SYSDATE-7'; Report of database schema File K-bytes Tablespace RB segs Name ---- ---------- -------------------- ------- ------------------- 1 47104 SYSTEM YES /vobs/oracle/dbs/tbs_01.f 2 978 SYSTEM YES /vobs/oracle/dbs/tbs_02.f 3 978 TBS_1 NO /vobs/oracle/dbs/tbs_11.f 4 978 TBS_1 NO /vobs/oracle/dbs/tbs_12.f 5 978 TBS_2 NO /vobs/oracle/dbs/tbs_21.f 6 978 TBS_2 NO /vobs/oracle/dbs/tbs_22.f 7 500 TBS_3 NO /vobs/oracle/dbs/tbs_31.f 8 500 TBS_3 NO /vobs/oracle/dbs/tbs_32.f 9 5120 SYSTEM YES /vobs/oracle/dbs/tbs_03.f
This example reports all datafiles in the database that require the application of five or more incremental backups to be recovered to their current state:
report need backup incremental 5 database; Report of files that need more than 5 incrementals during recovery File Incrementals Name ---- ------------ ---------------------------------------------- 1 9 /vobs/oracle/dbs/tbs_01.f 2 9 /vobs/oracle/dbs/tbs_02.f 3 9 /vobs/oracle/dbs/tbs_11.f 4 9 /vobs/oracle/dbs/tbs_12.f 5 9 /vobs/oracle/dbs/tbs_21.f 6 9 /vobs/oracle/dbs/tbs_22.f 7 9 /vobs/oracle/dbs/tbs_23.f 8 9 /vobs/oracle/dbs/tbs_03.f
The following example reports all datafiles from tablespace SYSTEM that will need more than two days of archived redo logs to be applied during recovery after being restored from the most recent backup:
report need backup days 2 tablespace system; Report of files whose recovery needs more than 2 days of archived logs File Days Name ---- ----- ----------------------------------------------------- 1 3 /vobs/oracle/dbs/tbs_01.f 2 3 /vobs/oracle/dbs/tbs_02.f 16 3 /vobs/oracle/dbs/tbs_03.f
The following example reports all datafiles that cannot be recovered from existing backups because redo may be missing:
report unrecoverable; Report of files that need backup due to unrecoverable operations File Type of Backup Required Name ---- ----------------------- ----------------------------------- 4 FULL /vobs/oracle/dbs/tbs_12.f
The following example reports obsolete backups and copies with a redundancy of 1:
report obsolete; Report of obsolete backups and copies Type Key Completion Time Filename/Handle -------------------- ------ ------------------ -------------------- Backup Set 836 04-DEC-98 Backup Piece 839 04-DEC-98 /vobs/oracle/dbs/05aetj6b_1_1 Backup Set 807 04-DEC-98 Backup Piece 810 04-DEC-98 /vobs/oracle/dbs/03aetj1f_1_1 Backup Set 835 04-DEC-98 Backup Piece 838 04-DEC-98 /vobs/oracle/dbs/04aetj6b_1_1
|
Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|
The previous attachment was filtered out by the ListGuru mailing software at fatcity.com because binary attachments are not appropriate for mailing lists. If you want a copy of the attachment which was removed, contact the sender directly and ask for it to be sent to you by private E-mail.
This warning is inserted into all messages containing binary attachments which have been removed by ListGuru. If you have questions about this message, contact Postmaster_at_fatcity.com for clarification.
Oracle8i Recovery Manager User's Guide and Reference Release 2 (8.1.6) Part Number A76990-01 |
|
This chapter describes, in alphabetical order, Recovery Manager commands and sub-clauses.
This section explains the conventions used in this book including:
The text in this reference adheres to the following conventions:
This reference uses syntax diagrams to show Recovery Manager commands. These syntax diagrams use lines and arrows to show syntactic structure, as shown here:
This section describes the components of syntax diagrams and gives examples of how to write Recovery Manager commands. Syntax diagrams are made up of these items:
Keywords have special meanings in Recovery Manager syntax. In the syntax diagrams, keywords appear in square boxes and an uppercase font. When described in text, RMAN keywords appear in lowercase bold, for example, backup database. You must use keywords in your RMAN statements exactly as they appear in the syntax diagram, except that they can be either uppercase or lowercase.
The RMAN language is free-form. Keywords must be separated by at least one white-space character, but otherwise there are no restrictions. A command may span multiple lines.
Parameters act as placeholders in syntax diagrams. In the syntax diagrams, they appear in ovals. When described in text, RMAN parameters appear in lowercase italics, for example, 'filename'. Parameters are usually:
When you see a parameter in a syntax diagram, substitute an object or expression of the appropriate type in your RMAN statement. For example, to write a duplicate target database to command, use the name of the duplicate database you want to create, such as dupdb, in place of the database_name parameter in the syntax diagram.
Some parameter values are enclosed in required or optional quotes. The syntax diagrams show single quotes, though in all cases double quotes are also legal. For example, you specify either 'filename' or "filename". For the sql command, it is recommended that you use double quotes.
This lists shows parameters that appear in the syntax diagrams and provides examples of the values you might substitute for them in your statements:
Table 10-1 is a list of RMAN reserved words. If you use one of these words by itself without surrounding it in quotes, then RMAN generates an error. These are examples of correct and incorrect entries:
allocate channel backup type disk; # incorrect allocate channel 'backup' type disk; # correct backup database tag full; # incorrect backup database tag 'full'; # correct
This reference contains many examples of RMAN commands. These examples show you how to use elements of RMAN. The following example shows a backup command:
run { allocate channel ch1 type disk; backup database; }
Note that examples appear in a different font from the text.
The description of each command or sub-clause contains the following sections:
The following table provides a functional summary of RMAN commands. Note that all release 8.0 commands still work with the release 8.1 RMAN executable.
Command | Purpose |
---|---|
Establish a channel, which is a connection between RMAN and a database instance. |
|
Allocate a channel in preparation for issuing maintenance commands such as change. |
|
Mount or open a database. |
|
Specify a range of archived redo logs files for use in backup, restore, and maintenance operations as well as queries to the recovery catalog. |
|
Back up a database, tablespace, datafile, or archived redo log file. |
|
Add information about a datafile copy, archived redo log, or control file copy to the recovery catalog and control file. Catalog a datafile copy as a level 0 backup, which enables you to use it as part of an incremental backup strategy. Record the existence of file copies created before RMAN was installed or generated through means other than RMAN. |
|
Mark a backup piece, image copy, or archived redo log as having the status UNAVAILABLE or AVAILABLE. Delete a backup piece, image copy, or archived redo log from the operating system and remove its recovery catalog record. Check whether backup pieces, datafile copies, or archived redo logs are available and, if they are not, mark them as EXPIRED. |
|
Connect to the target, recovery catalog, or auxiliary database. Specify that you are using RMAN without a recovery catalog. Specify a command file, which is a user-defined file containing RMAN commands. Specify the file in which RMAN records the results of processed commands. Add to rather than overwrite the contents of the command file. Generate debugging output and specify its location. |
|
A sub-clause that specifies a time range during which the backup or copy completed. |
|
Set the compatibility level of the recovery catalog. |
|
Establish a connection between RMAN and a target, auxiliary (duplicated or auxiliary instance used for TSPITR), or recovery catalog database. |
|
Specify the username, password, and net service name for connecting to a target, recovery catalog, or auxiliary database. The connection is necessary to authenticate the user and identify the database. |
|
Create an image copy of a file. |
|
Create a schema for the recovery catalog. |
|
Create a stored script and store it in the recovery catalog for future reference. |
|
Determine whether backup sets stored on disk or tape still exist. |
|
Specify a datafile by filename or absolute file number. |
|
Turn RMAN's debugging feature off and on. |
|
Delete backup sets marked EXPIRED by the crosscheck command and remove references to them from the recovery catalog and control file. |
|
Delete a stored script from the recovery catalog. |
|
Specify the type of storage for a backup or copy. |
|
Remove the schema from the recovery catalog. |
|
Use backups of the target database to create a duplicate database that you can use for testing purposes. |
|
Invoke an operating system command-line sub-shell from within RMAN. |
|
Produce a detailed report about a specified group of backup sets or copies recorded in the recovery catalog or target control file. |
|
Specify a database or one or more tablespaces, control files, datafiles, or archived redo logs. |
|
Print a stored script to the RMAN message log file. Specify the log filename with the log argument at the command line (see "connect"). |
|
Apply redo logs or incremental backups to a restored backup set or copy in order to update it to a specified time. |
|
Register the target database in the recovery catalog so that RMAN can access it. |
|
Release a sequential I/O device while maintaining the connection to the target database instance. |
|
Release a sequential I/O device specified in an allocate channel command with the for delete or for maintenance option. |
|
Replace an existing script stored in the recovery catalog. If the script does not exist, replace script creates it. |
|
Copy the control file to multiple destinations. |
|
Perform detailed analyses of the content of the recovery catalog. |
|
Create a new database incarnation record in the recovery catalog. |
|
Restore files from backup sets or from copies on disk to the current location, overwriting the files with the same name. |
|
Perform a full resynchronization, which creates a snapshot control file and then compares the recovery catalog to either the current control file of the target database or the snapshot control file and updates it with information that is missing or changed. |
|
Execute stand-alone commands, which are commands you run from the command-line interpreter (CLI), that is, the RMAN prompt. |
|
Compile and execute job commands, which are one or more statements executed within the braces of run. |
|
Send a vendor-specific quoted string to one or more specific channels. |
|
Specify the auxiliary filenames for target datafiles. This operation is useful when performing TSPITR. Display executed RMAN commands in the message log. Specify a database's db identifier. Set the filename of the snapshot control file. |
|
Specify new filenames for datafiles. Specify a limit for the number of permissible block corruptions. Override default archived redo log destinations. Specify that backups should be duplexed. Determine which server process corresponds to which channel. Limit the number of buffers that will be read from each input datafile on a specified channel. Limit the number of input files that a backup operation can have open at any given time for a specified channel. Limit the size of the backup pieces for a specified channel. |
|
Shut down the target database without exiting RMAN. This command is equivalent to the SQL*Plus SHUTDOWN command. |
|
Execute a SQL statement from within Recovery Manager. |
|
Start up the database from within the RMAN environment. This command is equivalent to the SQL*Plus STARTUP command. |
|
Specify that a datafile copy is now the current datafile, that is, the datafile pointed to by the control file. |
|
Upgrade the recovery catalog schema from an older version to the version required by the RMAN executable. |
|
Examine a backup set and report whether its data is intact. RMAN scans all of the backup pieces in the specified backup sets and looks at the checksums to verify that the contents can be successfully restored if necessary. |
|
Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|
The previous attachment was filtered out by the ListGuru mailing software at fatcity.com because binary attachments are not appropriate for mailing lists. If you want a copy of the attachment which was removed, contact the sender directly and ask for it to be sent to you by private E-mail.
This warning is inserted into all messages containing binary attachments which have been removed by ListGuru. If you have questions about this message, contact Postmaster_at_fatcity.com for clarification.
Oracle8i Recovery Manager User's Guide and Reference Release 2 (8.1.6) Part Number A76990-01 |
|
Recovery Manager Command Syntax, 37 of 50
To restore files from backups or image copies to the current location, overwriting the files with the same name. You can use set newname command to restore files to non-default locations. RMAN restores backups from disk or tape and restores images copies from disk only.
RMAN considers restored files as datafile copies. If you restore to the default location, RMAN creates records for the datafile copies in the repository and immediately updates them to status DELETED. If you restore to a new location, issue set newname commands to rename the files, and issue a switch command to make the restored files current, RMAN also updates the records to DELETED. If you do not issue switch commands, then RMAN considers the restored files as valid copies for use in future restore operations.
Typically, you restore when a media failure has damaged a current datafile, control file, or archived redo log or prior to performing a point-in-time recovery. This command restores full backups, incremental backups (level 0 only), or copies of:
Note that when you perform a restore operation using a backup control file and use a recovery catalog, RMAN automatically adjusts the control file to reflect the structure of the restored backup.
See Also:
Chapter 6, "Restoring and Recovering with Recovery Manager" to learn how to restore files. |
If the entire database is to be restored, then it must be mounted.
For example, if you made some backups of a datafile to disk channels and others to 'sbt_tape' channels, and only a disk channel is allocated for the restore command, then RMAN will not restore from any backups that were created on 'sbt_tape' channels.
datafile 1
is both specified explicitly and implied by the SYSTEM tablespace:
restore tablespace system datafile 1;
restoreObject |
specifies the objects to be restored. |
|
|
controlfile |
restores the current control file and automatically replicates it to all CONTROL_FILES locations in the parameter file. If you specify a new pathname with the to 'filename' option, RMAN restores the control file to the new location: you must replicate it manually using the replicate command. |
|
database |
restores all datafiles in the database except those that are offline or read-only. Unlike backup database, restore database does not automatically include the control file--you must issue an additional restore command to perform this operation. If you specify the check readonly option, then RMAN examines the headers of all read-only files and restores any that need restoring. Use an optional skip ... tablespace argument to avoid restoring specified tablespaces, which is useful when you want to avoid restoring tablespaces containing temporary data. |
|
restores the datafiles specified by filename or absolute datafile number. See "datafileSpec". |
|
|
tablespace tablespace_name |
restores all datafiles in the specified tablespaces. |
|
archivelogRecord- Specifier clause |
restores the specified range of archived redo logs. See "archivelogRecordSpecifier". |
restoreSpec- Operand |
specifies options for the restoreObject clause. Note: These parameters override the parameters with the same name at the restore command level. |
|
|
channel channel_id |
specifies the name of a channel to use for this restore operation. If you do not specify a channel, restore uses any available channel allocated with the correct device type. |
|
from tag tag_name |
overrides the default selection of the most recent backups or file copy available. The tag restricts the automatic selection to backup sets or file copies that have the specified tag. If multiple backup sets or file copies have a matching tag, then RMAN selects the most recent one. |
|
parms channel_parms |
specifies a quoted string containing operating system-specific information. The string is passed to the OSD layer each time a backup piece is restored. |
channel channel_id |
See the restoreSpecOperand clause. |
|
from tag tag_name |
See the restoreSpecOperand clause. |
|
parms channel_parms |
See the restoreSpecOperand clause. |
|
from |
specifies whether RMAN should restore from a datafilecopy on disk or a backupset. By default restore chooses the most recent backup set or file copy, that is, the file copy or backup set that needs the least media recovery. |
|
limits the selection to those backup sets or file copies that would be suitable for performing a point-in-time recovery. In the absence of any other criteria, RMAN selects the most current file copy or backup set to restore. See "untilClause". |
||
validate |
causes RMAN to decide which backup sets, datafile copies, and archived logs need to be restored and then scans them to verify their contents. This operation creates no output files. Specify this option periodically to verify that the copies and backup sets required to restore the specified files are intact and usable. |
|
check logical |
tests data and index blocks that pass physical corruption checks for logical corruption, for example, corruption of a row piece or index entry. If RMAN finds logical corruption, it logs the block in the Provided the sum of physical and logical corruptions detected for a file remain below its maxcorrupt setting, the RMAN command completes and Oracle populates V$BACKUP_CORRUPTION and V$COPY_CORRUPTION with corrupt block ranges. If maxcorrupt is exceeded, the command terminates without populating the views. Note: The maxcorrupt setting represents the total number of physical and logical corruptions permitted on a file. |
|
check readonly |
checks the datafiles to make sure they exist, are readable, and have the appropriate checkpoint. If any of these conditions is not met, then RMAN restores the files--whether or not they are read-only. By default, RMAN does not restore read-only files when you issue the restore database command. |
This example takes a tablespace offline, restores it, then performs media recovery:
run { # recover tablespace tbs_1 while the database is open allocate channel ch1 type 'sbt_tape'; sql "ALTER TABLESPACE tbs_1 OFFLINE IMMEDIATE" ; restore tablespace tbs_1 ; recover tablespace tbs_1 ; sql "ALTER TABLESPACE tbs_1 ONLINE" ; release channel ch1 ; }
This example restores the control file to its default location, replicates it to all CONTROL_FILES locations, and mounts the database:
startup nomount; run { allocate channel ch1 type 'sbt_tape'; restore controlfile; alter database mount; }
This example restores the control file specified by a tag, replicates it to all CONTROL_FILES locations, and then mounts the database:
startup nomount; run { allocate channel ch1 type 'sbt_tape'; restore controlfile from tag 'monday_cf_backup'; alter database mount; }
This example restores the control file to a new location, replicates it to all control file locations specified in the parameter file, and then mounts the control file in order to restore the database:
startup nomount; run { allocate channel ch1 type 'sbt_tape'; restore controlfile to '/oracle/dbs/cf1.ctl'; replicate controlfile from '/oracle/dbs/cf1.ctl'; alter database mount; restore database; }
This example restores all archived redo logs to the /oracle/temp_restore
directory:
run { set archivelog destination to '/oracle/temp_restore'; allocate channel ch1 type disk; restore archivelog all; }
|
Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|
The previous attachment was filtered out by the ListGuru mailing software at fatcity.com because binary attachments are not appropriate for mailing lists. If you want a copy of the attachment which was removed, contact the sender directly and ask for it to be sent to you by private E-mail.
This warning is inserted into all messages containing binary attachments which have been removed by ListGuru. If you have questions about this message, contact Postmaster_at_fatcity.com for clarification.
Oracle8i Recovery Manager User's Guide and Reference Release 2 (8.1.6) Part Number A76990-01 |
|
Recovery Manager Command Syntax, 26 of 50
To produce a detailed listing of specified backups (either backup sets or media-managed proxy copies) or image copies recorded in the recovery catalog or target control file. RMAN records the output to either standard output or the message log (see "cmdLine"), but not to both at the same time. Use this command to list:
Chapter 4, "Generating Lists and Reports with Recovery Manager" to learn how to make lists and reports.
See Also:
incarnation |
displays information about the incarnations of a database. See Table 10-10 for an explanation of the column headings of the list incarnation output table. The listing includes the primary keys of all database incarnation records for the specified database name. Use the key in a reset database command to change the incarnation that RMAN considers to be current to a previous incarnation. If you do not specify the of database option, then the command lists all databases registered in the recovery catalog. |
|
|
of database database_name |
specifies the name of the database. |
copy |
displays information about datafile copies, archived redo logs, and image copies of archived redo logs. By default, list will display copies of all files in the database. Both usable and unusable image copies are included in the output, even those that cannot be restored or are expired or unavailable. See Also: Table 10-8 and Table 10-9 for an explanation of the column headings of the list copy output tables. |
|
backup |
displays information about backups: backup sets, backup pieces, and proxy copies. The output displays a unique key for each. By default, backups of the whole database are listed. Both usable and unusable backups are included in the output, even those that cannot be restored, are expired or unavailable, or are incremental backups that cannot be restored because their parent full backup or copy no longer exists. See Also: Table 10-4, Table 10-5, Table 10-6, and Table 10-7 for an explanation of the column headings of the list backup output tables. Use the KEY column of the output to obtain the primary key usable in the change and delete expired backupset commands. |
|
restricts the list of objects operated on to the object type specified in the listObjList clause. See "listObjList". If you do not specify an object, list defaults to of database. |
||
specifies a range of time for completion of the backup or copy. See "completedTimeSpec". |
||
tag tag_name |
restricts the datafile copies and backups by specifying the tag of the copy or backup. If you specify tag, only copies or backups with the specified tag will be listed. |
|
recoverable |
specifies only backups or copies of datafiles that are available and can possibly be used in a restore operation. To be a candidate for restore operations a backup must meet these criteria. If the backup is: |
|
|
specifies an end time, SCN, or log sequence number. See "untilClause". |
|
lists only backup sets residing on one of the specified device types (see "deviceSpecifier"). If not specified, all available backup sets will be listed. This option applies only to the list backup command. |
||
like string_pattern |
restricts datafile copies by specifying a filename pattern. The pattern can contain Oracle pattern matching characters '%' and '_'. RMAN lists only files whose name matches the pattern. Note: You cannot use the like option with the list ... archivelog command. |
The status information that appears in the output is shown in Table 10-4:
Column | Indicates |
KEY |
a unique key identifying this backup set. Note: If the target database control file is used instead of the recovery catalog, then this field is a unique identifier that specifies this backup set in the target database control file (and is equal to the RECID, which serves this purpose when a recovery catalog is not used). Use this key in a change ... backupset statement to change the status of the backup set. |
RECID |
when combined with the STAMP column, a unique key that identifies this backup set in the target database control file. The RECID will be invalid when a new control file record occupies the space used by the old record. For this reason, issue resync commands often so that the new records are copied to the recovery catalog as soon as possible. |
STAMP |
when combined with the RECID column, a unique key that identifies this backup set in the target database control file. |
LV |
the level of the backup: NULL for non-incrementals, level 0-4 for incrementals. |
SET STAMP |
when combined with the SET COUNT column, a unique key that identifies this backup set in the target database control file. Use these values to access the control file records in the V$BACKUP_SET, V$BACKUP_PIECE, V$BACKUP_DATAFILE, and V$BACKUP_REDOLOG views. The SET STAMP value is valid at all times, both in the control file (when not using a recovery catalog) and when using a recovery catalog. SET STAMP values are never entered by a user because they are part of a two-value key. Oracle World Wide Support may request this value if your database requires recovery when no recovery catalog exists and control file records are gone. See Also: Oracle8i Reference for more information about data dictionary views. |
SET COUNT |
when combined with the SET STAMP column, a unique key that identifies this backup set in the target database control file. Use these values to access the control file records in the V$BACKUP_SET, V$BACKUP_PIECE, V$BACKUP_DATAFILE, and V$BACKUP_REDOLOG views. The SET COUNT value is valid at all times, both in the control file (when not using a recovery catalog) and when using a recovery catalog. SET COUNT values are never entered by a user because they are part of a two-value key. Oracle World Wide Support may request this value if your database requires recovery when no recovery catalog exists and control file records are gone. |
COMPLETION TIME |
the date and time that the backup set completed. Note that the format of this field depends on the NLS_LANG and NLS_DATE_FORMAT environment settings. |
Column | Indicates |
FILE |
the number of the file that was backed up. |
NAME |
the location where this file would be restored now if it were restored from this backup set and no set newname command (see "set_run_option") was entered. |
LV |
the level of the backup: NULL for non-incrementals, level 0-4 for incrementals. |
TYPE |
whether the backup was FULL or INCR (incremental). |
CKP SCN |
the checkpoint of the datafile at the time it was backed up. All database changes prior to the SCN have been written to the file; changes after the specified SCN have not been written to the file. |
CKP TIME |
the checkpoint of the datafile at the time it was backed up. All database changes prior to the time have been written to the file; changes after the specified time have not been written to the file. |
The following example lists datafile copies and archived redo logs recorded in the recovery catalog:
list copy of database archivelog all; List of Datafile Copies Key File S Completion time Ckp SCN Ckp time Name ------- ---- - --------------- ---------- ---------- ------ 1262 1 A 18-AUG-98 219859 14-AUG-98 /vobs/oracle/dbs/copy/tbs_01.f List of Archived Log Copies Key Thrd Seq S Completion time Name ------- ---- ------- - --------------- ------------------------------------ 789 1 1 A 14-JUL-98 /vobs/oracle/work/arc_dest/arcr_1_1.arc 790 1 2 A 11-AUG-98 /vobs/oracle/work/arc_dest/arcr_1_2.arc 791 1 3 A 12-AUG-98 /vobs/oracle/work/arc_dest/arcr_1_3.arc
The following example lists backups of two datafiles recorded in the recovery catalog:
list backup of datafile '/oracle/dbs/tbs_01.f', '/oracle/dbs/tbs_02.f'; List of Backup Sets Key Recid Stamp LV Set Stamp Set Count Completion Time ------- ---------- ---------- -- ---------- ---------- ---------------------- 1174 12 341344528 0 341344502 16 14-SEP-98 List of Backup Pieces Key Pc# Cp# Status Completion Time Piece Name ------- --- --- ---------- ------------------ ----------------------------- 1176 1 1 AVAILABLE 14-AUG-98 /vobs/oracle/dbs/0ga5h07m_1_1 Controlfile Included Ckp SCN Ckp time ---------- --------------- 219857 14-AUG-98 List of Datafiles Included File Name LV Type Ckp SCN Ckp Time ---- ------------------------------------- -- ---- ---------- ------------- 1 /oracle/dbs/tbs_01.f 0 Full 199843 14-AUG-98 2 /oracle/dbs/tbs_02.f 0 Full 199843 14-AUG-98
The following example lists all database incarnations recorded in the recovery catalog:
list incarnation; List of Database Incarnations DB Key Inc Key DB Name DB ID CUR Reset SCN Reset Time ------- ------- ------- ------ --- ---------- ---------- 1 2 PROD1 1224038686 NO 1 02-JUL-98 1 582 PROD1 1224038686 YES 59727 10-JUL-98
|
Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|
Oracle8i Recovery Manager User's Guide and Reference Release 2 (8.1.6) Part Number A76990-01 |
|
Recovery Manager Command Syntax, 37 of 50
To restore files from backups or image copies to the current location, overwriting the files with the same name. You can use set newname command to restore files to non-default locations. RMAN restores backups from disk or tape and restores images copies from disk only.
RMAN considers restored files as datafile copies. If you restore to the default location, RMAN creates records for the datafile copies in the repository and immediately updates them to status DELETED. If you restore to a new location, issue set newname commands to rename the files, and issue a switch command to make the restored files current, RMAN also updates the records to DELETED. If you do not issue switch commands, then RMAN considers the restored files as valid copies for use in future restore operations.
Typically, you restore when a media failure has damaged a current datafile, control file, or archived redo log or prior to performing a point-in-time recovery. This command restores full backups, incremental backups (level 0 only), or copies of:
Note that when you perform a restore operation using a backup control file and use a recovery catalog, RMAN automatically adjusts the control file to reflect the structure of the restored backup.
See Also:
Chapter 6, "Restoring and Recovering with Recovery Manager" to learn how to restore files. |
If the entire database is to be restored, then it must be mounted.
For example, if you made some backups of a datafile to disk channels and others to 'sbt_tape' channels, and only a disk channel is allocated for the restore command, then RMAN will not restore from any backups that were created on 'sbt_tape' channels.
datafile 1
is both specified explicitly and implied by the SYSTEM tablespace:
restore tablespace system datafile 1;
restoreObject |
specifies the objects to be restored. |
|
|
controlfile |
restores the current control file and automatically replicates it to all CONTROL_FILES locations in the parameter file. If you specify a new pathname with the to 'filename' option, RMAN restores the control file to the new location: you must replicate it manually using the replicate command. |
|
database |
restores all datafiles in the database except those that are offline or read-only. Unlike backup database, restore database does not automatically include the control file--you must issue an additional restore command to perform this operation. If you specify the check readonly option, then RMAN examines the headers of all read-only files and restores any that need restoring. Use an optional skip ... tablespace argument to avoid restoring specified tablespaces, which is useful when you want to avoid restoring tablespaces containing temporary data. |
|
restores the datafiles specified by filename or absolute datafile number. See "datafileSpec". |
|
|
tablespace tablespace_name |
restores all datafiles in the specified tablespaces. |
|
archivelogRecord- Specifier clause |
restores the specified range of archived redo logs. See "archivelogRecordSpecifier". |
restoreSpec- Operand |
specifies options for the restoreObject clause. Note: These parameters override the parameters with the same name at the restore command level. |
|
|
channel channel_id |
specifies the name of a channel to use for this restore operation. If you do not specify a channel, restore uses any available channel allocated with the correct device type. |
|
from tag tag_name |
overrides the default selection of the most recent backups or file copy available. The tag restricts the automatic selection to backup sets or file copies that have the specified tag. If multiple backup sets or file copies have a matching tag, then RMAN selects the most recent one. |
|
parms channel_parms |
specifies a quoted string containing operating system-specific information. The string is passed to the OSD layer each time a backup piece is restored. |
channel channel_id |
See the restoreSpecOperand clause. |
|
from tag tag_name |
See the restoreSpecOperand clause. |
|
parms channel_parms |
See the restoreSpecOperand clause. |
|
from |
specifies whether RMAN should restore from a datafilecopy on disk or a backupset. By default restore chooses the most recent backup set or file copy, that is, the file copy or backup set that needs the least media recovery. |
|
limits the selection to those backup sets or file copies that would be suitable for performing a point-in-time recovery. In the absence of any other criteria, RMAN selects the most current file copy or backup set to restore. See "untilClause". |
||
validate |
causes RMAN to decide which backup sets, datafile copies, and archived logs need to be restored and then scans them to verify their contents. This operation creates no output files. Specify this option periodically to verify that the copies and backup sets required to restore the specified files are intact and usable. |
|
check logical |
tests data and index blocks that pass physical corruption checks for logical corruption, for example, corruption of a row piece or index entry. If RMAN finds logical corruption, it logs the block in the Provided the sum of physical and logical corruptions detected for a file remain below its maxcorrupt setting, the RMAN command completes and Oracle populates V$BACKUP_CORRUPTION and V$COPY_CORRUPTION with corrupt block ranges. If maxcorrupt is exceeded, the command terminates without populating the views. Note: The maxcorrupt setting represents the total number of physical and logical corruptions permitted on a file. |
|
check readonly |
checks the datafiles to make sure they exist, are readable, and have the appropriate checkpoint. If any of these conditions is not met, then RMAN restores the files--whether or not they are read-only. By default, RMAN does not restore read-only files when you issue the restore database command. |
This example takes a tablespace offline, restores it, then performs media recovery:
run { # recover tablespace tbs_1 while the database is open allocate channel ch1 type 'sbt_tape'; sql "ALTER TABLESPACE tbs_1 OFFLINE IMMEDIATE" ; restore tablespace tbs_1 ; recover tablespace tbs_1 ; sql "ALTER TABLESPACE tbs_1 ONLINE" ; release channel ch1 ; }
This example restores the control file to its default location, replicates it to all CONTROL_FILES locations, and mounts the database:
startup nomount; run { allocate channel ch1 type 'sbt_tape'; restore controlfile; alter database mount; }
This example restores the control file specified by a tag, replicates it to all CONTROL_FILES locations, and then mounts the database:
startup nomount; run { allocate channel ch1 type 'sbt_tape'; restore controlfile from tag 'monday_cf_backup'; alter database mount; }
This example restores the control file to a new location, replicates it to all control file locations specified in the parameter file, and then mounts the control file in order to restore the database:
startup nomount; run { allocate channel ch1 type 'sbt_tape'; restore controlfile to '/oracle/dbs/cf1.ctl'; replicate controlfile from '/oracle/dbs/cf1.ctl'; alter database mount; restore database; }
This example restores all archived redo logs to the /oracle/temp_restore
directory:
run { set archivelog destination to '/oracle/temp_restore'; allocate channel ch1 type disk; restore archivelog all; }
|
Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|
Oracle8i Recovery Manager User's Guide and Reference Release 2 (8.1.6) Part Number A76990-01 |
|
Recovery Manager Command Syntax, 29 of 50
To apply redo logs or incremental backups to one or more restored datafiles in order to update them to a specified time.
RMAN uses online redo records and restores backup sets of archived redo logs as needed to perform the media recovery. RMAN first looks for the original archived logs or image copies, and if none are available, restores backups.
If RMAN has a choice between applying an incremental backup or applying redo, then it always chooses the incremental backup. If overlapping levels of incremental backup are available, RMAN automatically chooses the one covering the longest period of time.
See Also:
Chapter 6, "Restoring and Recovering with Recovery Manager" to learn how to recover datafiles. |
database |
specifies that the entire database is to be recovered. You can specify an optional untilClause that causes the recovery to stop when the specified condition has been reached. |
|
untilClause |
specifies a non-current time, SCN, or log sequence number for the recover command. See "untilClause". |
|
skip [forever] tablespace tablespace_name |
lists tablespaces that should not be recovered, which is useful for avoiding recovery of tablespaces containing only temporary data or for postponing recovery of some tablespaces. The skip clause takes the datafiles in the specified tablespaces offline before starting media recovery. These files are left offline after the media recovery is complete. If you perform incomplete recovery, then skip is not allowed. Instead, use skip forever, with the intention of dropping the skipped tablespaces after opening the database with the RESETLOGS option. The skip forever clause causes RMAN to take the datafiles offline using the DROP option. Only use skip forever when the specified tablespaces will be dropped after opening the database. |
|
tablespace tablespace_name |
specifies tablespaces by tablespace name. |
|
datafile datafileSpec |
specifies a list of one or more datafiles to recover. Specify datafiles by filename using a quoted string or absolute datafile number using an integer (see "datafileSpec"). If you are using the control file as the exclusive repository for RMAN metadata, then the filename must be the name of the datafile as known in the control file. If you are using a recovery catalog, then the filename of the datafile must be the most recent name recorded in the catalog. For example, assume that a datafile was renamed in the control file. The database then crashes before you can resynchronize the catalog. Specify the old name of the datafile in the recover command, since this is the name recorded in the catalog. |
|
delete archivelog |
deletes restored archived logs that are no longer needed. RMAN does not delete archived logs that were already on disk before the restore command started. |
|
check readonly |
checks the headers of read-only files to ensure that they are current before omitting them from the recovery. |
|
noredo |
suppresses the application of redo logs--only incremental backups are applied. This option is intended for recovery of NOARCHIVELOG databases using incremental backups. If you do not specify noredo when recovering a NOARCHIVELOG database, Oracle aborts a recovery and issues an error. |
The following example takes tablespace TBS_1 offline, restores and recovers it, then brings it back online:
run { allocate channel dev1 type 'sbt_tape'; sql "ALTER TABLESPACE tbs_1 OFFLINE IMMEDIATE"; restore tablespace tbs_1; recover tablespace tbs_1; sql "ALTER TABLESPACE tbs_1 ONLINE"; }
The following example allocates one disk channel and one media management channel to use datafile copies on disk and backups on tape, and restores one of the datafiles in tablespace TBS_1 to a different location:
run { allocate channel dev1 type disk; allocate channel dev2 type 'sbt_tape'; sql "ALTER TABLESPACE tbs_1 OFFLINE IMMEDIATE"; set newname for datafile 'disk7/oracle/tbs11.f' to 'disk9/oracle/tbs11.f'; restore tablespace tbs_1; switch datafile all; recover tablespace tbs_1; sql "ALTER TABLESPACE tbs_1 ONLINE"; }
Assume that both the database and archived redo log 1234 were lost due to a disk crash. Because you do not have incremental backups, you need to recover the database using available archived redo logs. There is no need to restore tablespace READONLY1 because it has not changed since log 1234.
run { # Recover database until log sequence 1234 allocate channel dev1 type disk; allocate channel dev2 type 'sbt_tape'; set until logseq 1234 thread 1; restore controlfile to '/vobs/oracle/dbs/cf1.f' ; # Because you specified a restore destination, you must manually replicate the # control file. The restore command replicates automatically when no destination is # specified. replicate controlfile from '/vobs/oracle/dbs/cf1.f'; alter database mount; restore database skip tablespace temp1, readonly1; recover database skip forever tablespace temp1; sql "ALTER DATABASE OPEN RESETLOGS"; sql "DROP TABLESPACE temp1"; sql "CREATE TABLESPACE temp1 DATAFILE '/vobs/oracle/dbs/temp1.f' SIZE 10M"; release channel dev1; release channel dev2; }
|
Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|
Oracle8i Recovery Manager User's Guide and Reference Release 2 (8.1.6) Part Number A76990-01 |
|
Recovery Manager Command Syntax, 26 of 50
To produce a detailed listing of specified backups (either backup sets or media-managed proxy copies) or image copies recorded in the recovery catalog or target control file. RMAN records the output to either standard output or the message log (see "cmdLine"), but not to both at the same time. Use this command to list:
Chapter 4, "Generating Lists and Reports with Recovery Manager" to learn how to make lists and reports.
See Also:
incarnation |
displays information about the incarnations of a database. See Table 10-10 for an explanation of the column headings of the list incarnation output table. The listing includes the primary keys of all database incarnation records for the specified database name. Use the key in a reset database command to change the incarnation that RMAN considers to be current to a previous incarnation. If you do not specify the of database option, then the command lists all databases registered in the recovery catalog. |
|
|
of database database_name |
specifies the name of the database. |
copy |
displays information about datafile copies, archived redo logs, and image copies of archived redo logs. By default, list will display copies of all files in the database. Both usable and unusable image copies are included in the output, even those that cannot be restored or are expired or unavailable. See Also: Table 10-8 and Table 10-9 for an explanation of the column headings of the list copy output tables. |
|
backup |
displays information about backups: backup sets, backup pieces, and proxy copies. The output displays a unique key for each. By default, backups of the whole database are listed. Both usable and unusable backups are included in the output, even those that cannot be restored, are expired or unavailable, or are incremental backups that cannot be restored because their parent full backup or copy no longer exists. See Also: Table 10-4, Table 10-5, Table 10-6, and Table 10-7 for an explanation of the column headings of the list backup output tables. Use the KEY column of the output to obtain the primary key usable in the change and delete expired backupset commands. |
|
restricts the list of objects operated on to the object type specified in the listObjList clause. See "listObjList". If you do not specify an object, list defaults to of database. |
||
specifies a range of time for completion of the backup or copy. See "completedTimeSpec". |
||
tag tag_name |
restricts the datafile copies and backups by specifying the tag of the copy or backup. If you specify tag, only copies or backups with the specified tag will be listed. |
|
recoverable |
specifies only backups or copies of datafiles that are available and can possibly be used in a restore operation. To be a candidate for restore operations a backup must meet these criteria. If the backup is: |
|
|
specifies an end time, SCN, or log sequence number. See "untilClause". |
|
lists only backup sets residing on one of the specified device types (see "deviceSpecifier"). If not specified, all available backup sets will be listed. This option applies only to the list backup command. |
||
like string_pattern |
restricts datafile copies by specifying a filename pattern. The pattern can contain Oracle pattern matching characters '%' and '_'. RMAN lists only files whose name matches the pattern. Note: You cannot use the like option with the list ... archivelog command. |
The status information that appears in the output is shown in Table 10-4:
Column | Indicates |
KEY |
a unique key identifying this backup set. Note: If the target database control file is used instead of the recovery catalog, then this field is a unique identifier that specifies this backup set in the target database control file (and is equal to the RECID, which serves this purpose when a recovery catalog is not used). Use this key in a change ... backupset statement to change the status of the backup set. |
RECID |
when combined with the STAMP column, a unique key that identifies this backup set in the target database control file. The RECID will be invalid when a new control file record occupies the space used by the old record. For this reason, issue resync commands often so that the new records are copied to the recovery catalog as soon as possible. |
STAMP |
when combined with the RECID column, a unique key that identifies this backup set in the target database control file. |
LV |
the level of the backup: NULL for non-incrementals, level 0-4 for incrementals. |
SET STAMP |
when combined with the SET COUNT column, a unique key that identifies this backup set in the target database control file. Use these values to access the control file records in the V$BACKUP_SET, V$BACKUP_PIECE, V$BACKUP_DATAFILE, and V$BACKUP_REDOLOG views. The SET STAMP value is valid at all times, both in the control file (when not using a recovery catalog) and when using a recovery catalog. SET STAMP values are never entered by a user because they are part of a two-value key. Oracle World Wide Support may request this value if your database requires recovery when no recovery catalog exists and control file records are gone. See Also: Oracle8i Reference for more information about data dictionary views. |
SET COUNT |
when combined with the SET STAMP column, a unique key that identifies this backup set in the target database control file. Use these values to access the control file records in the V$BACKUP_SET, V$BACKUP_PIECE, V$BACKUP_DATAFILE, and V$BACKUP_REDOLOG views. The SET COUNT value is valid at all times, both in the control file (when not using a recovery catalog) and when using a recovery catalog. SET COUNT values are never entered by a user because they are part of a two-value key. Oracle World Wide Support may request this value if your database requires recovery when no recovery catalog exists and control file records are gone. |
COMPLETION TIME |
the date and time that the backup set completed. Note that the format of this field depends on the NLS_LANG and NLS_DATE_FORMAT environment settings. |
Column | Indicates |
FILE |
the number of the file that was backed up. |
NAME |
the location where this file would be restored now if it were restored from this backup set and no set newname command (see "set_run_option") was entered. |
LV |
the level of the backup: NULL for non-incrementals, level 0-4 for incrementals. |
TYPE |
whether the backup was FULL or INCR (incremental). |
CKP SCN |
the checkpoint of the datafile at the time it was backed up. All database changes prior to the SCN have been written to the file; changes after the specified SCN have not been written to the file. |
CKP TIME |
the checkpoint of the datafile at the time it was backed up. All database changes prior to the time have been written to the file; changes after the specified time have not been written to the file. |
The following example lists datafile copies and archived redo logs recorded in the recovery catalog:
list copy of database archivelog all; List of Datafile Copies Key File S Completion time Ckp SCN Ckp time Name ------- ---- - --------------- ---------- ---------- ------ 1262 1 A 18-AUG-98 219859 14-AUG-98 /vobs/oracle/dbs/copy/tbs_01.f List of Archived Log Copies Key Thrd Seq S Completion time Name ------- ---- ------- - --------------- ------------------------------------ 789 1 1 A 14-JUL-98 /vobs/oracle/work/arc_dest/arcr_1_1.arc 790 1 2 A 11-AUG-98 /vobs/oracle/work/arc_dest/arcr_1_2.arc 791 1 3 A 12-AUG-98 /vobs/oracle/work/arc_dest/arcr_1_3.arc
The following example lists backups of two datafiles recorded in the recovery catalog:
list backup of datafile '/oracle/dbs/tbs_01.f', '/oracle/dbs/tbs_02.f'; List of Backup Sets Key Recid Stamp LV Set Stamp Set Count Completion Time ------- ---------- ---------- -- ---------- ---------- ---------------------- 1174 12 341344528 0 341344502 16 14-SEP-98 List of Backup Pieces Key Pc# Cp# Status Completion Time Piece Name ------- --- --- ---------- ------------------ ----------------------------- 1176 1 1 AVAILABLE 14-AUG-98 /vobs/oracle/dbs/0ga5h07m_1_1 Controlfile Included Ckp SCN Ckp time ---------- --------------- 219857 14-AUG-98 List of Datafiles Included File Name LV Type Ckp SCN Ckp Time ---- ------------------------------------- -- ---- ---------- ------------- 1 /oracle/dbs/tbs_01.f 0 Full 199843 14-AUG-98 2 /oracle/dbs/tbs_02.f 0 Full 199843 14-AUG-98
The following example lists all database incarnations recorded in the recovery catalog:
list incarnation; List of Database Incarnations DB Key Inc Key DB Name DB ID CUR Reset SCN Reset Time ------- ------- ------- ------ --- ---------- ---------- 1 2 PROD1 1224038686 NO 1 02-JUL-98 1 582 PROD1 1224038686 YES 59727 10-JUL-98
|
Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|
Oracle8i Recovery Manager User's Guide and Reference Release 2 (8.1.6) Part Number A76990-01 |
|
Recovery Manager Command Syntax, 37 of 50
To restore files from backups or image copies to the current location, overwriting the files with the same name. You can use set newname command to restore files to non-default locations. RMAN restores backups from disk or tape and restores images copies from disk only.
RMAN considers restored files as datafile copies. If you restore to the default location, RMAN creates records for the datafile copies in the repository and immediately updates them to status DELETED. If you restore to a new location, issue set newname commands to rename the files, and issue a switch command to make the restored files current, RMAN also updates the records to DELETED. If you do not issue switch commands, then RMAN considers the restored files as valid copies for use in future restore operations.
Typically, you restore when a media failure has damaged a current datafile, control file, or archived redo log or prior to performing a point-in-time recovery. This command restores full backups, incremental backups (level 0 only), or copies of:
Note that when you perform a restore operation using a backup control file and use a recovery catalog, RMAN automatically adjusts the control file to reflect the structure of the restored backup.
See Also:
Chapter 6, "Restoring and Recovering with Recovery Manager" to learn how to restore files. |
If the entire database is to be restored, then it must be mounted.
For example, if you made some backups of a datafile to disk channels and others to 'sbt_tape' channels, and only a disk channel is allocated for the restore command, then RMAN will not restore from any backups that were created on 'sbt_tape' channels.
datafile 1
is both specified explicitly and implied by the SYSTEM tablespace:
restore tablespace system datafile 1;
restoreObject |
specifies the objects to be restored. |
|
|
controlfile |
restores the current control file and automatically replicates it to all CONTROL_FILES locations in the parameter file. If you specify a new pathname with the to 'filename' option, RMAN restores the control file to the new location: you must replicate it manually using the replicate command. |
|
database |
restores all datafiles in the database except those that are offline or read-only. Unlike backup database, restore database does not automatically include the control file--you must issue an additional restore command to perform this operation. If you specify the check readonly option, then RMAN examines the headers of all read-only files and restores any that need restoring. Use an optional skip ... tablespace argument to avoid restoring specified tablespaces, which is useful when you want to avoid restoring tablespaces containing temporary data. |
|
restores the datafiles specified by filename or absolute datafile number. See "datafileSpec". |
|
|
tablespace tablespace_name |
restores all datafiles in the specified tablespaces. |
|
archivelogRecord- Specifier clause |
restores the specified range of archived redo logs. See "archivelogRecordSpecifier". |
restoreSpec- Operand |
specifies options for the restoreObject clause. Note: These parameters override the parameters with the same name at the restore command level. |
|
|
channel channel_id |
specifies the name of a channel to use for this restore operation. If you do not specify a channel, restore uses any available channel allocated with the correct device type. |
|
from tag tag_name |
overrides the default selection of the most recent backups or file copy available. The tag restricts the automatic selection to backup sets or file copies that have the specified tag. If multiple backup sets or file copies have a matching tag, then RMAN selects the most recent one. |
|
parms channel_parms |
specifies a quoted string containing operating system-specific information. The string is passed to the OSD layer each time a backup piece is restored. |
channel channel_id |
See the restoreSpecOperand clause. |
|
from tag tag_name |
See the restoreSpecOperand clause. |
|
parms channel_parms |
See the restoreSpecOperand clause. |
|
from |
specifies whether RMAN should restore from a datafilecopy on disk or a backupset. By default restore chooses the most recent backup set or file copy, that is, the file copy or backup set that needs the least media recovery. |
|
limits the selection to those backup sets or file copies that would be suitable for performing a point-in-time recovery. In the absence of any other criteria, RMAN selects the most current file copy or backup set to restore. See "untilClause". |
||
validate |
causes RMAN to decide which backup sets, datafile copies, and archived logs need to be restored and then scans them to verify their contents. This operation creates no output files. Specify this option periodically to verify that the copies and backup sets required to restore the specified files are intact and usable. |
|
check logical |
tests data and index blocks that pass physical corruption checks for logical corruption, for example, corruption of a row piece or index entry. If RMAN finds logical corruption, it logs the block in the Provided the sum of physical and logical corruptions detected for a file remain below its maxcorrupt setting, the RMAN command completes and Oracle populates V$BACKUP_CORRUPTION and V$COPY_CORRUPTION with corrupt block ranges. If maxcorrupt is exceeded, the command terminates without populating the views. Note: The maxcorrupt setting represents the total number of physical and logical corruptions permitted on a file. |
|
check readonly |
checks the datafiles to make sure they exist, are readable, and have the appropriate checkpoint. If any of these conditions is not met, then RMAN restores the files--whether or not they are read-only. By default, RMAN does not restore read-only files when you issue the restore database command. |
This example takes a tablespace offline, restores it, then performs media recovery:
run { # recover tablespace tbs_1 while the database is open allocate channel ch1 type 'sbt_tape'; sql "ALTER TABLESPACE tbs_1 OFFLINE IMMEDIATE" ; restore tablespace tbs_1 ; recover tablespace tbs_1 ; sql "ALTER TABLESPACE tbs_1 ONLINE" ; release channel ch1 ; }
This example restores the control file to its default location, replicates it to all CONTROL_FILES locations, and mounts the database:
startup nomount; run { allocate channel ch1 type 'sbt_tape'; restore controlfile; alter database mount; }
This example restores the control file specified by a tag, replicates it to all CONTROL_FILES locations, and then mounts the database:
startup nomount; run { allocate channel ch1 type 'sbt_tape'; restore controlfile from tag 'monday_cf_backup'; alter database mount; }
This example restores the control file to a new location, replicates it to all control file locations specified in the parameter file, and then mounts the control file in order to restore the database:
startup nomount; run { allocate channel ch1 type 'sbt_tape'; restore controlfile to '/oracle/dbs/cf1.ctl'; replicate controlfile from '/oracle/dbs/cf1.ctl'; alter database mount; restore database; }
This example restores all archived redo logs to the /oracle/temp_restore
directory:
run { set archivelog destination to '/oracle/temp_restore'; allocate channel ch1 type disk; restore archivelog all; }
|
Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|
Oracle8i Recovery Manager User's Guide and Reference Release 2 (8.1.6) Part Number A76990-01 |
|
Recovery Manager Command Syntax, 29 of 50
To apply redo logs or incremental backups to one or more restored datafiles in order to update them to a specified time.
RMAN uses online redo records and restores backup sets of archived redo logs as needed to perform the media recovery. RMAN first looks for the original archived logs or image copies, and if none are available, restores backups.
If RMAN has a choice between applying an incremental backup or applying redo, then it always chooses the incremental backup. If overlapping levels of incremental backup are available, RMAN automatically chooses the one covering the longest period of time.
See Also:
Chapter 6, "Restoring and Recovering with Recovery Manager" to learn how to recover datafiles. |
database |
specifies that the entire database is to be recovered. You can specify an optional untilClause that causes the recovery to stop when the specified condition has been reached. |
|
untilClause |
specifies a non-current time, SCN, or log sequence number for the recover command. See "untilClause". |
|
skip [forever] tablespace tablespace_name |
lists tablespaces that should not be recovered, which is useful for avoiding recovery of tablespaces containing only temporary data or for postponing recovery of some tablespaces. The skip clause takes the datafiles in the specified tablespaces offline before starting media recovery. These files are left offline after the media recovery is complete. If you perform incomplete recovery, then skip is not allowed. Instead, use skip forever, with the intention of dropping the skipped tablespaces after opening the database with the RESETLOGS option. The skip forever clause causes RMAN to take the datafiles offline using the DROP option. Only use skip forever when the specified tablespaces will be dropped after opening the database. |
|
tablespace tablespace_name |
specifies tablespaces by tablespace name. |
|
datafile datafileSpec |
specifies a list of one or more datafiles to recover. Specify datafiles by filename using a quoted string or absolute datafile number using an integer (see "datafileSpec"). If you are using the control file as the exclusive repository for RMAN metadata, then the filename must be the name of the datafile as known in the control file. If you are using a recovery catalog, then the filename of the datafile must be the most recent name recorded in the catalog. For example, assume that a datafile was renamed in the control file. The database then crashes before you can resynchronize the catalog. Specify the old name of the datafile in the recover command, since this is the name recorded in the catalog. |
|
delete archivelog |
deletes restored archived logs that are no longer needed. RMAN does not delete archived logs that were already on disk before the restore command started. |
|
check readonly |
checks the headers of read-only files to ensure that they are current before omitting them from the recovery. |
|
noredo |
suppresses the application of redo logs--only incremental backups are applied. This option is intended for recovery of NOARCHIVELOG databases using incremental backups. If you do not specify noredo when recovering a NOARCHIVELOG database, Oracle aborts a recovery and issues an error. |
The following example takes tablespace TBS_1 offline, restores and recovers it, then brings it back online:
run { allocate channel dev1 type 'sbt_tape'; sql "ALTER TABLESPACE tbs_1 OFFLINE IMMEDIATE"; restore tablespace tbs_1; recover tablespace tbs_1; sql "ALTER TABLESPACE tbs_1 ONLINE"; }
The following example allocates one disk channel and one media management channel to use datafile copies on disk and backups on tape, and restores one of the datafiles in tablespace TBS_1 to a different location:
run { allocate channel dev1 type disk; allocate channel dev2 type 'sbt_tape'; sql "ALTER TABLESPACE tbs_1 OFFLINE IMMEDIATE"; set newname for datafile 'disk7/oracle/tbs11.f' to 'disk9/oracle/tbs11.f'; restore tablespace tbs_1; switch datafile all; recover tablespace tbs_1; sql "ALTER TABLESPACE tbs_1 ONLINE"; }
Assume that both the database and archived redo log 1234 were lost due to a disk crash. Because you do not have incremental backups, you need to recover the database using available archived redo logs. There is no need to restore tablespace READONLY1 because it has not changed since log 1234.
run { # Recover database until log sequence 1234 allocate channel dev1 type disk; allocate channel dev2 type 'sbt_tape'; set until logseq 1234 thread 1; restore controlfile to '/vobs/oracle/dbs/cf1.f' ; # Because you specified a restore destination, you must manually replicate the # control file. The restore command replicates automatically when no destination is # specified. replicate controlfile from '/vobs/oracle/dbs/cf1.f'; alter database mount; restore database skip tablespace temp1, readonly1; recover database skip forever tablespace temp1; sql "ALTER DATABASE OPEN RESETLOGS"; sql "DROP TABLESPACE temp1"; sql "CREATE TABLESPACE temp1 DATAFILE '/vobs/oracle/dbs/temp1.f' SIZE 10M"; release channel dev1; release channel dev2; }
|
Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Peter Gram INET: peter.gram_at_miracleas.dk Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Thu May 16 2002 - 05:09:07 CDT