Вы находитесь на странице: 1из 9

PMON

SMON

MMAN

MMON

CJQn

SHARED POOL Library Cache Shared SQL Area

SYSTEM GLOBAL AREA

LARGE POOL
IO Buffer Area

JAVA POOL
Used Memory Free Memory

Data Dictionary Cache Result Cache Enqueue Latches Fixed Area Other

M R U

MidPt inter secti on

L R U

Response Queue Request Queue Oracle XA Interface

Sort Extent Pool Streams Pool

KEEP CACH E SIZE

RECYC LE CACH E SIZE

DB_ CAC HE_S IZE

Backup/Recovery Operations UGA for shared Servers

Flashback Buffer

PROGRAM GLOBAL AREA User Process


Stack Space User Session Data Cursor Statistics

Redo Log Buffer


Sort Area DBWR

User Global Area


LGWR CKPT

ARCn

Control Files Server Process

Database and Temporary files

Online Redo Log

Archive d Log

USER PROCESSES ORACLE NET SERVICES LISTENER.ORA TNSNAMES.ORA SQLNET.ORA

SYSTEM GLOBAL AREA a) LIBRARY CACHE b) SHARED POOL c) DICTIONARY CACHE d) SHARED SQL AREA e) ENQUEUES f) LATCHES g) RESULT CACHE h) OTHER i) FIXED AREA
DATABASE BUFFER CACHE db_recycle_cache_size db_keep_cache_size REDO LOG BUFFER LARGE POOL JAVA POOL a) SORT EXTENT POOL b) STREAMS POOL c) FLASHBACK MEMORY DATABASE WRITER REDO LOG WRITER ARCHIVER LOG WRITER CHECKPOINT

USER PROCESSES
When a user runs an application program (such as a Pro*C program) or an Oracle tool (such as Oracle Enterprise Manager or SQL*Plus), Oracle Database creates a user process to run the user's application.

ORACLE NET SERVICES


supports network communication between a client application and a remote or local database running on a variety of operating systems. Oracle Net Services allows the database servers and the client applications (or servers acting as clients) that access it to run on separate machines, and provides a means for moving data between the nodes on a network. Oracle Net Services is also used for Inter Process Communication if clients and servers are running on the same machine.

LISTENER.ORA
is a SQL*Net configuration file used to configure Oracle Database Listeners (required to accept remote connection requests). This file normally resides in the ORACLE HOME\NETWORK\ADMIN directory or in the directory define by the $TNS_ADMIN variable.

TNSNAMES.ORA
is a SQL*Net configuration file that defines databases addresses for establishing connections to them. This file normally resides in the ORACLE HOME\NETWORK\ADMIN directory.

SQLNET.ORA
is a text file that provides SQL*Net with basic configuration details like tracing options, default domain, encryption, etc. This file can be found in the ORACLE HOME\NETWORK\ADMIN directory.

SYSTEM GLOBAL AREA - System Global Area (SGA) is a group of shared memory areas that are
dedicated to an Oracle instance. It consists of Shared Pool Database Buffer Cache Redo Log buffer Large Pool Java Pool

SHARED POOL
is a RAM area within the RAM heap that is created at startup time. This is Since it is not possible to dedicate separate regions of memory for the shared pool components, the shared pool is usually the second-largest SGA memory area (depending on the size of the db_cache_size parameter). All of the sub-areas in shared pool are controlled by the single shared_pool_size parameter. The shared pool is like a buffer for SQL statements. Oracle's parsing algorithm ensures that identical SQL statements do not have to be parsed each time they're executed. The shared pool is used to store SQL statements. The shared pool contains RAM memory regions that serve the following purposes:

LIBRARY CACHE
Responsible for collecting, parsing, interpreting, and executing all of the SQL statements that go against the Oracle database. Contains the current SQL execution plan information. It also holds stored procedures and trigger code.

SHARED SQL AREA - The shared SQL area stores each SQL statement executed in the database.
This area allows SQL execution plans to be reused by many users.

