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 usefulbut 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 |
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. |
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:
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 |