Oracle Memory Components and Background Processes


Oracle Memory Components and Background Processes

Memory Components

Comments

Dynamic

Auto Tune

MMAN

SGA_TARGET

PGA

=%20*SGA

In general ,in Dedicated connection PGA contains

· Private SQL area

· Cursor and SQL area

· Work area

· Session memory that holds session specific variables, such as logon information.

PGA Contains data and control information for a server process.

If the session connects to a dedicated Oracle server, PGA is automatically managed.

If oracle is using shared servers, this memory area is shared.

The database administrator just needs to set the PGA_AGGREGATE_TARGET initialization parameter to the maximum amount of memory he/she wants Oracle to use for client processes. Oracle will ensure that the total PGA allocated to all processes will never exceed this value.

SGA

Default DB Buffer Cache

DB_CACHE_SIZE

copies of data files data blocks

· Free/Unused buffers:

· Clean buffers: These are buffers that do not contain any useful data, and, thus, the database can reuse them to hold new data it reads from disk.

· Pinned buffers: These are data buffers that are currently in active use by user sessions.

· Dirty buffers: These contain data that was read from disk and then modified, but hasn’t yet been written to the data files on disk.

YES

Redo Log buffer

LOG_BUFFER

Shared Pool

SHARED_POOL_SIZE

Data dictionary cache

Library cache(SQL and PL/SQL parsed code)

Shared SQL Area(Parse tree , SQL Execution Plans)

Private SQL Area(Actual Data Values)

Locks

Session Data

Data Dictionary Cache(a roadmap to structure and layout of the database)

YES

O p t i o n a l

Large Pool

LARGE_POOL_SIZE=[2GB - 2TB ]

XA Interface

I/O Server

RMAN Backup/Restore buffers

Use by Parallel processing

Shared Servers

YES

Java Pool

JAVA_POOL_SIZE

YES

Streams Pool

STREAM_POOL_SIZE

Oracle Streams buffer

N e w

Keep Buffer Cache

DB_KEEP_CACHE_SIZE

Recycle Buffer Cache

DB_RECYCLE_CACHE_SIZE

nK Block Size Buffer Caches

DB_nK_CACHE_SIZE

The SGA isn’t a homogeneous entity; rather, it’s a combination of several memory structures. The following are the main components of the SGA:

· Database buffer cache: Holds copies of data blocks read from data files.

· Shared pool: Contains the library cache for storing SQL and PL/SQL parsed code in order to share it among users. It also contains the data dictionary cache, which holds key data dictionary information.

· Redo log buffer: Contains the information necessary to reconstruct changes made to the database by DML operations. This information is then recorded in the redo logs by the log writer.

· Java pool: Keeps the state of Java program execution.

· Large pool: Stores large memory allocations, such as RMAN backup buffers.

· Streams pool: Supports the Oracle Streams feature.


Background Processes

Server Side (Mandatory)

RAC

ASM

Other

1. PMON - Process Monitor

2. DBWR, DBWn - Database Writer (n=0-9,a-j)

3. LGWR, LGWn - Online Redo Log Writer

4. CKPT - Checkpoint

5. SMON - System Monitor

1. CM Cluster Manager

2. GCS Global Cache Service.

3. GES Global Enqueue Service Daemon

4. GMS Group Membership Service

5. GSD Global Services Daemon

6. LCKn Shared Resource Locking

7. LMDn Global Enqueue Service Daemon

8. LMON Global Enqueue Service Monitor

9. LMSn Global Cache Service Processes(Lock Manager Server)

10. NM Node Monitor

11. NPIC Network Inter-Process Communication

12. PSPn a PL-SQL plug in.

· Oracle Parallel Fail Safe in 8ià Oracle Real Application Clusters Guard in 9i

· DLMà GES+ GCS

· OPSDàGSD

· PCMàGCS

NOTE:CGS Cluster Group Services (it is really a layer not process)

ASM Instance

1. ARBn , A00n

2. ORBn

3. RBAL

ASM Clients (RDBMS instances)

