0% found this document useful (0 votes)
44 views31 pages

Overview of Oracle RDBMS

The document provides an overview of the Oracle RDBMS, including its architecture, components, and processes. It describes the memory structures like the shared pool, database buffer cache, and redo log buffer. It also explains the different background processes like DBWR, LGWR, PMON, SMON, CKPT, ARCH, and their key functions in managing the database, handling transactions, and performing recovery.

Uploaded by

Amir Khan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views31 pages

Overview of Oracle RDBMS

The document provides an overview of the Oracle RDBMS, including its architecture, components, and processes. It describes the memory structures like the shared pool, database buffer cache, and redo log buffer. It also explains the different background processes like DBWR, LGWR, PMON, SMON, CKPT, ARCH, and their key functions in managing the database, handling transactions, and performing recovery.

Uploaded by

Amir Khan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 31

Overview of Oracle RDBMS

By Hanumanth
Part 1. Introduction to Database System

 Introduction to Database

 History of RDBMS

 Entity-Relationship Modeling

 Database Language
 Database Management System(DBMS)
 A software system that enables users to define, create and
maintain the database and provides controlled access to
database
 DDL
 DML : procedural, non-procedural
 Control : security, integrity, concurrency control,
recovery control, user-accessible catalog

 Components of the DBMS Environment


 Hardware - Software - Data - Procedures - People
 Functions of a DBMS
1. Data storage, retrieval, and update
2. A user-accessible catalog
3. Transaction support
4. Concurrency control services
5. Recovery services
6. Authorization services
7. Support for data communication
8. Integrity services
9. Services to promote data independence
10. Utility services
 Terminology
 Relation : a relation is a table with columns and rows
 Attribute : an attribute is a named column of a relation
 Domain : a domain is the set of allowable values for
one or more attributes
 Tuple : a tuple is a row of a relation
 Degree : the degree of a relation is the number of
attributes it contrains
 Cardinality : the cardinality of a relation is the number
of tuples it contains
 Relational database : a collection of normalized
relation
 Properties of Relations
 The relation has a name that is distinct from all other
relation names
 Each cell of the relation contains exactly on atomic
value
 Each attribute has a distinct name
 The values of an attribute are all from the same domain
 The order of attributes has no significance
 Each tuple is distinct; there are no duplicate tuples
 The order of tuples has no significance, theoretically
 Normalization
 A technique for producing a set of relations with desirable
properties, given the data requirements of an enterprise
 UNF is a table that contains one or more repeating groups
 1NF is a relation in which the intersection of each row and column contains one
and only one value
 2NF is a relation that is in 1NF and every non-primary-key attribute is fully
functionally dependent on the primary key.
 3NF is a relation that is in 1NF, 2NF in which no non-primary-key attribute is
transitively dependent on the primary key
 BCNF is a relation in which every determinant is a candidate key
 4NF is a relation that is in BCNF and contains no trivial multi-valued
dependency
 5NF is a relation that contains no join dependency
 DML
 SELECT
 INSERT
 UPDATE
 DELETE
 DDL
 CREATE(DROP) SCHEMA
 CREATE(ALTER, DROP) DOMAIN
 CREATE(ALTER, DROP) TABLE
 CREATE(DROP) VIEW
 CREATE(DROP) INDEX
Part 2. Understanding Oracle Database

 Overview of oracle Database Architecture

 Memory Structure

 Process Structure

 Storage Structure
Overview of Oracle Architecture

PMON SMON RECO D000 S000 P000 * Total SGA Size :


1700 Mbyte
* Fixed Size :
Redo Log
SGA Buffer
70 Kbyte
Shared SQL Area Database Buffer Cashe
* Variavle Size :
490 MByte

TL-812
4,000,000 KByte 1,200,000 KByte 2,100 KByte

DBW0 CKPT LGWR


Server
Data File
Raw Device ARCH
USER
Archive Log Mode(50M)
Memory Structure : Shared Pool

Shared Pool  Shared Pool Contents


- Text of the SQL or PL/SQL statement
Library Cache Dictionary
Cache - Parsed form of the SQL or PL/SQL statement
- Execution plan for the SQL or PL/SQL
Shared
statements
SQL Area
- Data dictionary cache containing rows of data
dictionary information
Control Structures
for example:  Library Cache
PL/SQL Procedures
Character Set - shared SQL area
and Package Conversion - private SQL area
Memory
Network Security - PL/SQL procedures and package
Attributes
Control Structures - control structures : lock and library cache handles
for examples; and so on ..
 Dictionary Cache
