Importance of Backup:
Before you create an Oracle database, decide how to protect the database against potential media failures. If you do not develop a backup strategy before creating your database, then you may not be able to perform recovery if a disk failure damages the datafiles, online redo log files, or control files. Hardware and software can always be replaced, but your data is irreplaceable, hence backup plays the most important role.
Database Backup: The following methods are valid for backing-up an Oracle database:
Export/Import - Exports are "logical" database backups in that they extract logical definitions and data from the database to a file.
Redundancy Set: It is a set of files needed to recover from any sort of database failure, we can create it (redundancy set) using the User managed/RMAN utility backups. It comprises of the following files:
· Backup of the control file and all the data files
· All archived redo logs generated after the last backup was taken
· A duplicate of the online redo log files generated by Oracle multiplexing
· A duplicate of the current control file generated by Oracle multiplexing
· Configuration files such as the server parameter file/parameter file (spfile/pfile), tnsnames.ora, and listener.ora
Golden Rule of Backup: It is recommended that you store the backup files (Redundancy set) separate from the database files, so that if the disk containing database files fails, we can restore the database using redundancy set (backup). Oracle also recommends to keep at least one copy of the entire redundancy set--including the most recent backup--on hard disk.
Cold or Off-line Backups (User Managed) - shut the database down and backup up ALL data, log, and control files.
Hot or On-line Backups (User Managed) - If the database is available and in ARCHIVELOG mode, set the table spaces into backup mode and backup their files. Also remember to backup the control files and archived redo log files.
RMAN Backups - While the database is off-line or on-line, use the "rman" utility to backup the database. (Oracle recommended).
Backup Frequency: It normally depends on the following factors:
· Rate of data change/ transaction rate
· Database availability/ Can you shutdown for cold backups?
· Criticality of the data/ Value of the data to the company
· Read-only table space needs backing up just once right after you make it read-only
· If you are running the database in archive log mode you can backup parts of a database over an extended cycle of days
· If archive logging is enabled one needs to backup archived log files timeously to prevent database freezes
Rman backup is the best option and oracle recommends it.
Advantage of RMAN :
· We no need to COPY data files manually to backup location
· RMAN is fast then User Managed backup
· We don’t put database in backup mode
· We can take backup in single RUN command
· RMAN also takes backup of archive log and delete all archive logs which are backed up.
· We don’t need to take the backup of spfile or controlfile separately; RMAN will take the backup of both.