0% found this document useful (0 votes)
177 views

Process Architecture: Open, Comprehensive, and Integrated Approach To Information Management. An Oracle

The document summarizes key concepts about Oracle databases including: 1. An Oracle database consists of an Oracle instance containing user processes, server processes, and background processes that manage the database. 2. The physical database structure includes datafiles that store data, redo log files that record changes, and control files that specify the database structure. 3. Logically, databases are divided into tablespaces containing schemas and objects like tables, indexes, and procedures that directly access the data.

Uploaded by

vishwasdeshkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
177 views

Process Architecture: Open, Comprehensive, and Integrated Approach To Information Management. An Oracle

The document summarizes key concepts about Oracle databases including: 1. An Oracle database consists of an Oracle instance containing user processes, server processes, and background processes that manage the database. 2. The physical database structure includes datafiles that store data, redo log files that record changes, and control files that specify the database structure. 3. Logically, databases are divided into tablespaces containing schemas and objects like tables, indexes, and procedures that directly access the data.

Uploaded by

vishwasdeshkar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 13

The Oracle server is an object-relational database management system that provides an

open, comprehensive, and integrated approach to information management. An Oracle


database is a collection of data that is treated as a unit. The general purpose of a database is to
store and retrieve related information. An Oracle server consists of an Oracle database and an
Oracle server instance.

An Oracle Instance
Every time a database is started, a system global area (SGA) is allocated and Oracle
background processes are started. The system global area is an area of memory used for
database information shared by the database users. The combination of the background
processes and memory buffers is called an Oracle instance.

Process Architecture
A process is a mechanism in an operating system that can execute a series of steps. A
process normally has its own private memory area in which it runs.
An Oracle instance has two types of processes: user processes and Oracle processes.

1. User (Client) Processes


A user process is created and maintained to execute the software code of an
application program (such as a Pro*C/C++ program) or an Oracle tool (such as Oracle
Enterprise Manager). The user process also manages the communication with the
server processes.

2. Oracle Process
Oracle processes are called by other processes to perform functions on behalf of the
invoking process. There are two types of Oracle processes, Server processes and
Background processes.

a. Server Processes
Oracle creates server processes to handle requests from connected user
processes. In a dedicated server configuration, a server process handles
requests for a single user process.

b. Background Processes
Oracle creates a set of background processes for each instance. The names of
these processes are DBWn, LGWR, CKPT, SMON, PMON, ARCH, RECO,
Dnnn, LCKn, SNPn, and QMNn.

BACKGROUND PROCESSES

1. Database Writer (DBWn)


The Database Writer writes modified blocks from the database buffer cache to the
datafiles. Although one database writer process (DBW0) is sufficient for most
systems, you can configure additional processes (DBW1 through DBW9) to improve
write performance for a system that modifies data heavily. The initialization
parameter DB_WRITER_PROCESSES specifies the number of DBWn processes.

2. Log Writer (LGWR)


The Log Writer writes redo log entries to disk. Redo log data is generated in the redo
log buffer of the system global area. As transactions commit and the log buffer fills,
LGWR writes redo log entries into an online redo log file.

3. Checkpoint (CKPT)
When DBWn writes all modified database buffers in the system global area to the
datafiles, that event is called as Checkpoint.

4. System Monitor (SMON)


The system monitor performs instance recovery at instance start-up. In a multiple
instance system (one that uses Oracle Parallel Server), SMON of one instance can
also perform instance recovery for other instances that have failed. SMON also cleans
up temporary segments that are no longer in use.

5. Process Monitor (PMON)


The process monitor performs process recovery when a user process fails. PMON is
responsible for cleaning up the cache and freeing resources that the process was using.

6. Archiver (ARCH)
The archiver copies the online redo log files to archival storage when they are full.
ARCH is active only when a database's redo log is used in ARCHIVELOG mode.

7. Recoverer (RECO)
The recoverer is used to resolve distributed transactions that are pending due to a
network or system failure in a distributed database.

An Example of How Oracle Works