Locks
Library - names of all tables and views in the database
Cache handles Reusable
and so on ... Runtime - names and datatypes of columns in database tables
Memory - privileges of all Oracle users
 SHARED_POOL_SIZE
Memory Structure :Database Buffer
Cache
 Database Buffer Cache holds copies of data blocks read from disk
 All users concurrently connected to the system share access to the buffer cache
 Dirty List
 LRU List
 Size = DB_BLOCK_SIZE * DB_BLOCK_BUFFERS

SGA Database Buffer Cache


Shared Pool

Shared SQL
Area
Memory Structure :Redo Log Buffer

 Circular buffer containing information about changes made to the database


 save it redo entry
 Redo Entries is used when Database Recovery
 DBWR write contents of Redo Log Buffer to Online Redo Log
 LOG_BUFFER

change vector #1
redo record
change vector #1

change vector #1
Oracle Processes

SNPn SMON PMON RECO LCK0

Pnnn
SGA
Database Buffer Cache Redo Log
Buffer
Offline
Storage
Device
Dedicated
Snnn Server
Process

DBWR LGWR ARCH

Dnnn
User
Process CKPT

Control
Files
Users Redo Log
Data
Files
Files
Background Process

 DBWR (Database Writer)


- write all dirty buffers to datafiles
- Use a LRU algorithm to keep most recently used blocks in memory
- Defers write for I/O optimization
 dirty list reaches a threshold length
 A process scnas a specifed number of buffer in the LRU without finding free buffer
 A time-out occurs
 DBWR checkpoint occurs

 LGWR (Log Writer)


- writes redo log entries to disk
 Commit occurs
 The redo log buffers pool becomes one-third full
 DBWR completes cleaning the buffer blocks at a checkpoint
 LGWR time-out
- A commit confirmation is not issued until the tx has been recorded in the rego
log file
Cont’d

 PMON (Process Monitor)


- Cleans up abnormally terminated connection
- Rolls back uncommited transactions
- Releases locks held by a terminated process
- Frees SGA resources allocated to the failed processes
- Database maintenance

 SMON (System Monitor)


- Performs automatic instance recovery
- Reclaims space used by temporary segments no longer in use
- Merges contiguous area of free space in the datafile
Cont’d

 CKPT (Check Point)


- is enabled by setting the parameter CHECKPOINT_PROCESS=TRUE
- If enabled, take over LGWR’s task of updating files at a checkpoint
- Updates header of datafiles and control files at the end of checkpoint
- More frequent checkpoint reduce recovery time from instance failure
- CKPT improve the performance of database with many database files
 ARCH (Archiver)
- Copies redo log files to tape or disk for media failure
- Operates only when a log switch occurs
- Is optional and is only needed when in ARCHIVELOG mode
- May write to a tape drive or to a disk
 LCKn (Lock), Dnnn (Dispatcher), Snnn (Server),
RECO (Recover), Pnnn(Parallel), SNPn(Job Queue),
QMNn(Queue Monitor),
Server/User Process

 User Processes
- A user process is used when a user runs an application program
- Runs the tool/application and is considered the client
- Passes SQL to the server process and receives the results

 Server Processes
- A server process must place the data in the database buffer cache
- Parce and execute SQL statements
- Read data blocks from disk into the shred database buffers of the SGA
- Return the results of SQL statements to the user process
 Parse : check syntax, security access, object resolution, optimization
 Execute : applies the parse tree to the data, perform a physical read and
change
 Fetch : Passes data to the user (only SELECT)
Oracle Files

 Datafile
 Redo Log Files
 Control Files
 Parameter File
 Archive File
 Log File (alert*.log, sqlnet.log, listener.log...)
 Trace File
Storage Architecture

 Physical storage structures


 Data files
 Segments
 Extents
 Blocks
 Logical storage structures
 Tablespaces
 Tables / Clusters / Indexes
 Rows
 Columns
Physical Storage Architecture
 Relationship among Segments, Extents, and Blocks

Segment
96K