DICTIONARY CACHE
The dictionary cache stores environmental information, which includes referential integrity, table definitions, indexing information, and other metadata stored within Oracle's internal tables.

RESULT CACHE
is an area in the shared pool and contains the end results of a query execution.

LATCHES
Background process needs one of the data structure to satisfy its purpose, it acquires a latch while it manipulates or looks for a shared resource. Latches are simple types of a lock that can be very quickly acquired and freed, low-level serialization mechanisms to protect shared data structures in the system global area (SGA). For example, latches protect the list of users currently accessing the database and protect the data structures describing the blocks in the buffer cache. A server or background process acquires a latch for a very short time while manipulating or looking at one of these structures. The implementation of latches is operating system dependent, particularly in regard to whether and how long a process will wait for a latch.

Advantages of Latches It can be very quickly acquired and freed. There is a cleanup procedure that will be called if process dies while holding a latch. Synchronization of levels of latching - Process acquires a latch at a certain level and it cannot acquire another latch subsequently that is equal to or less than that level. Prevents more than one process from executing the same piece of code at a given time. Latches have an associated level that is used to prevent deadlocks. Limitations Low-level of serialization (one at a time) The implementation of latches is operating system dependent, particularly in regard to whether and how long a process will wait for a latch. A server or background process acquires a latch for a very short time while manipulating or looking at one of these structures. If it acquires a latch for more time, there is a possibility process may die. There is no ordered queue of waiters like in enqueues. Latch waiters may either use timers to wakeup and retry or spin (only in multiprocessors). Since all waiters are concurrently retrying (depending on the scheduler), anyone might get the latch and conceivably the first one to try might be the last one to get.

ENQUEUES
Enqueues are another type of locking mechanism used in Oracle. Any object (Not only data structures) which can be concurrently(non serially) used, can be protected with enqueues. A good example is of locks on tables. We allow varying levels of sharing on tables e.g. two processes can lock a table in share mode(Read) or in share update mode(Read and Write) etc. Enqueue is obtained using an OS specific(not dependent) locking mechanism. An enqueue allows the user to store a value in the lock, i.e the mode in which we are requesting it. The OS lock manager keeps track of the resources locked. If a process cannot be granted the lock because it is incompatible with the mode requested and the lock is requested with wait, the OS puts the requesting process on a wait queue which is serviced in FIFO. Advantages Allows several concurrent processes to have varying degree of known resources. Enqueue is obtained using an OS specific(not dependent) locking mechanism. If a process cannot be granted lock then it puts the process in wait queue. There is ordered queue of waiters. Differences between Latches and Enqueues Latches - Low level of serialization. Enqueue - Concurrency

Latches - Process acquires latch for a short time and there is no ordered queue of waiters. Enqueue Obtained using OS Specific locking mechanism, there are waiters.

FIXED AREA
contains several thousand atomic variables. These are small data structures, such as latches and pointers, which refer to other areas of the SGA. The size of the fixed area is static. It also contains general information about the state of the database and the instance which the background processes need to access.

OTHER
The following table lists the different areas stored in the shared pool and their purpose: * PRIVATE SQL AREA - Private SQL areas are non-shared memory areas assigned to unique user sessions. * PL/SQL AREA - Used to hold parsed and compiled PL/SQL program units, allowing the execution plans to be shared by many users. * CONTROL STRUCTURES - Common control structure information, for example, lock information

DATABASE BUFFER CACHE The SGA is used to store incoming data (the data buffers as defined by the db_cache_size parameter), and internal control information that is needed by the database. The amount of memory to be allocated to the SGA include db_cache_size, shared_pool_size and log_buffer. When Oracle receives a request to retrieve data, it will first check the internal memory structures to see if the data is already in the buffer. Following are its Tasks Storage for data blocks that have been retrieved from data files. Provides optimization boost for DML operations (UPDATES) Managed via the LRU algorithm db_keep_cache_size - Segments that contain frequently accessed blocks should be assigned to the keep buffer pool so that the blocks of those segments will not be inadvertently removed, thus impacting performance. db_recycle_cache_size - Any segments whose blocks tend to be accessed with less frequency should be assigned to the recycle pool so that it does not flush the other segments, either in the default cache or the keep pool. REDO LOG BUFFER The redo log buffer is a RAM area (defined by the initialization parameter log_buffer) that works to save changes to data, in case something fails and Oracle has to put it back into its original state.