The following example illustrates an Oracle configuration where the user and associated
server process are on separate machines (connected via a network).
1. An instance is currently running on the computer that is executing Oracle (often
called the host or database server).
2. A computer running an application (a local machine or client workstation) runs the
application in a user process. The client application attempts to establish a connection
to the server using the proper Net8 driver.
3. The server is running the proper Net8 driver. The server detects the connection
request from the application and creates a (dedicated) server process on behalf of the
user process.
4. The user executes a SQL statement and commits the transaction. For example, the
user changes a name in a row of a table.
5. The server process receives the statement. It checks the shared pool for any shared
SQL area that contains an identical SQL statement. If a shared SQL area is found,
the server process checks the user's access privileges to the requested data. The
previously existing shared SQL area is used to process the statement. If a shared
SQL area is not found, a new shared SQL area is allocated for the statement so that it
can be parsed and processed.
6. The server process retrieves any necessary data values from the actual datafile (table)
or those stored in the system global area.
7. The server process modifies data in the system global area. The DBWn process writes
modified blocks permanently to disk when doing so is efficient. Because the
transaction committed, the LGWR process immediately records the transaction in the
online redo log file.
8. If the transaction is successful, the server process sends a message across the network
to the application. If it is not successful, an appropriate error message is transmitted.
9. Throughout this entire procedure, the other background processes run, watching for
conditions that require intervention. In addition, the database server manages other
users' transactions and prevents contention between transactions that request the same
data.

An Oracle database has both a physical and a logical structure.

PHYSICAL DATABASE STRUCTURE


Each Oracle database is made of three types of files: one or more data files, two or more redo
log files, and one or more control files.

1. Datafiles
Every Oracle database has one or more physical datafiles. A database's
datafiles contain all the database data. The data of logical database
structures such as tables and indexes is physically stored in the datafiles.
The characteristics of datafiles are:
 A data file can be associated with only one database.
 Database files can automatically extend when the database runs out of space.
 One or more datafiles form a logical unit of database storage called a
tablespace.

Modified or new data is not necessarily written to a data file immediately. To reduce
the amount of disk access and increase performance, data is pooled in memory and
written to the appropriate datafiles all at once, as determined by the DBWn
background process of Oracle.

2. Redo Log Files


Every Oracle database has a set of two or more redo log files. The set of redo log
files for a database is collectively known as the database's redo log. The primary
function of the redo log is to record all changes made to data. Redo log files are
critical in protecting a database against failures. To protect against a failure involving
the redo log itself, Oracle allows a multiplexed (multiple) redo log so that two or more
copies of the redo log can be maintained on different disks. The process of applying
the redo log during a recovery operation is called rolling forward.
3. Control Files
Every Oracle database has a control file. A control file contains entries that specify the
physical structure of the database. For example, it contains the following types of
information:
 Database name
 Names and locations of a database's datafiles and redo log files
 Time stamp of database creation
Like the redo log, Oracle allows the control file to be multiplexed for protection of the
control file. Every time an instance of an Oracle database is started, its control
file is used to identify the database and redo log files that must be opened for
database operation to proceed.
LOGICAL DATABASE STRUCTURE
An Oracle database's logical structure is determined by: one or more tablespaces, the
database's schema objects &, Data Blocks, Exents, Segments.

1. Tablespaces
Tablespaces are the logical storage unit. A tablespace is used to group related logical
structures together.

 Each database is logically divided into one or more tablespaces.


 Each tablespace is madeup of one or more datafiles.
 The combined size of datafiles is the total storage capacity of the tablespace.
 The combined storage capacity of tablespaces is the total storage capacity of the
database.

A tablespace can be online (accessible) or offline (not accessible). A tablespace is


normally online so that, users can access the information within the tablespace.
However, sometimes a tablespace may be taken offline to make a portion of the
database unavailable.

2. Schemas and Schema Objects


A schema is a collection of database objects. Schema objects are the logical structures
that directly refer to the database's data. Schema objects include such structures as
tables, views, sequences, stored procedures, synonyms, indexes, clusters, and database
links. (There is no relationship between a tablespace and a schema; objects in the
same schema can be in different tablespaces, and a tablespace can hold objects from
different schemas.)

3. Oracle Data Blocks


