Está en la página 1de 7

9i Architecture

When ever user want to interact with the oracle server the interaction with the server will take the fallowing steps. User Process A database user who needs to request information from the database must first make a connection with the oracle server the connection is requested using a database interface tool such as SQLPLUS and beginning the user process. the user process not interact directly with the oracle server.rather it generates calls through the user program interface which creates a session and starts a server process. Connection It is a communication path way between a user process and oracle server There r three types of connections * 1 tier A user directly interacts with server with in the system * 2 tier A user interacts with the server through a network * 3 tier A user interacts with the server over the network to an application. Server Process Once a user has established a connection a server process is started to handle the user process requests. a server process can be either a dedicated or shared server process. Dedicatedthe server process handles the request of a single user process. Once a user process disconnects, the server process is terminated. Sharedthe server process handles the request of several user processes. It runs on the same machine as the oracle server .each server process serves services only one user process. This server process is create when a user request a connection and is generally terminated when a user disconnects. The server process uses the oracle program inter face (OPI) which is used to communicate with the oracle server at the requests of the user process This server process returns status information and results to the user process Each server process uses as area of memory called the program global area (PGA). PGAprogram global area When a user gives a transaction, in PGA a block will allocate for particular user before going to oracle server. This block is a temporary area until the out put reaches to the user When using the dedicated server configuration the PGA contains

sort area: used for any sort that may be necessary before rows are processed or returned to the user session information: such as user privileges for the session cursor state: which indicate the stage in the processing of various cursors that r currently used by the session stack space: containing the session variables Thus PGA is allocated when a process is created and de allocated when the process is terminated.

Sessions A session is a specific connection of a user to an oracle server. The session starts when the user connects to the oracle server. And it ends when the user logs out. SGASystem global area It is a dynamic It is used to store database information that is shared by database processes. Dynamic SGA Dynamic SGA implements an infrastructure that allows the SGA configuration to change with out shut down the instance. This modified sga will effect on db buffer cache and shared pool only To view sga desc v$sgastat To change sga sizealter system set sga_max_size=64m; Shared pool It holds most recently executed sql statements Most recently used data definition To change the size alter system set shared_pool_size=64m; Library cache Stores information about the most recently used SQL and PLSQL statements If the size of the shared pool is too small, statements r continuously reloaded into library cache. It is manage my LRU algorithm Shared SQL it stores and shares the execution plan and parse tree for sql statements. Is second time the statement is run it takes from parse tree Shared PLSQL stores and shares the most recently used plsql statements it stores functions ,packages and triggers Data dictionary cache Collection of most recently used definitions in the database

Includes information about database files, tables, indexes, columns, users, privileges and other database objects During parse phase the server process looks at data dictionary for information to resolve object names and validate access. Data buffer cache Stores copies of data blocks that have been retrieved from the data files When a query is parsed the oracle server process looks in data buffer cache for any block it need if it is not found in db buffer the server process reads the block from data files and place a copy in db buffer cache. To resize alter system set dba_cache_size=96m; Redo log buffer cache It records all changes made to the database data blocks Primary purpose is recovery Large pool Share the burden of shared pool Backup and restore operation a or RMAN Java pool Services parsing requirements for java commands It is an optional setting but is required if installing and using java. Background processes Maintains and enforces relation ships between physical database and memory structures. DBWRn Writes the dirty buffers from database buffer cache to the data files. Here the server process records changes to undo data blocks in the db buffer cache. Dbwrn writes when check point occurs There is no free buffer When tablespace offline, read only, drop or truncate, begin backup. LGWRn It records all changes made to the database data blocks. It occurs when a transaction commits When redolog buffer is one third full When more then 1MB of changes recorded in the redo log buffer

Before DBWRn writes modified blocks in db buffer cache to datafiles Every three seconds SMON---(system monitor) Responsible for instance recovery Ex. if OS causes instance failure. The smon will automatically recover when the database is reopened. Here the recover data has been recorded in the online redo log. This data not written in disk bcoz of loss of sga during instance failure. During this process smon reads data from redo log and records in data blocks. Bcoz committed transaction records in redologs. It performs coalesces free space in datafiles and deallocates temporary segments. PMON(process monitor) It watches the user process on database works correctly on not. If process fails during its connection to oracle. It cleans up after failed process by rolling back the transaction releasing locks and other resources Restarting dead dispatches CKPT(checkpoint) For every three seconds the ckpt process stores data in the control file to identify that place in the redo log file where recovery is begin. It verifies that buffers in db buffer cache that were modified prior to a point in time have written to datafiles. for recovery in case of instance failure Here it will update datafile header with checkpoint information and updating control file with checkpoint information Going to push DBWR to work in sink with LGWR Alert always on the back of DBWR ARCn(archiver) Optional background process Automatically archives online redologs when archive log mode is set Preserves the records of all changes made to the database. NO ARCHIVE LOG mode In this online redo logs files r over written each time a log switch occurs. But it will not over write until a checkpoint occurs. ARCHIVELOG mode

Inactive groups of filled online redolog files must be archived before they can be used again. RECO --(recoverer) This process is used to resolve distributed transactions that r pending due to a network or a system failure in distributed database. At time intervals .the RECO attempts to connect to a remote database and automatically complete the commit or rollback a local portion of any pending distributed transactions. Dnnn(dispatchers) It is responsible fro routing requests from connected user processes to available shared server process and returning responses back to the appropriate user processes CJQ(Coordinator job query process) This is a Coordinator of job queue to the appropriate user processes. SCN(system change number) It defines a committed version of a database at a precise moment of time. When a transaction commits. It is assigned an SCN that uniquely identifies the transaction. Primarily used for recovery operations. The oracle database architecture includes logical and physical structure that makes up the database The physical structure includes the control files, online redolog files, and datafiles that makes up the database The logical structure includes tablespace, segments, extents and data blocks.

PHYSICAL STRUCTURE DATA FILES An oracle database has one r more physical data files that holds the actual database of all logical structure like tables, indexes etc. A data file can be associated with only one database and only one tablespace REDOLOG FILES

The primary function of redologs is to record all changes made to the database before they are written to the data files. These files can be mirrored and are used in performance recovery operations. CONTROL FILES The control files record control information of all files with in the database. They are used to maintain internal consistency and play a vital role in recovery operation. These files can be mirrored. Oracle automatically modifies control files. Which user cannot edit to maintain internal consistency and guide during database recovery it includes --information about the database total no. of datafiles, redolog and threads that are enabled --information about each log group and current log group that LGWR is writing --Redologs each member of log group, the size, path, full name .log sequence number etc. --Datafiles their size, name, path status etc --log history of database LOGICAL STRUCTURE An oracle database contains at least one tablespace A tablespace contains one r more segments A segment is made up of extents An extents is made up of logical blocks A block is the smallest unit for read and writes operations TABLESPACE It is logical area of storage in a database that directly corresponds to one or more physical data files A tablespace can belong to only one database at a time A tablespace may contain one r more operating system files, which are called datafiles. SEGMENTS A segment is the space allocated for specific logical storage structure with in a tablespace A segment cannot span tablespace however a segment can span multiple datafiles that belong to same tablespace. EXTENT

Space is allocated to a segment by extents As the segment grows, extents get added to the segments An extent is a set of contiguous oracle blocks An extent cannot span datafiles, and there fore it must exist in one datafiles. DATA BLOCKS The oracle server manages the storage space in the datafiles in units called oracle blocks or data blocks The data in an oracle database is stored in data blocks.

También podría gustarte