Oracle® Database 2 Day DBA 11g Release 1 (11.1) Part Number B28301-03 |
|
|
View PDF |
This section describes how to back up your database with Oracle Enterprise Manager Database Control (Database Control). The Oracle suggested strategy for disk-only backups provides efficient daily backup of the database. This strategy enables you to quickly return your database to its state at any point during the previous 24 hours. For more flexible backup options, see Oracle Database Backup and Recovery User's Guide.
This section provides the concepts you need to understand the Oracle suggested backup strategy and other backup types provided through Database Control.
A full backup of a datafile includes all used blocks of the datafile. As explained in "About RMAN Backups", an RMAN backup can be either an image copy or backup set. An image copy is a bit-for-bit copy of the datafile, and thus includes unused blocks.
RMAN incremental backups copy only those blocks in a datafile that change between backups. A level 0 incremental backup, which copies all blocks in the datafile, is used as a starting point for an incremental backup strategy.
Incremental backups at level 1 copy only images of blocks that have changed since a previous incremental backup. Level 1 backups can be cumulative, in which case all blocks changed since the most recent level 0 backup are included, or differential, in which case only those blocks changed since the most recent level 0 or level 1 incremental backup are included. A typical incremental strategy makes level 1 backups at regular intervals such as once each day.
Recovering changed blocks from incremental backups can speed media recovery. Because an incremental level 1 backup copies the final contents of all datafile blocks changed during the period covered by the incremental backup strategy, the recovery process can omit reapplying individual updates from the redo logs of that period, and update each block with its final contents. The redo logs are used only for changes from the period not covered by level 1 backups.
RMAN enables you to apply level 1 incremental backups to an older image copy of your datafiles. You can roll forward the old copy to the point in time of the most recent level 1 incremental backup. All blocks changed since the image copy was created are overwritten with their new contents as of the time of the last level 1 incremental backup. The effect is to roll the file forward in time, so that its contents are equivalent, for the purposes of database recovery, to an image copy of the datafile made at the time of the last incremental level 1 backup.
Incorporating incrementally updated backups into your backup strategy shortens expected recovery times. The reason is that media recovery to the present time or to a point in time in the recent past can begin at the time of the last level 1 backup applied, rather than at the time of the last full database backup.
All RMAN backups, including incremental backups, are labeled with a tag. A tag is a text string that identifies that backup, either uniquely or as part of a group of backups. For instance, if you performed a weekly, full database backup on Saturday nights, you could use the tag FULL_SAT
to identify all such backups.
You can use tags to refer to specific backups in RMAN commands. For example, you could issue a command to move the latest FULL_SAT
backup to tape. If you do not specify a tag, then RMAN creates a unique tag automatically.
Because you can use tags to refer to different groups of backups, you can create different routines in your backup strategy that do not interfere with each other. When you schedule a backup job and give the job a name, the job name is used as a tag.
Database Control enables you to perform RMAN backups and schedule backup jobs required by your backup strategy.
Whole backups of a database include the complete contents of all datafiles of the database, as well as the control file, archived redo logs, and server parameter file. With these files, you can perform a complete recovery.
While whole database backups can be an important element in your overall backup strategy, they are also a required step in some situations, such as when you enable or disable ARCHIVELOG
mode (see "Configuring Recovery Settings"). This section explains how to make whole database backups to disk.
To perform a whole database backup when the database is open:
On the Database Home page, click Availability to display the Availability subpage.
In the Backup/Recovery section of the Availability page, click Schedule Backup.
The Schedule Backup page appears.
In the Customized Backup section, select Whole Database, and then click Schedule Customized Backup.
The Schedule Customized Backup: Options page appears.
In the Backup Type section, select Full Backup.
In the Backup Mode section, select either Online Backup or Offline Backup.
Typically, you will want to perform online backups to maximize database availability.
Note:
As explained in "Configuring Your Database for Basic Backup and Recovery", you can make online backups only if your database is running inARCHIVELOG
mode.In the Advanced section, make the following selections, and then click Next:
If you are performing an online backup, select Also back up all archived logs on disk.
You do not need to back up archived logs when performing an offline backup because the database is in a consistent state at the time of backup and does not require media recovery if you restore the database from this backup. However, you can choose to include archived logs in the backup.
If a flash recovery area is your only archiving destination, do not select "Delete all archived logs from disk after they are successfully backed up".
In this case, redo logs that have been backed up are deleted automatically as space is needed. If you are using some other archiving destination, it may be useful to select this option as part of managing your backup storage.
Do not select "Use proxy copy supported by media management software to perform a backup" for now.
If the flash recovery area stores backups, do not select the Delete obsolete backups option.
In this case, obsolete backups are deleted automatically as space is needed. If you use another destination for your backup files, you can select this option.
Do not enter a value for Maximum Files per Backup Set.
Do not select the Encryption option.
For improved security, you can encrypt RMAN backup sets with a user-selected algorithm. Encrypted backups cannot be read by unauthorized users.
The Schedule Customized Backup: Settings page appears.
Select Disk and then click Next.
Oracle recommends backing up to disk when possible to minimize recovery time by minimizing restore operations from tape. Later, you can move disk backups to tape.
The Schedule Customized Backup: Schedule page appears.
Complete the following steps:
In the Job section, leave the default values for Job Name and Job Description.
In the Job Name field, you can enter a user-specified tag for this backup. The job name is used as a prefix for the backup tag for backups created by this job.
Note:
For recurring jobs, it is useful to set a Job Name so that the resulting backups are easy to identify as part of an ongoing series. Use a descriptive tag, such asWEEKLY_FULL_BACKUP
.In the Job Description field, you can enter any descriptive text that is useful for your own reference.
In the Schedule section, click One Time (Immediately), and then click Next.
The Schedule Customized Backup: Review page appears.
Click Submit Job.
The Status page appears. This page should contain a message that indicates the job was successfully submitted.
Click View Job to monitor the progress of the backup.
The Execution: Database page appears. This page contains a Summary section describing the job. The table at the bottom of the page displays the progress of the various steps of the backup job. You can reload this page in your browser to monitor the ongoing progress of the job.
In the Name column of the table, you can see the current phase of the RMAN job. Clicking the name of the phase of the backup job displays a page containing the RMAN output for that part of the job. From this page, click the Back button in your browser to return to the Execution: Database page.
To perform a whole database backup when the database is closed:
Follow the same steps as for an open database backup, except select Offline Backup in Step 4 and then continue with the steps that follow.
Database Control makes it easy to set up an Oracle suggested backup strategy for backups to disk that protects your data and provides efficient recoverability to any point in the user-specified recovery window (time period). The Oracle suggested strategy leverages the incremental backup and incrementally-updated backup features to provide faster backups than whole database backups, and faster recoverability than is possible through applying database changes from the archive log to your datafiles.
The Oracle suggested strategy is based on creating an image copy of your database. The database rolls forward this copy by using incrementally updated backups. Oracle Enterprise Manager schedules RMAN backup jobs during the overnight hours.
For each datafile, the strategy calls for backups as follows:
At the beginning of day 1 of the strategy (the time the first scheduled job actually runs), RMAN creates an incremental level 0 datafile copy. It contains the datafile contents at the beginning of day 1.
If a recovery is required, the redo logs from day 1 can be used to recover to any point during day 1.
At the beginning of day 2, RMAN creates an incremental level 1 backup that contains the blocks changed during day 1.
If a recovery is required, RMAN can apply this incremental level 1 to roll forward the level 0 backup to the beginning of day 2. RMAN can use redo logs to recover to any point during day 2.
At the beginning of each day n for day 3 and onward, RMAN applies the level 1 backup from the beginning of day n-1 to the level 0 backup. This action brings the datafile copy to its state at the beginning of day n-1. Then, RMAN creates a new level 1 backup that contains the blocks changed during day n-1.
If a recovery is required, RMAN can apply this incremental level 1 backup to the datafile rolled forward on day n-1 to the beginning of day n. RMAN can use redo logs to recover the database to any point during day n.
The datafile copies used in the Oracle suggested backup strategy are tagged as ORA$OEM_LEVEL_0
. The level 1 incremental backups for use in this strategy are created for use with datafile copies with this label. You can safely implement other backup strategies without interfering with the Oracle suggested backup strategy.
Oracle suggested backup strategies also use tape backups in addition to disk backups, but these are beyond the scope of this section.
The following procedure schedules daily database backups. The strategy uses incremental backups and incrementally applied backups to enable quick recovery to any time in the preceding 24 hours.
To backup your database using the Oracle-suggested disk backup strategy:
On the Database Home page, click Availability to display the Availability subpage.
In the Backup/Recovery section of the Availability page, click Schedule Backup.
The Schedule Backup page appears.
In the Oracle-Suggested Backup section, click Schedule Oracle-Suggested Backup.
The Schedule Oracle-Suggested Backup: Destination page appears. On this page, you select the destination media for the backup, which can be disk, tape, or both.
Select Disk and then click Next.
The Schedule Oracle-Suggested Backup: Setup page appears.
This page describes the backups that are performed each day as part of the disk-based strategy.
Review the information and then click Next.
The Schedule Oracle-Suggested Backup: Schedule page appears.
Choose a Start Date, Time Zone, and Daily Backup Time for the daily backups, and then click Next.
The Schedule Oracle-Suggested Backup: Review page appears.
Database Control displays the backup script that RMAN will run (although you cannot edit the script directly). The script should look similar to the following:
Daily Script: run { allocate channel oem_disk_backup device type disk; recover copy of database with tag 'ORA$OEM_LEVEL_0'; backup incremental level 1 cumulative copies=1 for recover of copy with tag 'ORA$OEM_LEVEL_0' database; }
Click Submit Job.
After taking some time to understand the full range of available backup options described in Oracle Database Backup and Recovery Basics, you may decide to schedule backup tasks beyond those used to implement the Oracle suggested backup strategy.
To schedule miscellaneous backup tasks:
On the Database Home page, click Availability to display the Availability subpage.
In the Backup/Recovery section of the Availability page, click Schedule Backup.
The Schedule Backup page appears.
In the Customized Backup section, select the object that you want to back up. For example, select Tablespaces or Archivelogs.
Click Schedule Customized Backup to start the Schedule Customized Backup wizard.
On the following pages of the wizard, specify details such as objects to back up, and required options and settings. Click Next to proceed to the next page.
The choices presented on these pages are determined by the type of objects being backed up. For more information about using the wizard, click Help on any page.
Click Submit Job.
As part of your backup strategy, you should periodically check whether or not your backups are intact and can be used to meet your recoverability objectives. You can validate your backups in the following ways:
Select specific backup sets or image copies in Database Control and validate them. This technique indicates if a backup exists and can be restored. For this form of validation, use the Manage Current Backups pages as described in "Validating Selected Backups".
Specify database files and let RMAN select backups to use when restoring those files, as it would for an actual restore operation. This technique ensures that your available backups are sufficient to restore the database. For this form of validation, use the Perform Recovery pages as described in "Validating Backups for Restore Operations".
Note:
Validating backups stored on tape can be time-consuming because the entire backup is read from tape.You can set up both forms of validation as scheduled tasks in Database Control. You should incorporate both forms of validation into your backup strategy to ensure that your recoverability goals are met by your available backups.
Validating specific backups checks whether or not these backups exist and can be restored. It does not test whether or not the set of available backups meet your recoverability goals. For example, image copies of datafiles for several tablespaces from your database may exist, each of which can be validated. If there are some tablespaces for which no valid backups exist, however, then you cannot restore and recover the database.
To validate selected backups:
On the Database Home page, click Availability to display the Availability subpage.
In the Availability page, click Manage Current Backups.
The Manage Current Backups page appears.
Use the search features on this page to identify the backups whose contents you want to validate.
Select the check boxes next to each backup of interest in the list of current backups, and click Validate.
The Validate: Specify Job Parameters page appears.
Specify a job name and description, and time settings for starting and repeating the operation, and then click Submit Job.
A message confirms the submission of the job.
Click View Job to display details about the validation.
See Also:
Oracle Database Backup and Recovery User's Guide to learn how to use the VALIDATE
command
You can test whether or not a sufficient set of backups exists that can be used to restore the specified database files. After you specify which tablespaces to restore and, possibly, a time as of which to restore them, RMAN selects a set of backups that contain the needed data. RMAN reads the selected backups in their entirety to confirm that they are not corrupt, but does not produce output files.
Validating the restoration of files tests whether or not the file can be restored given the available backups, but it does not test whether or not all backups of the specified object are valid.
To verify whether or not specified database files can be restored:
On the Database Home page, click Availability to display the Availability subpage.
In the Availability page, click Perform Recovery.
The Perform Recovery page appears.
In the User-Directed Recovery section, select Datafiles or Tablespaces from the Recovery Scope list, depending on what you want to validate.
For the Operation Type, select Restore Datafiles or Restore Tablespaces and then click Recover.
The Perform Object Level Recovery page appears.
Click Add to add tablespaces or datafiles for the validate operation. After making your selections, click Next.
The Perform Object Level Recovery: Restore page appears.
In the Backup Selection section, specify which backups should be restored.
In the Backup Validation section, select Validate the specified backup without restoring the datafiles. Then, click Next.
The Perform Object Level Recovery: Review page appears.
Click Submit Job to run the validation.
The Perform Recovery: Result page appears.
See Also:
Oracle Database Backup and Recovery User's Guide to learn how to use the RESTORE
...
VALIDATE
command