What must I backup
description
Transcript of What must I backup
What must I backup? Backup and Recovery Tips
Copyright © Howard Rogers 2001 19/10/2001 Page 1 of 1
What must I backup? The answer to this question depends on another: are you performing hot backups or cold (in other words, is the database up and running when you take the backup, or have you shut it down completely before starting?). If you are performing cold backups, then things are very simple: you back up the entire database without qualification. That means you need to take copies of all Control Files, all Data Files and all Online Redo Logs. You also need to make sure that the Password File (if there is one), the init.ora and the Archived Redo Logs (if you’re taking them) get backed up, too. Strictly speaking, you can always re-create a lost Password File using the orapwd utility; and a lost init.ora can always be reconstructed from an alert log. But in the event of disaster, you really want recovery to be performed with as few hassles as possible –and having to faff around reconstructing small files that could so easily have been backed up in the first place is more trouble than it is worth. If you are performing hot backups, things get rather trickier, because you run up against Rogers’ First Rule of Hot Backups –which is that no part of an Oracle database can be copied hot without the resulting copy containing internal inconsistencies that render those copies useless. (In case you are panicking, there’s a second Rogers’ Rule, too: Oracle provides mechanisms for making internally inconsistent Control Files and Data Files consistent). What that means is this: copies of the Control Files can be taken, because we have the ALTER DATABASE BACKUP CONTROLFILE TO ‘BLAH.BKP’ command to make the hot copies internally consistent. Copies of the Data Files can also be taken, because we have the redo available to make the internally inconsistent copies useable. But copies of the Online Redo Logs are a big no-no, because there is no mechanism available for making inconsistent copies of redo log consistent and useable. Given that the mechanism for fixing up the Data File copies is redo, it follows that you can’t realistically perform hot backups at all unless you have all required redo permanently available –and that means you must be running in archivelog mode, and generating archives. And since those archives are going to be crucial to making your Data File copies useable, you’d better make sure you include them in your backup, too. Likewise, the same comments as I made earlier about backing up the Password File and init.ora are also applicable. Summing all of that up: COLD = Control Files, Data Files, Online Redo Logs, init.ora, Password File, Archived Redo Logs (if present) HOT = Control Files, Data Files, init.ora, Password File, Archived Redo Logs (not optional!), but not the online Logs.