05.11.2015 Views

Apress.Expert.Oracle.Database.Architecture.9i.and.10g.Programming.Techniques.and.Solutions.Sep.2005

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

156<br />

CHAPTER 5 ■ ORACLE PROCESSES<br />

Server Processes<br />

Server processes are those that perform work on behalf of a client session. They are the<br />

processes that ultimately receive <strong>and</strong> act on the SQL statements our applications send to<br />

the database.<br />

In Chapter 2, we briefly touched on two connection types to <strong>Oracle</strong>, namely the following:<br />

• Dedicated server, whereby you get a dedicated process on the server for your connection.<br />

There is a one-to-one mapping between a connection to the database <strong>and</strong> a server<br />

process or thread.<br />

• Shared server, whereby many sessions share a pool of server processes spawned <strong>and</strong><br />

managed by the <strong>Oracle</strong> instance. Your connection is to a database dispatcher, not to a<br />

dedicated server process created just for your connection.<br />

■Note It is important to underst<strong>and</strong> the difference between a connection <strong>and</strong> a session in <strong>Oracle</strong> terminology.<br />

A connection is just a physical path between a client process <strong>and</strong> an <strong>Oracle</strong> instance (e.g., a network<br />

connection between you <strong>and</strong> the instance). A session, on the other h<strong>and</strong>, is a logical entity in the database,<br />

where a client process can execute SQL <strong>and</strong> so on. Many independent sessions can be associated with a<br />

single connection, <strong>and</strong> these sessions can even exist independently of a connection. We will discuss this<br />

further shortly.<br />

Both dedicated <strong>and</strong> shared server processes have the same job: they process all of the SQL<br />

you give to them. When you submit a SELECT * FROM EMP query to the database, an <strong>Oracle</strong> dedicated/shared<br />

server process parses the query <strong>and</strong> places it into the Shared pool (or finds it in<br />

the Shared pool already, hopefully). This process comes up with the query plan, if necessary,<br />

<strong>and</strong> executes the query plan, perhaps finding the necessary data in the buffer cache or reading<br />

the data from disk into the buffer cache.<br />

These server processes are the workhorse processes. Many times, you will find these<br />

processes to be the highest consumers of CPU time on your system, as they are the ones<br />

that do your sorting, your summing, your joining—pretty much everything.<br />

Dedicated Server Connections<br />

In dedicated server mode, there will be a one-to-one mapping between a client connection<br />

<strong>and</strong> a server process (or thread, as the case may be). If you have 100 dedicated server connections<br />

on a UNIX machine, there will be 100 processes executing on their behalf. Graphically it<br />

looks as shown in Figure 5-1.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!