Extent Extent
24K 72K 2K
2K
2K 2K 2K 2K
2K 2K 2K 2K
2K 2K 2K 2K
2K 2K 2K 2K
2K 2K 2K 2K
2K 2K 2K 2K
2K 2K 2K 2K
2K 2K 2K 2K
2K 2K 2K 2K
2K 2K 2K 2K

Database Blocks
Logical Storage Architecture

 Relationship between tablespaces and datafiles

Database

System Tablespace USER Tablespace

DATA1.ORA DATA2.ORA
DATA3.ORA
Block

Header
Table Dictionary General Block Information
Row Dictionary (Block add, Segment type)
85 ~ 100 bytes
Free Space
Table info in Cluster

Row info in Block


(2 byte per row)
Row Data

using when New Row


Insert or Update
(pctfree, pctused)

Table or Index Data


PCTFREE / PCTUSED
PCTFREE
PCTFREE PCTUSED
PCTUSED

20% Free space

61% Free space

PCTFREE = 20 PCTUSED = 40

 Insert new row until 80%  Can insert new row when below 60%
 When Usage is below 40% (61% Free
 20% use when Update space), block is listed in FREELIST
Extent
A set of contiguous database blocks within a datafile.
 Extent are allocated when.
- The segment is created (INITIAL EXTENT)
- The segments grows (NEXT EXTENT)
- The table is altered to allocate extents.
 Extent are de-allocated when the
- The segment is dropped and truncated.
- The segment is larger than optimal and contains free extents
(for rollback segments only)
 Each segment is created with at least on extend( initial extent )
( Rollback segment : 2)
 ALTER TABLE table_name DEALLOCATE UNUSED
Segment

 a set of one or more extents that contains all the data for a specific type of logical storage
structure within a tablespace
 Data Segment
- A collection of extents that holds all of the data for a table or a cluster
 Index Segment
- A collection of extents that holds all of the index data for search optimization on large tables
and clusters
 Rollback Segment
- A collection of extents that holds rollback data for rollback, read-consistency, or recovery
 Temporary segment
- A collection of extents that holds data belonging to temporary tables created during a sort
operation
 Bootstrap segment
- An extent that contains dictionary definitions for dictionary tables to be loaded when the
database is opened.
Oracle Client/Server Architecture

NETWORK

Client Server b
Application

Client/Server Server/Server

Server A
 Benefit of Client/Server Component
- Database S/W work on Server - Only Server upgrade to increase size
- Minimize network resource - Minimize Client H/W spec
- concurrency, consistency, transparency - concurrency, consistency, transparency
SQL*Net

 What is SQL*Net?
- Oracle’s Client/Server middleware product
- transparent connection from client tool to DB ( from on DB to another )
- works across multiple network protocol and operation system
 What is TNS?
- Transparent Network Substrate
- Oracle’s Network applications to access the underlying network protocols transparently
- TNS-based application, Oracle Protocol Adapters, Network software like TCP/IP
 Configuration File
- TNSNAME.ORA ( Client )
- TNSNAV.ORA ( Client )
- SQLNET.ORA ( Client, Server )
- LISTENER.ORA ( Server )
SQL*Net Configuration

 TNSNAME.ORA  LISTENER.ORA
info = LISTENER=
(DESCRIPTION= (ADDRESS_LIST=
(ADDRESS_LIST= (ADDRESS=
(ADDRESS=
(PROTOCOL=tcp)
(PROTOCOL=tcp)
(HOST=brinfoa01)
(HOST=brinfoa01)
(PORT=1521) (PORT=1521)
) )
) )
(CONNECT_DATA= SID_LIST_LISTENER=
(SID=BRBINFO1) (SID_LIST=
) (SID_DESC=
) (SID_NAME=BRBINFO1)
(ORACLE_HOME=/oracle7/oracle7)
(ENVS='EPC_DISABLED=TRUE')
)
)
 SQLNET.ORA STARTUP_WAIT_TIME_LISTENER=0
# SQLNET.EXPIRE_TIME = 0 CONNECT_TIMEOUT_LISTENER=0
LOG_DIRECTORY_LISTENER=/oracle7/oracle7/network/log
SQLNET.AUTHENTICATION_S
LOG_FILE_LISTENER=listener
ERVICES=(none, beq)
TRACE_LEVEL_LISTENER=OFF
Questions ???
Thank You

You might also like