DBA Training: Understanding Doc
Session: 1
Dated-13th Dec 2012
Topics Covered:
Oracle DB server
Connection to the Oracle DB server
Single Server Instance and Multi-Server Instance
Shared Server Process and Dedicated Server Process
Database Architecture
Sample SQL command execution steps
What is Oracle Database?
Oracle Database Server consists of two things:
Doc
Memor Oracle DB
y Oracle Instance
We can draw an analogy with the picture
given to the oracle database. Human
being can store something in his brain and
can write that into some document. Just
like that in a broader concept we can say
that the Oracle instance is analogous to
the human here. Whereas the document
files which he can write can be thought
like the Oracle DB
Connection to the Oracle Database Server :
We can understand and easily
remember the logic for connection to
the Database server.
Shyam
Suppose Shyamal wants to go to
Rahuls House. Then he needs the al
following information to reach there.
Rahuls
Address House
Room No
Transport Media
Gate No
Mechanism which validates
their relationship
In a similar manner we can think of the connection mechanism to the oracle database
server. Like to connect to the Oracle database we need the following information:
IP address/DNS names of the server---Analogous to the Address for the
previous example
Database nameJust like Room No
TCP- like Transport Media
Port- like gate No
User Id/Password- Validation mechanism
Tnsnames.ora File
The above mentioned information is stored in file called tnsnames.ora. This File exists
both in the client as well as in the server. By default installation of Oracle database it is
generally resides in the following directory:
$ORACLE_HOME\NETWORK\ADMIN
Typically it contains the information in the following manner:
Single Instance Server and Multi- Instance Server:
The single server instance is one where only one instace is using the
Datafiles.Whereas in Multi-Instance Server one Datafile is used by
multiple Instances.As depicted in the picture below.
In In In In
st s1 s2 s3
an
ce
Data Files Data files
Single Instance Multi Instance Server
Server
Advantages of Multi-Instance Server:
Some common and very useful advantages of the Multi-Instance Server
are like:
It can tollarate Fail-Over
Load Balancing can be achived.
Shared Server Process and Dedicated Server Process:
In the dedicated Server process configuration each client is privileged
with a dedicated server process that can serve its need.On the other
hand In Shared server Process configuration one Server Process can serve
to many clients.So here Requset Queue and
Response Queue are used.The scenario can be understood by the
following simple pictures:
Client Listener Dedicated
Server Instance
Process
Dedicated Server Process
Shared
Client Listner Dispatcher Req Server
Q Process
Resp
Instance
Shared Server process
Significance of Listener:
There is a process called Listener is running in the server. The Job of the
Listener is to listen the client request and pass it to appropriate Server
Process to serve the request.
Significance of Dispatcher:
For shared Server Process configuration there is process called dispatcher
runs in the Server. The task of the dispatcher is to pass the client request to
the Request Queue.
Architectural overview Of Oracle Database:
For a very basic understanding of oracle database architecture we
describe this as follows:
Listene Shared Pool DB Buffer Cache
r Redo Buffer Cache
Library
Use
Server cache
r
Process
Dictionary
cache
PMO SMO DB CKP LGW
N N WR T R
Control Files Data Files 10 1
1
TABLE SPACES ARCH
R
UNDO
SEGMENT
Offline Archive File
Step By Step Execution of Update Statement In Database:
User requests for connection to the database server.
User Process reads the tnsnames.ora file and find the service name.
Listener will listen the request and send it to the server process.
Some process will validate the credentials and parameters.
Connection established.
User invokes some sql statement.For example Update.
Parsing is done-It validates the SQL command in Shared Pool.
Execute update command.
DB buffer picks value from table which one is requseted by the user to
update.
REDO log buffer records all the activities of the server process.
DB buffer cache contains the updated value as well as the old value.
User decides to save that value and makes a commit.
While committing, the REDO log buffer content will go to the online
redo log files.
Then UNDO segment is created.
When the REDO log files are filled the contents are switched to the
Archive log file.
While switching the server process tells the CKPT to make control file
and data files in Sync.
After that CKPT gives signal to the DBWR to write the value in db files.