In this conclusion to a three-part article series on backing up and recovering an Oracle database, you'll learn how to perform manual and automatic backups, and how to recover database objects. This article excerpted from chapter 30 of the book Beginning PHP and Oracle: From Novice to Professional, written by by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).
Now that you have multiplexed your online redo log files, multiplexed your control files, and enabled ARCHIVELOGmode in your database, you are ready for your first full backup of the database. Any media recovery operation requires at least one full backup of the database, even if you are not inARCHIVELOGmode. (Remember that an instance failure requires only the online redo log files for recovery.) You can back up manually, or schedule an automatic backup at regular intervals. We cover both of these scenarios in the following sections.
Whether you are using Linux or Windows as your operating system, performing a manual backup is very straightforward. Under Linux, start with the Applications menu under Gnome, or the K menu if you’re using KDE, select Oracle Database 10g Express Edition ➤ Backup Database. For Windows, from the Start menu, select Programs ➤ Oracle Database 10g Express Edition ➤ Backup Database. In both cases, a console window launches so that you can interact with the backup script. This interaction occurs only if you are not in ARCHIVELOGmode. The backup script warns you that Oracle will shut down the database before a full backup can occur.
For a full backup under Linux, the output in the console window looks similar to if not exactly like this:
-------------------------------------------- Doing online backup of the database. Backup of the database succeeded. Log file is at /usr/lib/oracle/xe/oxe_backup_current.log. Press ENTER key to exit --------------------------------------------
The script output identifies the log file location. Oracle keeps the two most recent log files. The previous log file is at this location:
The log file contains the results of one or more RMAN sessions. After the backup completes, RMAN deletes all obsolete backups. By default, Oracle only keeps the last two full backups. If you are using Windows as your host operating system, the backup logs reside in these locations:
Scheduling automatic backups is very straightforward. Oracle Database XE provides a script for each platform that you can launch using your favorite scheduling program, such as the cronprogram under Linux or the Scheduled Tasks wizard under Windows.