Database Reference
In-Depth Information
Step 7. Alter the Database/Tablespaces out of Backup Mode
After you're finished copying all your data files to the backup directory, you need to alter the tablespaces out of
backup mode. This example alters all tablespaces out of backup mode at the same time:
SQL> alter database end backup;
If you're altering your tablespaces into backup mode one at a time, you need to alter each tablespace out of
backup mode after its data files have been copied:
SQL> alter tablespace <tablespace_name> end backup;
If you don't take the tablespaces out of backup mode, you can seriously degrade performance and compromise
the ability to recover your database. You can verify that no data files have an ACTIVE status with the following query:
SQL> alter session set nls_date_format = 'DD-MON-RRRR HH24:MI:SS';
SQL> select * from v$backup where status='ACTIVE';
setting the NLS_DATE_FORMAT parameter appropriately will allow you to see the exact date/time when the data
file was placed into backup mode. this is useful for determining the starting sequence number of the archivelog needed,
in the event that the data file needs to be recovered.
Note
Step 8. Archive the Current Online Redo Log, and Note the Maximum Sequence
Number of the Online Redo Logs
The following statement instructs Oracle to archive any unarchived online redo logs and to initiate a log switch. This
ensures that an end-of-backup marker is written to the archive redo logs:
SQL> alter system archive log current;
Also, note the maximum online redo log sequence number. If a failure occurs immediately after the hot backup,
you need any archive redo logs generated during the hot backup to fully recover your database:
select thread#, max(sequence#)
from v$log
group by thread#
order by thread#;
Step 9. Back Up the Control File
For a hot backup, you can't use an OS copy command to make a backup of the control file. Oracle's hot backup
procedure specifies that you must use the ALTER DATABASE BACKUP CONTROLFILE statement. This example makes
a backup of the control file and places it in the same location as the database backup files:
SQL> alter database backup controlfile
to '/u01/hbackup/O12C/controlbk.ctl' reuse;
The REUSE clause instructs Oracle to overwrite the file if it already exists in the backup location.
 
 
Search WWH ::




Custom Search