Oracle Architecture


Instance

The Instance is the combination of memory and processes that are part of a running installation.


database

The database is the physical component or the files.

An instance can exist without a database.

A database can exist without an instance, but would be useless.

An instance can only access one database.

You can set up multiple instances to access the same set of files or one database.


Oracle architecture = Memory + Processes + Files and structures;


System Global Area

The System Global Area (SGA) is a group of shared memory structures. It contains things like data and SQL. It is shared between both Oracle background processes and server processes.
The SGA is made up of several parts called the SGA components:
 Shared pool
 Database buffer cache
 Redo log buffer
 Large pool
 Java pool

Shared pool = Library cache + Dictionary cache + Quickest result cache

(A cache is a temporary area in memory created for a quick fetch of information that might otherwise take longer to retrieve.)

The library cache = it is a library of ready-to-go SQL statements.

The dictionary cache = The dictionary cache is also frequently used for parsing when you execute SQL. You can think of it as a collection of information about you and the database’s objects. It can check background-type information. 

The quickest result cache = SQL result cache + PL/SQL function result cache


Database buffer cache(typically the largest portion of the SGA) :It has data that comes from the files on disk.the database buffer cache’s sole purpose is to cache the data in memory for quicker access. It contain all types of objects: Tables, Indexes, Materialized views, System data.

A block in the buffer cache can be in one of three states:

Free: Not currently being used for anyting

Pinned: Currently being accessed

Dirty: Block has been modified, but not yet written to disk


What triggers a block write and therefore a dirty block:

The database is issued a shutdown command.

A full or partial checkpoint occurs — that’s when the system periodically dumps all the dirty buffers to disk.

A recovery time threshold, set by you, is met; the total number of dirty blocks causes an unacceptable recovery time.

A free block is needed and none are found after a given amount of searching.

Certain data definition language (DDL) commands.

Every three seconds.

Other reasons.


Redo log buffer : This buffer records every SQL statement that changes data.

The redo log buffer is flushed when these things occur:

Every time there’s a commit to data in the database

Every three seconds

When the redo buffer is 1⁄3 full

Just before each dirty block is written to disk


Large pool:The large pool relieves the shared pool of sometimes-transient memory requirements.

These features use the large pool:

Oracle Recovery Manager

Oracle Shared Server

Parallel processing

I/O-related server processes


PGA:The Program Global Area (PGA) contains information used for private or session-related information that individual users need.

PGA = Session memory + Private SQL area


process = Background processes + Server processes + User processes

Background
Process Name
Description
PMON The process monitor (or P-MOM, because it cleans up after
you like your mother did when you were a kid) manages the
system’s server processes. It cleans up failed processes by
releasing resources and rolling back uncommitted data.
SMON The system monitor is primarily responsible for instance
recovery. If the database crashes and redo information
must be read and applied, the SMON takes care of it. It also
cleans and releases temporary space.
DBWn The database writer’s sole job is taking dirty blocks from
the dirty list and writing them to disk. There can be up to 20
of them, hence the n. It starts as DBW0 and continues with
DBW1, DBW2, and so on. After DBW9, it continues with
DBWa through DBWj. An average system won’t see more
than a few of these.
LGWR The log writer process flushes the redo log buffer. It writes
the redo entries to disk and signals a completion.
CKPT The checkpoint process is responsible for initiating check
points. A check point is when the system periodically dumps
all the dirty buffers to disk. Most commonly, this occurs
when the database receives a shutdown command. It also
updates the data file headers and the control files with the
check point information so the SMON know where to start
recovery in the event of a system crash.
ARCn Up to 30 archiver processes (0–9, a–t) are responsible for
copying filled redo logs to the archived redo storage area.
If your database isn’t running in archive mode, this process
shuts down.
CJQ0 The job queue coordinator checks for scheduled tasks
within the database. These jobs can be set up by the user
or can be internal jobs for maintenance. When it finds a job
that must be run it spawns the following goodie.
J000 A job queue process slave actually runs the job. There can
be up to 1,000 of them (000–999).
DIA0 The diagnosability process resolves deadlock situations and
investigates hanging issues.
VKTM The virtual keeper of time sounds like a fantasy game
character but simply provides a time reference within the
database.


User and server processes

server processes:The server process serves. It does anything the user requests of it. It is responsible for reading blocks into the buffer cache. It changes the blocks if requested. It can create objects.


Server processes can be one of two types: Dedicated or Shared

(DBA connections must have a dedicated server.

The fact is shared server configurations are less common in today’s environment where memory is cheap. Most applications these days get around the problems associated with too many dedicated servers by using advanced connection pooling on the application server level.)


Physical Structures:Data files + Control files + Redo log files + Archive log files + Server and initialization parameter files

Data files: Where the data meets the disk,Data files are also binary in nature. You can’t read them yourself without starting an instance and executing queries. The data is stored in an organized format broken up into Oracle blocks.

In every data file, the very first block stores the block header.By default, the header block is 64k.

These header
blocks are for managing the data file’s internal workings. They contain  Backup and recovery information,  Free space information,  File status details


Control files:The control file is a very important file in the database — so important that you have several copies of it.

Control files contain the following things:
 Names and locations of your data files and redo log files
 Recovery information
 Backup information
 Checkpoint information
 Archiving information
 Database name
 Log history
 Current logging information


Redo log files:Redo log files store the information from the log buffer. They’re written to by the Log Writer (LGWR). Every database must have at least two redo log groups.

Redo log files contain all the information necessary to recover lost data in your database. Every SQL statement that you issue changing data can be reconstructed by the information saved in these files.

(And, as with control files, each member
should be on a separate disk device. That way, if a disk fails and the database goes down, you still have recovery information available. You should not lose any data.)


Archive log files are simply copies of redo log files.


Server and initialization parameter files:PFILE or SFILE


Logical Structures


Tablespaces are the first level of logical organization of your physical storage.

Each tablespace is responsible for organizing one or more data files.


Segments are
objects in the database that require physical storage and include the following:
 Tables
 Indexes
 Materialized views
 Partitions


Extents are like the growth rings of a tree.


An Oracle block is the minimum unit that Oracle will read or write at any given time.





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值