0% found this document useful (0 votes)
9 views8 pages

Database Unit-V Notes

The document provides an overview of Oracle Database architecture, detailing its memory structure, database system, and processes. It explains the components of Oracle instances, including the System Global Area (SGA) and various background processes, as well as the types of files in the database system. Additionally, it discusses backup and recovery strategies, including online and offline backups, and the importance of Oracle Recovery Manager (RMAN) for efficient database management.

Uploaded by

318Giri Prasad C
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views8 pages

Database Unit-V Notes

The document provides an overview of Oracle Database architecture, detailing its memory structure, database system, and processes. It explains the components of Oracle instances, including the System Global Area (SGA) and various background processes, as well as the types of files in the database system. Additionally, it discusses backup and recovery strategies, including online and offline backups, and the importance of Oracle Recovery Manager (RMAN) for efficient database management.

Uploaded by

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

Unit-V

Oracle Architecture

Oracle Database is one of the most popular RDBMSs on the market and is used to store and retrieve
data for a wide range of applications. Oracle Database is well-known for its dependability,
scalability, and performance, and it is compatible with a wide range of programming languages
and development frameworks.

The oracle database architecture consists of

 Memory structure(Instances)
 Database system
 Processes

Oracle Instances

The instance is a collection of two things:


1. SGA: It stands for System Global Area. It is a shared memory area. Whenever a database
instance starts, some memory gets allocated and that memory is termed SGA. Along with memory
allocation, one or more background processes will. SGA is used to store data as well as control
information about one database instance through its various subcomponents, Where each
component is dedicated to a specific purpose. Various Components are:
 Database buffer cache: The Buffer Cache is a portion of the SGA that stores copies of data blocks
read from datafiles. It is used to cache frequently accessed data blocks, reducing the number of
disks I/Os required to access the data. This can improve performance by reducing disk I/O time
and increasing the speed of data retrieval.
 Redo log Buffer: The most crucial structure for recovery operations is the redo log, which consists
of two or more preallocated files that store all changes made to the database as they occur. Every
instance of an Oracle Database has an associated redo log to protect the database in case of an
instance failure.
 Java pool: The Java Pool is an optional portion of the SGA that is used by Java Virtual Machine
(JVM) and related components. It is used to store Java-related data structures, such as Java classes
and objects. This pool is used when the Oracle Database is configured to run Java applications or
when using Oracle JVM.
 Large Pool: The Large Pool is an optional portion of the SGA that can be used for large memory
allocation, such as backup and restore operations and I/O server processes. It is typically used to
improve the performance of these operations by reducing the amount of disk I/O required.
 Shared pool: The Shared Pool is a portion of the SGA that contains shared memory structures,
such as shared SQL and PL/SQL areas. It is used to store the parsed representation of SQL
statements, execution plans, and PL/SQL program units. This allows for the efficient reuse of
frequently executed statements, reducing the need for reparsing and improving performance.

2. Background processes: Oracle has a collection of processes that are called background
processes. These processes are responsible for managing memory, performing I/O operations, and
other maintenance activities. Following are some important background processes that are
required:
 System Monitor Process (SMON): These processes are responsible for performing system-level
recovery and maintenance activities.
 Process Monitor Process (PMON): The task of these processes is to monitor other background
processes.
 Database Writer Process (DBWR): This process performs the task of writing data blocks from
the Database Buffer Cache (present in SGA) to physical data files(Present in the Database system).
 Log Writer Process (LGWR): This process writes the Redo blocks from Redo Log Buffer
(present in SGA) to Redo Log Files(present in the Database system).
 CheckPoint (CKPT): This process maintains data files and control files with the most recent
checkpoint information.
Database System

The database system is suited to the storage system of a computer. The Database system is simply
the storage of files. There are three categories of files that are situated in the database system and
those are:-
 Data files: These files hold the actual data in the database.
 Redo log files: These files are used to hold the changes made in the database. Redo log files can
be utilized during the database recovery process to retrieve the original information.
 Control files: It is a binary file that holds database status-related information like Database Name,
Data File, and Redo Log file Names, File Locations, and Log Sequence Number.
There are other categories of files that contribute to database management.
 Parameter file: This file contains the parameters which define the way the database is expected
to start up.
 Password file: This file holds the user passwords and thus maintains the security of databases.
Processes
There are two types of processes:
 User process: It is also known as the client process The user actually connects to the instance
with the help of user processes.
the user process is stabilized when the user sends a connection request to the oracle server.
 Server process: The server Process connects the user to the database and performs the activities
on the client’s behalf as executing SQL statements or retrieving data from the database.

Components for Backup and Recovery


A backup policy should include what data is to be protected, where to store the backup, how often
the backup should run, and how long to retain the backup copy.

