Monday, September 15, 2008

Oracle Recovery


CKPT is an Oracle backgroud process that timestamps all datafiles and control files to indicate that a checkpoint has occurred. It signals DBWn to write blocks to disk.

Online Redo Log records changes to the database as they occur. it enable Oracle database to recover committed data not yet written to the data file. the contents of the log include uncommitted transaction, undo data, and schema and object management statements.

Archived Redo Log is a coping of filled groups of redo log files on offline destinations. The archived redo log contains a copy of every group created since archivelog mode enabled. The archive log files can be used to recover database from last backup to current failure point.

Monday, August 25, 2008

Types of Oracle Database Failures

There are six general categories for database related failures.

Statement Failures occur when a single database operation fails, such as insert, delete statment.
User Process Failures happen when the abnormal termination of a user session, any uncommited transaction must be cleaned up
Network Failures can be found when the hardware failures between the server and client. It also includes a listener process fails on Oracle server.
User Error Failures when the operation's result is not what the user intended even there is no error message generated, such as delete or modify data or drop an index.
Instance Failues occurs when the instance shuts down without synchronizing all the database files to the same system change number.
Media Failures that are any type of failure that results in the loss of one or more database files.

Oracle Instance Structure

A database instance is a set of memory structures that manage database files. It includes a memory area (SGA) and several background processes.

The most important SGA components are the following:
Database buffer cache is the memory area that stores copies of data blocks read from data file.
Redo log buffer is a circular buffer that stores redo entries describing changes made to the database.
Shared pool caches various types of program data, such as parsed SQL, PL/SQL code, system parameters and data dictionary information.
Large pool is an optional memory area intended for memory allocations that are larger than is appropriate for the shared pool.
Streams pool stores buffered queue messages and provides memory for Oracle Streams processes
Fixed SGA is an internal housekeeping area.

Background processes run by default in a database instance started.
PMON monitors the other background process and performs process recovery
SMON is in charge of a variety of system-level cleanup duties.
DBWn writes the contents of database buffers to data files.
LGWR manages the redo log buffer.
CKPT updates the control file and data file header with checkpoint information and signals DBWn to write blocks to disk.
MMON performs many tasks related to the Automatic Workload Repository.
REC0 automatically resolves failures in distributed transactions.