Database Reference
In-Depth Information
Your client application will have Oracle libraries linked into it. These libraries provide the APIs you need in
order to talk to the database. These APIs know how to submit a query to the database and process the cursor that
is returned. They know how to bundle your requests into network calls that the dedicated server will know how to
unbundle. This piece of software is called Oracle Net , although in prior releases you might have known it as SQL*Net
or Net8 . This is the networking software/protocol that Oracle employs to allow for client/server processing (even in an
n -tier architecture, there is a client/server program lurking). Oracle employs this same architecture even if Oracle Net
is not technically involved in the picture. That is, even when the client and server are on the same machine this
two-process (also known as two-task ) architecture is still employed. This architecture provides two benefits:
Remote execution : It is very natural for the client application to be executing on a machine
other than the database itself.
Address space isolation : The server process has read-write access to the SGA. An errant pointer
in a client process could easily corrupt data structures in the SGA if the client process and
server process were physically linked together.
In Chapter 2, we saw how these dedicated servers are spawned or created by the Oracle listener process. I won't
cover that process again; rather, we'll quickly look at what happens when the listener isn't involved. The mechanism is
much the same as it was with the listener, but instead of the listener creating the dedicated server via a fork() / exec()
in UNIX/Linux or an interprocess communication (IPC) call in Windows, the client process itself creates it.
there are many variants of the fork() and exec() calls, such as vfork() and execve() . the call used by
Oracle may vary by operating system and implementation, but the net effect is the same. fork() creates a new process
that is a clone of the parent process; on UNIX/Linux, this is the only way to create a new process. exec() loads a new
program image over the existing program image in memory, thus starting a new program. So, SQL*plus can fork
(copy itself) and then exec the Oracle binary, the dedicated server, overlaying the copy of itself with this new program.
Note
We can see this parent/child process creation clearly on UNIX/Linux when we run the client and server on the
same machine:
$ sqlplus eoda/foo
SQL*Plus: Release 12.1.0.1.0 Production on Thu Mar 20 14:29:00 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Last Successful login time: Thu Mar 20 2014 13:47:01 -07:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
EODA@ORA12CR1> select a.spid dedicated_server, b.process clientpid
2 from v$process a, v$session b
3 where a.addr = b.paddr
4 and b.sid = sys_context('userenv','sid');
DEDICATED_SERVER CLIENTPID
------------------------ ------------------------
18571 18570
EODA@ORA12CR1> !/bin/ps -fp 18571 18570
UID PID PPID C STIME TTY STAT TIME CMD
oracle 18570 11782 0 15:17 pts/4 S+ 0:00 sqlplus
oracle 18571 18570 0 15:17 ? Ss 0:00 oracleORA12CR1(DESCRIPTION=(LOCAL=...
 
 
Search WWH ::




Custom Search