Vous êtes sur la page 1sur 138

In the name of God, the most Gracious, the most Compassionate.

O Or ra ac cl le e 9 9i i D Da at ta ab ba as se e A Ad dm mi in ni is st tr ra at ti io on n
i in n 1 10 0 M Mi in nu ut te es s




Oracle 9i Database Administration in 10 Minutes
2

3


O
O
r
r
a
a
c
c
l
l
e
e
9
9
i
i
D
D
a
a
t
t
a
a
b
b
a
a
s
s
e
e

A
A
d
d
m
m
i
i
n
n
i
i
s
s
t
t
r
r
a
a
t
t
i
i
o
o
n
n


I
I
n
n


1
1
0
0
M
M
i
i
n
n
u
u
t
t
e
e
s
s










B BY Y

A AS SI IM M A AB BB BA AS SI I








. .: :| |: :. . T Ta ak kv ve ee en n, , I In nc c. .
Oracle 9i Database Administration in 10 Minutes
4
Copyright 2005 Takveen, Inc. P.O. Box 1, South River, NJ
08882. All rights reserved. No part of this publication may be
stored in a retrieval system, transmitted, or reproduced in any
way, including but not limited to photocopy, photography,
magnetic, or other record, without the prior agreement and
written permission of the publisher and author.


ISBN: 0-9770739-7-1


Takveen and the Takveen logo are either registered trademarks
or trademarks of Takveen, Inc. in the United States and/or
other countries.

The author and publisher have made their best effort to prepare
this book, and the content is based upon final release software
whenever possible. Portion of the manuscript may be based
upon pre-release versions supplied by the software
manufacturer(s). The author and the publisher make no
representation or warranties of any kind with regard to the
completeness or accuracy of the contents herein and accept no
liability of ANY KIND including but no limited to
performance, merchantability, fitness for any particular
purpose, or any losses or damages of ANY KIND caused or
alleged to be caused directly or indirectly from this book.



Manufactured in the United States of America.
5



D De ed di ic ca at te ed d T To o t th he e o on nl ly y O On ne e



T To o t th he e o on nl ly y O On ne e, ,
W Wh ho o s se ee es s t th hr ro ou ug gh h o ou ur r e ey ye es s, ,
W Wh ho o l li is st te en ns s t th hr ro ou ug gh h o ou ur r e ea ar rs s, ,
W Wh ho o h ha as s n no o f fe ea ar r. .

T To o t th he e o on nl ly y O On ne e, ,
W Wh ho o k kn no ow ws s w wh ha at t s s i in ns si id de e o ou ur r h he ea ar rt t, ,
W Wh he et th he er r i it t s s p pu ur re e o or r J Ja ar rv vi ik k h he ea ar rt t, ,

T To o t th he e o on nl ly y O On ne e, ,
W Wh ho o g gu ui id de es s, ,
W Wh ho o g gl li id de es s t th he e s sh hi ip ps s t to o t th he e s si id de e, ,
W Wh ho o f fi in nd ds s t th he e g gr ro oo om ms s f fo or r t th he e b br ri id de es s. .

T To o t th he e o on nl ly y O On ne e, ,
W Wh ho o l le et t y yo ou u h ha av ve e a a d dr ro op pl le et t f fr ro om m H Hi is s s se ea a, ,
W Wh ho o l le et t y yo ou u d dr ri in nk k h ho on ne ey y f fr ro om m H Hi is s b be ee e. .

T To o t th he e o on nl ly y O On ne e, ,
W Wh ho o w wa as s t th he e b be eg gi in nn ni in ng g, ,
W Wh ho o w wi il ll l b be e t th he e e en nd d, ,
W Wh ho o w wi il ll l d de ec ci id de e w wh he et th he er r I I w wi il ll l b be e i in n H He ea av ve en n o or r H He el ll l, ,

W Wh ha at te ev ve er r n na am me e y yo ou u g gi iv ve e H Hi im m, , A As si im m! !
I I k kn no ow w o on ne e t th hi in ng g f fo or r s su ur re e, ,
H He e i is s t th he e o on nl ly y O On ne e. .







Oracle 9i Database Administration in 10 Minutes
6









7
About the Author


Mr. Abbasi is President and CEO of Takveen, Inc. NJ, which is
firm providing information technology related Optimal
Solutions to industry. He is also attached with three top-notch
computer schools of NJ teaching Oracle Database
Administration in Unix/Windows Server environments. Before
coming to NJ, he used to teach Oracle in heart of NC, Raleigh
while working as Chief Technologist with a business solutions
development firm.

Mr. Abbasi has been attached intensely with the IT field for
past 13 years and has written dozens of softwares and tons of
code from programming microcontrollers using Assembly
language to writing 3-tier multi-language web applications.

He did B.Sc. Electrical Engineering from University of
Engineering & Technology, Lahore, Pakistan
(www.uet.edu.pk). He is Oracle Certified Professional
Database Administrator (OCP), Microsoft Certified
Professional (VB) and lots of other computer certifications.
Besides certifications, he has lots of publications and has filed
1 patent with United States Patent & Trade Mark Office.

When asked Mr. Abbasi, he said that it all erupted with a
saying of my engineering professor,

Think yourself .

Oracle 9i Database Administration in 10 Minutes
8

9
Acknowledgements

First, I am really thankful to God: The Designer of this
Universe, everything within and beyond. I always remember
Him as Supreme Progneer (Programmer & Engineer). The
only One whos every release is a final release and no
upgrades, version releases or service packs after words. I salute
your sea of computational and engineering skills my Lord and
your graciousness for letting me have a droplet from it.

I really want to thank my father and mother for their wonderful
support. Although my father is no more living but his
exceptional sacrifices will never be forgotten

I like to thank Arshia, Mateen and Abdul-Wadud for their
encouragement to let me work on this book even during the
time which I should had spent with them.

Finally, I am thankful to all the wonderful instructors,
professors, scholars, students and friends I had for their support
and encouragement.



Oracle 9i Database Administration in 10 Minutes
10

11
Table of Contents

Minute 1: ......................................................................... 17
Understanding the Oracle Environment

Minute 2: ......................................................................... 23
Understanding the Oracle Instance

Minute 3: ......................................................................... 33
Understanding the working of Oracle Instance

Minute 4: ......................................................................... 39
Understanding Oracle Database

Minute 5: ......................................................................... 51
Oracle 9i Software Installation

Minute 6: ......................................................................... 57
Oracle 9i Database Design using DBCA

Minute 7: ......................................................................... 85
Enabling Other Computers to Access Oracle
Server

Minute 8: ....................................................................... 107
Oracle Enterprise Manger

Minute 9: ....................................................................... 121
Oracle Backup & Recovery -Simple Technique

Minute 10: ..................................................................... 129
Oracle Performance Tuning

INDEX .......................................................................... 135

Oracle 9i Database Administration in 10 Minutes
12




















