Documente Academic
Documente Profesional
Documente Cultură
1]
Modified 12-JUN-2009
Type TROUBLESHOOTING
In this Document
Purpose
Last Review Date
Instructions for the Reader
Troubleshooting Details
BACKUP SCENARIOS
a) Consistent backups
b) Inconsistent backups
c) Database Archive mode
d) Backup Methods
e) Incremental backups
f) Support scenarios
RECOVERY SCENARIOS
1. Online Block Recovery.
2. Thread Recovery.
3. Media Recovery.
Media Failure and Recovery in Noarchivelog Mode
Media Failure and Recovery in Archivelog Mode
a) Point in Time recovery:
b) Recovery without control file
c) Recovery of missing datafile with rollback segments
d) Recovery of missing datafile without undo segments
e) Recovery with missing online redo logs
f) Recovery with missing archived redo logs
g) Recovery with resetlogs option
h) Recovery with corrupted undo segments.
i) Recovery with System Clock change.
j) Recovery with missing System tablespace.
k) Media Recovery of offline tablespace
l) Recovery of Read-Only tablespaces
References
Applies to:
Oracle Server - Enterprise Edition - Version: 7.2 to 10.2
Oracle Server - Personal Edition - Version: 7.2 to 10.2
Oracle Server - Standard Edition - Version: 7.2 to 10.2
Information in this document applies to any platform.
Purpose
Describe various Backup and Recovery Scenarios.
Status PUBLISHED
Troubleshooting Details
BACKUP SCENARIOS
a) Consistent backups
A consistent backup means that all data files and control files are consistent to a point in time. I.e. they have the
same SCN. This is the only method of backup when the database is in NO Archive log mode.
b) Inconsistent backups
An Inconsistent backup is possible only when the database is in Archivelog mode. You must apply redo logs to the
data files, in order to restore the database to a consistent state. Inconsistant backups can be taken using
RMANwhen the database is open.
Inconsistant backups can also be taken using other OS tools provided the tablespaces (or database) is put into
backup mode.
ie: SQL> alter tablespace data begin backup;
SQL> alter database begin backup; (version 10 and above only)
d) Backup Methods
Essentially, there are two backup methods, hot and cold, also known as online and offline, respectively. A cold backup
is one taken when the database is shutdown. The database must be shutdown cleanly. A hot backup is on taken
when the database is running. Commands for a hot backup:
For non RMAN backups:
1. Have the database in archivelog mode (see above)
2. SQL> archive log list
--This will show what the oldest online log sequence is. As a precaution, always keep the all archived log files starting
from the oldest online log sequence.
3. SQL> Alter tablespace tablespace_name BEGIN BACKUP;
or SQL> alter database begin backup (for v10 and above).
4. --Using an OS command, backup the datafile(s) of this tablespace.
5. SQL> Alter tablespace tablespace_name END BACKUP
--- repeat step 3, 4, 5 for each tablespace.
or SQL> alter database end backup; for version 10 and above
6. SQL> archive log list
---do this again to obtain the current log sequence. You will want to make sure you have a copy of this redo log file.
7. So to force an archived log, issue
SQL> ALTER SYSTEM SWITCH LOGFILE
A better way to force this would be:
SQL> alter system archive log current;
8. SQL> archive log list
This is done again to check if the log file had been archived and to find the latest archived sequence number.
9. Backup all archived log files determined from steps 2 and 8.
10. Back up the control file:
SQL> Alter database backup controlfile to 'filename'
For RMAN backups:
see Note.<<397315.1>> RMAN - Sample Backup Scripts 10g
or the appropriate RMAN documentation.
e) Incremental backups
These are backups that are taken on blocks that have been modified since the last backup. These are useful as they
don't take up as much space and time. There are two kinds of incremental backups Cumulative and Non cumulative.
Cumulative incremental backups include all blocks that were changed since the last backup at a lower level. This
one reduces the work during restoration as only one backup contains all the changed blocks.
Noncumulative only includes blocks that were changed since the previous backup at the same or lower level.
Using rman, you issue the command "backup incremental level n"
Oracle v9 and below RMAN will back up empty blocks, oracle v10.2 RMAN will not back up empty blocks
f) Support scenarios
When the database crashes, you now have a backup. You restore the backup and
then recover the database. Also, don't forget to take a backup of the control
file whenever there is a schema change.
RECOVERY SCENARIOS
Note: All online datafiles must be at the same point in time when completing recovery;
There are several kinds of recovery you can perform, depending on the type of failure and the kind of backup you
have. Essentially, if you are not running in archive log mode, then you can only recover the cold backup of the
database and you will lose any new data and changes made since that backup was taken. If, however, the database
is in Archivelog mode you will be able to restore the database up to the time of failure. There are three basic types of
recovery:
2. Thread Recovery.
This is also performed automatically by Oracle. Occurs when an instance crashes while having the database open.
Oracle applies all the redo changes in the thread that occurred since the last time the thread was checkpointed.
3. Media Recovery.
This is required when a data file is restored from backup. The checkpoint count in the data files here are not equal to
the check point count in the control file.
using a control file other that the current. The database must then be opened with
resetlogs option.
a new one using the create controlfile command. Basically, the point here is that you should take a backup of the
control file every time you switch a tablespaces mode.
References
NOTE:388422.1 - Top 10 Backup and Recovery best practices.
Backup and Recovery HandBook, Intro to DataServer Course Material
Backup and Recovery - an Overview
Related
Products
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server Personal Edition
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server Enterprise Edition
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server Standard Edition
Type FAQ
Status PUBLISHED
In this Document
Purpose
Top 10 Backup and Recovery best practices.
Questions and Answers
Applies to:
Oracle Server - Enterprise Edition - Version: 9.2
Information in this document applies to any platform.
Purpose
Top 10 Backup and Recovery best practices.
This document assumes that you are doing the Backup and Recovery basics
Related
Products
Oracle Database Products > Oracle Database > Oracle Database > Oracle Server Enterprise Edition
Keywords
ARCHIVELOG; BACKUP DATABASE; CONTROLFILE;
CONTROL_FILE_RECORD_KEEP_TIME; DB_BLOCK_CHECKING; RECOVER
DATABASE