Pages

Subscribe:

Ads 468x60px

Thursday, 30 July 2020

What is SGA in Oracle?

The SGA (System Global Area) in Oracle Instance


System Global Area (SGA) memory is memory shared by all server and background processes.


The SGA is made up of three mandatory components and three optional elements.

Mandatory components:

     Shared memory area
     Database buffer cache
     Redo log buffer

Optional items:

     LARGE POOL memory area
     Java memory area (Java Pool)
     Streams memory area (streams pool)

To learn more about the components and basic concepts of the Oracle architecture, take look at our Expert DBA Team Club blog and more advance topics are available at this source.

What is Oracle instance

What is Oracle instance?


An Oracle server is made up of an Oracle instance and an Oracle database.

An Oracle database can only be accessed through one instance. See our tutorial on managing an oracle instance to learn how to manipulate the associated database.

An Oracle server instance is made up of a SGA (Global Area System) shared memory structure and several background Oracle processes each with a specific role.


An instance can only open one database at a time.

A database can be opened by multiple instances using the RAC (Oracle Real Application Clusters) option for high availability and load balancing. (see diagram below)


In such a configuration, users waiting to be connected can be directed to the least loaded instance and in addition, if one instance fails, the other takes over for better database availability.

N.B: In Windows environment, each instance is associated with a service named OracleService “InstanceName”. This service must be started in order to start the instance.

When it starts up, the instance uses an initialization settings file.

An instance has a SID. This determines the parameter file used at STARTUP (spfile ”SID” .ora or spfile.ora or init ”SID” .ora in this order of priority, if Oracle does not find one it goes to the next).

The components of the instance (SGA + background processes) are described in the following sections.

To learn more about the components and basic concepts of the Oracle architecture, take look at our Expert DBA Team Club blog and more advance topics are available at this source.

PGA memory in Oracle

What is the PGA memory


An additional memory structure called PGA (Global Area Program) is created for each logged in user.

PGA stores user session specific control information such as private areas for cursor processing, bind variables, session information, sort area ...

Each server process has its own private PGA memory which is exclusively reserved for it.

When the user process disconnects (end of session), the associated server process ends and the PGA memory is freed.

N.B: In a shared server configuration:

    a server process handles requests from multiple user processes.
    a global amount of PGA memory can be allocated to the Oracle instance through the PGA_AGGREGATE_TARGET initialization parameter.

Depending on the technical architecture of the application, the user process exists, either on the user's PC (in the case of a client / server application) or on the application server of the intermediate level (middle-tier) in the case of an n-tier application.

To learn more about the components and basic concepts of the Oracle architecture, take look at our Expert DBA Team Club blog and more advance topics are available at this source.