Monday, June 10, 2013

Understanding - TNS Architecture

TNS : Transparent Network Substrate 

Oracle uses a common set of services known as Transparent Network Substrate (TNS) to handle communication within Oracle components.
The actual task of moving the data between two machines is left to the services provided by the networking software. Oracle software uses these underlying services to establish the communication between the components.
It is important to remember this model of network communication. The acronym TNS occurs in many places, especially in error messages. TNS uses the underlying protocol, which could be TCP/IP, SPX/IPX, DECNET, AppleTALK, etc.
This combination of TNS and the underlying networking protocol makes the diagnosis of problems quite challenging, but Oracle does provide some tracing facilities to make it easier.

The Oracle Transparent Network Substrate (TNS) facilitates simple inter-database communication.
To implement TNS, Oracle has built a management layer over the standard network topology.

Oracle management layer 
To implement Net8, several Oracle files must be present on the server:
  1. tnsnames.ora defines outgoing database requests. It contains all database names (SIDs) running on the processor.
    When a new database is added to a box, the file /etc/tnsnames.ora must be updated.
    This file also describes each domain name, including protocol, host, and port information.
  2. istener.ora contains a list of destinations for incoming database connections.. When a new destination database is added to a box, it must be added to /etc/listener.ora and the listener must be bounced.
In addition, TNS uses several server files to resolve host and service names. On UNIX, these files include:
  1. /etc/HOSTS lists all the host names and their corresponding IP addresses.
  2. /etc/SERVICES lists the SQL*Net services and their IP addresses.




Thursday, June 6, 2013

Oracle Memory Architecture


 Oracle uses three kinds of memory structures

SGA
(System Global Area)
is a large part of memory that all the oracle background processes access.
PGA  
(Process Global Area)
This is memory that is private to a single process or thread and is not accessible by any other process or thread
UGA
(User Global Area)
This is memory that is assoicated with your session, it can be found in the PGA or SGA depending on whether you are connected to the database via shared server
Shared Server - the UGA will be in the SGA
Dedicated Server - the UGA will be in the PGA

SGA
There are five memory structures that make up the System Global Area (SGA). The SGA will store many internal data structures that all processes need access to, cache data from disk, cache redo data before writing to disk, hold parsed SQL plans and so on.

The fixed SGA contains a set of variables that point to the other components of the SGA, and variables that contain the values of various parameters., the area is a kind of bootstrap section of the SGA, something that Oracle uses to find other bits and pieces of the SGA

PGA and UGA
The PGA (Process Global Area) is a specific piece of memory that is associated with a single process or thread, it is not accessible by any other process or thread, note that each of Oracles background processes have a PGA area. The UGA (User Global Area) is your state information, this area of memory will be accessed by your current session, depending on the connection type (shared server) the UGA can be located in the SGA which is accessible by any one of the shared server processes, because a dedicated connection does not use shared servers the memory will be located in the PGA
  • Shared server - UGA will be part of the SGA
  • Dedicated server - UGA will be the PGA
 Oracle creates a PGA area for each users session, this area holds data and control information, the PGA is exclusively used by the users session. Users cursors, sort operations are all stored in the PGA. The PGA is split in to two areas

Java : OutOfMemoryError

java.lang.OutOfMemoryError Exception Thrown when the Java Virtual Machine cannot allocate an object because it is out of memory, and no ...