Chapter 4.Once the database is operational, your most important responsibility is to ensure the availability of the data in that database. You need to develop a backup and recovery plan in advance. This chapter describes the various situations you may encounter and introduces the basic tools you can use to recover your data. Chapter 16, gives the detailed syntax for using the tools described in this section. 4.1. Types of BackupsThe time to plan for a recovery is before you need to recover data. There are several ways in which your data can be backed up, and each way has its limitations. No two installations will have the same requirements, nor will they necessarily back up data in the same way. In Table 4.1, we list the most common scenarios and show the appropriate backup strategies. 4.1.1. Physical BackupsA physical backup of the database is one in which the datafiles are backed up. Most installations copy the datafiles to tape, but copies can be made to disk or to another computer system. Unless otherwise noted, we'll assume in our discussion that the datafiles have been copied to tape. 4.1.1.1. BenefitsWith physical backups, the recovery process is usually faster than with logical backups, since you only need to restore files from the tape backup. 4.1.1.2. LimitationsYou can usually only restore to a computer system that's running the same operating system as the one from which the backups were made. There may also be limitations on operating system and Oracle release levels. The backup process doesn't take into account the database objects that are stored within the database. The granularity of the recovery in this case is the entire database. 4.1.2. Logical BackupsA logical backup is one in which individual database objects are backed up. The information is stored in a way that allows objects to be created and data inserted into tables. 4.1.2.1. BenefitsWith logical backups, individual objects can be recovered separately. You can usually restore to different computer systems, operating systems, and release levels. 4.1.2.2. LimitationsWith logical backups, as objects are being created and rows inserted through the SQL buffer, indexes have to be rebuilt as well. Since individual tables can be recreated through these backups, you need to be careful to ensure that referential integrity rules are maintained. 4.1.3. Archivelog ModeArchivelog is an optional mode for the database. You can set it with the INIT.ORA parameter ARCHIVELOG or in the ALTER DATABASE statement. In this mode, the ARCH background process copies the contents of each redo log to an archive file at the time of a log switch. Be sure to allocate enough redo logs so that ARCH has sufficient time to copy the redo log to the archive file before the redo log is reused. Archivelog mode comes at a cost of increased overhead. The ARCH process reads from the most recently used redo log at the same time that the LGWR process is writing to the current redo log.
4.1.3.1. BenefitsThe contents of the archive files are used in conjunction with a physical backup to roll the database forward during recovery. 4.1.3.2. LimitationsIf the database is in archivelog mode and the ARCH process cannot copy the redo logs to the archive files, the database will hang until ARCH is successful.
4.1.4. Incremental BackupsAn incremental backup makes a copy only of what has changed since the last backup. With physical backups, this means either the datafiles or the individual data blocks that have changed. With logical backups, this means the objects that have been changed. 4.1.4.1. BenefitsWith incremental backups, the amount of tape or disk storage is less than that needed for a full backup. 4.1.4.2. LimitationsThere are several limitations on performing incremental backups:
|
|