DBA T is pchnologies Provides Oracle DBA Online Training Class course by excellent experienced IT professionals who has more then 18+ Years of real time experience Our trainers has good training experience so that best quality output will be delivered. visit - http://www.dbatechnologies.net/
1. WELCOME TO DBA TECHNOLOGIES
ORACLE DATABASE
ARCHITECTURE-2
By
Mr. PRASAD
MYNUMPATI
18 Years Real Time in
INDIA-USA
www.dbatechnologies.net
www.dbatechnol
ogies.net
2. database Architecture – USER TS
•
USER tablespace is to store data
permanently
•
Entire Application data storage and retrieval
from USER tablespaces
For load balancing purpose we use different
•
•
•
tablespaces on different disks for INDEX and
DATA
How many tablespaces for a database? depends on design
of the application and number of applications
3. ORACLE & OS comparison
FILE SYSTEM
TABLESPACE
File system Partitions (ext3)
Tablespaces (Undo, Temp and Permanent)
Mount file system (To read and write)
By default TS is mounted
Files & Directories
Tables , Indexes (objects)
OS Block size
TS Block size (Default 8K)
Multi user access based on privileges
Multi users access by assigned quota
Backup FS
Backup tablespace
FS consistency (fsck)
Database level consistency (RMAN)
4. Server & Storage
configuration
•
• OS and ORACLE SW is on Server
Database is going to be on high end
– SAN
storage (Storage area
– NAS (Network
Networks) area Storage)
5. Identifying OS for
• ORACLE SW version
•
•
•
•
Need to follow certification matrix From oracle metalink.
www.metalink.oracle.com?
What kind of OS we need
Need to choose certified OS
Can we install multiple versions
(7,8,8i,9i,10g,11g) of Oracle SW on same server?
Yes we can
6. Single DB vs. Multiple databases
•
•
•
Can we create multiple databases by using same
version of Oracle Software? Yes we can
One database vs. Multiple databases
– Nature of applications
• Dependency
– Size of the database (maintenance)
– Application Complexity
…
..
7. •
Instance and Database
– CPU
Instance will be hosted on server
–
–
MEM
PROCESS
ES
•Database (C,R,D files) is located on high
end
storage solutions like SAN with fiber optic
technology.
• Process power and memory for all Database
operations are from server resources
8. ORACLE INSTANCE
• BACKGROUND PROCESSES
• Mandate and Optional background process will be
• stated when INSTANCE starts
•
All the running background processes can be
viewed –ef | grep $ORACLE_SID
– $ps
DATABASE LEVELlevels
@ two different
- SQL> Select PNAME From v$process Where PNAME
• OS LEVEL
is not null ORDER by PNAME;
– $echo the available background process
How to see all$ORACLE_SID (Instance
details
Name)
– SQL>Select name from v$bgprocess;
10. •
•
Mandate Background
Processes DBWn an buff (mem
What is the betw blo (fil
DBWn : Writes only dirty buffers that are LRU (Least recently
difference
een ck e) d er ory)
Used
Data Basebuffers) to dbf files and MRU
Buffer Cache
during CKPT
(Memory)
Dbf file
Blocks : (Storage) Default
Non default supported block
Block Size 8K
sizes: 2k,4k,16k,32k
12. •
Types of Buffers in
Buffer Cache
Dirty Buffers
•
•
that are buffer
writt t da fil
–Modified in
not yet
o ta es
cache(memory) en
Free
(storage)
Buffers
–Ready to use
Pinned Buffers
–Buffers that
in use by
Oracle
13. •
•
DBWn writes
when?
Dirty buffers threshold
When required free buffers
•
During
are available
•
n
ot
Any TS status change
graceful/consistent
• like (read only,
shutdown
offline or Tablespace
Begin backup..)
14. Mandate Background
• LGWR : Log writer writes change records
fro
Processes LGWR
redo buffers to redo log files
m
SHAR
ED
Redo buffers
PO
OL
DATAB
ASE
Current (In use)
Active (Required
for recovery
Log
Inactive (Ready to
Switch
be current)
)
Redo log
files
15. LGWR writes
when
•
•
•
At every commit
•
• Every three
seconds
When 1/3 full of redo log vect
– Change vector
•
Scn and
buffers Time Stamp of change ors
•
contains
• Transaction Id
•
When worth of committed
Commit details if redo
•
• ( scn is 1MB
recordsand timestamp)
Type of operation
What contains change
Segment name and type
Change
vectors details
16. •
LG
WR
Server Process copy redo
• records from user
memory space (PGA) to
•
redo log buffers for every
• DML and DDL
V$system_ - log file switch
(event,total_waits, time_waited
• LOG_BUFFER is the parameter to set redo log
event
completion
and average_wait)
buffers size. Min 64k.
• Alert log file also records the above event check
Log buffer space (v$session_wait) – wait event(in
for
checkpoint not complete
seconds) indicates insufficient log buffers size
17. Mand background
LR
LR LR
ate process CKPT
SHARED
U
U
U
DATABASE
BUFFERMR MR
MR CACHE
DBWn
CK
PT
72
3
Cont fil
rol e
U
U
Da file
ta 1
72
U
POOL
REDO
LOG
BUFF
ERS
72
3
72
3
723
3
Da file
ta 2
Redo log
files
18. Mandatevery critical background process to
background
Checkpoint is a
•process CHECKPOINT time
reduce the instance or media recovery
Checkpoint wont write any data but in only
• ensures
marking SCN in Redo, Control file and data files
– During checkpoint DBWn writes data to dbf files and
• marks Redo, control file and data files with scn#
•
•
Checkpointrecovery must startpointer
where position (SCN) in redo is the from
Checkpoint ensures all the dirty buffers to disk
(LRU & MRU)
Checkpoint position is the oldest dirty buffer in
the
database buffer cache
19. •
•
Types of
checkpoint
Thread checkpoint :
– (database checkpoint)
Database writes to disk all buffers
– Consistent
modified by redo in a specific thread,
occurs during the following
database shutdown
situations system
– Alter
checkpoint
20. Types of checkpoint
• TS and data file checkpoints:
– Tablespace checkpoint is with respect to
a particular table space during the status
change like read only, read write, begin
backup. Only for the
data files that
belongs to a TS
21. •
Types of checkpoint
Incremental checkpoints
– It is kind of thread checkpoint in order
to avoid large number of blocks at online
redo log switches.
•
DBWn checks every 3 seconds to
any work to do, if DBWn
check
writes dirty
buffers, it advances the
checkpoint
22. •
•
Types of checkpoint
Incremental checkpoints
It is kind of thread checkpoint in
order to avoid large number of blocks
at online redo log switches.
•
DBWn checks every 3
seconds to check
any work to do, if DBWn
writes dirty
23. Mandate background
process SMON
•
•
• SMON : System Monitor
•
Responsible for Instance crash
recovery (ICR)is applying records from
– Instance recovery
Cleans up temporary segments. For example if
redo
index creation failed it recent checkpoint
to dbf files after most cleans up all the
temporary
– Information from redo must be transferred
segments.
to
What ismake it permanent and consistent
dbf to ICR?
–
24. SM
ON
Cra
Recov
sh
ery
245 Control file
ICR SMON
INSTANCE
BUFFER CACHE
STARTUP
AFTER CRASH
24
5
24
5
Data
file 1
Data
file 2
245
Data file 3
1.Rollforward
2.Rollback
Committ
(uncommitted txns)
ed &
Undo
3.24
Recovery done Data
5
file 1
SHARED POOL
DATABASE
un
committ
ed
24
5
Committ
ed &
un
committ
ed
25. Mandate background
• process PMON
PMON : Processes
•Respon for Monitor
ade proces
sible
cleanin
ad ses
resourc g
User process
Crash of
es
User
process
SG
A
PM
ON
27. SQL statements ORACLE
PARSI
processing in DATABASE
Us
er
Pro
cess
SQL>
Select *
from
employee
s;
DATAB Server
SHAR
Processes
ASE
ED
BUFFER
PO
CACHE
OL
REDO
BUFFERS
data
file
Execut
ion
Row source
generation
NG
1. Syntax
check
2. Semantic
check
If
3.Shared
so
SP
pool check
ft
che har
ck d
OPTIMI
=n
ZER
o
Multiple
EP’s
28. SQL statements ORACLE
PARSI
processing in DATABASE
Us
er
p
Proc DB
Wn
ess
SQL>
Update
sal=20K
from
salary
where
sal=1
0K
Rows u
dated
DATAB Server
SHAR
Processes
ASE 10
ED
10 10
BUFFER
RED
PO
k k k
20 20 20
O
CACHE
OL
BUFF
k k k
ERS
Un data
do User data
file
file
Execut
ion
Row source
generation
NG
1. Syntax
check
2. Semantic
check
If
3.Shared
so
SP
pool check
ft
che har
ck d
OPTIMI
=n
ZER
o
Multiple
EP’s