Performing a Whole Database Backup

Whole backups of a database include the complete contents of all data files of the database, plus the control file, archived redo log files, and server parameter file. With these files, you can perform a complete recovery.

While whole database backups can be an important element in your overall backup strategy, they are also a required step in some situations, such as when you enable or disable ARCHIVELOG mode (see "Configuring Recovery Settings"). This section explains how to make whole database backups, both offline and online, to disk. Typically, you want to perform online backups to maximize database availability.

To perform a whole database backup when the database is open:

  1. Connect RMAN to the target database as described in "Connecting to the Target Database Using RMAN."

  2. Ensure that your database is in ARCHIVELOG mode as described in "Enabling Archiving of Redo Log Files."

    You can make online backups only if your database is running in ARCHIVELOG mode.

  3. Back up the database, along with archived redo logs by using the following command:

    BACKUP DATABASE PLUS ARCHIVELOG;
    

This backup is created on the default device that you configured for storing backups. If you did not configure a default device, then the backup is created in the fast recovery area. RMAN uses a default format while naming the backup sets that comprise the backup.

To perform a whole database backup when the database is closed:

  1. Connect RMAN to the target database as described in "Connecting to the Target Database Using RMAN."
  2. Shut down the database and then mount the database using the following commands.
    SHUTDOWN IMMEDIATE;
    STARTUP MOUNT;
    
  3. Back up the database using the following command:
    BACKUP DATABASE;
    

    While backing up a database that is closed, you need not back up the archived log files because the database is in a consistent state at the time of backup. Therefore, no media recovery is required if you restore the database from this backup.

  4. Open the database after the backup is complete.
    ALTER DATABASE OPEN;
    

See Also: