PREVIOUS CHAPTER | NEXT CHAPTER
PREVIOUS CHAPTER | NEXT CHAPTER
Learn Oracle - Data Structures Used for Database Recovery
Several structures of an Oracle database safeguard data against possible failures. This section introduces each of these structures and its role in database recovery.
This section contains these topics:
- Redo Logs
- Rollback and Undo Segments
- Control Files
Learn Oracle - Redo Logs
The online redo log, present for every Oracle database, records all changes made in an Oracle database. The online redo log of a database consists of at least two redo log files that are separate from the datafiles (which actually store a database's data). As part of recovery from an instance or media failure, Oracle applies the appropriate changes in the database's redo log to the datafiles, which update database data to the instant that the failure occurred.
Online Redo Log Groups and Members
Every database must have at least two online redo log groups. Each redo log group contains at least one online redo log member, which is a physical file containing the redo records. If Oracle DBA configure a group to contain multiple members, then Oracle DBA are multiplexing the online redo logs. The multiplexed members of the group contain identical redo data but use different filenames.
Oracle uses and reuses these files in a circular fashion to record database changes. The log file that Oracle is currently writing to is called the current online redo log.
The background process LGWR records all changes made through the associated instance to the current online redo log files. Each redo record contains both the old and the new values. Oracle also records the old value to an undo block located either in a rollback segment (if running in manual undo management mode) or in a dedicated undo tablespace (if running in automatic undo management mode).
Archived Redo Logs
Optionally, Oracle DBA can configure an Oracle database to archive copies of the online redo logs after they fill. This type of log is called an archived redo log. An archived log is uniquely identified by its redo thread number and log sequence number. By archiving filled online redo log files, older redo log data is preserved for operations such as media recovery, while the preallocated online redo log files continue to be reused to store the most current database changes.
Datafiles that were restored from backup, or were not closed by a clean shutdown, may not be completely up to date. During recovery, datafiles must be updated by applying the changes in the archived and online redo logs.
Learn Oracle - Rollback and Undo Segments
Oracle DBA can operate the database in either of two mutually exclusive modes: manual undo management mode, or automatic undo management mode. In the first case, Oracle DBA must create and manage rollback segments. In the case of automatic undo management, Oracle DBA create an undo tablespace that contains system-managed undo segments. Rollback and undo segments are used for a number of functions in the operation of an Oracle database. In general, these segments store the "before image" of data that has been changed by uncommitted transactions.
Among other things, the information in a rollback or undo segment is used during database recovery to undo any uncommitted changes applied from the redo log to the datafiles. Therefore, if database recovery is necessary, then the data is in a consistent state after the rollback segments are used to remove all uncommitted data from the datafiles.
Learn Oracle - Control Files
In general, the control files of a database store the status of the physical structure of the database. The control file is absolutely crucial to database operation. It contains (but is not limited to) the following types of information:
Status information in the control file such as the database checkpoints, current online redo log file, and the datafile header checkpoints for the datafiles guides Oracle during crash, instance, or media recovery.
- Database information (RESETLOGS SCN and time stamp)
- Progress of the thread checkpoint
- Tablespace and datafile records (filenames, datafile checkpoints, read/write status, offline ranges)
- Redo threads (current online redo log)
- Log records (sequence numbers, SCN range in each log)
- RMAN backup and copy records
Block corruption information
More Tutorials on Oracle dba ...
Liked it ? Want to share it ? Social Bookmarking
Source : Oracle Documentation |
Return to Learn Oracle
Want to share or request Oracle Tutorial articles to become a Oracle DBA. Direct your requests