Backup for Files - How do I backup Oracle databases?

Written By Tami Sutcliffe (Super Administrator)

Updated at March 31st, 2021

Overview

We support backup of Oracle10gR2 databases via the flash recovery area (new to release 2 of Oracle 10g). For older versions of Oracle you can use one of the following techniques:

  • Use Volume Shadow Copy and and the backup mode for Oracle tablespaces for live database backups
  • Use Volume Shadow Copy and temporarily shutdown Oracle (1-2 minutes) during snapshot creation (Windows Server 2003 only)
  • Perform physical backups of your database using the local file system as the storage media (via RMAN), and then backup the files generated by the physical backup
  • Perform logical backups (exports) of your database, and then backup your logical database backups (small databases only).

Instructions

Flash Recovery Area Method (Oracle10g Release 2 only):

  1. Configure the Oracle flash recovery area. See the Oracle Database Backup and Recovery Basics Book, section 1.6, section 2.3.2, and section 3.5.
  2. Configure scheduled backups of your databases to the flash recovery area (see section A.1 in the above book).
  3. Configure online backup to begin after Oracle finishes backing up to the flash recovery area. For example, if Oracle is backing up to the flash recovery area at 2:00am, and the operation takes no longer than 30 minutes (depends on your database size and how much of it changes between backups), you should start the online backup at 3:00am (allowing for extra time in case the Oracle backup takes longer than expected).

Live Volume Shadow Copy Method (Windows Server 2003 only):

This method will allow you to reliably and efficient make a live (online) backup of your Oracle databases. The outline of this solution is as follows: before the VSS snapshot is taken, a script will execute SQL on your Oracle server that places all of your tablespaces into backup mode. Then the VSS snapshot is taken, effectively creating an exact logical copy of your disk frozen in time. A script then executes SQL on your Oracle server that takes all tablespaces out of backup mode. Because it does not take very long to create the VSS snapshot (around 60 seconds) the overhead of placing all tablespaces into backup mode at once is minimal. Here are more detailed instructions:

  1. Write a batch file that executes the following SQL on your Oracle server: "ALTER TABLESPACE xyz BEGIN BACKUP;" (If you have more than one tablespace it should place all tablespaces into backup mode.) Call this batch file "oracle-before-vss.bat"
  2. Write a batch file that executes the following SQL on your Oracle server: "ALTER TABLESPACE xyz END BACKUP;" Call this batch file "oracle-after-vss.bat"
  3. Open the backup manager to the Options page. Go to the Backup tab. Specify the full pathname of "oracle-before-vss.bat" for the Preinit Stop Scripts option. Use the full pathname of "oracle-after-vss.bat" for the Postinit Start Scripts.
  4. Use the Folders page to add all datafiles in your tablespace and your control file (.bkf file) to the data that should be backed up. This data must be on a local drive.

Offline Volume Shadow Copy Method (Windows Server 2003 only):

This method will only be viable if you are able to shut down your database for a few minutes each time a backup is performed (it only needs to be offline while the VSS snapshot is created). If you are using Oracle 10g Release 2 you should use the flash recovery area method as described above. If you want to keep your database online during the backup, follow the instructions in the previous section above.

The idea with this technique is to shutdown your databases before online backup begins. When online backup begins it will use VSS to create a snapshot of the filesystem, which will ensure that it will backup the database in a consistent state. Once the VSS snapshot has been created at the start of backup it is safe to restart the databases, as the operation of the databases will not interfere with the VSS snapshot (and thus the integrity of the backup).

  1. Configure online backup to backup your database control files and all data files in all tablespaces in your database. Note that you do not need to backup the redo log files, because you will be backing up a consistent snapshot of your entire database. Incremental delta calculation will be automatically performed, so there is no need to deal with the complexity of periodic full backups and daily incremental backups.
  2. Go to the Backup tab of the Options Page.
  3. For the "Preinit Stop Services" option specify something like: "OracleService<SID1>; OracleService<SID2>" (where <SID1> and <SID2> are the SIDs of your databases).
  4. For the "Postinit Start Services" option specify the same thing as "Preinit Stop Services"

You should test this configuration to confirm that the databases are shutting down as expected, the VSS snapshot is being created, and the databases are restarted after the backup begins.

Logical Backups (Database Export) Method:

This method is recommended only for small databases, as the entire database will have to be backed up each day. The general technique is to schedule an automated export of your database, and then backup the files generated by the export. Additional information on how to export your data can be found in the Oracle Utilities Book, in the export section of the book, in the import/export FAQ, and in this article on the data pump.

As the entire database will be uploaded after each export, you should set a maximum number of historical versions to keep. To do this, navigate to the Folders page in the backup manager, select the Folder containing the exported database files, right click it and choose Properties, and then change the Maximum Number of Versions to Keep setting to something appropriate (based on the amount of disk space you are willing to use for historical database data).

Notes