Oracle® Database Backup and Recovery Advanced User's Guide 10g Release 2 (10.2) Part Number B14191-01 |
|
|
View PDF |
Many sites keep an backup of the database stored on disk in case a failure occurs on the primary database or an incorrect user action such as a DROP
TABLE
requires point-in-time recovery. A datafile backup on disk simplifies the restore step of recovery, making recovery much quicker and more reliable.
Caution: Never make backups, split mirror or otherwise, of online redo logs. Restoring online redo log backups can create two archived logs with the same sequence number but different contents. Also, it is best to use theBACKUP CONTROLFILE command rather than a split mirror to make control file backups. |
One way of creating a datafile backup on disk is to use disk mirroring. For example, you can use the operating system to maintain three identical copies of each file in the database. In this configuration, you can split off a mirrored copy of the database to use as a backup.
RMAN does not automate the splitting of mirrors, but can make use of split mirrors in backup and recovery operations. For example, RMAN can treat a split mirror of a datafile as a datafile copy, and can also back up this copy to disk or tape.
The following procedure shows how to make a split mirror backup with the SUSPEND
/RESUME
functionality. The SUSPEND/RESUME
feature is not required for split mirror backups in most cases, although it is necessary if your system requires the database cache to be free of dirty buffers before the volume can be split.
To make a split mirror backup of a tablespace by using SUSPEND/RESUME:
Start RMAN and then place the tablespaces that you want to back up into backup mode with the ALTER
TABLESPACE
...
BEGIN
BACKUP
statement. (To place all tablespaces in backup mode, you can use ALTER DATABASE BEGIN BACKUP
instead.)
For example, to place tablespace users
in backup mode, start RMAN and run the following commands:
RMAN> CONNECT TARGET SYS/oracle@trgt RMAN> CONNECT CATALOG rman/cat@catdb RMAN> SQL 'ALTER TABLESPACE users BEGIN BACKUP';
Suspend the I/Os if your mirroring software or hardware requires it. For example, enter the following SQL statement:
RMAN> SQL 'ALTER SYSTEM SUSPEND';
Split the mirrors for the underlying datafiles contained in these tablespaces.
Take the database out of the suspended state:
RMAN> SQL 'ALTER SYSTEM RESUME';
Take the tablespaces out of backup mode. For example, enter:
RMAN> SQL 'ALTER TABLESPACE users END BACKUP';
You could also use ALTER DATABASE END BACKUP
to take all tablespaces out of backup mode.
Start an RMAN session and then catalog the user-managed mirror copies as datafile copies with the CATALOG
command. For example, enter:
RMAN> CATALOG DATAFILECOPY '/dk2/oradata/trgt/users01.dbf'; # catalog split mirror
Back up the datafile copies. For example, assuming that you have configured automatic channels, run the BACKUP
DATAFILECOPY
command at the prompt:
RMAN> BACKUP DATAFILECOPY '/dk2/oradata/trgt/users01.dbf';
When you are ready to resilver the split mirror, first use the CHANGE
...
UNCATALOG
command to uncatalog the datafile copies you cataloged in step 6. For example, enter:
RMAN> CHANGE DATAFILECOPY '/dk2/oradata/trgt/users01.dbf' UNCATALOG;
Resilver the split mirror for the affected datafiles.