13
FIGURE 1: THE COMPLETE ORACLE SYSTEM: ORACLE INSTANCE & ORACLE DATABASE.
................................................................................................... 20
FIGURE 2: ORACLE INSTANCE CAN HEAR YOU FROM ANY CORNER OF GLOBE WHETHER ITS
LAN OR INTERNET. .......................................................................... 21
FIGURE 3: BACKGROUND PROCESSES & MEMORY ARCHITECTURE INSIDE BRAIN. .. 26
FIGURE 4: PHYSICALLY ALL HUMAN BRAINS ARE SIMILAR. .................................. 26
FIGURE 5: ORACLE INSTANCE MEMORY ARCHITECTURE. ................................... 27
FIGURE 6: ORACLE INSTANCE BACKGROUND PROCESSES; SHARED SERVER MODE. .. 35
FIGURE 7: ORACLE INSTANCE BACKGROUND PROCESSES; DEDICATED SERVER MODE.36
FIGURE 8: RESTAURANT RUNNING UNDER SHARED WAITRESS MODE ................ 37
FIGURE 9: RESTAURANT RUNNING UNDER DEDICATED WAITER MODE ............... 38
FIGURE 10: PHYSICAL ARCHITECTURE: ORACLE DATABASE ............................... 42
FIGURE 11: ORACLE DATABASE LOGICAL ARCHITECTURE. .................................. 44
FIGURE 12: PHYSICAL & LOGICAL ARCHITECTURE RELATIONSHIP. ........................ 45
FIGURE 13: TABLESPACES RELATES TO DATA FILES ONLY. .................................. 46
FIGURE 14: ONE OBJECT (E.G. TABLE) CAN BE IN TWO OR MORE DATA FILES BUT ONLY IN
ONE TABLESPACE. ............................................................................ 47
FIGURE 15: REDO LOG FILES IN ACTION. ........................................................ 48
FIGURE 16: THE FIRST TEXT BOX WILL ASK YOU THE LOCATION OF ORACLE SOFTWARE FILES
THAT NEEDS TO BE INSTALLED. THE SECOND IS THE NAME TEXT BOX WHERE YOU
WRITE THE ORACLE HOME NAME AND THE THIRD ONE IS THE DESTINATION
LOCATION WHERE YOU WANT ORACLE SOFTWARE TO BE INSTALLED. .......... 53
FIGURE 17: SECOND OPTION IS FOR INSTALLING A CLIENT AND WOULD LACK THE ABILITY TO
CREATE THE DATABASE. THE THIRD OPTIONAL IS BASICALLY AN ADD-ON FEATURE
WHICH WILL INSTALL ORACLE MANAGEMENT SERVER AND OTHER RELATED
MANAGEMENT AND INTEGRATION TOO. ............................................... 54
FIGURE 18: ORACLE ENTERPRISE EDITION IS FOR HIGH-VOLUME APPLICATIONS. STANDARD
EDITION IS FOR DEPARTMENTAL APPLICATIONS WHEREAS PERSONAL EDITION OF
ORACLE IS FOR SINGLE USER DEVELOPMENT ENVIRONMENT. .................... 55
FIGURE 19: IF WE SELECT GENERAL PURPOSE THEN ORACLE UNIVERSAL INSTALLER
(OUI) WILL NOT ONLY INSTALL THE SOFTWARE BUT WILL CREATE A STANDARD
GENERAL PURPOSE DATABASE TOO BY DEFAULT. BUT WE WANT TO INSTALL
SOFTWARE ONLY USING OUI AND THEN LATER LEARN HOW TO DEVELOP THE
DATABASE. ..................................................................................... 56
FIGURE 20: BEFORE USING DBCA WE HAVE TO SET CERTAIN OS ENVIRONMENT
VARIABLES. .................................................................................... 59
FIGURE 21: IN WINDOWS OPERATING SYSTEM CLICK: <START>, <ALL PROGRAMS>,
<ORACLE>, <CONFIGURATION & MIGRATION TOOLS> AND FINALLY <DATABASE
CONFIGURATION ASSISTANCE>. ......................................................... 61
FIGURE 22: FIRST WINDOW OF DBCA IS BASICALLY A WELCOME MESSAGE WITH A BRIEF
DESCRIPTION ON THE PURPOSE OF THIS TOOL. ....................................... 62
Oracle 9i Database Administration in 10 Minutes
14
FIGURE 23: DBCA CAN ASSIST DBA WITH 3 OTHER TASKS BESIDES CREATING A NEW
DATABASE I.E. CONFIGURING DATABASE OPTIONS IN A DATABASE, DELETE A
DATABASE AND MANAGE TEMPLATES................................................... 63
FIGURE 24: EACH TEMPLATE HAS PREDEFINED SETTINGS E.G. DATA WAREHOUSE
TEMPLATE HAS SETTINGS GOOD FOR ANALYTICAL PROCESSING PURPOSES. .. 64
FIGURE 25: YOU CAN ASSIGN ANY NAME TO GLOBAL DATABASE NAME. .............. 65
FIGURE 26: THIS WINDOW IS MEANT FOR MAKE A DECISION WHETHER WE WANT TO RUN
OUR ORACLE SERVER IN DEDICATED SERVER MODE OR THE SHARED SERVER
MODE. ......................................................................................... 66
FIGURE 27: CUSTOM OPTION WILL ALLOW YOU TO SELECT THE SGA SIZE ACCORDING TO
YOU NEEDS. ................................................................................... 67
FIGURE 28: THIS WINDOW WILL ALLOW YOU TO SET UP ORACLE SERVER FOR ARCHIVING
OF REDO LOG FILES. ......................................................................... 68
FIGURE 29: THIS TAB WILL BE HAVING THE INFORMATION ABOUT LOCATION OF ALL
ORACLE PHYSICAL FILES. ................................................................... 69
FIGURE 30: THESE FOUR PARAMETERS ARE PRESENT IN INIT(SID).ORA FILE. ......... 70
FIGURE 31: THIS WINDOW PROVIDES THE COMPLETE LIST OF INIT(SID).ORA FILE
PARAMETERS. ORACLE INSTANCE READS THE FILE AT THE TIME OF STARTUP.71
FIGURE 32: A CLOSE-UP OF FIGURE 31. ........................................................ 72
FIGURE 33: EACH ORACLE DATABASE REQUIRES ONE CONTROL FILE AND THROUGH THIS
WINDOW YOU CAN SET-UP YOUR CONTROL FILE LOCATION(S). MIRROR COPIES
SHOULD BE ON DIFFERENT DRIVES FOR GREATER FAULT TOLERANCE. .......... 73
FIGURE 34: SET THE MAXIMUM NUMBER OF DATAFILES, REDO LOG GROUPS ETC. .. 74
FIGURE 35: CLICKING DATAFILES WILL CHANGE THE RIGHT PANE VIEW TO SHOW ALL
DATAFILES. ..................................................................................... 74
FIGURE 36: CLICKING 1 UNDER REDO LOG GROUPS WILL CHANGE THE RIGHT PANE VIEW
TO SHOW ALL THE MEMBER OF THAT PARTICULAR REDO LOG GROUP. EACH REDO
LOG GROUP SHOULD HAVE AT LEAST ONE MEMBER. ................................ 75
FIGURE 37: EITHER YOU CAN CHANGE THE DEFAULT FILE SIZE FOR REDO LOG MEMBER OR
GO WHAT IS DEFAULT USING THIS WINDOW. ......................................... 76
FIGURE 38: YOU CAN ALSO SAVE THE SETTINGS FOR YOUR DATABASE IN A TEMPLATE FOR
CLONE DATABASE DEVELOPMENT. ....................................................... 77
FIGURE 39: ITS BETTER TO CHANGE ALL THE DEFAULT PASSWORDS AT THIS POINT BY
CLICKING THE <PASSWORD MANAGEMENT> BUTTON. ............................ 78
FIGURE 40: CHANGE THE PASSWORD AND MAKE SURE THE ACCOUNT IS NOT HAVE A CHECK
MARK IN THE CORRESPONDING LOCK ACCOUNT? FIELD. ....................... 79
FIGURE 41: USE ORACLE ENTERPRISE MANAGER (OEM) TO TEST CONNECTION TO YOUR
RECENTLY DEVELOPED DATABASE. OEM IS LOCATED UNDER <START>, <ALL
PROGRAMS>, <ORACLE> FOLDER. ...................................................... 80
FIGURE 42: A CLOSE-UP OF THE FIGURE 41. .................................................. 80
FIGURE 43: SELECT THE LAUNCH STANDALONE OPTION. ................................. 81
15
FIGURE 44: THE TEST DATABASE WILL BE VISIBLE IN THE TREE HIERARCHY OF OEM
(ORACLE ENTERPRISE MANAGER). ..................................................... 82
FIGURE 45: CONNECTING AS SYSDBA TO TEST DATABASE .............................. 82
FIGURE 46: EXPAND THE TABLESPACES ITEM IN THE TREE TO SEE THE LIST OF
TABLESPACES WITHIN TEST DATABASE. ............................................... 83
FIGURE 47: ORACLE NET NEEDS TO BE CONFIGURED ON SERVER AS WELL AS ON EACH
CLIENT. ......................................................................................... 87
FIGURE 48: ORACLE INSTANCE KNOWS HOW TO SPEAK WITH ORACLE NET LAYER WHEREAS
ORACLE NET DEALS WITH DIFFERENT NETWORK PROTOCOLS. ................... 88
FIGURE 49: ACCESSING ORACLE NET MANAGER (ONM): JAVA BASED PROGRAM,
COMPLETELY INDEPENDENT OF OPERATING SYSTEM. .............................. 89
FIGURE 50: EXPANDING LISTENERS SHOWS NO LISTENER PROCESS. ................. 90
FIGURE 51: ORACLE NET MANAGER SHOWING NO SERVICE NAME. ................... 90
FIGURE 52: CLICK THE LISTENER AND THEN THE + ICON TO CREATE NEW LISTENER
PROCESS. ....................................................................................... 91
FIGURE 53: ASSIGN THE NAME TO THE LISTENER PROCESS................................. 91
FIGURE 54: ADD ADDRESS OF NEWLY ADDED LISTENER PROCESS TO TREE. ........ 93
FIGURE 55: LISTENERS LOCATION FOR LISTENING REQUESTS. ............................ 94
FIGURE 56: LISTENER PROCESS WILL BEQUEATH THE CONNECTION REQUEST FROM THE
CLIENT TO THE DATABASE ADDED USING THE <ADD DATABASE> BUTTON. .. 95
FIGURE 57: ENTER GLOBAL DATABASE NAME, DATABASE HOME DIRECTORY LOCATION
AND FINALLY SID (NAME OF ORACLE INSTANCE). ................................... 96
FIGURE 58: SAVE NETWORK CONFIGURATION AND START THE LISTENER. ............. 97
FIGURE 59: IN WINDOWS SERVER 2003 ENVIRONMENT, THE LISTENER PROCESS CAN BE
ACTIVATED UNDER THE SERVICES WINDOW. ...................................... 98
FIGURE 60: CLICK THE SERVICE NAME ITEM AND THEN CLICK THE + ICON TO ADD A
NEW SERVICE NAME TO THE TREE. ....................................................... 99
FIGURE 61: NET SERVICE NAME WILL BE THE NICK NAME ON THIS MACHINE FOR THE
ORACLE DATABASE WE WANT TO CONNECT TO. IT CAN BE ANY NAME. ..... 100
FIGURE 62: SELECT THE NETWORK PROTOCOL USED TO COMMUNICATE WITH ORACLE
SERVER FROM THIS CLIENT. ............................................................. 101
FIGURE 63: NET SERVICE NAME IS AN ALIAS GIVEN TO DETAILED LIST OF CONNECTION
PARAMETERS. HOST NAME WILL BE THE NAME OF THE MACHINE ON THE NETWORK
RUNNING ORACLE DATABASE SERVER. .............................................. 102
FIGURE 64: SERVICE NAME WILL BE GLOBAL DATABASE NAME OF ORACLE DATABASE
SERVER. LISTENER PROCESS WILL BE REQUESTED BY CLIENT TO BEQUEATH THE
CONNECTION TO THIS ORACLE DATABASE SERVER. ............................... 103
FIGURE 65: SERVICE NAME & NET SERVICE NAME IS NOT SAME. SERVICE NAME IS THE
GLOBAL DATABASE NAME. ............................................................. 104
FIGURE 66: SAVE NETWORK CONFIGURATION. ORACLE NET MANAGER WILL GENERATE
TNSNAMES.ORA FILE CONTAINING NET SERVICE NAME (ALIAS) RESOLUTION TO
MAKE A ORACLE SERVER CONNECTION. ............................................. 105
Oracle 9i Database Administration in 10 Minutes
16
FIGURE 67: ORACLE ENTERPRISE MANAGER (OEM) IS A JAVA BASED APPLICATION,
COMPLETELY OPERATING SYSTEM INDEPENDENT. ................................. 109
FIGURE 68: NO NEED TO REMEMBER SQL STATEMENTS. MOST OF THE TIME RIGHT-CLICK
SOLVES THE PROBLEM AND POPPED UP MENU PROVIDES YOU THE COMMAND YOU
WERE LOOKING FOR. ...................................................................... 110
FIGURE 69: CREATE THE NEW TABLESPACE USING THIS WINDOW. .................... 111
FIGURE 70: STORAGE TAB WILL GIVES YOU THE OPTION TO SELECT LOCALLY MANAGED OR
DICTIONARY MANAGED EXTENTS. YOU CAN ALSO SELECT TO MAKE THE TABLESPACE
EXTEND AUTOMATICALLY IN CASE IT RUNS OUT OF SPACE BY SELECTING
AUTOMATIC ALLOCATION. ........................................................... 112
FIGURE 71: MANAGE DATA FILES USING ORACLE ENTERPRISE MANAGER (OEM).113
FIGURE 72: MANAGE REDO LOG FILES & GROUPS USING ORACLE ENTERPRISE MANAGER
(OEM). ...................................................................................... 114
FIGURE 73: COMPLETE USERS MANAGEMENT USING ORACLE ENTERPRISE MANAGER
(OEM). ...................................................................................... 115
FIGURE 74: CREATE USER USER WINDOW WILL POP UP ONCE YOU RIGHT CLICK ANY USER
AND SELECT THE OPTION CREATE AS SHOWN IN THE SLIDE ABOVE.COMPLETE
ORACLE INSTANCE MANAGEMENT USING ORACLE ENTERPRISE MANGER (OEM).
................................................................................................. 116
FIGURE 75: MEMORY TAB GIVES YOU FULL CONTROL OVER ORACLE INSTANCE MEMORY
ARCHITECTURE COMPONENTS. ......................................................... 117
FIGURE 76: DATABASE RECOVERY ISSUES CAN BE MANAGED EASILY USING ORACLE
ENTERPRISE MANAGER (OEM). ...................................................... 118