At the finest level of granularity, an Oracle database's data is stored in data blocks.
One data block corresponds to a specific number of bytes of physical database space
on disk. A data block size is specified for each Oracle database when the database is
created. A database uses and allocates free database space in Oracle data blocks.

4. Extents
The next level of logical database space is called an extent. An extent is a specific
number of contiguous data blocks, obtained in a single allocation, used to store a
specific type of information.

5. Segments
The level of logical database storage above an extent is called a segment. A segment is
a set of extents allocated for a certain logical structure. For example, the different
types of segments include the following:
TYPES OF SEGMENTS

1. Data Segment
Each non-clustered table has a data segment. All of the table's data is stored in the
extents of its data segment. Each cluster has a data segment. The data of every table
in the cluster is stored in the cluster's data segment.

2. Index Segment
Each index has an index segment that stores all of its data.

3. Rollback Segment
One or more rollback segments are created by the database administrator for a
database to temporarily store "undo" information. This information is used:
 To generate read-consistent database information.
 During database recovery.
 To rollback uncommitted transactions for users.
In general, the rollback segments of a database store the old values of data changed by
ongoing transactions (that is, uncommitted transactions).

4. Temporary Segment
Temporary segments are created by Oracle when a SQL statement needs a temporary
work area to complete execution. When the statement finishes execution, the
temporary segment's extents are returned to the system for future use.

Oracle dynamically allocates space when the existing extents of a segment become full.
Therefore, when the existing extents of a segment are full, Oracle allocates another extent for
that segment as needed. Because extents are allocated as needed, the extents of a segment
may or may not be contiguous on disk

Memory Structure and Processes


Memory Structures
Oracle creates and uses memory structures to complete several jobs. For example, memory
stores program code being executed and data that is shared among users. Memory structures
associated with Oracle are
1. The system global area.
2. The program global area.

SYSTEM GLOBAL AREA (SGA)


The System Global Area (SGA) is a shared memory region that contains data and control
information for one Oracle instance. The information stored within the system global area is
divided into several types of memory structures, including the database buffers, redo log
buffer, and the shared pool. These areas have fixed sizes and are created during instance
startup
1. Database Buffer Cache
Database buffers of the system global area stores the most recently used blocks of
database data; the set of database buffers in an instance is the database buffer cache.
The buffer cache contains modified as well as unmodified blocks.

2. Redo Log Buffer


The redo log buffers of the system global area stores redo entries - a log of changes
made to the database. The redo entries stored in the redo log buffers are written to an
online redo log file, which is used if database recovery is necessary. Its size is static.

3. Shared Pool
The shared pool is a portion of the system global area that contains shared memory
constructs such as shared SQL areas. A shared SQL area is required to process every
unique SQL statement submitted to a database.

PROGRAM GLOBAL AREA (PGA)


The Program Global Area (PGA) is a memory buffer that contains data and control
information for a server process. A PGA is created by Oracle when a server process is started.
The information in a PGA depends on the configuration of Oracle.

Locking Mechanisms
Oracle uses locks to control concurrent access to data & to prevent destructive interaction
between users accessing Oracle data. Locks guarantee data integrity while allowing
maximum concurrent access to the data by unlimited users.

Automatic Locking
Oracle locking is performed automatically and requires no user action. Implicit locking
occurs for SQL statements as necessary, depending on the action requested. There are two
types of locks exclusive locks and share locks.

1. Exclusive locks
Only one exclusive lock can be obtained on a resource (such as a row or a table).

2. Share locks
Many share locks can be obtained on a single resource.

Both exclusive and share locks always allow queries on the locked resource, but prohibit
other activity on the resource (such as updates and deletes).
Distributed Processing and Distributed Databases
Client/Server Architecture: Distributed Processing
Distributed processing uses more than one processor to divide the processing for a set of
related jobs. An Oracle database system can easily take advantage of distributed processing
by using its client/server architecture. In this architecture, the database system is divided into
two parts: a front-end or a client portion and a back-end or a server portion.

