Database Administrator 3
Database Administrator 3
Database Administrator 3
Oracle server:
There are several files, processes, and memory structures
in an Oracle server
Not all of them are used when processing a SQL
statement
Some are used to improve the performance of the
database, ensure that the database can be recovered in
the event of a software or hardware error, or perform other
tasks necessary to maintain the database.
The Oracle server consists of an Oracle instance and an
Oracle database
Oracle Server
An Oracle server:
Is a database management system that provides an open,
comprehensive, integrated approach to information
management
Consists of an Oracle instance and an Oracle database
The Oracle server can run on a number of different
computers in one of the following ways
Client-Application Server-Server
Server-to-Server (S2S) is a method of sharing data about app or
web activity from one server to another
Client-Server
dividing tasks between servers and clients
Host-Based
A system controlled by a central or main computer. A host-based
system may refer to a hierarchical communications system
controlled by a central computer
Overview of Primary Components
Oracle instance:
An Oracle instance is the combination of the background
processes and memory structures.
The instance must be started to access the data in the
database.
Every time an instance is started, a System Global Area
(SGA) is allocated and Oracle background processes are
started.
Background processes perform functions on behalf of the
invoking process.
Oracle instance
1.Every Running Oracle Database must be associated with at
least one database instance.
2.Now, one more important point is that an instance exists in
memory and a database exists on disk, so an instance can
exist without a database and a database can exist without an
instance.
3.Losing an instance is no issue, but losing data files for
example losing the database. That means if you lose some
data file, it means you are losing the database. If you lose
the instance, no issue, you can create the instance again.
Microsoft word example
We can understand the database and instance using a very
simple example. Actually, the difference between Database
and Database Instance like Microsoft word and Microsoft
document. For example, Microsoft Word imagines as the
Database Instance and so it is the program. And imagine
Microsoft Document is the Database. So, we use Microsoft
Word to read the data inside the document.
Oracle Instance
An Oracle instance:
Is a means to access an Oracle database
Always opens one and only one database
Consists of memory and process structures
Physical Structure
The physical structure of an
Oracle database is
determined by the operating
system files that provide the
actual physical storage for
database information
Control files
Data files
Redo log files
Memory Structure
Oracle’s memory structure consists of two memory
areas known as
System Global Area (SGA): Allocated at instance startup,
and is a fundamental component of an Oracle Instance
Program Global Area (PGA): Allocated when the server
process is started
Memory Structure
Oracle’s memory structure consists of two memory
areas known as
System Global Area (SGA): Allocated at instance startup,
and is a fundamental component of an Oracle Instance
Program Global Area (PGA): Allocated when the server
process is started
Process Structure
An Oracle process is a program that depending on its
type can request information, execute a series of steps,
or perform a specific task.
Oracle takes advantage of various types of processes:
User process
Server process
Background process
User Process
A user process is a program that requests interaction
with the Oracle server.
It must first establish a connection.
It does not interact directly with the Oracle server
Server Process
whenever the user connects to the database and tries
to run any SQL statements, oracle creates the server
process. This is the main purpose of the server process.
It means reading database data from the database storage
and loading that data into the Oracle instance buffer
cache
A server process is a program that directly interacts with the
Oracle server.
It fulfills calls generated and returns results.
Can be dedicated or shared server
Server process communicates with the Oracle server
using the Oracle Program Interface
Program Global Area (PGA)
Each server process has its own cache dedicated for each
connecting client. This cache is also known as the PGA.
Storing the data is faster from the redo log buffer to the
database compared to the database buffer cache database a
Oracle database
An Oracle database consists of operating system
files
Also known as database files, that provide the
actual physical storage for database information.
The database files are used to ensure that the
data is kept consistent and can be recovered in
the event of a failure of the instance
Oracle Database
An Oracle database:
Is a collection of data that is treated as a unit
Consists of three file types
Oracle Database
The general purpose of a database is to store and retrieve
related information.
An Oracle database has a logical and a physical structure.
The physical structure of the database is the set of operating
system files in the database.
Oracle Database
Data files
Data Files contain the actual user data, application data, and
metadata. i.e Tables, Rows, indexes procedures, views, etc.
The combination of datafiles is represented as tablespaces.
The data is stored using Database writer
If you lose Datafiles, you lose your database. The extension
for datafiles is .dbf
Redo logs
Redo Log Files stores changes to the database as they
occur and are used for data recovery. The redo log files store
the changes made to the database like DML and DCL
operations. Log writer is used to writing the changes to redo
log files.
Note: If you lose Redo log files, you lose your database. The
extension for the redo log file is .log
Other Key File Structures
Control files
Control files stores metadata about the data files and online redo log files
like names, locations, timestamp, and status. This information is required
by the database instance to start and open the database. The extension for
Control files is .ctl
This is explained as a group of redo log files. All the redo log files
are archived and stored in some other location for backup and
recovery purposes. Contains ongoing history of the data
changes. Using the backup file and archived redo log files you
can recover your Oracle databaserecover from media failures
Alert Log File: