Home » Oracle Basics » 05 - Oracle DBA - Users, Backup, and Export
5

Backups

Creating backups for the database

Oracle databases may be backed up in several different ways. An Export is a logical backup that saves data, logical definition and structures to a file. An off-line back up or cold backup is a complete backups that involves shutting down the database and then backing up all data, logs, and control files. A Hot or On-line Backup sets tablespaces into backup mode and backs up associated datafiles. These may be performed only if the database is in archivelog mode. The DBA should backup control files and archive redo logs after an online backup. The RMAN utility may be used to backup a database that is either online or offline. A wise DBA would use a different type of backup for different contexts and test recovery from backups.

The term restoring refers to copying datafiles from tape drives, zip drives and so on onto the database's datafile location to replace corrupted datafiles. This is a matter of copying '.dbf' datafiles using OS utilities. Suppose a database crashes at 5:00pm Sunday and the previous backup was taken at 5:00am Saturday. The DBA would restore the corrupted datafiles from the old backup. What about all modifications from Saturday morning to Sunday afternoon? The DBA performs Recovery to bring the database up to date. Recovery involves executing the redo logs (these contain all the commands applied to the database up to the current time) to the database and bringing it up to date or rolling it forward :

connect SYS as SYSDBA
RECOVER DATABASE UNTIL TIME '2006-12-10:17:00:00'
USING BACKUP CONTROLFILE;