Sunday, 24 July 2016

Detailed Explanation Of Physical Architecture

1.       SGA (System Global Area)
The SGA is a read/write memory area that stores information shared by all database processes and by all users of the database (sometimes it is called the Shared Global Area).
  •  The SGA is allocated in memory and virtual memory. 
  •  The size of the SGA can be established by a DBA by assigning a value to the parameter SGA_MAX_SIZE in the parameter file—this is an optional parameter.
The SGA is allocated when an Oracle instance (database) is started up based on values specified in the initialization parameter file (either PFILE or SPFILE). 

The SGA has the following mandatory memory structures:
  •  Database Buffer Cache
  •  Redo Log Buffer
  •  Java Pool
  •  Streams Pool
  •  Shared Pool – includes two components:  1.  Library Cache Data      2.  Dictionary Cache
  Additional optional memory structures in the SGA include          
  • Large Pool


 Note: Early versions of Oracle used a Static SGA.  This meant that if modifications to memory management were required, the database had to be shutdown, modifications were made to the init.ora parameter file, and then the database had to be restarted.
Oracle 11g uses a Dynamic SGA.   Memory configurations for the system global area can be made without shutting down the database instance.  The DBA can resize the Database Buffer Cache and Shared Pool dynamically. 

Memory is allocated to the SGA as contiguous virtual memory in units termed granules.  Granule size depends on the estimated total size of the SGA, which as was noted above, depends on the SGA_MAX_SIZE parameter.  Granules are sized as follows:
  •  If the SGA is less than 1 GB in total, each granule is 4 MB.
  •  If the SGA is greater than 1 GB in total, each granule is 16 MB.
Granules are assigned to the Database Buffer Cache, Shared Pool, Java Pool, and other memory structures, and these memory components can dynamically grow and shrink. 

2.  Program Global Area (PGA)

A private memory region that contains the data and control information for a server process. Only a server process can access the PGA. Oracle Database reads and writes information in the PGA on behalf of the server process. There is one PGA for each server process. Background processes also allocate their own PGAs.




3.  User Global Area

The User Global Area is session memory.
The UGA must be available to a database session for the life of the session.  For this reason, the UGA cannot be stored in the PGA when using a shared server connection because the PGA is specific to a single process.  Therefore, the UGA is stored in the SGA when using shared server connections, enabling any shared server process access to it. When using a dedicated server connection, the UGA is stored in the PGA.
END OF NOTES



Monday, 18 July 2016

Basic Oracle Physical Architecture

Oracle Server Architecture

The architecture includes physical components, memory components and logical structures.

Oracle Primary Architecture Component         



Oracle Terms:

Oracle Server – It is a combination of Oracle Instance and Oracle Database.

Oracle Database - Oracle database consists of file: datafiles, control files, redo log files and archive redo log files.  The Oracle server also accesses parameter files and password files.

Oracle Instance - Oracle Instance consists of two different sets of components:
  1. Background processes - (PMON, SMON, RECO, DBW0, LGWR, CKPT, D000 and others).
  2. Memory structures -   Comprise the Oracle instance.When an instance starts up, a memory structure called the System Global Area (SGA) is allocated.  At this point the background processes also start. 
User and server processes – Manage the execution of Sql statements.
  • Shared Server Process can share memory and variable processing for multiple user processes.
  • Dedicated Server Process manages memory and variables for a single user process.


User - A User is the account you use to connect to a database.

Schema - A Schema is the set of objects (tables, views, etc.) that belong to that User account.

Tablespace - A tablespace is a storage location where the actual data underlying database objects can be kept.


                                         Oracle Database Physical structure 

Oracle Database consists of 3 types of physical files


  1. Datafiles – These files contain the actual data.
  2. Redo logfile - Store all changes made to the database as they occur and enable recovery when failures occur.
  3. Control Files - A small binary file that records the physical structure of the database that includes – database name, locations of associated datafiles and redo files, checkpoint information, current sequence number etc.
Other key files as noted above include: 
  1. Parameter file – there are two types of parameter files.
  2. The init.ora file (also called the PFILE) is a static parameter file.  It contains parameters that specify how the database instance is to start up.
  3.  The spfile.ora is a dynamic parameter file.  It also stores parameters to specify how to startup a database; however, its parameters can be modified while the database is running.
  4.  Password file– specifies which *special* users are authenticated to startup/shut down an Oracle Instance.
  5.  Archived redo log files – are copies of the redo log files and are necessary for recovery in an online, transaction-processing environment in the event of a disk failure.

 Memory Structures

The memory structures include three areas of memory:
  1. System Global Area (SGA) – this is allocated when an Oracle Instance starts up.
  2. Program Global Area (PGA) – this is allocated when a Server Process starts up.
  3. User Global Area (UGA) – this is allocated when a user connects to create a session.
Note: A session is a connection of a user to an instance through a user process.


  Processes
Different types of Processes:
  1.  User Process:  Starts when a database user requests to connect to an Oracle Server.
  2. Server Process:  Establishes the Connection to an Oracle Instance when a User Process requests connection – makes the connection for the User Process.
  3. Background Processes:  These start when an Oracle Instance is started up.

END OF NOTES