When Oracle SQL updates a table (a process called Data Manipulation Language, or DML), redo images are created and stored in the redo log buffer Serves for assistance with database recovery tasks Records all changes made to database blocks Places changes recorded to redo entries for redo logs Oracle will eventually flush the redo log buffer to disk, only after a commit operation occurs.

LARGE POOL
This area is only used if shared server architecture, also called multi-threaded server (MTS), is used, or if parallel query is utilized. The large pool holds the user global areas when MTS is used and holds the parallel query execution message queues for parallel query

The large pool is optional memory component and it provides RAM for UGA holds session based information for the a shared server Oracle XA Interface is involved in case of distributed transactions I/O Server Processes Parallel Query Buffers Oracle Backup and Restore Operations using RMAN.

JAVA POOL Caching parsed Java programs, used for java objects, Java methods and other java execution memory.
java_pool_size parameter controls the amount of memory for this area. The JAVA Pool holds the JAVA execution code in a similar manner to the PL/SQL cache in the shared pool. The JAVA pool is used by many internal routines, such as import and export, and should be sized at approximately 60 megabytes if no other JAVA will be utilized in the user applications.

SORT EXTENT POOL The SEP tracks extents either in the shared pool area, ie. the UGA in MTS instances and in the PGA user's process area in non-MTS instances. Thus the SEP is always in the SGA since it tracks sort extents but the actual sort extents themselves are in several areas. STREAMS POOL Cache Oracle Streams objects. Oracle streams allows data propagation between Oracle Databases (homogeneous) and between Oracle and non-Oracle databases (heterogeneous environment). Oracle Streams can be used for:

Replication

Message Queuing Loading data into a Data Warehouse Event Notification Data Protection

FLASHBACK MEMORY Flashback lets you view past states of database objects or to return database objects to a previous state without using point-in-time media recovery The flashback memory buffer area is used with the flashback features which were first introduced in Oracle 10g such as the ability to perform flashback transaction query(retrieves data from a past point in time), flashback table(recovers a table to its state at a past point in time, without having to perform a point in time recovery), flashback database(restore the whole database back to a point in time) and flashback versions(shows you different versions of data rows, plus start and end times of a particular transaction that created that row query), flashback drop( allows you to reverse the effects of a drop table statement, without resorting to a point-in-time recovery). There are a number of flashback levels row level - flashback query, flashback versions query, flashback transaction query table level -flashback table, flashback drop database level - flashback database

DATABASE WRITER Process that writes the contents of Database buffer cache to Data files. REDO LOG WRITER Process that writes the contents of the Redo Log buffer to Redo Log Writer ARCHIVER LOG WRITER Process that copies Redo log files to a designated storage device after a log switch occurs CHECKPOINT Process that timestamps all datafiles and control files to indicate that a checkpoint has occurred. Checkpoint is the event when occurs, DBWR process writes all the modified buffers in SGA to the Data files and control file.

REFERENCES http://www.dba-oracle.com/

https://asktom.oracle.com/ http://www.toadworld.com/ http://parthokonar.wordpress.com/2009/09/01/latches-and-enqueues/ http://jonathanlewis.wordpress.com/2007/01/21/shared-sql/ http://oracledba.ezpowell.com/oracle/instanceArchitectureInternalInstanceMemory.html http://arup.blogspot.in/2013/04/streams-pool-is-only-for-streams-think.html http://www.datadisk.co.uk/html_docs/oracle/flashback.htm

Вам также может понравиться