View
449
Download
1
Category
Tags:
Preview:
DESCRIPTION
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/
Citation preview
WELCOME TO DBA TECHNOLOGIES
ORACLE DATABASE ARCHITECTURE-2
By
Mr. PRASAD MYNUMPATI18 Years Real Time in INDIA-USA
www.dbatechnologies.net
www.dbatechnologies.netBuilding Career With Passion
database Architecture – USER TS
USER tablespace is to store data permanently
Entire Application data storage and retrieval from USER tablespacesFor load balancing purpose we use different
•
•
•
tablespaces on different disks for INDEX andDATAHow many tablespaces for a database? depends on design of the application and number of applications
••
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)
Server & Storage configuration
OS and ORACLE SW is on Server Database is going to be on high end storage– NAS (Network area Storage)
••
– SAN (Storage area Networks)
Identifying OS for ORACLE SW version
What kind of OS we need ?•• Need to follow certification matrix From oracle metalink.
www.metalink.oracle.comNeed to choose certified OS•
• Can we install multiple versions(7,8,8i,9i,10g,11g) of Oracle SW on same server?Yes we can
•
Single DB vs. Multiple databases
Can we create multiple databases by using same version of Oracle Software? Yes we canOne database vs. Multiple databases– Nature of applications
•
••
• Dependency
– Size of the database (maintenance)– Application Complexity
…..
Instance and Database
Instance will be hosted on server•––
–
CPU
MEM
PROCESSES
•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
•
ORACLE INSTANCE BACKGROUND PROCESSES
Mandate and Optional background process will be stated when INSTANCE startsAll the running background processes can be viewed@ two different levelsOS LEVEL– $echo $ORACLE_SID (Instance Name)
•
•
•
– $ps –ef | grep $ORACLE_SIDDATABASE LEVEL
- SQL> Select PNAME From v$process Where PNAMEis not null ORDER by PNAME;
How to see all the available background process details– SQL>Select name from v$bgprocess;
•
•
Mandate Background Processes DBWn
DBWn : Writes dirty buffers from•Instance Buffer Cache to DBF files
SHAREDPOOLDATABASE
USER DATAFILE
Redo buffers
Mandate Background Processes DBWn
DBWn : Writes only dirty buffers that are LRU (Least recentlyUsed buffers) to dbf files and MRU during CKPT
•
• What is the difference between block (file) and buffer (memory)
Data BaseBuffer Cache (Memory)
Dbf fileBlocks : (Storage) Default Block Size 8KNon default supported block sizes: 2k,4k,16k,32k
Types of Buffers in Buffer Cache
• Dirty Buffers
• Free BuffersDATABASE BUFFER CACHE
• Pinned Buffers
Types of Buffers in Buffer Cache
Dirty Buffers–Modified in buffer cache(memory)
•
that are not yet(storage)
written to data files
• Free Buffers–Ready to usePinned Buffers–Buffers that are
•in use by Oracle
DBWn writes when?
Dirty buffers thresholdWhen required free buffers are available
•• not
• During graceful/consistent shutdown
• Any TS status change like (read only,offline or Tablespace Begin backup..)
Checkpoint•
)
Mandate Background Processes LGWR
• LGWR : Log writer writes change records redo buffers to redo log files
from
SHAREDPOOLDATABASE
Current (In use)Active (Required for recoveryInactive (Ready to be current)
Redo log filesLog Switch
Redo buffers
LGWR writes when
At every commitEvery three secondsWhen 1/3 full of redo log buffersWhen worth of redo records is 1MBWhat contains change vectors– Change record is combination of change
•••••
vectors– Change vector contains
••••••
Scn and Time Stamp of changeTransaction IdCommit details if committed ( scn and timestamp)Type of operationSegment name and typeChange details
LGWR
Server Process copy redo records from user memory space (PGA) to redo log buffers for every DML and DDLLOG_BUFFER is the parameter to set redo log buffers size. Min 64k.Log buffer space (v$session_wait) – wait event(in seconds) indicates insufficient log buffers size
•
•
•
• V$system_event - log file switch completion(event,total_waits, time_waited and average_wait)
Alert log file also records the above event check for checkpoint not completeHighly recommended multiplexing
•
•
Mandate
DBWn
background process CKPT
LRU LRU LRUSHARED POOL
DATABASE BUFFER CACHE
REDO LOGBUFFERS
MRU MRU MRUCKPT
Data723
file 1723 723
723723
Control file Data file 2 Redo log files
Mandate background process CHECKPOINT
•Checkpoint is a very critical background process to reduce the instance or media recovery timeCheckpoint 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#
Checkpoint position (SCN) in redo is the pointer
•
•where recovery must start fromCheckpoint ensures all the dirty buffers to disk(LRU & MRU)
Checkpoint position is the oldest dirty buffer in the database buffer cache
•
•
Types of checkpoint
Thread checkpoint :– (database checkpoint)
Database writes to disk all buffers modified by redo in a specific thread, occurs during the following situations
•
•
– Consistent database shutdown– Alter system checkpoint– Online redo log switch– Alter database begin backup
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 thatbelongs to a TS
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 dirtybuffers, it advances the checkpointposition to the control file but not thedata file headers
Types of checkpoint
Incremental checkpointsIt is kind of thread checkpoint in order to avoid large number of blocks at online redo log switches.
••
• DBWn checks every 3 seconds to checkany work to do, if DBWn writes dirtybuffers, it advances the checkpointposition to the control file but not thedata file headers
Mandate background process SMON
SMON : System MonitorResponsible for Instance crash recovery (ICR)
Cleans up temporary segments. For example if index creation failed it cleans up all the temporary segments.What is ICR?
•••
•– Instance recovery is applying records from
redo to dbf files after most recent checkpoint– Information from redo must be transferred
to dbf to make it permanent and consistent–
SHARED POOL DATABASE
BUFFER CACHE
ICR - SMON
SMON
INSTANCE STARTUP AFTER CRASH
CrashRecovery 245
245 Data file 1
245
245
Data file 2
Data file 3245 - Control file
1.Rollforward2.Rollback (uncommitted txns)3. Recovery done Committed &
un committedCommitted &un committed
245 Undo Data file 1
Mandate background process PMON
PMON : Processes Monitor•• Responsible
resources offor cleaninga dead processes
SGA
User process
User process Crash
PMON
Mandate background process
RECO : Recoverer
RECO
•• Responsible for resolving in-doubt transactions in distributed
database environment.Distributed txn
RECO RECO
User
SQL statements processing in
ServerProcesses
ORACLE DATABASE
PARSING
DATABASEBUFFER CACHE
1. Syntax check2. Semantic check3.Shared pool check
SHAREDPOOL
REDO BUFFERS
UserProces
s
If SPcheck
=no
SQL> Select *from employees; soft
harddata file
OPTIMIZERExecution
Row source generation Multiple EP’s
p
Use
SQL statements processing in
ServerProcesses
ORACLE DATABASE
PARSING
DATABASEBUFFER CACHE
1. Syntax check2. Semantic check3.Shared pool check
SHAREDPOOLUser
Process
Rows u dated
10k 10k 10k
REDOBUFFERSDBWn 20k 20k 20k
If SPcheck
=no
SQL> Updatesal=20K fromsalary where
sal=10K
softUndo data file
hardr data file
OPTIMIZERExecution
Row source generation Multiple EP’s
Building career with passion
DSNR:944 11 72 718/040-65555689www.dbatechnologies.net
QUESTION AND ANSWER SESSION
Recommended