Previous | Table of Contents | Next

Page 597

A listing of all database data files can be obtained with this SQL statement:

SELECT FILENAME FROM DBA_DATA_FILES;

Oracle will return a query result listing all of the OS-level filenames used for tablespaces within the database.

If the database is shut down normally, the redo logs will contain no information that Oracle needs. Technically, they do not need to be backed up for your cold backup to be useful—but you'd still have to create new ones during recovery, so you may want to back them up anyway. This SQL statement will result in a listing of redo log files:

SELECT MEMBER FROM V$LOGFILE;

Archived logs are usually automatically written out by the archiver process to a single directory. The log_archive_dest keyword in the init.ora file is set to the destination directory where the archived logs will be written. You can also use this SQL statement to obtain the same information:

SELECT VALUE FROM V$PARAMETER WHERE NAME='log_archive_dest';
TIP
In a large database, keeping track of individual files can be very time consuming and prone to error. Your best defense against both problems is a good organizational structure of files. When possible, I like to have either a single directory or a very small set of directories that contain files exclusively for a particular instance. Here's an example:
/opt/app/oracle/database_files/prod/config
     # Storage for init.ora & config.ora
/opt/app/oracle/database_files/prod/archives
     # Archived logs
/opt/app/oracle/database_files/prod/slice1/data
     # Data files on slice 1
/opt/app/oracle/database_files/prod/slice2_data
     # Data files on slice 2
/opt/app/oracle/database_files/prod/slice1/control
     # Control files on slice 1
/opt/app/oracle/database_files/prod/slice2/control
     # Control files on slice 2
/opt/app/oracle/database_files/prod/slice3/redo
     # Redo logs on slice 3
/opt/app/oracle/database_files/prod/slice4_redo
     # Redo logs on slice 4

With this organization, all you really need to do is back up the /opt/app/oracle/database_files/prod directory to back up all the files comprising the prod instance. The slice1 through slice4 directories would likely reside on different physical disks to provide performance-enhancing striping, as well as redundancy for the control and redologs.

The backup can be made using standard OS backup commands or utilities.

Page 598

Shutting Down OracleYou don't need to do anything special here. Just shut down the database normally. Do not use SHUTDOWN ABORT. Use either SHUTDOWN NORMAL or SHUTDOWN IMMEDIATE.

Performing the BackupHere's where the rubber meets the road. With the list of files you have either on hand or from step #1 (Building Your Filename List), you're ready to back up the database. Using your OS-level tool of choice, you need to back up the files, in any order, to a backup device (usually tape).

For UNIX, the tools of choice tend to be tar, cpio, or vdump, with tar being the most universal.

VMS DBAs will usually use either the BACKUP or COPY utilities. BACKUP is usually preferred because it offers some degree of file validation, whereas COPY does not.

Starting OracleStart up Oracle as you normally would.

TIP
Although cold backups tend to be time consuming, you have several options to help reduce the time your database must be down.

If you have lavish amounts of disk space, you can simply perform a file copy of the configuration file(s), data files, control files, redo logs, and archived logs to a temporary area on disk. Then you can start up your database again and then start the backup of the temporary area to tape. You'll need at least twice the amount of disk space needed for the database, but it will dramatically decrease the time needed to do your backup.

Consider adding multiple tape units to your system. With many OSs, you can run multiple instances of the backup program at the same time. This allows you to back up several different areas of the data-base at once. In practice, four tape drives will usually back up a database in one-third the time as a single tape drive.

Desktop-Driven Cold Backups

Remember when computers were completely text-driven, using arcane commands that made little sense? Just as the GUI interface has simplified word processing, spreadsheets, email, and even system administration, it has provided many useful capabilities to the DBA. Oracle's Backup Manager serves as a one-stop-shopping utility for Oracle backups. What used to be done with scripts and numerous OS-based utilities can now be done with a single program supplied and supported by Oracle. Figure 24.1 shows the versatile yet simple interface of the Backup Manager.

Backup Manager's interface is fairly simple to use. Please note that the Backup Manager dialog box may be slightly different than what you see in Figure 24.1. It may only provide you with options that are applicable to the database state (running/not running, archive/noarchivelog mode).

Page 599

FIG. 24.1
Oracle's Backup
Manager for
Windows NT.

The only work you need to do outside of this utility is to determine where to store your offline backup. Backup Manager will allow you to back up either to a directory on disk or to a tape drive. Notice that in the lower-left corner of Figure 24.1, Backup Manager tells you exactly how much space will be needed to back up the database. You'll need either a directory or a tape device with enough capacity for the backup function to work properly.

Performing a cold physical backup involves the following steps:

  1. Be sure the database is up and running normally. (See the following Caution.)

  2. Start Backup Manager.

  3. Choose the Offline - Full Database option from the Select Backup Type box.

  4. Choose to back up either to disk or tape by selecting either Tape or Disk in the Destination box. If you back up to tape, you also need to indicate which tape device to use. Otherwise, you need to indicate which directory you would like to back up to.

  5. Click on the Backup button. Backup Manager does the rest.

  6. Restart the database.

CAUTION
Do not back up to the same physical device(s) that your database resides on.

CAUTION
Because cold backups are usually made while the database is offline, it may seem odd to make sure that the database is running in step #1. This is because Backup Manager needs to access the database before
it shuts it down for a backup so it can build a list of database files it needs to back up. Starting Backup Manager without the database running may result in an incomplete backup set.

Previous | Table of Contents | Next