1. ASMB

2. OSMB

3. RBAL

1. AQ

2. DMON

3. LNSV

4. MPR

5. SNPnnn

6. TRWR

7. WMON

Server Side (Optinal)

UnDocumented

1. RECO Distributed Transaction Recovery, Remote DB

2. CJQn Job Coordinator Process

3. QMNn

4. ARCH, ARCn Archiver(Archive Redo Log Files)

5. CTWR Block Change Tracking Writer

6. Dnnn Dispatcher

7. Jnnn Jobb Queue

8. MMAN Memory Manager

9. MMNL Metrics Monitor, session history, metrics computation

10. MMON Metrics Monitor, statistics, snapshots

11. ORAnnn Dedicated Server(User Process)

12. RVWR Recovery Writer(Flash Back Database)

13. Snnn Share Server

· Server Side (Extra)

1. CM

2. DIAG

3. EMNO

4. FAL Server

5. FMON

6. NSV0

7. RSM0

· Standby Node

1. FAL Client

2. LSPn

3. MRP0

4. RFS

Oracle Processes

  • AQ Time Manager
  • ARBn,A00n A group of slave processes establish connections to the ASM instance,
  • ARCH The Archiver Process archives redo log files if ARCHIVELOG is enabled.
  • ASMB This process contacts CSS using the diskgroup name, and acquires the associated ASM connect string. This connect string is then used to connect into ASM instance.
  • CGS The software layer that provides mechanisms for instances to exchange configuration information, interprocess communication (IPC) port identifiers, and other kinds of meta data needed for Real Application Clusters operation. Cluster group services are also known as LMON-provided services.
  • CKPT The Checkpoint Process reqularly initiates a checkpoint which uses DBWR to write all dirty blocks back to the datafiles, thus synchronizing the database. Since a Checkpoint records the current SCN, in a recovery only redo records with a SCN higher than that of the last checkpoint need to be applied.
  • DBWR The Database Writer writes dirty blocks from the database buffer to the datafiles. How many DBWn Processes are started is determined by the initialization parameter DB_WRITER_PROCESSES. DBWR also writes the actual SCN with the Block.
  • DMON The Data Guard Broker process.
  • Dnnn The Dispatcher Process is used in a shared server environment.
  • LCKnnn Inter-instance locking process.
· LMSn The Global Cache Service Processes (LMSn) are the processes that handle remote Global Cache Service (GCS) messages. Current Real Application Clusters software provides for up to 10 Global Cache Service Processes. The number of LMSn varies depending on the amount of messaging traffic among nodes in the cluster. The LMSn handle the acquisition interrupt and blocking interrupt requests from the remote instances for Global Cache Service resources. For cross-instance consistent read requests, the LMSn will create a consistent read version of the block and send it to the requesting instance. The LMSn also control the flow of messages to remote instances.
· GCS The Global Cache Service is the controlling process that implements Cache Fusion. It maintains the block mode for blocks in the global role. It is responsible for block transfers between instances. The Global Cache Service employs various background processes such as the Global Cache Service Processes (LMSn) and Global Enqueue Service Daemon (LMD).
· GES This service coordinates enqueues that are shared globally.
· GSD The Global Services Daemon (GSD) is a component that receives requests from SRVCTL to execute administrative job tasks, such as startup or shutdown. The command is executed locally on each node, and the results are sent back to SRVCTL. The daemon is installed on the nodes by default. It should not be deleted.
  • LMDn Global Enqueue Service Daemon (LMD) The Global Enqueue Service Daemon (LMD) is the resource agent process that manages Global Enqueue Service (GES) resource requests. The LMD process also handles deadlock detection Global Enqueue Service (GES) requests. Remote resource requests are requests originating from another instance.
  • LMON monitors the health of the Global Cache Service (GCS), registers and de-registers from the Cluster Manager CM. The background Global Enqueue Service Monitor (LMON) monitors the entire cluster to manage global resources. LMON manages instance and process expirations and the associated recovery for the Global Cache Service (GCS) and Global Enqueue Service (GES). In particular, LMON handles the part of recovery associated with global resources. LMON-provided services are also known as cluster group services (CGS).
  • MMAN The memory manager
  • MMON New background process in Oracle 10g.
  • MRP Managed recovery process: the process that applies archived redo log to the standby database.
  • ORBn These perform the actual rebalance data extent movements
  • OSMB Any database instance that is using an ASM disk group will contain a background process called OSMB. The OSMB process is responsible for communicating with the ASM instance. The RBAL background process within in database instance, called RBAL (just like in the ASM Instance) performs a global open on ASM disks. A global open means that more than one database instance can be accessing the ASM disks at a time.
  • PMON The Process Monitor checks if a user process fails and if so, does all cleaning up of resources that the user process has aquired.
  • QMNn
  • RBAL (ASM Clients)
  • RBAL (ASM Instance) Rebalancer, Coordinator, This process performs global opens of all the disks in the disk groups
  • RECO The Distributed Transaction Recovery Process finds pending (distributed) transaction and resolves them.
  • RFS The remote file server process on the standby database receives archived redo logs from the primary database.
  • SMON The System Monitor carries out a crash recovery when a crashed insance is started up again. It also cleans temporary segments.
  • Snnn The Shared Server Process is used in a shared server environment.
  • SNPnnn The snapshot process.
  • TRWR Trace writer
  • WMON The wakeup monitor process.


