| ||||||||
|
|
Whether Oracle DBA make consistent or inconsistent backups depends on a number of factors. If your database must be open and available all the time, then inconsistent backups are your only option. If there are recurring periods of minimal use, then Oracle DBA may decide to take regular consistent backups of the whole database and supplement them with online backups of often-used tablespaces.
Oracle makes the control files and datafiles consistent to the same SCN during a database thread checkpoint. The only tablespaces in a consistent backup that are allowed to have older SCNs are read-only and offline normal tablespaces, which are still consistent with the other datafiles in the backup because no changes have been made to them. If the checkpoint SCN in the datafile header matches the offline-start SCN in the control file, then Oracle knows that the datafile needs no recovery.
The important point is that Oracle DBA can open the database after restoring a consistent whole database backup without applying redo because the data is already consistent: no action is required to make the data in the restored datafiles correct. Hence, you can restore a year-old consistent backup of your database without performing media recovery and without Oracle performing instance recovery.
The only way to make a consistent whole database backup is to shut down the database with the NORMAL, IMMEDIATE, or TRANSACTIONAL options and make the backup while the database is closed. If a database is not shut down cleanly, for example, an instance fails or Oracle DBA issue a SHUTDOWN ABORT statement, then the database's datafiles are always inconsistent--unless the database is a read-only database. Instance recovery will be required at open time.
A consistent whole database backup is the only valid backup option for databases operating in NOARCHIVELOG mode, because otherwise redo will need to be applied to create consistency. In NOARCHIVELOG mode, Oracle does not archive the redo logs, and so the required redo logs may not exist on disk.
If the database must be up and running 24 hours a day, 7 days a week, then you have no choice but to perform inconsistent backups of a whole database. For example, a backup of an offline tablespace in an open database is inconsistent with other tablespaces because portions of the database are being modified and written to disk while the backup of the tablespace is progressing. The datafile headers for the online and offline datafiles may contain inconsistent SCNs. Oracle DBA must run your database in ARCHIVELOG mode to make online backups of online datafiles.
If you run the database in ARCHIVELOG mode, then Oracle DBA can construct a whole database backup using backups of online datafiles taken at different times. For example, if your database contains seven tablespaces, and if Oracle DBA back up the control file as well as a different tablespace each night, then in a week you will back up all tablespaces in the database as well as the control file. You can consider this staggered backup as a whole database backup.
If you run the database in NOARCHIVELOG mode, then only back it up when you have closed it cleanly with the IMMEDIATE, NORMAL, or TRANSACTIONAL options. Inconsistent whole database backups of databases running in NOARCHIVELOG mode are usable only if the redo logs containing the changes made prior to the backup are available when you restore it--an unlikely occurrence.
The reason that NOARCHIVELOG inconsistent backups are not recommended is that the datafile headers of the backed up files contain different SCNs (a normal shutdown guarantees the consistency of these SCNs), and because the database is in NOARCHIVELOG mode, no archived redo logs are available to apply the lost changes. For this reason, RMAN does not allow Oracle DBA to back up a database that has been running in NOARCHIVELOG mode and shut down abnormally because the backup is not usable for recovery.
The basic guideline is: if you run your database in NOARCHIVELOG mode, always have a backup that is usable without performing any recovery. This aim is defeated if you need to apply redo from logs to recover a backup.
ALTER SYSTEM ARCHIVE LOG CURRENT;
When the database is mounted, open, or closed, you can run the following SQL statement to force Oracle to archive all noncurrent redo logs:
ALTER SYSTEM ARCHIVE LOG ALL;
When the database is mounted, open, or closed, Oracle DBA can run the following SQL statement to archive a specific group, where integer is the number of the group:
ALTER SYSTEM ARCHIVE LOG GROUP integer;
More Tutorials on Oracle dba ...
Want to share or request Oracle Tutorial articles to become a Oracle DBA. Direct your requests
to
webmaster@oracleonline.info |
|||||||
|---|---|---|---|---|---|---|---|---|