100% found this document useful (1 vote)
95 views

Oracle Database Administrator Notes

Uploaded by

abraraw
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
95 views

Oracle Database Administrator Notes

Uploaded by

abraraw
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Oracle Database Administrator Notes

Section 1. Oracle Database Architecture


1.1 Oracle Instance
An Oracle Database consists of a database and at least one instance. An instance, or
database instance, is the combination of memory and processes that are a part of a running
installation and a database is a set of files that store data. The following picture illustrates
the Oracle Database server architecture.

An Oracle instance must be started without having it access any database files to read and
write information to the database. An instance can access only one database at a time.
When you start an instance, the next step is to mount that instance to a database. An
instance can mount only one database at a single point in time. Multiple database instances
can access the same database. In a clustering environment, many instances on several
servers can access a central database to enable high availability and scalability.

1.2 Database Storage Structures


An essential task of a relational database is data storage. This section briefly describes the
physical and logical storage structures used by Oracle Database.
Physical Storage Structures
The physical storage structures are simply files that store data. When you execute a
CREATE DATABASE statement to create a new database, Oracle creates the following files:
1. Datafiles: 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. Note: If you lose Datafiles,
you lose your database. The extension for datafiles is .dbf
2. 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. Note: If you lose Control Files,
you lose your database. The extension for Control files is .ctl
3. 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
4. Database Backup files: Any backups of your database that you have taken to be
stored in any location to recover the database when the database is crashed. Note:
The backup must include the data files, control files, and redo log files to recover
because these are the important database files.
5. Archived Redo log files: 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 database.
6. Parameter files: This file defines how the database instance is configured when it
starts up. All the configurations of the database are present in the parameter file.
There are two parameter files.
a. Pfile: is a parameter file. You can edit again.
b. Spfile: is a binary file, you cannot edit it directly; it should be done by using
oracle commands.
Note: If you lose the spfile no issue, you can recreate it again. But it is better to take
a backup of the spfile in order to restore all the configurations of the database.
7. Password files: It stores passwords for users with administrative privileges (sys
user) in order to connect remotely. Sys user has all the privileges to the database.
Note: DBA password cannot be stored in the database, because Oracle cannot access
the database before the instance is started, therefore, the authentication of the DBA
must happen outside of the database. The password file will be present in
$ORACLE_HOME \database\ PWD [database_Name]. ora
8. Alert log files: is an Oracle Database in sequential order write out a chronological
log of messages and errors. Therefore, this is your go-to file in case you are trying to
troubleshoot a problem with your database. This log file has all the records what are
all the changes to files and other errors also. For example, you can see when the
database was started and stopped.
9. Trace files: Each server and background process writes to a trace file. When a
process detects an internal error, it writes information about the error to its trace
file.
Logical Storage Structures
Oracle Database uses a logical storage structure for fine-grained control of disk space
usage. The following are logical storage structures in an Oracle Database:
1. Data blocks: a data block corresponds to a number of bytes on the disk. Oracle
stores data in data blocks. Data blocks are also referred to as logical blocks, Oracle
blocks, or pages.
2. Extents: An extent is a specific number of logically contiguous data blocks used to
store a particular type of information.
3. Segments: a segment is a set of extents allocated for storing database objects, e.g., a
table or an index.
4. Tablespaces: a database is divided into logical storage units called tablespaces. A
tablespace is a logical container for a segment. Each tablespace consists of at least
one data file.
Note: In the logical structure, the relation between tablespace and datafile is many to one.
A tablespace is a container of segments. Segments contain objects like tables or indexes.
The relation between tablespaces and databases is many to one. We could have many
tablespaces belonging to one database. In addition, the next figure shows the relationship
between logical and physical storage structures:
 One Tablespace may has different
physical data file.
 One oracle data block has different
OS block
 One physical data file has different
OS block.
 One Tablespace has different
Segments
 One Segment has different Extents
 One Extent has different oracle
data block
 One physical data File has different
Extents.

A Database Instance is an interface between client applications (users) and the database.
An Oracle instance consists of three main parts: System Global Area (SGA), Program Global
Area (PGA), and background processes.
-------
1.2 Processes
While memory structures contain information, processes control what happens within the
data server. Put another way, processes determine the series of steps that are applied to
the data. Oracle Database processes can be organized into four primary categories:
Client processes — allow client applications to connect to the server and run its code.
Server processes — bridge the client and the database. In dedicated server mode, a server
caters only to one client. In shared server mode, a server can cater to multiple clients
simultaneously.
Background processes — handle administration activities such as I/O. Examples include
process monitor (PMON), system monitor (SMON), and log writer (LGWR).
Slave processes — assist the other processes to achieve their objectives.

1.3 Memory structures


Oracle Database stores in memory information that includes program code, sessions,
locking details, and program execution requirements, along with data. Oracle organizes this
information into four distinct areas:
System global area (SGA): Every Oracle database instance has one SGA. The data inside
SGA is shared across multiple processes and sessions. Examples of data stored here include
cached data and shared SQL.
Program global area (PGA): PGA contains data and control information, exclusive to each
process. A process such as database log writer has details specific to its logs in its PGA.
User global area (UGA): UGA is memory allocated exclusively for a session. As a user
session ends, its UGA is deleted. When you connect to a database instance and execute SQL
commands and transactions, these happen inside your UGA. In dedicated server mode, UGA
is stored inside PGA, whereas in a shared server mode, UGA is stored inside SGA.
Code areas: These are memory areas used to store and run code.

Section 2. Database Administrative Tasks

Section 3. Managing Tablespaces

Section 4. Users & Privileges

Section 5. Roles

Section 6. User Profiles

Section 7. Data Migration

Section 8. Database Links

Section 9. Useful Tips

You might also like