17

M
M
i
i
n
n
u
u
t
t
e
e
1
1
:
:



Understanding the
Oracle
Environment










Oracle 9i Database Administration in 10 Minutes
18


19
Oracle is such a complex system that without analogies its
very hard to comprehend and grasp the concept of Oracle
architecture and its working. Also once you understand the
concepts then there is nothing left for cramming.

Oracle System is basically divided into two things namely
Oracle Instance and Oracle Database. We have taken the
analogy of a Genie (Ghost/Djin): just like the one you might
have seen in the movie/story of Aladdin & the Magic Lamp.
When Aladdin rubbed the lamp; Genie became available and
fulfilled all his commands. Similarly when you double click
Oracle icon in your system, Oracle Instance gets alive and
waits for users information/data related commands to fulfill, as
it is a magnificent Data Management Genie.

Oracle Instance is something with which users interact in terms
of storing and retrieving information. Anything that is going
into the database or coming out of the database has to be
through Oracle Instance and to communicate with Oracle
Instance we need to learn Genies language: SQL. It stands for
Structured Query Language and pronounced as See-Qual.

The Oracle Database is basically Genies area to write
information and to make the changes permanent on the hard
disk. The communication between Oracle and user takes place
in a fashion that first user has to establish a connection with
Oracle server or more precisely oracle instance by providing
his/her credentials (Username and password). Once verified,
Oracle accepts the connection otherwise the connection request
will get rejected.




Figure 1: The C


In Oracle wo
considered as
oracle server
oracle server
sessions drop
very easy to m
words with n
have a look o

SELECT nam
FROM addre
Once Oracle
retrieve all t
Oracle 9i Database
omplete Oracle S
orld each con
s session. If th
r, we can say
r. If one pers
ps to two. SQ
master, as it is
no or very litt
n following SQ
me, phone
ss_book;
e Instance wi
the name a
e Administration in
System: Oracle In
nnected user w
here are three
that there are
son logs off
QL commands
comprised of
tle abbreviatio
QL command
ill receive thi
and phone i
10 Minutes
stance & Oracle D
with oracle se
connected use
e three sessio
then the num
s are very sim
all full-length
ons. For exam
is command,
information fr
20

Database.

erver is
ers with
ons with
mber of
mple and
English
mple lets
it will
rom the

address_book
If there are 1
sent to user co

Figure 2: Oracle




k table and sen
000 records o
omputer.
e Instance can hea
LA
nd it to the user
r rows in that
ar you from any c
AN or internet.

r who had aske
table; all of th
corner of globe w
21
ed for it.
hem get

whether its

Oracle 9i Database Administration in 10 Minutes
22


23

M
M
i
i
n
n
u
u
t
t
e
e
2
2
:
:



Understanding
Oracle Instance












Oracle 9i Database Administration in 10 Minutes
24

25
The thing I want you to memorize if you havent memorized it
yet, the definition of Oracle Instance i.e. the background
processes and memory architecture constitute the Oracle
Instance. To better understand these two things I want to give
you the analogy of the way human brain works. Human brains
works pretty much the same way Oracle Instance works.

Oracle System Human System
Oracle Instance + Oracle
Database
Human Brain + Note
Books (Papers etc.)
Oracle Instance is
composed of background
processes & memory
architecture.
Human brain is composed
of background processes &
memory architecture.
Sources of input to Oracle
Instance are connected
users.
Sources of input to human
brain are nose, eye, ear etc.
Background processes
receives input from
connected users and using
the memory (RAM)
architecture produce the
output.
Background processes
(decision, alerts,
relationships etc.) receives
input from five senses and
using the brain memory
produces the output
(decision).
Physically all Oracle
Systems are alike i.e. data
files, control file, redo log
files etc.
Physically all human brains
are alike i.e. two
hemispheres.
Its the logical architecture
which makes one Oracle
system different from the
other.
Its the logical architecture
which makes one brain
different than other.




Figure 3: Bac


Fig
Oracle 9i Database
ckground Process
gure 4: Physically
e Administration in
ses & Memory Ar
y all human brain
10 Minutes
rchitecture inside

ns are similar.
26

Brain.



Understand
Architectu

By saying, m
how RAM is
memory, occ
categories. O
called Non Sh

F


Oracle allocat
starts and dea
mandatory ar
5. Optional a
arises. In ma
Buffer Cache
areas we hav
utilized for S
PL/SQL obje
ding Oracle
re
memory archite
utilized by O
cupied by O
ne is called Sh
hared Memory
igure 5: Oracle In
tes SGA (Syst
allocates it whe
reas and two op
area means y
andatory areas
e and Redo Lo
ve Large Poo
SQL requests
ects execution,
e Instances
ecture of Orac
racle Instance
racle is divid
hared Memory
y.
nstance memory a
tem Global Are
en the Instance
ptional areas a
ou can have
s, we have Sh
g Buffer Cach
ol and Java P
coming from
data dictionar
Memory
cle Instance w
. The RAM or
ded into two
y and the othe
architecture.
ea) whenever I
e ends. SGA h
as shown in the
it if the requ
hared Pool, D
he whereas in o
Pool. Shared
the connected
ry views, locks
27
we mean
r simply
o major
er one is


Instance
has three
e Figure
uirement
Database
optional
Pool is
d users,
s and so
Oracle 9i Database Administration in 10 Minutes
28
on. There is a special area inside Shared Pool that deals with
SQL and PL/SQL, is called the Library Cache. If one user has
executed the SQL statement that statement will get parsed and
complied utilizing this area.

The Data Dictionary Cache holds the most recently used
database dictionary information. Data Dictionary is basically
the information about the data inside the database or in other
words metadata in the form of tables and view about the
database.

Database Buffer Cache holds the DB Blocks recently read from
the data files. Database Buffer Cache has further three sub-
caches. One is called KEEP, second one is RECYCLE and the
third one is DEFAULT. In KEEP, DB blocks will be retained
in the RAM and will not get aged out. Oracle Instance will
remove stuff placed in RECYCLE from the RAM as soon as
they are not needed. DB Blocks without any assigned attribute
(KEEP or RECYCLE) are placed in the DEFAULT buffer
pool.

Within whole Database Buffer Cache, there lie three different
types of buffers or in other words three different states of
buffers. These three states are, Dirty Buffers, Free Buffers and
Pinned Buffers. Buffers that need to be written to the data files
are marked dirty and hence got the name Dirty Buffers. Once
written to the data files they are available to be over-written
and those which never had any data, are called Free Buffers.
Buffers that are currently being accessed or those that are
explicitly marked for future use, are called Pinned Buffers e.g.
KEEP buffer pool.

Redo Log Buffer Cache holds the information about the
changes that are being made to the database. Large Pool is
optionally required for specific database operation like backup
or restore to avoid contention with rest of the good stuff of
SGA.
29

Java Pool is another optional area and can be requested to
provide memory for java objects within Oracle database. The
Non-Shared part of memory is called PGA (Program Global
Area) and contains the data and control information for a server
process. Stack space in the PGA is utilized by server process to
hold variables, arrays and other useful information pertaining
to connected session.


Understanding Oracle Instances Background
Processes

Oracle background processes have been assigned a specific
job. Each process gets executed under certain circumstances. If
those circumstances happen again, the process gets executed
again. Lets look at each of these processes one by one.

DBWn

DBWn or Database Writer process writes the contents of dirty
buffers of Database Buffer Cache to the data files.

LGWR

The Log Writer process writes the Redo Log Buffers from
the Redo Log Cache to the Redo Log files.


ARCn

If we dont want the Redo Log files to be overwritten by
LGWR process then we have to run the database in
ARCHIVELOG mode and we have to enable automatic
archiving by setting LOG_ARCHIVE_START = True.

Oracle 9i Database Administration in 10 Minutes
30
Under this mode Archiver process (ARCn) become alive.
ARCn process makes sure that the Redo Log files gets archived
to the archived location before it gets overwritten by LGWR
process. In Oracle 9i, we can have as many as ten Archiver
processes (ARC0 to ARC9).

CKPT (Checkpoint)

CKPT process updates the header of data files and control file.
Its a event that happens automatically and kicks the DBWR
process to write the dirty buffers to data files.

SMON, PMON

SMON or System Monitor performs instance recovery, if
necessary on system startup whereas PMON or Process
Monitor frees up all the resources held by a user process
whenever it fails.

Dnnn or Dispatcher Process(es)

Dnnn or Dispatcher process is only available if you run Oracle
system in Shared Server mode. Its prime job is to take the
request from the connected user and place it in the in the
Request Queue. Server process when its free picks up the
request form the request queue and put the response back in the
Response Queue after processing the request. Dispatcher
process when its free picks that response from the response
queue and sends it back to the user who submitted that request.
You can have multiple Dnnn processes for single Database
Instance.






31
Snnn or Shared Server Process(es)

Shared Server processes (Snnn) utilizing the beauty of
Dispatcher process and Request and Response Queue to serve
more than one user. The number of Shared Server processes
can be controlled using two init.ora parameters,
SHARED_SERVERS and MAX_SHARED_SERVERS.

















Oracle 9i Database Administration in 10 Minutes
32


33

M
M
i
i
n
n
u
u
t
t
e
e
3
3
:
:



Understanding the
Working of Oracle
Instance










Oracle 9i Database Administration in 10 Minutes
34


Oracle Serve
mode or as D
Instance wor
beauty of sh
process hand
server proces

