Oracle9i User-Managed Backup and Recovery Guide Release 2 (9.2) Part Number A96572-01 |
|
This chapter introduces database concepts that are fundamental to user-managed backup and recovery.
This chapter includes the following topics:
See Also: Oracle9i Backup and Recovery Concepts for a conceptual overview of essential backup and recovery concepts |
User-managed backup and recovery is any strategy in which Recovery Manager (RMAN) is not used as the principal backup and recovery tool. The basic user-managed backup strategy is to make periodic backups of datafiles and archived logs with operating system commands.
The basic user-managed procedure for recovering from a media failure is as follows:
RECOVER
statement.Oracle Corporation recommends using RMAN as the foundation of an enterprise backup and recovery strategy, but user-managed methods (that is, methods that do not involve RMAN) are also just as effective. Note that some features such as block media recovery can only be performed with RMAN.
The following are possible circumstances in which you may choose to employ user-managed methods rather than use RMAN:
RECOVER
command.Oracle Corporation supports user-managed backup and recovery as a viable alternative to RMAN.
This section contains these topics:
User-managed backups can be either logical or physical. You can use the Export utility to make backups of logical objects such as tables, views, and stored procedures, and use the Import utility to restore these objects.
If you do not use RMAN, then you can use operating system utilities to make physical backups. A physical backup is a backup of an Oracle database file or archived redo log located on the operating system. Note that these files can either be manually-managed database files or Oracle-managed files. If you use the Oracle Managed Files feature, then Oracle names the files for you and also deletes them for you when you drop a tablespace. From the point of view of backup and recovery, Oracle managed files are no different from user-managed files.
The following table illustrates the main types of physical backups and the non-RMAN methods for performing these backups.
See Also:
|
The basic method for taking user-managed backups of the whole database is as follows:
cp
command to back up datafiles and archived redo logs (refer to "Making User-Managed Backups of the Whole Database" for procedures).cp
command to back up configuration files (refer to"Making User-Managed Backups of Miscellaneous Oracle Files" for procedures).
You can use RMAN or operating system commands to make an inconsistent backup or a consistent backup. An inconsistent backup is a backup of one or more database files made while the database is open or after the database has not been shut down normally. A consistent backup is a backup of one or more database files that you make after the database has been shut down normally. Unlike an inconsistent backup, a consistent backup does not require recovery after it is restored.
A consistent whole database backup is the only valid backup option for databases running in NOARCHIVELOG
mode, because otherwise redo needed for recovery is not available. In NOARCHIVELOG
mode, Oracle overwrites redo records without archiving them first.
If you run the database in ARCHIVELOG
mode, then you can back up database files while the database is open. These backups are inconsistent, but as long as you have the necessary archived redo logs you can recover these backups. You can either take a tablespace offline and back up its datafiles, or perform an online backup. An online backup occurs when the tablespace is still online. To perform an online backup, you must begin and end the backup with SQL statements that place the tablespace in and take the tablespace out of backup mode.
Some third-party tools allow you to mirror a set of disks or logical devices, that is, maintain an exact duplicate of the primary data in another location, and then split the mirror. Splitting the mirror involves separating the copies so that you can use them independently.
Using the SUSPEND
/RESUME
functionality, you can suspend I/O to the database, then split the mirror and make a backup of the split mirror. By using this feature, which complements the online backup functionality, you can quiesce the database so that no new I/O can be performed. You can then access the suspended database to make backups without I/O interference.
The best method for backup verification is to perform a test restore and recover of the database to another location. If you successfully perform this operation, then you know that the backup is valid.
You can also use the DBVERIFY utility to test backups for corruption. DBVERIFY is an external command-line utility that performs a physical data structure integrity check on offline datafiles. Use DBVERIFY primarily when you need to ensure that a backup datafile is valid before it is restored or as a diagnostic aid when you have encountered data corruption problems. The name and location of DBVERIFY is dependent on your operating system (for example, dbv
on Sun/Sequent systems).
When a media failure occurs that damages datafiles, you must restore backups of the affected datafiles using operating system commands and then perform recovery with the SQL*Plus RECOVER
command. You can either restore only some datafiles and perform recovery of the tablespaces containing the restored datafiles, or restore and recover the entire database. You should keep careful records of your backups so that you know the original locations of the datafiles as well as the locations of the backups.
To begin media recovery operations when your database is running in ARCHIVELOG
mode, use the SQL*Plus RECOVER
command. The two basic types of media recovery are complete recovery, in which all redo generated on the database is applied, and incomplete recovery, in which not all the existing redo is applied. Incomplete recovery is only valid for restore and recovery of the entire database. A special procedure for performing incomplete recovery of an individual tablespace is called tablespace point-in-time recovery (TSPITR).
The basic user-managed restore and recovery strategy is as follows:
RECOVER
command to recover the files, as described in "Performing User-Managed Media Recovery: Overview".The archiving mode of the database determines the type of recovery that you can perform. For example, if a database is in NOARCHIVELOG
mode and a media failure damages some or all of the datafiles, then usually the only option for recovery is to restore the most recent consistent, whole database backup and open it.
The disadvantage of NOARCHIVELOG
mode is that to recover the database from the time of the most recent full backup up to the time of the media failure, you have to reenter manually all of the changes executed in that interval. If your database is in ARCHIVELOG
mode, and the redo logs covering this interval are available as archived log files or online log files, then you can use complete or incomplete recovery to reconstruct your database, thereby minimizing the number of lost changes.
User-managed tablespace point-in-time recovery (TSPITR) enables you to quickly recover one or more tablespaces (other than the SYSTEM
tablespace) to a time that is different from that of the rest of the database.
User-managed TSPITR is most useful for recovering the following:
DROP
TABLE
or TRUNCATE
TABLE
operation.
|
Copyright © 2002 Oracle Corporation. All Rights Reserved. |
|