Distributed Databases
A distributed database is a network of databases managed by multiple database servers that
appears to a user as a single logical database. Benefits of a distributed database
1. The data of all databases can be simultaneously accessed and modified.
2. Data of physically separate databases can be logically combined and potentially (can
be) made accessible to all users on a network.

Each computer that manages a database in the distributed database is called a node. The
database to which a user is directly connected is called the local database. Any additional
databases accessed by this user are called remote databases.

Location Transparency
Location transparency occurs when the physical location of data is transparent to the
applications and users of a database system. Several Oracle features, such as views,
procedures, and synonyms, can provide location transparency. For example, a view that joins
table data from several databases provides location transparency because the user of the view
does not need to know from where the data originates.

Site Autonomy (Independence)


Site autonomy means that each database participating in a distributed database is
administered separately and independently from the other databases.

Two-Phase Commit
Oracle provides the assurance of data consistency using the transaction model and a two-
phase commit mechanism. Oracle's two-phase commit mechanism guarantees that no matter
what type of system or network failure might occur, a transaction either commits or rolls back
to maintain data consistency across the global distributed database.

Database Security
Multi-user database systems include security features that control how a database is accessed
and used. For example, security mechanisms do the following:
 Prevent unauthorized database access
 Prevent unauthorized access to schema objects
 Control disk usage
 Control system resource usage (such as CPU time)
 Audit user actions
Schema is associated with each database user and has same name as user. A schema is a
logical collection of objects (tables, views, sequences, synonyms, indexes, clusters,
procedures, functions, packages, and database links). By default, each database user creates
and has access to all objects in the corresponding schema.

Database security can be classified into two distinct categories: system security and data
security.

System security
Includes the mechanisms that control the access and use of the database at the system level.
For example, system security includes:
 valid username/password combinations
 the amount of disk space available to the objects of a user
 the resource limits for a user

System security mechanisms check:


 whether a user is authorized to connect to the database
 whether database auditing is active
 which system operations a user can perform

Data security
Includes the mechanisms that control the access and use of the database at the object level.
For example, data security includes
 which users have access to a specific schema object and the specific types of actions
allowed for each user on the object (for example, user SCOTT can issue SELECT and
INSERT statements but not DELETE statements using the EMP table)
 the actions, if any, that are audited for each schema object

Security Mechanisms

The Oracle Server provides discretionary access control, which is a means of restricting access to
information based on privileges. The appropriate privilege must be assigned to a user in order for that
user to access an object. Appropriately privileged users can grant other users privileges at their
discretion; for this reason, this type of security is called "discretionary".

Oracle manages database security using several different facilities:


 database users and schemas
 privileges
 roles
 storage settings and quotas
 resource limits
 auditing

Database Users and Schemas


Each Oracle database has a list of usernames. Each username has an associated password to
prevent unauthorized use.
Security Domain
Each user has a security domain - a set of properties that determine such things as the:
 actions (privileges and roles) available to the user
 tablespace quotas (available disk space) for the user
 system resource limits (for example, CPU processing time) for the user

Privileges
A privilege is a right to execute a particular type of SQL statement. Some examples of
privileges include the
 right to connect to the database (create a session)
 right to create a table in your schema
 right to select rows from someone else's table
 right to execute someone else's stored procedure
The privileges of an Oracle database can be divided into two distinct categories: system
privileges and schema object privileges.

System Privileges
System privileges allow users to perform a particular systemwide action or a particular action
on a particular type of schema object. For example, the privileges to create a tablespace or to
delete the rows of any table in the database are system privileges. Many system privileges are
available only to administrators and application developers because the privileges are very
powerful.

Schema Object Privileges


Schema object privileges allow users to perform a particular action on a specific schema
object. For example, the privilege to delete rows of a specific table is an object privilege.
Object privileges are granted (assigned) to end-users so that they can use a database
application to accomplish specific tasks.

Roles
Roles are named groups of related privileges that are granted to users or other roles.

Trusted Oracle
Trusted Oracle is Oracle Corporation's multilevel secure database management system product.
Trusted Oracle enforces mandatory access control (MAC). Mandatory access control is a means of
restricting access to information based on labels.

Types of Failures
Several circumstances can halt the operation of an Oracle database. The most common types of failure
are described below

User error :