The focus in Oracle Database backup and recovery is on the physical backup of database files, which
permits you to reconstruct your database. The files protected by the backup and recovery facilities
built into Oracle Enterprise Manager Database Control (Database Control) include data files, control
files, server parameter files, and archived redo log files. With these files you can reconstruct your
database.

The backup mechanisms work at the physical level to protect against file damage, such as the
accidental deletion of a data file or the failure of a disk drive.

Oracle Recovery Manager (RMAN), a command-line and Enterprise Manager-based tool, is the
method preferred by Oracle for efficiently backing up and recovering your Oracle database. RMAN
is designed to work intimately with the server, providing block-level corruption detection during
backup and restore. RMAN optimizes performance and space consumption during backup with file
multiplexing and backup set compression, and integrates with leading tape and storage media
products.
Logical backups, such as exporting database objects such as tables or table spaces, are a useful
supplement to physical backups, but cannot protect your whole database. An effective backup
strategy must be based on physical backups.
The Oracle Database flashback features provide a range of physical and logical data recovery tools
as efficient, easy-to-use alternatives to physical and logical backups. The flashback features enable
you to reverse the effects of unwanted database changes without restoring data files from backup or
performing media recovery.

 Consistent and Inconsistent Backups

 Media Recovery

 Fast Recovery Area

 RMAN Repository

Types of failures

Failure in terms of a database can be defined as its inability to execute the specified
transaction or loss of data from the database. A DBMS is vulnerable to several
kinds of failures and each of these failures needs to be managed differently. There
are many reasons that can cause database failures such as network failure, system
crash, natural disasters, carelessness, sabotage(corrupting the data intentionally),
software errors, etc.
Online Vs Offline backups

An online or hot backup is a backup performed while the database is online and available for
read/write operations. Except for Oracle exports, you can only perform online backups when running
in ARCHIVELOG mode. An offline or cold backup is a backup performed while the database is
offline and unavailable to its users.

Oracle Offline/Cold Database Backups

A backup performed when the database is shut down is known as an offline or cold backup. You
must copy the data files, control file and online redo log files using an OS copy utility. This is a
considered a complete backup of the database. Any changes made after this backup are
unrecoverable if the database is running in NOARCHIVELOG mode. All transactions are recorded
in online redo log files whether the database is archiving or not. When redo logs are archived
(ARCHIVELOG mode), Oracle allows you to apply these transactions after restoring files that were
damaged (assuming that an active redo log file was not among the files damaged).
Whenever the schema of the database is changed, such as when you add a new data file, rename a
file, or create or drop a tablespace is created, you must shut down the database and copy at least the
control file and the newly added data file. A complete backup of the database is preferred.
Before performing a cold backup, it is essential to get a list of all the Oracle files that need to be
backed up. Running the following queries will provide a list of all the files.

select name from sys.v_$datafile;


select member from sys.v_$logfile;
select name from sys.v_$controlfile;

Shut down the database from SQL*Plus or Server Manager. Back up all the files to secondary storage
(for example, tapes). Ensure that you back up all data files, all control files, and all log files. When
completed, restart your database.
Oracle Online/Hot Database Backups
A backup performed when the database instance is running is known as online or hot backup. Online
backups are very important at customer sites where a database instance must operate 24-hours per
day and offline backups are not feasible. During the duration of an online backup, the database
remains available for both reading and updating. For this kind of backup, the database must be in
ARCHIVELOG mode. Only data files and current control file need to be backed up. Unlike offline
backups, the unit of a online backup is a tablespace, and any or all tablespaces can be backed up
whenever needed. Different data files can be backed up at different times.
To perform an online backup, you switch the tablespace into “backup mode” before copying the files
as shown in the following example.

ALTER TABLESPACE xyz BEGIN BACKUP;


! cp xyfFile1 /backupDir/
ALTER TABLESPACE xyz END BACKUP;

It is better to backup individual tablespaces than to put all tablespaces in backup mode at the same
time. Backing them up separately incurs less overhead. After completing the tablespace backups, it
is important to back up the control files as shown in the following example.

ALTER SYSTEM SWITCH LOGFILE; -- Force log switch to update control file headers
ALTER DATABASE BACKUP CONTROLFILE TO '/<directory name>/control.dbf';

The frequency of online backups is inversely proportional to the time taken for recovery in case of
a media failure. The older your backup, the more redo log files need to be applied, and the recovery
times increases. Backup strategies should be tested before being used to protect a production
database.
We strongly recommend that you run online backups at times when the database is least accessed,
during non-peak hours. Oracle writes complete database blocks instead of the normal deltas to redo
log files while in backup mode. This leads to excessive database archiving and even database freezes
Ref: https://www.microfocus.com/documentation/borland-connect/3.1/install-help/STARTEAM-
DC9FDDDA-ORACLEBACKUPS-CON.html

You might also like