LGWR (Log
SMON (Syste
Oracle backg
memory arc
background p
area) to fulfill

Figure 6: Or


Figure 7 show
might have
especially the
Response Qu
working in D
er can be conf
Dedicated Ser
rking under
ared server co
dles multiple s
s reduces.
g Writer Pro
em Monitor), A
ground proces
chitecture of
process utilize
l requests of al
acle Instance bac
ws the same thi
noticed that
ere is no Disp
ueue. This is be
edicated Serve
figured to run
rver mode. Fi
Shared Serve
onfiguration is
essions and h
cess), PMON
ARCn (Archiv
ses and SGA
Oracle Inst
e the memory
ll the connecte
kground processe
ing as the prev
we have less
patcher process
ecause; here w
er mode.
under Shared
gure 6 shows
r configuratio
s that a single
hence the idle
N (Process M
ver Process) etc
in the center
ance. So all
y architecture
d users.
es; shared server m
vious one but h
s number of
s and no Requ
we are showing
35
d Server
s Oracle
on. The
e server
time of
Monitor),
c. are all
r is the
l these
(shared

mode.

here you
blocks,
uest and
g Oracle


In dedicated s
a separate ser
having high i
would be doin
arrive. This c
should only
resources ava

Figure 7: Orac


The Shared S
a restaurant a
serving more
waitress will
be having one

Oracle 9i Database
server mode, e
rver process. A
dle server time
ng nothing and
configuration
be utilized w
ailable.
cle Instance backg
Server mode ca
as shown in the
e people. In t
be less comp
e waitress per p
e Administration in
each connected
Although this co
e as most of th
d waiting for n
has high perfo
when you hav
ground processes
an be best visu
e Figure 8. The
this case the
ared to the sit
person.
10 Minutes
d user is enterta
onfiguration w
he time Server
next SQL state
formance facto
ve plenty of
; dedicated server
ualized if you i
ere are two wa
idle time f
tuation where
36
ained by
would be
process
ement to
or but it
system

r mode.

imagine
aitresses
for each
we will

Figure 8


In Shared Se
receives the u
Server proces
request queu
response queu
the response
specific user w

The point to
queues are n
words part
Dedicated Se
Queues nor a
to Oracle Ins
serve him/her

8: Restaurant Run
erver mode th
users request an
ss when its f
ue, processes
ue. Dispatcher
from the res
who submitted
be noted ove
not processes.
of memory (
erver mode t
any Dispatcher
stance, one n
r.
nning Under Shar
here is a dispa
nd places it in
free picks up
it and put th
r process wh
sponse queue
d that request.
r here is that
They are part
(RAM) utilize
there is neith
r process. Whe
ew Server pro
red Waitress Mod
atcher process
the Request Q
p the request f
he response b
en its free p
and sends it
request and r
t of SGA or i
ed by proces
her Request/R
enever a user c
ocess gets cre
37

de

, which
Queue.
from the
back in
picks up
t to the
response
in other
sses. In
Response
connects
eated to

Figure 9


Let me give y
for you i.e. Sh
Server takes
system runnin
Oracle system
7 concurrent
Dedicated Se
Mode.




Oracle 9i Database
: Restaurant Runn
you an idea ho
hared Server o
approximatel
ng Oracle have
m needs to sup
t users. Unde
erver Mode o
e Administration in
ning Under Dedic
ow to find out
or Dedicated Se
ly of 20MB
e 1 GB of RA
pport 10 users
er this scena
therwise stick
10 Minutes
cated Waiter Mod
which will wo
erver. Each De
of memory.
AM available a
and on the ave
ario always g
k with Shared
38

de

ork best
edicated
If your
and your
erage of
go with
d Server
39

M
M
i
i
n
n
u
u
t
t
e
e
4
4
:
:



Understanding
Oracle Database















Oracle 9i Database Administration in 10 Minutes
40

41
Oracle database has a logical architecture as well as physical
architecture. When we talk about database objects e.g. tables
we are actually talking about logical architecture and when are
talking about physical files like control file, data files etc., we
are actually talking about physical architecture of Oracle
database.


Physical Architecture

Physical architecture of Oracle Database is comprised of five
different types of files.

Physical Architecture of Oracle Database
Purpose File Names
Main Oracle Database Files.
Control File
Data Files
Redo Log Files
Oracle Instance reads it at startup. Parameter File (init.ora)
Archiving of Redo Log Files Archived Redo Log Files

Control File:

Every database has one control file and it basically contains the
information regarding the structure of database. Oracle
Instance reads control file at the time of startup to find out
database name, location of data files and redo log files.

Data Files:

Data files are the files where the actual databases data resides.
Oracle database can have one or more data files. The size of
each data file is limited to OS (operating system) maximum file
size. But the size of the Oracle Database can be whatever you
like. There is no limit on the maximum size of the database. If
you are running out of space you can always add more data
files to the database.


Fig


Redo Log Fil

Redo Log f
happening in
more redo log
log files gets
Instance finis
overwriting th

The way we c
the Oracle In
in this mode
Oracle 9i Database
gure 10: Physical
es & Archived
files are the
n data. Every
g files. Each se
s utilized in a
shes writing t
he first one.
can protect ove
stance in Arch
e then redo l
e Administration in
Architecture: Ora
d Redo Log Fil
files that ma
Oracle Databa
et is called red
a circular fash
the last redo l
erwriting of Re
hive Log Mode
log files will
10 Minutes
acle Database
les:
aintains the c
ase has set of
o log file grou
hion i.e. when
log file then
edo Log files i
e. If Oracle is
get archived
42

changes
f two or
up. Redo
n Oracle
it starts
is to run
running
d to the
43
destination you specify in the parameter file before getting
overwritten.

Parameter File (PFILE):

Parameter file contains the name of the database, location of
control file, memory structure of Oracle Instance and certain
other necessary Oracle system configuration parameters.
PFILE is read by Oracle Instance while starting up the database
or even before that i.e. when the Instance creates itself.


Logical Architecture

Logically the data inside the database resides inside the
tablespaces. Each tablespace is comprised of segments. Oracle
Instance allocates a segment each time you create a object
(table, view etc) inside the database. Each segment is
composed of Extents and What are Extents? Each extent is a
group of contiguous DB Blocks. Now what are DB Blocks? A
DB Block is the smallest building block of the database and is
usually the even multiple of OS Block e.g. DB Block can be (2
* OS Block) but not (1.37 * OS Block). The size of the DB
Block can be specified using DB_BLOCK_SIZE init.ora
parameter. You can assign values like 2KB (2 Kilo Byes) and
if the OS permits you can have 4KB, 8KB etc.




















Lo

F


Oracle 9i Database
ogical Architec
T
D
igure 11: Oracle d
e Administration in
cture of Oracle
Tablespace
Segments
Extents
DB Blocks


database logical a
10 Minutes
e Database
architecture.
44



Figur


Figure 12 sho
and physical
the same but
talk about its
about its table

Tablespaces a
inside these t
only one dat
maximum siz
Operating Sy
another data
size of tables
size.


re 12: Physical &
ows the side b
architecture o
you can look
files (data file
espaces, segme
are like small
tablespaces re
ta file associa
ze of the tab
stem maximum
file to the tab
pace is not lim
logical architectu
by side relation
of Oracle datab
k at it through
es, control file
ents (objects) e
departmental
sides in the d
ated with the
blespace canno
m files size. Bu
blespace. In th
mited to the OS
ure relationship.
nship between
base. The data
two angles. Y
e etc.) or you c
etc.
level database
ata a file. If
e tablespace th
ot be more th
ut you can alw
his way the ma
S marked limit
45


n logical
abase is
You can
can talk
es. Data
there is
hen the
han the
ways add
aximum
t on file

Fi


When we ta
physical arch
about how t
tablespace ca
but each da
tablespace.

Segments (da
within the tab
at the Figure
Oracle 9i Database
igure 13: Tablesp
alk about the
hitecture of dat
tablespaces ar
an have one or
ata file can
atabase objects
blespace. This
14.
e Administration in
aces relates to da
relationship
tabase, we mea
re related to
r more data fi
never belong
s) can lie in m
can be better
10 Minutes
ata files only.
between logi
an that we are
the data files
iles associated
to more th
more than one d
visualized by
46


cal and
e talking
s. Each
d with it
han one
data file
looking

Figure 14: One
















e object (e.g. table
in o
e) can be in two o
one tablespace.
or more data files
47

but only


How Oracl

Every databas
redo log grou
called membe



Within one R
of each other
different phy
factor. Havin
within a gro
Whatever dat
written to the
Oracle 9i Database
le Instance U
se should have
up should have
ers.
Figure 15: R
Redo log group
r and its recom
ysical hard dri
ng mirror cop
oup is called
ta changes are
e Redo Log fil
e Administration in
Uses Redo L
e two or more
e at least two o
Redo log files in a
p, all redo log f
mmend that the
ives to increas
pies of the ori
Multiplexing
happening in
les. In other w
10 Minutes
Log Files?
redo log group
or more redo l
action.
files are mirro
ey all should re
se the fault to
iginal Redo L
of Redo Lo
the database,
words you can
48
ps. Each
log files


r copies
eside on
olerance
Log file
og files.
all gets
say its
49
the Undo copy of the original database. As shown in Figure
15, Oracle Instance (or more precisely, the Log Writer process)
will start writing these changes in data from Redo Log group 1,
once it gets filled up, Oracle instance will move to group 2 and
finally group 3. Once group 3 finishes up, Oracle instance will
start all over gain from group 1. Thats the reason we say that
Redo Log files get utilized in a circular fashion.

To avoid overwriting of Redo Log files, you should run the
Oracle Instance in Archive Log Mode. Whenever Oracle is
running in this mode, redo log files gets archived well before
they get overwritten.












Oracle 9i Database Administration in 10 Minutes
50


51

M
M
i
i
n
n
u
u
t
t
e
e
5
5
:
:



Oracle 9i Software
Installation













Oracle 9i Database Administration in 10 Minutes
52



You can dow
oracle websit
you download
unzip those d
setup.exe file
(OUI).

Step 1:

Once you run
will see the f
Next button o

Figure 16: The
files that needs
write the Orac
w

nload complet
e (www.oracle
d the Oracle so
download files
which will sta
n the setup.ex
following win
once done.
e first text box wi
to be installed. T
cle Home name an
where you want Or
te Oracle softw
e.com) for lear
oftware then yo
most probably
art the Oracle U
xe file OUI wi
ndow with defa
ill ask you the loc
The second is the N
nd the third one is
racle software to
ware for free fro
rning purpose.
ou would need
y before runnin
Universal Insta
ill start and th
fault values. C
cation of Oracle s
Name text box w
s the destination l
be installed.
53
om
Once
d to
ng the
aller
hen you
Click the

oftware
here you
location


Step 2:

Select the fir
selected Orac

Figure 17: Seco
to create the d
which will insta








Oracle 9i Database
rst option of O
cle9i Database
ond option is for in
database. The thir
all Oracle Manage
and i
e Administration in
Oracle 9i Data
option then cli
nstalling a client
rd optional is bas
ement Server and
integration too.
10 Minutes
abase. Once yo
ick Next butt
and would lack th
ically an add-on f
other related man
54
ou have
ton.

he ability
feature
nagement


Step 3:

In this wind
Oracle you w
then click the

Figure 18: O
Standard Editio
of Or








ow OUI will
would like to h
e Next button
Oracle Enterprise E
on is for departme
racle is for single
ask you rega
have. Select E
n.
Edition is for high
ental applications
e user developmen
arding the ed
Enterprise Edit
h-volume applica
whereas Persona
nt environment.
55
dition of
tion and

ations.
al Edition


Step 4:

Select the op
Software On
process will
Oracle Softw

Figure 19: If w
(OUI) will not
purpose databas
OUI



Oracle 9i Database
ption of Soft
nly option and
start and upon
ware has been i
we select Genera
t only install the s
se too by default.
and then later lea
e Administration in
ftware Only.
d click Next
n successful co
installed succe
al Purpose then O
software but will
But we want to i
arn how to develo
10 Minutes
Once you se
button the inst
ompletion it w
essfully.
Oracle Universal I
create a standard
install software on
op the database.
56
lect the
tallation
will say,

Installer
general
nly using

57

M
M
i
i
n
n
u
u
t
t
e
e
6
6
:
:



Oracle 9i Database
Design Using
DBCA










Oracle 9i Database Administration in 10 Minutes
58




Before even
Assistant) w
variables. OR
where Oracl
environment w

Step 1:

Lets suppose

C:\> SET OR

Figure 20: Be


Whereas in U

% setenv ORA

ORACLE_HO
ORACLE_BA
According to
environment
n we start
we have to se
RACLE_BASE
le software
we can set it u
e the DOS prom
RACLE_BASE
efore using DBCA
Unix we write t
ACLE_BASE
OME specifie
ASE and its h
o OFA (Opt
variable
DBCA (Dat
et some of t
E describes th
will be inst
using the SET c
mpt is C:\>.
E C:\Oracle
A we have to set c
variables.
the command a
/Oracle
es the directo
here where Or
timal Flexible
should
tabase Config
the OS envir
he top most d
talled. In W
command.
certain OS enviro
as shown below
ory that lies
racle products
e Architecture
to set
59
guration
ronment
directory
Windows

onment

w.
beneath
s reside.
e), this
t to
Oracle 9i Database Administration in 10 Minutes
60
ORACLE_BASE/product/release#. Lets suppose the DOS
prompt is C:\>.

C:\> SET ORACLE_HOME C:\Oracle\database\9_2

Whereas in Unix we write the command as shown below.

% setenv ORACLE_HOME /Oracle/product/9_2

ORACLE_SID is the instance name or rather default instance
name on the machine having Oracle installed. Lets suppose
the DOS prompt is C:\>.

C:\> SET ORACLE_SID test

Whereas in Unix we write the command as shown below.

% setenv ORACLE_SID test

PATH is the environment variable and its usually set to
ORACLE_HOME/bin folder. The bin folder contains all the
tools that shipped with Oracle.
















61
Step 2:

After setting the above mentioned parameters the next step
would be to run DBCA. DBCA can be invoked from the
Windows operating system start menu as shown below or by
entering the following Unix command.

dbca


Figure 21: In windows operating system click: <Start>, <All Programs>,
<Oracle>, <Configuration & Migration Tools> and finally <Database
Configuration Assistance>.












Step 3:

Click the <Ne

Figure 22: Firs










Oracle 9i Database
ext> button.
t window of DBC
brief description
e Administration in
CA is basically a W
on the purpose o
10 Minutes
Welcome messag
f this tool.
62

ge with a


Step 4:

Using DBCA
existing data
manage temp
selected and t

Figure 23: DBC
database i.e. co






A you can creat
abase, delete
lates. Make su
then click Nex
CA can assist DBA
onfiguring databa
and m
te a new datab
an already e
ure that Create
xt button.
A with 3 other tas
ase options in a da
manage templates.
ase, configure
xisting databa
e a Database o
sks besides creatin
atabase, delete a d
63
already
ase and
option is

ng a new
database


Step 5:

DBCA has c
using Gener
that General
button.

Figure 24: Ea
template





Oracle 9i Database
certain built-in
ral Purpose d
Purpose opti
ach template has p
has settings good
e Administration in
n templates. O
atabase templa
ion is selected
predefined setting
d for Analytical P
10 Minutes
Over here we
ate option. Ma
and then click
gs e.g. Data Ware
rocessing purpose
64
will be
ake sure
k Next

ehouse
es.


Step 6:

Decide on
Identifier (SID
case we hav
Name and tes
then click the

Figure 25





Global Datab
D) will be the
ve entered tes
st will come u
e Next button
: You can assign
base Name
name of the O
st.takveen as
up automatical
n.
any name to Glob
& Domain.
Oracle Instance
the Global D
ly as SID. On
bal Database Nam
65
System
e. In our
Database
ce done

me.


Step 7:

Decide on th
Oracle Instan
Mode.

Figure 26: This
run our Orac





Oracle 9i Database
he mode of o
nce either in D
s window is mean
le Server in dedi
e Administration in
operation of in
Dedicated Ser
nt for make a dec
icated server mod
mode.
10 Minutes
nstance. We c
rver or Shared
ision whether we
de or the shared
66
can run
d Server

e want to
server


Step 8:

Decide on SG
Here you ca
memory arch
your needs. O
that the stuff

Figure 27: Cus


GA sizing. Us
an either use
hitecture of Or
Once done cli
in there is acco
stom option will a
to
se either Typic
the default
racle or chang
ick the Archi
ording to your
allow you to selec
o you needs.
cal or Custom
values provid
ge them accor
ive tab to ma
requirement.
ct the SGA size ac
67
option.
ded for
rding to
ake sure

ccording


Step 9:

Archive Log
files will be a
DB Sizing t
to your requ
default values

Figure 28: This

Oracle 9i Database
Mode: if you s
archived befor
tab to make sur
uirement. All
s.
window will allo
of r
e Administration in
select this opti
re overwritten
re that the stuf
these tabs wi
ow you to set up O
redo log files.
10 Minutes
ion then the Re
. Once done c
ff in there is ac
ill already be
Oracle Server for
68
edo Log
click the
ccording
having

archiving


Step 10:

Parameter Fil
tab. All the d
screen are ac
about it.

Figure 29: Th




le and Trace F
default locatio
cording to stan
his tab will be hav
Oracl
Files locations
ons and file na
ndards. So you
ving the informati
le physical files.
can be set us
ames specified
u dont have t
ion about location
69
sing this
d in this
o worry

n of all


Step 11:

Make sure t
values you s
Location Var
of these
ORALCE_HO
OK button an

Figure 30:


Oracle 9i Database
the OS enviro
set before sta
riables button
four vari
OME, DB_NA
nd you will be b
These four param
e Administration in
onment variab
arting DBCA.
to see and to
iables viz.,
AME and SID.
back to the pre
meters are present
10 Minutes
bles reflect th
. Click on th
make sure the
ORACLE_
. Once done c
evious window
t in init(SID).ora
70
he same
he File
e values
_BASE,
click the
w.

file.


Step 12:

To see the co
All Initializa
will be havin
those you hav
be a comple
deselect any
click Close
window and t

Figure 31: Th
parameter


mplete list of i
ation Paramete
g complete lis
ve selected and
etely editable
of the parame
button and it
then click the
his window provi
rs. Oracle Instanc
initialization p
ers button. Th
t of all the init
d those you ha
window i.e.
ters and edit t
will take you
Next button.
des the complete
e reads the file at
arameters click
he popped up w
tialization para
avent select. I
you can sel
the values. On
u back to the p
list of init(SID).o
t the time of start
71
k on the
window
ameters,
It would
ect and
ce done
previous

ora file
tup.







Oracle 9i Database
Figure 32: A
e Administration in
A close-up of figu
10 Minutes
ure 31.
72



Step 13:

If you click t
pane you will
with their loc

Figure 33: Each
window you ca
be

















the Control file
l see all the mu
ation. Once do
h Oracle database
an set-up your con
e on different driv
e item on the
multiplexed con
one click the O
e requires one Con
ntrol file location
ves for greater fau
left pane, on t
ntrol files name
Options tab.
ntrol file and thro
n(s). Mirror copies
ult tolerance.
73
the right
es along
ough this
s should



Step 14:

The options t
log groups an
database cou
Datafiles ite

Figure 34: Se


Figure 35: Clic


Oracle 9i Database
tab defines the
nd log membe
uld ever possi
em on the right
et the maximum n
cking Datafiles w
e Administration in
e maximum lim
ers in each red
iblely has. O
t pane.
number of datafil
will change the ri
datafiles.
10 Minutes
mit on data fil
do log group t
Once done the
es, redo log group
ght pane view to
74
es, redo
that this
en click

ps etc.


show all


Step 15:

Once you clic
will show al
along with the

Figure 36: Clic
view to show a








ck the Data f
ll the data file
eir location in
cking 1 under Re
all the member of
log group should
files in the rig
es your datab
the system.
edo Log Groups w
f that particular re
d have at least one
ght pane, the le
base is compri
will change the ri
edo log group. Ea
e member.
75
eft pane
ised off

ght pane
ach redo


Step 16:

Click the red
will change. W
of each other
location whe
information a
viewing the
Next.

Figure 37: Eith












Oracle 9i Database
o log group 1
Within a Redo
r. You can ad
ere you want
about redo log
information r
her you can chang
or go what is d
e Administration in
1 and informa
o Log Group a
dd more memb
to place the
g group 2 and
regarding redo
ge the default file
default using this w
10 Minutes
ation in the rig
all members ar
bers and speci
em. Click 2
similarly for 3
o log group 3
size for redo log
window.
76
ght pane
e image
ify their
to see
3. After
3, click

member


Step 17:

Configuration
clone databa
based on the
just save the
both. Once d
window.

Figure 38: You







n values you e
ase developme
configuration
configuration
done click Fi
can also save the
clone dat
entered in DB
ent. You can
n settings you
settings as a te
inish button
settings for your
abase developme
BCA can be sa
create the D
provided or y
emplate or you
and it take yo
r database in a tem
ent.
77
aved for
Database
you can
u can do
ou next

mplate for


Step 18:

One should
SYSTEM ac
locked. After
you will be b
database crea

Figure 39: Its
c
Oracle 9i Database
change the
counts. Make
r changing the
back on the pr
ation process w
s better to change
clicking the <Pass
e Administration in
standard pass
sure that SC
e password, c
revious screen
will start.
e all the default pa
sword Manageme
10 Minutes
sword for SY
COTT account
click Ok but
. Click Exit
asswords at this p
ent> button.
78
YS and
t is not
ton and
and the

point by


Figure 40: Cha
check





















ange the passwor
mark in the corre
rd and make sure
esponding Lock
the account is not
Account? field.
79

t have a

Oracle 9i Database Administration in 10 Minutes
80
Step 19:

Once you see the message, database has been created
successfully. Open up OEM (Oracle Enterprise Manager) as
shown in the figure below.


Figure 41: Use Oracle Enterprise Manager (OEM) to test connection to your
recently developed database. OEM is located under <Start>, <All
Programs>, <Oracle> folder.




Figure 42: A close-up of the figure 41.





Once you c
window will
standalone or
Server. Oracl
we havent
standalone.

Fig


The next pop
OEM. From
running all o
one database

click Enterpr
popup asking
r you want to
le Managemen
installed it s
Click Ok.
gure 43: Select th
pped up windo
here you can
over the world
i.e. TEST.
rise Manager
you whether y
o login to the
nt Server is an
so we will b
he Launch standa
w will be the
n control all th
d. Right now i
Console, fo
you want to ru
Oracle Mana
n add-on prod
be running O
alone option.
main control p
he databases
ts showing y
81
ollowing
un OEM
agement
duct and
OEM as


panel of
you are
you only

Figure 44: Th


TEST is the d
you click on
appear askin
There is no n
SYSDBA fro
OK button.

Figur
Oracle 9i Database
he TEST databa
OEM (Oracl
database that w
TEST item in
g you for cr
need to specify
om Connect a
re 45: Connecting
e Administration in
ase will be visible
le Enterprise Man
we have devel
the tree, the fo
edentials i.e.
y the login and
as drop down
g as SYSDBA to
10 Minutes

e in the tree hierar
nager).
loped using DB
following wind
login and pa
d password jus
option box an
TEST database
82
rchy of

BCA. If
dow will
assword.
st select
nd click


83
Now you would be able to expand the tree under TEST
database. If you click Tablespaces under Storage item, you
would be able to see the list of all the tablespaces and
corresponding data files that DBCA has developed for you. Let
me give you a closer look to this window in the following
picture. We will learn in depth about OEM and other good stuff
later in this book.


Figure 46: Expand the Tablespaces item in the tree to see the list of
tablespaces within TEST database.






Oracle 9i Database Administration in 10 Minutes
84


85

M
M
i
i
n
n
u
u
t
t
e
e
7
7
:
:



Enabling Other
Computers to
Access Oracle
Database Server









Oracle 9i Database Administration in 10 Minutes
86


The purpose
environment
even world c
machine. Est
you have to d
and client sid

Figure 47: Ora


Oracle Net
installation o
have to sele
Universal Ins
listener.ora fi
development
Oracle Net f
process, it lis
the listener
e of making
where users f
can access the
tablishing an O
do is to config
de.
acle Net needs to b
gets installed
of Oracle Serv
ect the option
staller. The w
file on the serv
of listener.ora
for the server.
stens to the us
process is to
Oracle netw
from all over t
database as if
Oracle networ
gure Oracle Ne

be configured on
client.
d on the ser
ver software bu
n of client in
way it works i
ver then we s
a file is actuall
Once we hav
ers connection
o bequeath th
work is to h
the city or cou
f its residing
rk is very simp
et layer on both
server as well as
rver at the t
ut for each cl
nstallation in
is first we cre
start the listen
y the configur
ve started the
n requests. The
he connection
87
have an
untry or
on their
ple. All
h server

on each

time of
lient we
Oracle
eate the
ner. The
ration of
listener
e job of
to the

dispatcher in
server mode o
running under

On the clien
Creating tnsn
Oracle Net o
contains the
connect to Or

Figure 48: O
wherea

Oracle 9i Database
case the Ora
or to the dedic
r dedicated mo
t side, we ha
names.ora file
on the client
resolution of
racle server.
Oracle Instance kn
s Oracle Net deal
e Administration in
acle server is r
ated server pro
ode.
ve to create t
e is actually
side. tnsname
service name
nows how to speak
ls with different n
10 Minutes
running under
ocess in case O
the tnsnames.o
the configura
es.ora is noth
e that we wil
k with Oracle Net
network protocols
88
r shared
Oracle is
ora file.
ation of
hing but
l use to

t layer
s.


Figure 49: Ac
c


Creating L

Step 1:

The next step
this single
tnsnames.ora
netmgr comm
the same sof
Programs > O



cessing Oracle N
completely indepe
Listener
p would be to
tool we ca
files. ONM ca
mand under O
ftware can be
Oracle.
Net Manager (ONM
endent of Operati
start the Orac
an create bo
an be accessed
ORACLE_HOM
found in win
M): Java based pr
ing System.
cle Net Mange
oth listener.o
d under Unix u
ME/bin directo
ndow under S
89

rogram,

er. With
ra and
using the
ory and
tart>All

Figure 5
Figure


Oracle 9i Database
50: Expanding L
51: Oracle Net M
e Administration in
Listeners shows n


Manager showing n
10 Minutes
no listener proces
no Service Name
90

s.


e.



Once you exp
in the tree, y
moreover ther

Figure 52: Click
Fig

pand the <Serv
you will see no
re is no tnsnam
k the Listener a
gure 53: Assign th
vice Naming> a
othing. There
mes.ora file.
and then the + i
process.
he name to the list
and <Listeners
is no listener
icon to create new
tener process.
91
s> items
running

w listener



Oracle 9i Database Administration in 10 Minutes
92
Select the Listener item from the tree in ONM and then click
the + sign shown in the slide to create the listener. In the
popped up window write the Listener Name. If you use the
default name of the listener than the Oracle Instance registers
itself with the listener dynamically and its called dynamic
service registration. Thats why we are sticking with the default
name of the listener i.e. LISTENER. Not only listener name
has to be default but we have to use default protocol i.e.
TCP/IP and default port i.e. 1521 or 1520 if we want to go with
dynamic service registration.




























Step 2:

After selectin
the OK butto
Addresses. Se
button on the
Oracle adds
machine runn
name resoluti
TCP/IP) and p

Figure 54:
ng listener nam
on. Once the
elect the listen
e right pane of
the default v
ning Oracle S
ion service lik
port (i.e. 1521)
Add Address o
me as LISTEN
Listener gets
ner name and c
f ONM. Once
values for Ho
Server or its IP
ke DNS is ava
).
of newly added lis
NER you have
created then
click Add Add
you click this
ost (i.e. name
P address in
ailable), Proto
stener process to t
93
to click
add the
dresses
s button
of the
case no
col (i.e.

tree.



Figu







Oracle 9i Database
ure 55: Listeners
e Administration in
s location for liste
10 Minutes
ening requests.
94



Step 3:

After you ha
drop down m
the option D

Figure 56: List
client to t

ave finalized H
menu from the
Database Servic
tener process will
the database adde
Host, Protocol
top as shown
ce.
l bequeath the con
ed using the <Add
l and port, se
in the slide an
nnection request f
d Database> butto
95
elect the
nd select

from the
on.



After selectin
click the Ad
(Oracle Netw

Figure 57: Enter
Now provide
our case it is
Oracle Home
case. The inf
should be ex
Once done do
when you sav

Oracle 9i Database
ng Database S
dd Database
work Manger).
r Global Database
and finally SID
the Database n
s test.takveen.
e directory an
formation you
xactly the sam
o not forget to
ve, ONM creat
e Administration in
Serives from
button on the
e Name, Database
(name of Oracle I


name i.e. Glob
Moreover pr
d the name o
u provide in th
me when you
o save the con
es or updates t
10 Minutes
the drop dow
e right pane o
e Home Directory
Instance).
bal Database N
rovide the loca
f SID i.e. test
hese three tex
created the d
figuration as i
the listener.ora
96
wn menu
of ONM

y location

Name. In
ation of
t in our
xt boxes
atabase.
its only
a file.

Figure 5


Step 4:

Next thing is
started using
environment.
clicking

Start>Setting

And then sel
pressing the


58: Save network
s to start the li
lsnrctl utility
You can also
s>Control Pan
lecting the lis
play on the to
configuration and
istener. The li
both in Wind
o run in wind
nel>Services
stener service
ool bar of serv
d start the Listene
stener process
dows Server an
dows environm
for Oracle an
vices console.
97

er.

s can be
nd Unix
ment by
nd then
Oracle 9i Database Administration in 10 Minutes
98

Figure 59: In Windows Server 2003 environment, the listener process can
be activated under the Services window.



C:\>lsnrctl start

This command will start the listener whereas if you replace
start with stop you can stop the listener. To check the
status of the listener use the following command.

C:\>lsnrctl status















Configurin

Step 1:

Since now w
listener proce
Service Name
short & easy
that helps cli
Service Nam
click the +

Figure 60: Click

ng Oracle Ne
e have created
ess. Next thin
e on this mach
to remember
ient applicatio
ming item in th
sign to add the
k the Service Nam
a new serv
et on client-
d the listener.o
ng we will do
hine. Net Servic
name for a lo
ons to connect
he tree on the
e Net Service N
me item and the
vice name to the t
-side
ora file and sta
o is to create
ce Name is bas
ong set of par
t to server. Se
left pane of ON
Name.
en click the + ic
tree.
99
arted the
the Net
sically a
rameters
elect the
NM and

con to add


Figure 61: Net
Oracle


In the poppe
asim. Now
means on this






Oracle 9i Database
Service Name wi
database we want
ed up window
w we are goin
s machine by c
e Administration in
ill be the nick nam
t to connect to. It
w write the N
g to define w
clicking Next
10 Minutes
me on this machin
can be any name
Net Service N
what the word
button.
100

ne for the
e.

Name as
asim

Step 2:

Select protoc
down the hos
other words th

Figure 62: Sel





ol as TCP/IP a
t name of the m
he listeners m
ect the network p
Server
and click Nex
machine runnin
machine name.
protocol used to c
r from this client.
xt button. The
ng Oracle Serv
ommunicate with
101
en write
ver or in

h Oracle


Figure 63: Net
parameters. H


Remember th
the listener
dispatcher in
in a dedicate
bequeathed t
takes place b
without any l
on which list
Host and click



Oracle 9i Database
Service Name is
Host Name will be
running Or
hat client applic
and listener
a shared serve
ed server mod
to the Oracle
between Oracle
listener proces
tener is listen
k Next.
e Administration in
an alias given to
e the name of the
racle Database Ser
cations send a
bequeath the
er mode or ded
de. After the
Instance then
e Instance and
s involvement
ing for conne
10 Minutes
detailed list of co
machine on the n
rver.
connection re
e connection
dicated server
connection ha
n the commun
d the connecte
t. Write down
ction requests
102

onnection
network

quest to
to the
process
as been
nication
ed client
the port
s on the

Step 3:

Service Name
global databa
to bequeath t
the Next bu

Figure 64: Serv
Server. List


The next pop
test the conn
Name asim


e over here is t
ase name of Or
he connection
utton.
ice name will be
tener process will
connection to th
pped up windo
nection and see
is resolving p
the parameter w
racle database
in our case it
Global Database
l be requested by
his Oracle Databas
ow will give y
e that your co
properly using t
where you spe
you what the
t is test.takveen
Name of Oracle D
client to bequeath
se Server.
you the opportu
onfigured Net
tnsname.ora.
103
ecify the
listener
n. Click

Database
h the

unity to
Service

Step 4:

Once you cl
Manger) wil
connection. I
if you would
too. Upon s
Network Con
or updated on
File and the