Table 4-1 Oracle Database Background Processes

Process Name

Description

CKPT

Checkpoint

A checkpoint is the conclusion of the process of writing a buffer of a dirty block to stable storage.

At specific times, all modified database buffers in the system global area are written to the datafiles by DBWn. This event is called a checkpoint.

The checkpoint process is responsible for signalling DBWn at checkpoints and updating all the datafiles and control files of the database to indicate the most recent checkpoint.

Checkpoint Process (CKPT)

When a checkpoint occurs, Oracle must update the headers of all datafiles to record the details of the checkpoint. This is done by the CKPT process.

The CKPT process does not write blocks to disk; DBWn always performs that work. The statistic DBWR checkpoints displayed by the System_Statistics monitor in

Enterprise Manager indicates the number of checkpoint requests completed.

Control files also record information about checkpoints. Every 3 seconds, the checkpoint process (CKPT) records information in the control file about the checkpoint position in the redo log. This information is used during database recovery to tell Oracle that all redo entries recorded before this point in the redo log group are not necessary for database recovery; they were already written to the datafiles.

A checkpoint performs the following operations:

1. Every dirty block in the SGA buffer cache is written to the files. That is, it synchronizes the datablocks in the buffer cache with the datafiles on disk.

· LGWR Flushing the contents of the redo log buffers to the redo log files

· DBWR Flushing the contents of the database buffer cache to disk

2. Writing a checkpoint record to the redo log file.

3. The latest SCN is written (updated) into the:

· Datafile header.

· Controlfiles.

NOTE:

The update of the datafile headers and the control files is done by the LGWR(CKPT if CKPT is enabled). As of version 8.0, CKPT is enabled by default.

Events that trigger a checkpoint

The following events trigger a checkpoint.

1. Online Redo log switch

2. LOG_CHECKPOINT_TIMEOUT has expired

3. LOG_CHECKPOINT_INTERVAL has been reached

4. DBA requires so (ALTER SYSTEM CHECKPOINT ;)

5. In RAC environment, after releasing the lock of each data block that have been asked to accessed by another instance.

6. Every 3 seconds

PMON

Process monitor

· PMON(Process Monitor) is in charge to perform process recovery when a user process fails (also when killed).

· PMON is responsible for cleaning up the cache and freeing resources that the process was using.

· PMON also checks on the Dispatcher Processes and Server Processes and restarts them if they have failed.

· As a part of service registration, PMON registers instance information with the listener.

Service registration is a feature which allows an Oracle Server to register itself with a listener. That means that the Oracle Service needs not be configured in the listener.ora configuration file.

