1.instance

27

Upload: malru

Post on 21-Jul-2016

3 views

Category:

Documents


1 download

DESCRIPTION

Oracle Instance

TRANSCRIPT

Page 1: 1.Instance
Page 2: 1.Instance

There are three default filenames. On Unix they are

$ORACLE_HOME/dbs/spfileSID.ora $ORACLE_HOME/dbs/spfile.ora $ORACLE_HOME/dbs/initSID.ora

and on Windows, %ORACLE_HOME%\database\SPFILESID.ORA %ORACLE_HOME%\database\SPFILE.ORA %ORACLE_HOME%\database\INITSID.ORA

Figure: Sequential search for an instance parameter file during STARTUP

Page 3: 1.Instance

Figure: High-level steps followed during an instance startup

This is the job of SMON process.

Checks the file headers of all the

data files and online redo log

files & compares SCN in those

headers with SCN

The file headers are all out of sync

SMON goes into the instance recovery routine and the database is actually opened only after the

roll forward phase has completed.

1. Database creation2. Controlfile recreation.

Doesn’t actually check for the

existence of data files at this point, but only identified their location from

1. Renaming location of data files.2. Recovery system tablespace data files.

Page 4: 1.Instance

Instance or Crash Recovery:

If the SCNs are different, then Oracle automatically performs crash or instance recovery, if possible.

Crash or instance recovery occurs if the redo needed to generate a consistent image is in the online redo log files.

If crash or instance recovery is not possible, because of a corrupted datafile or because the redo required to recover is not in the online redo logs, then Oracle requests that the DBA perform media recovery. Media recovery involves recovering one or more database datafiles from a backup taken of the database and is a manual process.

Page 5: 1.Instance

Figure: Typical resolution logic for client connection request

Page 6: 1.Instance

Figure: Shared server mode

Page 7: 1.Instance
Page 8: 1.Instance

Figure: The database is protected from users by several layers of segregation.

Page 9: 1.Instance
Page 10: 1.Instance

The server process is representative of the server side of a client-server connection, with the client component consisting of a user session and user process.

Page 11: 1.Instance

The server process interacts with the datafiles to fetch a data block into the buffer cache.

For each change, the server process• pins data block buffer(s) in exclusive mode• builds change vectors in PGA• constructs redo record in PGA• determines space required in log buffer• allocates space in log buffer• changes data block(s) in buffer cache

Page 12: 1.Instance

. This may be modified by some DML, dirtying the block in the buffer cache.

Page 13: 1.Instance

The change vector is copied into the circular log buffer that is flushed in almost real-time by the log writer process (LGWR) to the online redo log files. If archivelog mode of the database is configured, the archiver process (ARCn) copies the online redo log files to an archive location.

Eventually, some condition may cause the database writer process (DBWn) to write the dirty block to one of the datafiles.

Page 14: 1.Instance
Page 15: 1.Instance
Page 16: 1.Instance
Page 17: 1.Instance

The commit command causes the Oracle LGWR process to flush the online redo log buffer to the online redo logs.

Uncommitted redo is flushed to the online redo logs regardless of a commit (in fact, uncommitted changes can be written to the datafiles, too). When a commit is issued,

The session will not return until his redo has been flushed to the online redo logs successfully, that will ensure that changes will be recoverable.

Page 18: 1.Instance
Page 19: 1.Instance
Page 20: 1.Instance
Page 21: 1.Instance

1. Applications and utilities access the RDBMS through a user process

2. The user process connects to a server process, which can be dedicated to one user process or shared among many.

3. The server process parses SQL statements that are submitted to it. It is also the process that reads data blocks from the data files into the database buffer cache.

Page 22: 1.Instance

Dictionary cache:Stores data dictionary rows that have been used to parse SQL statements. Information such as segment information, security and access privileges, and available free storage space is held in this area.

4.

5.6.7.8.9.10.11.12.

Page 23: 1.Instance