Sei sulla pagina 1di 16

Oracle Database administration in

SAP

Mohammed
Jashim

What is Oracle Database ?


Oracle database is collection of data
logically treated as units.
The data is physically stored in one or
several files.
Oracle manages data in logical unit
called Tablespaces
Database objects is created in particular
tablespace. Ex : - Creation of Table
Tablespace consist of one or more files.

What is Oracle Instance ?


The combination of Oracle
background processs and memory
buffers is called Oracle instance.
Every running Oracle database is
linked to Oracle instance.
Every Oracle database needs its own
instance.
Using RAC (real application clusters).
One database is severed by two or
more instances.

Important Terms
System Global Area (SGA)
When oracle instance started a shared
memory region is getting allocated called
SGA.
SGA allocated by Oracle instance can only be
accessed by Oracle process.
Each instance having its own SGA.
SGA contains copies of data and control
information of corresponding Oracle instance.
When instance is stopped, SGA is deallocated.

Important Terms

Oracle Process
When instance started Oracle
background process is started.
DBW0, DBW1 - Database Writer
LGWT Log Writer
ARC0 - Arc-hiver
CKPT Check Point
PMON Process Monitor
SMON System Monitor

Important Terms
System Identifier
Every database in the network can be identified by using
the system identifier.
In-order to distinguish between SAP system identifier and
Database system identifier, we have below.
DBSID Database System Identifier
SAPSID SAP System Identifier
SID naming convention :First letter is Uppercase letter, and the remaining two is
Upper case letters or digits.

Database architecture
Oracle Instance and Database: Architecture
Overview

Important Terms
Oracle Listener
After Oracle instance is started, a
special process called LISTENER,
(Networking work process that
work with Oracle) that allows the
database clients and the instance
to communicate with each other.
When a work process makes a
request to connect to Database,
Listener creates a dedicated Server
process and makes an appropriate
connection between SAP and
Oracle.

Shadow Process
The separate server process
created on behalf of each work
process in database is called
Shadow Process.
Work Process in SAP.
Server Process in Database.
1:1 ratio for SAP WP : Shadow WP

Important Terms

Shared SQL area


Oracle database management system holds the
executable SQL statements in Shared SQL area
(which is also called as Shared Cursor Cache ) which is
the part of Shared Pool in SGA.

Row Cache
Row cache caches the Oracle data dictionary
information.

Database Buffer Cache


Database stores the data in hard disks. However data is never
processed on disks themselves.
No matter when a user wants to read or modify any data, first it
has to be copied from disks to buffer cache by Shadow process. If
data not available in the buffer cache.
When any instance started, for the first time all the datas are
cached in the buffer cache, and any active users can use the same.
The smallest logical unit that Oracle uses, in-order to store the data
from disks to buffer cache as well as managing the data in the
cache is called data block.
Data block default size in SAP installation is 8 kb.
Depending on the size of the buffer cache, it may sometimes be
necessary to overwrite the least recently used data block in the
buffer cache.

Writing of Modified Data to Data files from Data Block


Any changes to Oracle data (insert
or update or deletion) are modified
in the buffer cache not on the disks
directly.
Database writer writes the modified
data (Dirty blocks) to disk.
Shadow process scans the buffer
cache for non-modified blocks,
reusable buffers in-order to copy the
data from data files or modifying the
data in the buffer cache. However if
the free buffer space is not available
or reaches certain threshold limit,
then Shadow process signals the
DBW0 to write the Least Recently
Used (LSU) modified data blocks
to data files, so that making more
buffer space for the buffer cache.

Cont.,

At specified times (CKPT Check Point process),


initiates or signals the Database Writer, to write the
modified data blocks from buffer cache to data files.
Using the concept of deferred writing instead of
immediate writing improves writing efficiency of
Database writer, because several changes are
performed on the same block before the data block is
copied to disk.
Database writer writes multiple data block in a
batched format in-order to improve the writing
efficiency.
One Database writer DBW0 is sufficient is most of the
cases to write the data to disks. However in an
exceptional case additional DBW1, DBW2 can be
configured.

Logging of Modifications

Cont.,
To achieve data consistency and read consistency, Oracle maintains redo
entries for roll forward or redo recovery for example after a crash, and
undo entries to roll back uncommitted transactions.
Redo entries contain the information necessary to reconstruct, redo, or roll
forward changes made to the database by SQL statements within a
committed
transaction. Redo entries contain the new values of the modified data, also
called after images.
Parallel to changes made in data blocks, Oracle shadow processes write
redo
entries into the redo log buffer.
This is a circular buffer in the system global area that temporarily records all
changes (both uncommitted and committed) made to the database .
The Oracle background process LGWR, writes contiguous portions of the
redo log buffer sequentially to an online redo log file (or group of files)
on disk.

Cont.,
Log Writer writes the entries from Redo Log Buffer to Online Redo Log
Buffer in below conditions.
When any transaction is committed.
Every three seconds.
Redo Log Buffer is 1/3 full.
When Database writer writes the data from data blocks to data files, that
time Log Writer also writes the log details from Redo Log Buffer to Online
Redo Log Buffer.
This algorithm ensures that space is always available in the redo log buffer
for new redo records.
When a User (work process) commits a transaction, then for the
corresponding transaction a System Change Number (SCN) is
assigned by the Database. Oracle records the SCN along with the
transaction in the Redo Log Buffer.
Undo Entries, which roll back the data modified in the data blocks by the
SQL statement which have not been committed.
Redo Entries Before Images
Undo Entries - After Images

Cont.,
Oracle stores undo information (old values of modified data),
called before images in a special undo segment, separate from
the redo log.
The Oracle undo space consists either of an undo tablespace (this
solution
is called automatic undo management . only the undo
Tablespaces must be
created) or of rollback segments (manual undo management .
rollback
segments must be allocated in a tablespace and managed).
The undo information of a transaction is retained in the undo
space at least
until the end of the transaction. It may be overwritten only after
the transaction
has been committed.

Potrebbero piacerti anche