The Oracle Net Client Stack
The Oracle Call Interface (OCI) Layer
Most database programming interfaces (JDBC, ADO, ODBC, etc.) communicate with the Oracle Net layer through the OCI layer (see Figure 1). Perl-DBI or PHP applications that talk to Oracle also interact via this layer. Pre-compiler applications like Pro*C/C++ or Pro*COBOL, however, communicate with Oracle through a layer parallel to OCI called SQLLIB. Both OCI and SQLLIB interact with Oracle Net through the UPI (User Program Interface) layer, the lowest layer of the client stack.
|Figure 1: Client End of an Oracle Application|
OCI is the lowest level at which client programs should interact with Oracle. OCI and SQLLIB layers get installed only when Oracle clients are installed. Although non-OCI JDBC drivers bypass the OCI layer, they are thin clients that contain limited networking capabilities for talking to the Oracle Net layer. Because these drivers do not require installation of the Oracle client, the applications are easier to deploybut at the cost of performance. The throughput these drivers provide is less than that of OCI-based JDBC drivers. (asktom.oracle.com provides a nice example of this.)
The Network protocols Oracle Net supports are TCP/IP, TCP/IP + SSH, and named pipes. These days, you can find other ways to connect to an Oracle database (e.g., using HTTP, FTP, and WebDAV), but this article doesn't cover these.
The Oracle Net Server Stack
On the server side, the Oracle Net layer consists of a listener and a combination of the protocol support and the foundation layer (see Figure 2). The PMON (process monitor) process of the server registers with the listener initially. The Oracle Listener listens for client requests and establishes a connection with the server. The listener serves only to establish a connection between the client and the server. Once it establishes the connection, it has no other purpose.
|Figure 2: Server End of an Oracle Application|
The OPI (Oracle Program Interface) is the highest layer of the server-side call stack. The Oracle Net layer talks to the OPI layer, which in-turn talks to the instance. (For the various layers that make up the Server Process, please refer to Oracle 8i Internal Services by Steve Adams, O'Reilly Press.)
Transparent Network Substrate (TNS)
TNS is the basis of the Net foundation layer. It provides a single common interface for all protocols.
The Two-task Common (TTC) Layer
Lying between the UPI and Oracle Net layers on the client is the TTC layer, which also exists between the OPI and RDBMSs. This layer enables conversion between different charactersets or formats. It evaluates the requirements for conversion when the listener initially establishes the connection.
Errors such as "ORA-03120 two-task conversion routine: integer overflow" are raised by this layer.