Rman oracle 10g manual
For enterprises that already use media management software in their environment, many of those software products can be directly integrated with RMAN. Contact your media management software vendor for details about whether they participate in the BSP and have an RMAN-compatible media management layer. RMAN uses server sessions on the target database instance to perform all backup, restore and recovery operations. The channels allocated as a result of configured settings are sometimes referred to as automatic channels.
If any channels are explicitly allocated then the configured channel settings are ignored. The number of channels that are used for an RMAN job controls the amount of work that is run in parallel. When backing up or restoring files, RMAN automatically schedules the work to make the most use of all the available channels.
This channel, known as the default channel , is not used for tasks involving bulk data transfer, such as backup or restore of database files.
The RMAN client is started by issuing the rman command at the command prompt of your operating system. RMAN can also connect to a recovery catalog database if you are using one. These configured settings can specify disk and SBT channel behavior, backup destinations, policies affecting backup strategy, and others.
Some frequently used configuration settings are described below. By default, RMAN allocates one disk channel for all operations automatically, and directs all backups to disk if no destination is specified. If your database uses a flash recovery area, then backups to disk are stored there if no other location is specified in the BACKUP command. Otherwise, disk backups are assumed to be stored in a platform-specific default location.
After configuring your media management software, you can make the media manager the default destination for RMAN backups:. Multiple channels can be configured to run backups in parallel. This command configures three sbt channels for use in RMAN jobs:. Retention policy governs how long database backups are retained, and determines how far into the past you can recover your database.
Retention policy can be set in terms of a recovery window how far into the past you need to be able to recover your database , or a redundancy value how many backups of each file must be retained. Choosing an effective retention policy is a vital part of your backup strategy.
This command ensures that RMAN retains all backups needed to recover the database to any point in time in the last 7 days:. For backups stored in a flash recovery area, you do not need to perform this step. The database automatically deletes obsolete backups in the flash recovery area when space is needed, as well as files that have been backed up to a media manager.
The following command configures RMAN to create these control file autobackups :. By default, RMAN automatically generates names for control file autobackups and stores them in the flash recovery area. You will usually configure default devices and channels in advance; BACKUP backs up your data to the configured default device and channels for the type of backup requested.
Image copies cannot be created on tape. A backup set consists of one or more backup pieces , physical files containing the data, written in a format that only RMAN can access. Only RMAN can create and restore backup sets. Backup sets can be written to disk or tape, and they are the only that RMAN can use to write backups to tape.
The following command creates a backup of the database and archived logs on tape, in backup set format, using the configured channels:. You can back up individual tablespaces, datafiles and control files, server parameter files, and backup sets with various options, as in these examples:.
Incremental backups capture on a block-by-block basis changes in your database since a previous incremental backup. The starting point for an incremental backup strategy is a level 0 incremental backup , which backs up all blocks in the database.
Level 1 incremental backups, taken at regular intervals, contain only changed blocks since a previous incremental backup. These can be cumulative including all blocks changed since the most recent level 0 backup or differential including only blocks changed since the most recent incremental backup, whether it is level 0 or level 1.
Incremental backups are generally smaller and faster to create than full database backups. Recovery from an incremental backup is faster than recovery using redo logs alone. During a restore from incremental backup, the level 0 backup is used as the starting point, then changed blocks are updated based on level 1 backups where possible to avoid re-applying changes from redo one at a time.
Recovering with incremental backups requires no additional effort on your part. If incremental backups are available, RMAN will use them during recovery.
RMAN's incrementally updated backups feature allows for a more efficient incremental backup routine. Changes from level 1 backups can be used to roll forward an image copy level 0 incremental backup, so that it includes all changes as of the SCN at which the level 1 incremental backup was created. Recovery using the updated level 0 incremental backup is faster, because all changes from the level 1 incremental backup have already been applied.
See Oracle Database Backup and Recovery Basics for more details and examples for incremental backups and incrementally updated backups. You can run a test RMAN backup that does not generate any output. Validation confirms that a backup could be run, by confirming that all database files exist, are in their correct location, and are free of physical and logical corruption. For example:. Restoring datafiles is retrieving them from backups as needed for a recovery operation.
Recovery is the application of changes from redo logs and incremental backups to a restored datafile, to bring the datafile to a desired SCN or point in time. Take the tablespace that needs recovery offline, restore and then recover the tablespace, and bring the recovered tablespace online.
The following steps recover the users tablespace:. Take the datafile that needs recovery offline, restore and recover the datafile, and bring the datafile online.
For example, to restore and recover datafile 7 :. RMAN can recover individual corrupted datafile blocks. Corruption is usually reported in alert logs, trace files or results of SQL queries. RMAN decides which backup sets, datafile copies, and archived logs are needed for the operation, and scans them to verify that they are usable. You can also query the views described in "Backup and Recovery Views". You can display specific objects, as in the following examples:.
Some of the main options are:. RMAN repository metadata is always stored in the control file of the target database. You can also create a recovery catalog in a separate database, and RMAN will record its metadata there as well. If you do not use a recovery catalog, then eventually RMAN control file records are overwritten. Set this initialization parameter in the parameter file of the target database to determine how long records are kept:.
Assuming that you have configured automatic channels, you can run these commands:. Use this command to record backups created with tools other than RMAN, such as datafile copies created with operating system-level utilities. RMAN can use these backups in restore and recovery operations. While the use of configured channels and other settings reduces many common RMAN operations to a single command, your backup routine may include frequently-used multi-step processes. Execute the contents of a command file using the RMAN command:.
Any file extension may be used. You can also launch RMAN with a command file to run, as shown here:. If one command fails, the remaining commands in the block will not be executed. Note, however, that RMAN will still try to execute as many tasks related to a failed command as possible.
This section gives an overview of the most common RMAN commands and their most commonly used options. Commands documented here include:. Syntax descriptions use vertical ellipses to indicate less-frequently-used parameters and options. Reports backup status of your database: which files are in the database, which files need backups, and which backups are obsolete or unrecoverable. The following table describes views you can use to query the RMAN repository.
Our goal is to make Oracle products, services, and supporting documentation accessible, with good usability, to the disabled community. To that end, our documentation includes features that make information available to users of assistive technology. This documentation is available in HTML format, and contains markup to facilitate access by the disabled community.
Accessibility standards will continue to evolve over time, and Oracle is actively engaged with other market-leading technology vendors to address technical obstacles so that our documentation can be accessible to all of our customers.
Screen readers may not always correctly read the code examples in this document. The conventions for writing code require that closing braces should appear on an otherwise empty line; however, some screen readers may not always read a line of text that consists solely of a bracket or brace.
This documentation may contain links to Web sites of other companies or organizations that Oracle does not own or control. Oracle neither evaluates nor makes any representations regarding the accessibility of these Web sites.
For TTY support, call Use TAG to identify the tag of the data file copy serving as basis for the backup strategy. RMAN automatically assigns the same tag to every level 1 backup of this copy. If no level 0 data file copy with the specified tag exists in either the current or parent database incarnation , then RMAN creates a level 0 data file copy with the specified tag.
Specifies where RMAN creates the data file copy if a copy does not exist. If you add a new data file to the database, then you do not need to change your script, because RMAN automatically creates the level 0 copy required by the incremental backup routine. The following script, run on a regular basis, is all that is required to implement a strategy based on incrementally updated backups. For example, enter the following commands to validate all database files and archived redo log files for physical and logical corruption:.
RMAN supports the use of command files to manage recurring tasks such as weekly backups. You can use any file extension. The RUN command provides a degree of flow-of-control in your scripts. For both backups and copies you have additional options shown in Table An expired backup may have been deleted by an operating system utility. Some main options are shown in Table Shows which files need backing up under current retention policy.
Lists backups that are obsolete under the configured backup retention policy. Reports the tablespaces and data files in the database at the current time default or a different time. Lists all data files for which an unrecoverable operation has been performed against an object in the data file since the last backup of the data file. The following example reports backups that are obsolete according to the currently configured backup retention policy:.
RMAN repository metadata is always stored in the control file of the target database. The RMAN maintenance commands use this metadata when managing backups. It is a good idea to crosscheck backups and copies before deleting them. The simplest way to diagnose and repair database problems is to use the Data Recovery Advisor.
This Oracle Database tool provides an infrastructure for diagnosing persistent data failures, presenting repair options to the user, and automatically executing repairs. A failure is a persistent data corruption detected by the Health Monitor.
Examples include physical and logical data block corruptions and missing data files. Each failure has a failure priority and failure status. The following example illustrates these two commands sample output included. First try to fix the problem manually. If you cannot fix the problem manually, then review the automated repair section. An automated repair option describes a server-managed repair for one or more failures. Repairs are consolidated when possible so that a single repair can fix multiple failures.
The repair option indicates which repair is performed and whether data is lost by performing the repair operation. If you do not want to use Data Recovery Advisor to repair the failure automatically, then you can use the script as the basis of your own recovery strategy. Example illustrates how to repair the failures identified in Example After executing a repair, Data Recovery Advisor reevaluates all existing failures on the possibility that they may also have been fixed.
Data Recovery Advisor always verifies that failures are still relevant and automatically closes fixed failures. If a repair fails to complete because of an error, then the error triggers a new assessment and re-evaluation of existing failures and repairs. You can use the Oracle Flashback Database to rewind the whole database to a past time.
Unlike media recovery, you do not need to restore data files to return the database to a past state. This configuration task is described in "Flashback Database". Flashback Database works by rewinding changes to the data files that exist at the moment that you run the command. You cannot use the command to repair media failures or missing data files.
If you have previously created a restore point , then you can flash back to this restore point if it falls within the flashback database window. If satisfied with the results, then issue the following sequence of commands to shut down and then open the database:. Restoring data files is retrieving them from backups as needed for a recovery operation.
Media recovery is the application of changes from redo logs and incremental backups to a restored data file to bring the data file forward to a desired SCN or point in time. If you must recover the database because a media failure damages database files, then you should first ensure that you have the necessary backups.
RMAN queries the metadata and does not actually read the backup files. The database can be open when you run this command. You must have previously made backups of all needed files. This scenario assumes that you can restore all data files to their original locations. The following example terminates the database instance if it is started and mounts the database:.
In this case, you must take the tablespace that needs recovery offline, restore and then recover the tablespace, and bring the recovered tablespace online. Unlike in user-managed media recovery, you should not place an online tablespace in backup mode. Unlike user-managed tools, RMAN does not require extra logging or backup mode because it knows the format of data blocks.
To recover an individual tablespace when the database is open:. RMAN can recover individual corrupted data file blocks. Corruption is usually reported in alert logs, trace files, or results of SQL queries. The RMAN client An Oracle Database executable that interprets commands, directs server sessions to execute those commands, and records its activity in the target database control file.
Some environments use the following optional components: A fast recovery area A disk location in which the database can store and manage files related to backup and recovery. A media manager An application required for RMAN to interact with sequential media devices such as tape libraries. A recovery catalog A separate database schema used to record RMAN activity against one or more target databases. Caution: Good security practice requires that passwords should not be entered in plain text on the command line.
See Oracle Database Security Guide to learn about password protection. To back up the database and archived redo logs while the database is open: Start RMAN and connect to a target database. Shut down the database consistently and then mount it. See Also: "Incremental Backups" for a more detailed conceptual overview of incremental backups and "Making and Updating Incremental Backups".
The strategy has the following main features: The strategy requires a level 0 data file copy as a base. See Also: "Incrementally Updating Backups". To create and run a command file: Use a text editor to create a command file. This is the default mode of presentation.
See Also: "Repairing Failures". Ensure that the database is in a mounted state. Preparing to Restore and Recover Database Files If you must recover the database because a media failure damages database files, then you should first ensure that you have the necessary backups.
To recover the whole database: Prepare for recovery as explained in "Preparing to Restore and Recover Database Files". Place the database in a mounted state. To recover an individual tablespace when the database is open: Prepare for recovery as explained in "Preparing to Restore and Recover Database Files".
0コメント