Database Reference
In-Depth Information
Step 3. Identify Which Files Need to Be Backed Up
For this step, you only need to know the locations of the data files:
SQL> select name from v$datafile;
When you get to step 5, you may want to consider altering tablespaces one at a time into backup mode. If you
take that approach, you need to know which data files are associated with which: tablespace:
select tablespace_name, file_name
from dba_data_files
order by 1,2;
Step 4. Note the Maximum Sequence Number of the Online Redo Logs
To successfully recover using a hot backup, you require, at minimum, all the archive redo logs that were generated
during the backup. For this reason, you need to note the archivelog sequence before starting the hot backup:
select thread#, max(sequence#)
from v$log
group by thread#
order by thread#;
Step 5. Alter the Database/Tablespaces into Backup Mode
You can put all your tablespaces into backup mode at the same time, using the ALTER DATABASE BEGIN BACKUP
statement:
SQL> alter database begin backup;
If it's an active OLTP database, doing this can greatly degrade performance. This is because when a tablespace is
in backup mode, Oracle copies a full image of any block (when it's first modified) to the redo stream (see the section
“Understanding the Split-Block Issue,' later in this chapter, for more details).
The alternative is to alter only one tablespace at a time into backup mode. After the tablespace has been altered
into backup mode, you can copy the associated data files (step 6) and then alter the tablespace out of backup mode
(step 7). You have to do this for each tablespace:
SQL> alter tablespace <tablespace_name> begin backup;
Step 6. Copy the Data Files with an OS Utility
Use an OS utility (Linux/Unix cp command) to copy the data files to the backup location. In this example all the data
files are in one directory, and they're all copied to the same backup directory:
$ cp /u01/dbfile/O12C/*.dbf /u01/hbackup/O12C
 
Search WWH ::




Custom Search