RelationalDBDesign RelationalDBDesign

Physical Backups  «Prev  Next»
Lesson 8 Performing an open database backup
Objective List the steps to perform an open database backup.

Steps to perform an open Database Backup

For a business that requires constant access to its data, it is mandatory that backups be performed while the database is operating. Oracle provides full access to the database, allowing modifications to all data, while the online database backup is operating. These "hot" backups can then be used for recovery as effectively as "cold" backups. There are several steps to follow to successfully perform an open database backup.

Identify the datafiles

Before beginning a backup on an entire tablespace, identify all of the tablespace's datafiles using the DBA_DATA_FILES data dictionary view. If a specific datafile is to be backed up, use the fully specified filename of the datafile.

Mark the beginning of the tablespace

Mark the beginning of the online tablespace backup by issuing the ALTER TABLESPACE... BEGIN BACKUP command.
This command causes a checkpoint and freezes the datafile header. This freeze prevents the sequence number in the datafile header from changing. In case a future recovery on the datafile is needed, logs are applied from the backup start time (as found in the frozen datafile header). If the DBA forgets to mark the beginning of an online tablespace backup properly, (for example, forgetting to enter the BEGIN BACKUP command), the backup datafiles will not be useful for recovery operations unless the tablespaces being backed up are read-only tablespaces.

Datafile structure

The first block of each datafile is called the datafile header. It contains critical information used to maintain the overall integrity of the database. One of the most critical pieces of information in this header is the checkpoint structure. This is a logical timestamp that indicates the last point at which changes were written to the datafile. This timestamp is critical during an Oracle recovery process as the timestamp in the header determines which redo logs to apply in bringing the datafile to the current point in time.

Back up the datafiles

The DBA uses the operating system command COPY to copy all datafiles in the tablespace to the back up storage.

Mark the end of the tablespace

To avoid performing any unnecessary media recovery, the DBA must end an open database backup properly. Mark the end of the tablespace backup by issuing the ALTER TABLESPACE...END BACKUP command. If you forget to indicate the end of an online tablespace backup and an instance failure or SHUTDOWN ABORT happens, Oracle will assume that media recovery is necessary at the next instance start up. Repeat the above steps for all tablespaces, including SYSTEM, temporary tablespaces, and rollback segment tablespaces.
During the process of open database backup, the database remains available for normal transactions. When a datafile is in backup mode, more redo records may be generated because the LGWR writes to the redo logs and the block images of the changed blocks in backup mode, instead of just writing the row information. The time between the commands ALTER TABLESPACE...BEGIN BACKUP and ALTER TABLESPACE...END BACKUP must be minimized. Therefore, you should perform a backup of one tablespace at a time.
The SlideShow below demonstrates how to perform an open database backup.

Perform Open Database Backup
The next lesson explains the methods and commands used to back up a control file.

Performing Backup - Quiz

Click the Quiz link below to review your understanding of basic database backup concepts.
Performing Backup - Quiz