Service registration provides the listener with the following information:

o The service names for each running instance of the database

o Instance names of the database

o Service handlers (dispatchers and dedicated servers) available for each instance This allows the listener to direct a client's request appropriately.

o Dispatcher, instance, and node load information.

This load information allows the listener to determine which dispatcher can best handle a client connection's request. If all dispatchers are blocked, then the listener can spawn a dedicated server for the connection.

However, if there is no listener at startup, PMON can obviously not register those information. Therefore, PMON tries then periodically to register with the listener, which might take up to 60 seconds. It is possible to force this registration with ALTER SYSTEM REGISTER.

Service registration offers the following benefits:

o Simplified configuration: Service registration reduces the need for the SID_LIST_listener_name parameter setting, which specifies information about the databases served by the listener, in the listener.ora file.

Note: The SID_LIST_listener_name parameter is still required if you are using Oracle Enterprise Manager to manage the database.

o Connect-time failover: Because the listener always knows the state of the instances, service registration facilitates automatic failover of the client connect request to a different instance if one instance is down. In a static configuration model, a listener would start a dedicated server upon receiving a client request. The server would later find out that the instance is not up, causing an "Oracle not available" error message.

o Runtime connection load balancing: Service registration enables the listener to forward client connect requests to the least loaded instance and dispatcher or dedicated server. Service registration balances the load across the service handlers and nodes.

· in shared server environment , PMON watch MAX_SHARED_SERVER value and check :

o if the load of system increased , it will spawn new shared server process .

o if the load of system decreased, it will kill the extra shared server process to reach the SHARED_SERVER value.

· PMON is responsible to report the traffic of dispatchers to listener. Choosing the dispatcher is up to listener.

· in RAC environment , During reconfiguration, the process monitor (PMON) process records reconfiguration information with all the listeners (LOCAL_LISTENER and REMOTE_LISTENER) in the cluster for cross-instance listener registration.

DBWn

Database writer

The database writer writes modified blocks from the database buffer cache to the datafiles.

Oracle Database allows a maximum of 20 database writer processes (DBW0-DBW9 and DBWa-DBWj).

The DB_WRITER_PROCESSES initialization parameter specifies the number of DBWn processes.

The database selects an appropriate default setting for this initialization parameter or adjusts a user-specified setting based on the number of CPUs and the number of processor groups.

LGWR

Log writer

The log writer process writes redo log entries to disk. Redo log entries are generated in the redo log buffer of the system global area (SGA).

LGWR writes the redo log entries sequentially into a redo log file. If the database has a multiplexed redo log, then LGWR writes the redo log entries to a group of redo log files.

LGWR begins writing to copy entries from the redo log buffer to the online redo log if any of the following are true:

· The log buffer becomes one third full.

· Each 3 seconds.

· more than 1MB of log buffers be exist.

· LGWR is posted by a server process performing a COMMIT or ROLLBACK.

· DBWR posts LGWR to do so.

SMON

System monitor

· The system monitor performs recovery when a failed instance starts up again.

In a RAC database, the SMON process of one instance can perform instance recovery for other instances that have failed.

· SMON also cleans up temporary segments that are no longer in use and recovers dead transactions skipped during system failure and instance recovery because of file-read or offline errors. These transactions are eventually recovered by SMON when the tablespace or file is brought back online.

ARCn Archiver

One or more archiver processes copy the redo log files to archival storage when they are full or a log switch occurs.

RECO

Recoverer

The recoverer process is used to resolve distributed transactions that are pending because of a network or system failure in a distributed database.

At timed intervals, the local RECO attempts to connect to remote databases and automatically complete the commit or rollback of the local portion

of any pending distributed transactions.

Dnnn Dispatcher

Dispatchers are optional background processes, present only when the shared server configuration is used.

LMS Global Cache Service

In a Real Application Clusters environment, this process manages resources and provides inter-instance resource control.

http://www.jamsahar.com/Oracle/Oracle.Mem.Process.V12.htm

0 comments:

Post a Comment