Figure 65: Servi

Oracle 9i Database
lick the Tes
ll use the
f you dont ha
d like to use so
successful con
nfiguration. Th
nly when you
en Save Netw
ice Name & Net S
the Glob
e Administration in
t button ON
scott/tiger a
ave this accoun
ome other acc
nnection dont
he tnsnames.or
save the conf
work Configura
Service Name is n
bal Database Nam
10 Minutes
NM (Oracle N
account to t
nt in your data
count you can
t forget to sa
ra file will get
figuration by c
ation.
not same. Service
me.
104
Network
test the
abase or
do that
ave the
created
clicking

e Name is


Figure 66: Save
tnsnames.ora fi


The defau
%ORACLE_
2003/2000/NT
$ORACLE_H
Net Service N
each of the m
Oracles clien

Its very impo
Name on one
the Net Servi
e Network Config
le containing Net
Oracle S
ult location
_HOME%\netw
T
HOME/networ
Name or tnsn
machines from
nt applications
ortant point to
e machine (e.g
ice Name on t
guration. Oracle N
t Service Name (a
Server connection
of tnsn
work\admin o
plateform
rk/admin unde
ames.ora file
m where you w
like SQL*Plu
o note over her
g. asim) need
the other mach
Net Manager will
alias) resolution to
n.
ames.ora fi
on Windows
m
er Unix enviro
has to be crea
want to launch
us, OEM etc.
re that the Net
ds not to be sim
hine (e.g. lets
105

generate
o make a

ile is
Server
and
onment.
ated for
h any of
Service
milar to
suppose
Oracle 9i Database Administration in 10 Minutes
106
cow) although both Net Service Names will resolves to the
same Oracle database (e.g. test.takveen).

You can connect to or manage multiple databases using OEM
remotely. All you need to do is to create the Net Service Name
for each of the databases you want to manage.

















107

M
M
i
i
n
n
u
u
t
t
e
e
8
8
:
:



Oracle Enterprise
Manager A SQL-
Less Database
Management
Environment






Oracle 9i Database Administration in 10 Minutes
108


Figure 67: Ora


Oracle Enter
application.
independent o
through Unix
2003/XP envi

Start > All Progra

Where as in
following com

$ oemapp con

As explained
when asked
There is no ne
be the extern
acle Enterprise Ma
completely oper
rprise Manage
As its java b
of OS. The on
x and Windo
ironment you c
ams > Oracle > Ente
Unix environ
mmand at the O
nsole
d before, conn
to provide lo
eed to specify
nally authentica
anager (OEM) is
rating system inde
er (OEM) is
based thats
nly difference
ows platform.
can invoke in b
erprise Manger Con
nment it can b
OS command p
nect to the d
ogin, password
the login and p
ated OSDBA
a Java based app
ependent.
a java based
why its com
is how you in
In Windows
by clicking
nsole
be invoked us
prompt.
database as SY
d and privileg
password as it
or OSOPER a
109
lication,

d client
mpletely
nvoke it
Server
sing the
YSDBA
ge level.
ts would
account.


Once you get
able to expa
Expand the
you select the
the list of all
and related in

Figure 68: No
click solves the
We can creat
tablespace m
Oracle 9i Database
t connected to
nd the tree o
Storage item;
e Tablespaces
l the Tablespac
nformation.
need to remembe
e problem and po
you w
te new tablespa
entioned in th
e Administration in
o the Oracle da
on the left pan
; you will see
item, on the ri
ces along with
er SQL statement
opped up menu pr
were looking for.
ace by right cl
he list and then
10 Minutes
atabase you w
ne of OEM w
Tablespaces
ight pane you
h associated da
s. Most of the tim
rovides you the co
licking any on
n selecting the
110
would be
window.
. When
will see
ata files

me right-
ommand

ne of the
e option

Create
above. Once
Tablespace w

Figure

in the popped
we click the
window will po
e 69: Create the n
d up window a
Create o
p up as shown
new tablespace usi
as shown in th
option then the
n in the next sli
ing this window.
111
he slide
e Create
ide.



Figure 70: Stora
Dictionary ma
extend automa


In this Create
a name and y
can also make
the tablespac
Oracle 9i Database
age tab will gives
anaged extents. Y
atically in case it r
A
e Tablespace w
you can have a
e the tablespac
e with OFFLI
e Administration in
you the option to
You can also selec
runs out of space
Allocation.
window you can
as many data f
ce ONLINE/OF
INE option the
10 Minutes
o select locally ma
ct to make the tabl
by selecting Au
n give your tab
files as you lik
FFLINE. If yo
en the tablespa
112

anaged or
lespace
utomatic

blespace
ke. You
u create
ace will

not be availab
it ONLINE.
Locally Man
Extents mana
and 10g.

Figure 71: M


Under the D
files associat
tablespaces. W
tablespace.

ble to users yo
Under the sto
naged otherw
agement. Its a
anage data files u
Datafiles item
ed to the data
We can create
ou will grant ac
rage tab make
wise you would
a nice feature
using Oracle Ente
m you will see
abase along w
a new data fi
ccess unless yo
e sure its sele
d have to take
available in O
erprise Manager (O
the list of all t
with the corresp
le and assign i
113
ou make
ected as
care of
Oracle 9i

OEM).

the data
ponding
it to the

Figure 72: M


If we expand
can see all th
can add new m
location after
member infor

Oracle 9i Database
Manage redo log
Man
the Redo Log
he redo log gr
members in all
r selecting the
rmation on the
e Administration in
files & groups us
nager (OEM).
g Groups item
roups and asso
l the redo log g
e group numb
right pane of O
10 Minutes
sing Oracle Enterp
m under Stora
ociated memb
groups as well
er and then a
OEM window
114

prise

age you
ers. We
as their
add new
.

Figure 73: Com


Using OEM,
Storage but y
the Users it

mplete users mana
management o
ou can do com
tem under the
agement using Or
(OEM).
of database is n
mplete managem
Security.
racle Enterprise M
not just limited
ment of users u
115

Manager

d to
utilizing

Figure 74: Cre
user and select t
Oracle Instan


We can also
selecting the
changing valu

Oracle 9i Database
eate User user wi
the option Create
nce management u
manage the O
Configuration
ues in the right
e Administration in
indow will pop up
e as shown in
using Oracle Ente
Oracle Instance
n item on the
t pane.
10 Minutes
p once you right c
n the slide above.C
erprise Manger (O
e related stuff
left pane of OE
116

click any
Complete
OEM).

by first
EM and

Figure 75: Mem


mory tab gives you
architec
u full control ove
cture components
r Oracle Instance
s.
117

e memory


Figure 76: Dat


If you want
NOARCHIVE
Recovery ta

The Recove
Instance n
Oracle 9i Database
tabase recovery is
Enterpris
to run the da
ELOG mode
ab as shown in
ery tab can b
node and the
e Administration in
ssues can be man
se Manager (OEM
atabase is ARC
e you can
n the slide.
be accessed by
n selection
10 Minutes
naged easily using
M).
CHIVELOG m
control that
y first expand
Configuration
118

g Oracle

mode or
t using
ding the
n item
119
underneath it. If you check the box Archive Log Mode then
the Archiver process will get alive and will start archiving
your redo log files. You can also specify Archive Log
Destination in the same Recovery tab at the bottom.
























Oracle 9i Database Administration in 10 Minutes
120


121

M
M
i
i
n
n
u
u
t
t
e
e
9
9
:
:


Oracle Database
Backup &
Recovery Simple
Technique










Oracle 9i Database Administration in 10 Minutes
122

123
User-Managed Offline Backup

The other names given to this kind of backup are
Closed/Cold/Consistent Database backup. No recovery is
needed in this kind of backup during the restore process.

Step 1:

Shut down the database

Connect to database as SYSDBA and then use the
SHUTDOWN statement with NORMAL, IMMEDIATE or
TRANSACTIONAL clause.

C:\> sqlplus /nolog

SQL>connect / as sysdba

SQL> SHUTDOWN NORMAL;

Remember that if there is any single user connected with the
database and you have used the NORMAL clause with the
SHUTDOWN statement then database will never shutdown
unless the user closes the session.

Step 2:

Backup all the data files

Once the database gets completely shutdown backup all the
data files associated with the database at the operating system
level or in other worlds using operating system commands e.g.
copy in Windows and cp in case of Unix.




Oracle 9i Database Administration in 10 Minutes
124
Step 3:

Backup Parameter File, Redo Log Files and Archived Redo
Log Files

Backup all these files too using operating system command.
Its highly recommended and provides greater fault tolerance in
case of database failures.

Step 4:

Startup Oracle Database with MOUNT option

Start the oracle instance and mount the database but dont
open.

C:\>sqlplus /nolog

SQL>connect / as sysdba

SQL>startup mount;

Step 5:

Backup the Control File

Control file can be backed up using the following statement
and at the desired location.

ALTER DATABASE BACKUP CONTROLFILE TO c:\staging\ctl.bak;

The backup created in this fashion will be the binary copy of
the control file. We can also take the backup of control file,
which will be in text format in the following manner.

ALTER DATABASE BACKUP CONTROLFILE TO TRACE;
125
As a result of this statement the text version of control file will
get copied to the location/folder specified in
USER_DUMP_DEST init.ora parameter.

Step 6:

Open the database

Now you have full database backup or in other words Whole
Database Backup. Its time to make the database available to
the users you executing the following statement.

ALTER DATABASE OPEN;

This completes our User-Managed Offline/Cold Database
Backup. Lets see now how we can perform User-Managed
Online/Hot Database Backup.

User-Managed Complete Recovery is done in two different
ways and it all depends on the mode in which you are running
the Oracle server. You can run Oracle server either in
ARCHIVELOG mode or NOARCHIVELOG mode. The way
we do the recovery in NOARCHIVELOG mode is different
from the way we do recovery in ARCHIVELOG mode. Lets
have a look on each procedure as follows.











Oracle 9i Database Administration in 10 Minutes
126
User-Managed Complete Recovery in
NOARCHIVELOG Mode

In NOARCHIVELOG mode the recovery is very simple. All
you have to do is to restore the database files from your backup
to the original location and start the database.

Lets suppose one of your data file got corrupted. The time try
to start the Oracle Instance, it will give you an error. In this
case shutdown the database. Restore all the data files; redo log
files and control file back to their original location from your
last whole/complete cold backup.

Then start the Oracle database again by first running SQL and
then connecting as SYSDBA. This time you will not get any
error.


User-Managed Complete Recovery in
ARCHIVELOG Mode

Lets suppose one of your data file got corrupted/deleted. The
time you try to start the Oracle Instance, it will give you an
error with the name and location of the data files. If the Oracle
server is up and running and you dont want to shut it down
then follow the following steps.

Step 1:

Take the corrupted data file offline

Use the following SQL statement to take the corrupted/deleted
data file offline.

ALTER DATABASE DATAFILE c:\oracle\oradata\test\users01.dbf
OFFLINE;

127
Step 2:

Restore the corrupted data file

Restore the corrupted data file by copy it from the backed up
location and pasting it to the original location at the operating
system level or in other words using operating systems
commands like copy in windows or cp in Unix/Linux.

Step 3:

Recover Data File

Recover the restored data file using the RECOVER
DATAFILE statement. Then apply all the available Redo Log
files by pressing Enter button on the keyboard whenever
asked.

C:\> sqlplus /nolog

SQL>connect / as sysdba

SQL>recover datafile c:\oracle\oradata\test\users01.dbf

This will complete the recovery process and you will realize
that no data will get lost i.e. everything that you entered or
changed after the last whole database backup will get
recovered by Oracle by applying all the redo log files.








Oracle 9i Database Administration in 10 Minutes
128
Difference between Recovery in ARCHIVELOG
mode & NOARCHIVELOG mode

In NOARCHIVELOG mode, the transactions that got
processed after the last complete backup, will get lost where as
in ARCHIVELOG mode no data will get lost i.e. everything
that you entered or changed after the last whole database
backup will get recovered by Oracle by applying all the redo
log files including the ones got archived by the Archiver
process.





















129

M
M
i
i
n
n
u
u
t
t
e
e
1
1
0
0
:
:


Oracle
Performance
Tuning







Oracle 9i Database Administration in 10 Minutes
130

131
Oracle Performance Tuning, the topic is not that scary as it
sounds. Actually its very simple if you understand the
performance tuning concept the bigger picture or in other
words birds eye view.

Performance tuning is nothing but the collection of statistics
regarding the current status of the system and then change
system values based on the statistics to enhance the
performance. In other words performance tuning is

Collection of system statistics
Changing system based on the statistics

Now we have to look into what are different sources that can
provide us the information regarding the current health of the
system. Although there are a lot of sources. The simple
sources, which can provide us the Oracle system information,
are alert log file, trace files, dynamic performance view, data
dictionary views etc. Lets start learning about each of these
sources one by one.


Alert Log File

The location of Alert log file is described by
BACKGROUND_DUMP_DEST initialization parameter. For
Oracle systems that follow OFA (Oracle Flexible Architecture)
or in other words standard directory architecture of Oracle
files, the location of Alter Log file will be as follows.

In Windows Server 2003/NT/XP,
%ORACLE_BASE%\admin\SID\bdump whereas in Unix it
would be $ORACLE_BASE/admin/SID/bdump. Where SID is
the name of the Oracle Instance. You might have noticed that
in Unix environment we use forward slash (/) whereas in
Windows we user backward slash (\).

Oracle 9i Database Administration in 10 Minutes
132
Oracle writes all the error messages and other alerts to this file
whenever that message occurs during it normal operations.


Background Process, Event & User Trace Files

Oracle trace files contain information pertaining to certain
event that happens in the regular operation of Oracle. The
location of these trace files is described by
BACKGROUND_DUMP_DEST initialization parameter. For
Oracle systems that follow OFA (Oracle Flexible Architecture)
or in other words standard directory architecture of Oracle
files, the location of these trace files will be as follows.

In Windows Server 2003/NT/XP,
%ORACLE_BASE%\admin\SID\bdump whereas in Unix it
would be $ORACLE_BASE/admin/SID/bdump. Where SID is
the name of the Oracle Instance.

All trace files have file extension of .trc no matter whether it is
Background process, Event or User trace file. In Windows
environment, the background processes will generate the
following files.

Process Monitor (PMON): sidPMON.trc
System Monitor (SMON): sidSMON.trc
Database Writer (DBW0): sidDBW0.trc
Archive Process (ARC0): sidARC0.trc
Log Writer (LGWR): sidLGWR.tc


If we have two Database Writer processes (DBW0, DBW1)
then you may see one more trace file sidDBW1.trc besides
sidDBWR0.trc, this applies to Archiver Process too. Similarly
for Checkpoint Process (CKPT) it is sidCKPT.trc whereas in
Unix environment the trace files pertaining to each of these
processes would include the name of that process in the file
133
names e.g. for PMON the trace file name would be
PMON_nnnn.trc etc.

Remember that user trace file will get generated when there is
an error in users server process which contains the details
regarding that error. We can limit the size of User trace file by
specifying the MAX_DUMP_FILE_SIZE init.ora parameter
e.g. specifying the value of this parameter as follows in init.ora
file will the user trace file size to 20MB.

MAX_DUMP_FILE_SIZE=20M


Dynamic Performance Views (V$) & Data
Dictionary Views

Dynamic Performance Views or in other words all the views
that start with V$ and Data Dictionary View are views created
on Oracle base tables. These tables are Oracle Internal tables
and are utilized by Oracle. They reside in the SYSTEM
tablespace and if you remember SYS is the owner of these
tables as these tables get created when we logged in to Oracle
as SYS and we ran two scripts which resulted in these Oracle
base tables and views.

Dynamic Performance Views as the name says are dynamic in
nature i.e. data inside these tables keeps changing and it
depends on the current state of Oracle system. Some of the
very important Dynamic Performance Views along with the
brief description of the stuff they contain are provided below.

V$SGASTAT

Contains information about the size of SGA (System Global
Area) and each of its major components.

V$SESSTAT
Oracle 9i Database Administration in 10 Minutes
134

Contains the statistics information regarding the each
connected session or in other words connected user.

V$SESSION

Contains the current connection information of each session or
in other words each connected user.

Whereas Data Dictionary Views are static in nature and the
values inside these tables change only when you change the
structure of the database. Some of the very important Data
Dictionary Views along with the brief description of the stuff
they contain are provided below.

DBA_TABLES

Contains information about the tables within the database, their
row and block information.

DBA_DATA_FILES

Contains the information about all the data files within the
database, their names, size etc.









135
I
I
N
N
D
D
E
E
X
X


1
10g 113
1521 93
A
Alert log 131
All Initialization Parameters 71
ARC0 132
Archive Log Destination 119
Archive Log Mode 68
Archived Redo Log Files 41, 44
Archived Redo Log Files: 42
ARCHIVELOG 118, 128
Archiver 119
Archiver Process 35
ARCn 29, 35
asim 100
B
background processes 25
Background processes 25
BACKGROUND_DUMP_DEST
131, 132
C
CKPT 30, 132
clone database development 77
Configuration 116
Control File 41
D
Data Dictionary Cache 28
data dictionary views 131
Data Dictionary Views 134
Data Files 41
Data Management Genie 19
Database Buffer Cache 27, 28
Database Configuration Assistant
59
Database Service 95
Datafiles 74
DB Blocks 43
DB Sizing 68
DB_BLOCK_SIZE 43
DB_NAME 70
DBA_DATA_FILES 134
DBA_TABLES 134
dbca 61
DBCA 59
DBW1 132
DBWn 29
Dedicated Server 66
dedicated server mode 36
Dedicated Server mode 35
DEFAULT 28
Dirty Buffers 28
Dispatcher 37
dispatcher process 37
Dispatcher process 30, 35, 37
Dnnn 30
dynamic service registration 92
E
Enterprise Edition 55
Oracle 9i Database Administration in 10 Minutes
136
Extents 43
F
Free Buffers 28
G
Genie 19
Global Database Name 65
H
Human brain 25
I
idle time 36
IMMEDIATE 123
init.ora 41
Instance 19
J
Java Pool 27, 29
K
KEEP 28
L
Large Pool 27
LGWR 29, 35, 132
Library Cache 28
listener.ora 87
Locally Managed 113
Log Writer 49
logical and physical architecture 46
lsnrctl 97, 98
M
MAX_DUMP_FILE_SIZE 133
MAX_SHARED_SERVERS 31
memory architecture 25
Multiplexing 48
N
NOARCHIVELOG 118, 125, 126,
128
NORMAL 123
O
OEM 80, 115
OFFLINE 112
ONLINE 112
ONM 93
Oracle background processes 29
Oracle Enterprise Manager 80
Oracle Net 87
Oracle Universal Installer 53
ORACLE_BASE 59, 70
ORACLE_HOME 59
ORACLE_HOME/bin 89
ORACLE_SID 60
ORALCE_HOME 70
OS Block 43
OS environment variables 70
OSDBA 109
OSOPER 109
OUI 53
P
Parameter File 43, 69
PATH 60
PFILE 43
PGA 29
physical architecture 41, 45
Pinned Buffers 28
PMON 35, 132
port 92
137
R
RECOVER DATAFILE 127
Recovery 118
RECYCLE 28
Redo Log Buffer Cache 27
Redo Log Files 41, 42
redo log group 48, 76
Redo Log Groups 114
Request Queue 37
Response Queue 35
Restaurant 37
S
SCOTT 78
segments 43
Segments 46
Service Naming 99
Services 97
SESSTAT 133
SET command 59
SGA 27
SGA sizing 67
Shared Pool 27
Shared Server 35
Shared Server Mode. 66
SHARED_SERVERS 31
SHUTDOWN 123
SID 65, 70
sidDBWR0 132
SMON 30, 35
SQL 19
Storage 110
SYS 78
SYSDBA 82, 109, 126
SYSTEM 78, 133
system statistics 131
T
tablespace 43
TCP/IP 92
template 77
test.takveen 65, 96
tnsnames.ora 88
trace files 132
Trace Files 69
TRANSACTIONAL 123
U
USER_DUMP_DEST 125
V
V$SESSION 134
V$SGASTAT 133



Oracle 9i Database Administration in 10 Minutes
138




Title: Oracle Database Administration Concepts &
Implementation Made Simple
ISBN: 0-9770739-0-4
Author: Asim Abbasi
Pages: 376

Buy from www.amazon.com or
www.lulu.com

Vous aimerez peut-être aussi