Lesson 4 | Closed Database Backups |
Objective | List the Required Steps to Prepare for a Closed Database Backup. |
Steps to Prepare Closed Database Backup
Closed or Cold Database Backup
A
closed or cold database backup is an operating system backup of all the datafiles, redo log files, control file(s), parameter files, and the password file that constitutes an Oracle database.
Before a backup is made there are several steps you must take:
- Perform a clean shutdowns
- Get an up-to-date list of all files
- Locate files
Perform Clean shutdown
First, all datafiles must be closed with a clean shutdown procedure. If a database instance is aborted, you have to reopen it and shut it down cleanly by issuing the command SHUTDOWN IMMEDIATE
or SHUTDOWN NORMAL.
Without a clean shutdown of the database, the backup files are inconsistent with respect to each other. This inconsistency forces Oracle to do an instance recovery on the first startup after the backup is restored. In certain failure scenarios,
this automatic recovery may not be successful, and the DBA may be forced to troubleshoot. It is best to avoid this situation by ensuring the database is shut down cleanly before backup.
Get List of all files
Second, you must get an up-to-date list of all the files for backup. Oracle datafiles belonging to a single database can reside on several disks. In order to have a complete copy of the database for database recovery, you must decide which files you need to back up.
Typically you must locate and copy the following files:
Oracle Database File | File Description |
Datafiles | Large binary file(s) containing data, indexes, and otherdatabase objects |
Redo logs | Small, re-usable binary files that continuously receive database change information in the form of "redo entries" |
Control files | Small binary file(s) containing database structure information |
Parameter files | Small text file(s) containing instance startup parameters |
The password file | Small, encrypted binary file containing DBA-level passwords |
Locate Files
Next, you must determine where these files are located. Since datafiles, redo logs, and control files are database files, you can obtain information about these files by querying the data dictionary views using SQL*Plus or Server Manager. The following table gives you a list of the data dictionary views you can use to find information about the database files that you must backup:
Data dictionary views | Function |
V$DATAFILE | Contains a list of the names and status of all datafiles |
V$CONTROLFILE | Contains the names of all control files |
V$LOGFILE | Contains the names of all redo log files |
DBA_DATA_FILES | Contains a list of all datafiles and their respective tablespaces |
The other two files, the parameter file and password file, are operating system files and are usually located in the file system of the machine on which the database server is started. A parameter file is also called init.ora with the naming convention initSID.ora. You can usually find it in ORACLE_HOME\DBS. On an NT platform, the parameter and the password files for a database named P look like this:
Parameter file:
D:\data\database\initP.ora
Password file: D:\orant\database\pwdP.ora
The Slideshow below demonstrates how to use the data dictionary views to retrieve the required information.
Obtain Database Files Information
If you use SQL*Plus, you must log in as System or Sys, or as a user with DBA privileges.
The next lesson shows you how to perform a closed database backup.