Process Architecture: Open, Comprehensive, and Integrated Approach To Information Management. An Oracle
Process Architecture: Open, Comprehensive, and Integrated Approach To Information Management. An Oracle
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.
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
3. Checkpoint (CKPT)
When DBWn writes all modified database buffers in the system global area to the
datafiles, that event is called as Checkpoint.
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.
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.
1. Tablespaces
Tablespaces are the logical storage unit. A tablespace is used to group related logical
structures together.
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
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.
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.
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
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".
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.
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.
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.
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.
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.