Pages

Subscribe:

Ads 468x60px

Thursday, 30 July 2020

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.

Characteristics of Oracle Server

Oracle server


An Oracle server, a database management system, consists of an Oracle instance and an Oracle database.

The instance and the database together constitute an Oracle server.

The architecture of Oracle Server can be described in three phases:

    User login to the database
    Memory structures that are part of the Oracle instance
    Background processes that are part of the Oracle instance
    Physical structures of files forming the Oracle database.

User login to the database

Two processes allow a user to interact with the instance and ultimately with the database: the user process and the server process.


Each time a user runs an application, such as an application for human resources management, financial management, or just an SQL command, the client machine first launches a user process to establish a connection from the user to the Oracle instance.
The Oracle Listener Listening Process

The Oracle listener process is the primary server-side Oracle component that establishes the connection between client computers and an Oracle database. The listener can be seen as a big ear that listens for connection requests to Oracle services.

Theoretically, a server machine can host several Oracle databases and one listener and only one to allow a client to connect to the Oracle instance of his choice. The instance name is submitted by the client during the connection process (step 1).

Two cases are possible:

    A Listener process can serve multiple databases configured on the same server machine,
    Several listener can be configured on the same machine (for failover or load balancing purposes to support heavy loads of connection requests).

In a dedicated server configuration, the Listener starts a new server process for each client and gives it control of the client session. Each client connection is served by its own server process.

The diagram above corresponds to a dedicated server configuration and for a client / server application.

The connection process goes through the following steps:

    The customer contacts the Oracle listener by choosing the instance to which he wishes to connect (request for a service name).
    The listener starts a dedicated process called a server process
    The listener sends an acknowledgment to the client with the address of the dedicated server process
    The client establishes a connection with the dedicated server process
    The server process connects to the Oracle instance on behalf of the user process (creation of a user session)

It is the server process that connects to the Oracle instance to serve the user process throughout the client session.

The user process does not directly interact with the Oracle server. Rather, it is the server process that interacts with the Oracle server, responds to user requests and returns results to the user.

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 Database?


Oracle Database


Oracle Database  is one product among others forming the Oracle  suite (Oracle Database, Oracle Application Server, Oracle Developer Suite, Oracle Enterprise Manager Grid Control…).

Oracle Database  is the Oracle database management system that allows multiple users to access data simultaneously while ensuring availability and disaster recovery mechanisms.

Be aware that Oracle Database refers to the entire Oracle software, while database has a specific meaning in the Oracle architecture.

To guarantee a high level of performance, Oracle maintains the database thanks to memory structures (in random access memory: RAM) and physical structures (on hard disk) and uses processes for the storage of data in memory or on disk .

Writing to disk is only performed when necessary and under conditions while Memory is used as much as possible since memory access is faster than disk access (performance gain).


In the event of a power outage, for example, Oracle will be able to recover well if data in memory, at the time of the incident, is not written to disk. This is the recovery of the instance managed by the SMON process discussed later in the oracle architecture.

An instance failure requires recovery, while a physical failure (such as a disk crash) requires a restore followed by a recovery.

Restoration and recovery are two different terms that should be clearly distinguished. The restoration is made from backup files and the recovery allows to reapply to the restored data files, the modifications already made on the base to find the consistent state of the database before the incident.


In the example in the figure, recovery at time t2 requires restoring the last available S1 backup and reimplementing any changes that occurred in the interval t1-t2.

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.