Statement and process failure : Statement failure occurs when there is a logical failure in the handling
of a statement in an Oracle program (for example, the statement is not a valid SQL construction).
When statement failure occurs, the effects (if any) of the statement are automatically undone by
Oracle and control is returned to the user.

Instance failure : Instance failure occurs when a problem arises that prevents an instance (system
global area and background processes) from continuing work. Instance failure may result from a
hardware problem such as a power outage, or a software problem such as an operating system crash.
When an instance failure occurs, the data in the buffers of the system global area is not written to the
datafiles. Instance failure requires instance recovery. Instance recovery is automatically performed by
Oracle when the instance is restarted.

Media (disk) failure : This is called disk failure because there is a physical problem reading or writing
physical files on disk

Data Dictionary

One of the most important parts of an Oracle database is its data dictionary,
which is a read-only set of tables that provides information about its associated
database. A data dictionary contains:
1. The definitions of all schema objects in the database (tables, views, indexes,
clusters, synonyms, sequences, procedures, functions, packages, triggers,
and so on)
2. How much space has been allocated for, and is currently used by, the
schema objects
3. Default values for columns
4. Integrity constraint information
5. The names of Oracle users
6. Privileges and roles each user has been granted
7. Auditing information, such as who has accessed or updated various schema
objects
8. Other general database information. The data dictionary is structured in
tables and views, just like other database data. All the data dictionary
tables and views for a given database are stored in that database's
SYSTEM tablespace.

The user SYS is the Owner of the Data Dictionary. SYS owns all base tables and
user-accessible views of the data dictionary. The security administrator should
keep strict control of this central account.

The data dictionary has three primary uses:

Oracle accesses the data dictionary to find information about users, schema
objects, and storage structures.

Oracle modifies the data dictionary every time that a data definition language (DDL)
statement is issued.

Any Oracle user can use the data dictionary as a read-only reference for information about
the database.

Oracle creates public synonyms on many data dictionary views so that users can
access them conveniently. (The security administrator can also create
additional public synonyms). Users should avoid naming their own schema
objects with the same names as those used for public synonyms.

Much of the data dictionary information is cached in the SGA (the dictionary
cache), because Oracle constantly accesses the data dictionary.

You can add new tables or views to the data dictionary. If you add new data
dictionary objects, the owner of the new objects should be the user SYSTEM or a
third Oracle user.

The Dynamic Performance Tables


------------------------------

Throughout its operation, Oracle maintains a set of "virtual" tables that record current
database activity. These tables are called dynamic performance tables.

Dynamic performance tables are not true tables, and they should not be accessed
by most users. However, database administrators can query and create views on
the tables and grant access to those views to other users. These views are
sometimes called fixed views because they cannot be altered or removed by the
database administrator.

SYS owns the dynamic performance tables; their names all begin with V_$.
Views are created on these tables, and then public synonyms are created for the
views. The synonym names begin with V$.

Partitioning
Oracle only supports partitioning for tables and indexes; it does not support partitioning of clustered
tables and their indexes, nor of snapshots.

Partition Pruning (TRIMMING, REDUCING)


Pruning means eliminating.

For each SQL statement, depending on the selection criteria specified, unneeded partitions can be
eliminated. Such intelligent pruning can dramatically reduce the data volume, resulting in substantial
improvements in query performance.

Partition pruning can eliminate index partitions even when the underlying table's partitions cannot be
eliminated, if the index and table are partitioned on different columns. You can often improve the
performance of operations on large tables by creating partitioned indexes which reduce the amount of
data that your SQL statements need to access or modify.
The ability to prune unneeded partitions from SQL statements increases performance.

Datatype Restrictions
For partitioned tables, the logical attributes have additional restrictions. Partitioned tables cannot have
any columns with LONG or LONG RAW datatypes, LOB datatypes (BLOB, CLOB, NCLOB, or
BFILE), or object types.
If a table (or index) is partitioned on a column that has the DATE datatype, its partition descriptions
should use the TO_DATE format mask; otherwise partition pruning is not possible.
Bitmap Restrictions
You can create bitmap indexes on partitioned tables.

You might also like