You are on page 1of 1

Hot Backup

An online backup or hot backup is also referred to as ARCHIVE LOG backup. An onl
ine backup can only be done when the database is running in ARCHIVELOG mode and
the database is open. When the database is running in ARCHIVELOG mode, the archi
ver (ARCH) background process will make a copy of the online redo log file to ar
chive backup location.
An online backup consists of backing up the following files. But, because the da
tabase is open while performing a backup, you have to follow the procedure shown
in Figure 3.2 to backup the files:
Data files of each tablespace
Archived redo log files
Control file
Init.ora and config.ora files
Figure 3.2 Steps for hot backup.
The general steps involved in performing hot backup are shown in Figure 3.2. The
se general steps are used in writing hot backup scripts for Unix and Windows NT.
The steps in Figure 3.2 are explained as follows.
Step 1Put the tablespace in the Backup mode and copy the data files.
Assume that your database has two tablespaces, USERS and TOOLS. To back up the f
iles for these two tablespaces, first put the tablespace in backup mode by using
the ALTER statement as follows:
SQL>alter tablespace USERS begin backup;
After the tablespace is in Backup mode, you can use the SELECT statement to list
the data files for the USERS tablespace, and the copy (cp) command to copy the
files to the backup location. Assume that the USERS tablespace has two data file
susers01.dbf and users02.dbf.
SQL>select file_name from dba_data_files
where tablespace_name='USERS';
$cp /u01/oracle/users01.dbf /u10/backup
$cp /u01/oracle/users01.dbf /u10/backup
The following command ends the backup process and puts the tablespace back in no
rmal mode.
SQL>alter tablespace USERS end backup;
You have to repeat this process for all tablespaces. You can get the list of tab
lespaces by using the following SQL statement:
SQL>select tablespace_name from dba_tablespaces;

You might also like