Shared-memory connections (UNIX)

A shared-memory connection uses an area of shared-memory as the channel through which the client and database server communicate with each other. A client cannot have more than one shared-memory connection to a database server.

The following figure illustrates a shared-memory connection.
Figure 1: Client application and a database server communication through a shared-memory connection.

In this figure, a client application and a database server are communicating through a shared-memory connection.

Shared memory provides fast access to a database server, but it poses some security risks. Errant or malicious applications might delete or view message buffers of their own or of other local users. Shared-memory communication is also vulnerable to programming errors if the client application performs explicit memory addressing or over-indexes data arrays. Such errors do not affect the database server if you use network communication or stream pipes.

Example of a shared-memory connection

The following figure shows a shared-memory connection on the computer named river.
Figure 2: A shared-memory connection between a client application and a database server named river_shm.

In this figure, a client application and a database server named river_shm communicate with each other through shared memory.
The onconfig file for this installation includes the following line:
DBSERVERNAME river_shm
The sqlhosts file for this installation includes the following lines:

#dbservername   nettype   hostname   servicename options
 river_shm      onipcshm  river      rivershm
The client application connects to this database server using the following statement:
CONNECT TO '@river_shm'

For a shared-memory connection, no entries in network configuration files are required. Use arbitrary values for the hostname and servicename fields of the sqlhosts file.