0% found this document useful (0 votes)
27 views20 pages

Database Administration and Management Lecture 3

Uploaded by

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

Database Administration and Management Lecture 3

Uploaded by

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

Database

Administration and
Management
Overview of DBA Tools and Interfaces
Server, Instance, SGA
Lecture # 3
Introduction to DBA Tools
What are DBA Tools?
Tools used to manage, monitor, and optimize databases.
Role: Supporting DBAs in database administration tasks such as
backups, monitoring, and performance tuning.

Why Are They Important?


Simplify complex operations.
Ensure database security and uptime.
Enable proactive problem detection.
Common DBA Tools
Examples of DBA Tools:
1. SQL*Plus:
A command-line tool for executing SQL and PL/SQL commands.
Use case: Script automation and direct database interaction.
2. Oracle SQL Developer:
A GUI for writing, testing, and tuning SQL queries.
Integrated with reporting and debugging features.
3. Oracle Enterprise Manager (OEM):
A web-based GUI for managing Oracle databases.
Features: Performance monitoring, backup automation, and security
management.
Centralized control for multiple databases.
DBA Interfaces
Command-Line Interfaces (CLI):
Examples: SQL*Plus, RMAN (Recovery Manager).
SQL*Plus: Used for executing SQL queries, PL/SQL scripts, and
performing administrative tasks.
RMAN (Recovery Manager): Specialized for backup, recovery, and
database maintenance.
Pros: Precise, scriptable, and lightweight.
Graphical User Interfaces (GUI):
Example: Oracle Enterprise Manager.
Pros: User-friendly and visual insights.
RESTful Interfaces and APIs:
RESTful APIs and interfaces allow applications to interact with the
database programmatically using HTTP methods.
These are especially useful in modern cloud and DevOps environments.
Roles of a DBA Using Tools
Core Responsibilities:
Performance Monitoring: Identifying bottlenecks and tuning queries.
Backup and Recovery: Automating regular backups and disaster
recovery plans.
Security Management: Setting user roles, permissions, and auditing.
Data Migration: Moving data between databases or systems.

How Tools Support These Roles:


Automated alerts for anomalies.
Visual dashboards for monitoring.
Oracle DBMS Architecture Overview
What is Oracle DBMS Architecture?
Oracle Database is a combination of physical files, memory structures,
and processes working together to store and retrieve data efficiently.
Architecture is designed for scalability, reliability, and performance.
Main Components of Oracle DBMS:
Database:
Physical files on disk that store data.
Includes data files, control files, redo log files, and archived log files.
Instance:
A combination of memory structures and background processes that
work together to manage database transactions and interactions.
Server:
The physical or virtual environment hosting the Oracle software and
database instance.
Oracle Server
A server is the physical or virtual system that provides the computational
resources (CPU, memory, and storage) needed to run the Oracle database
software.

Key Functions of the Oracle Server:


1. Hosting the Instance and Database: Runs the database instance
processes and manages physical database files.
2. Managing User Connections: Facilitates user requests and connections
through network protocols.
3. Ensuring Resource Allocation: Allocates memory, processing, and
storage resources effectively.
4. Security and Access Management: Enforces user authentication and
permissions.

Server Configurations:
Single-Instance Database: A basic configuration where a single Oracle
database is managed by one instance on a single server.
RAC (Real Application Clusters): Multiple instances on different servers
Oracle Instance
What is an Instance?
An instance is the set of memory structures and background
processes that Oracle uses to interact with the database.
An instance must be started to access a database.
Core Components of an Instance:
Memory Structures:
System Global Area (SGA): Shared memory used by all
sessions.
Program Global Area (PGA): Private memory for each user
session.
Background Processes:
Processes that perform maintenance, data writing, and recovery
tasks in the background.
Memory Structures of an Instance

SGA (System Global Area)


The SGA is a shared memory area allocated when an Oracle instance
starts.
It is used to store data and control information required by the
database.
Purpose of the SGA:
Facilitates efficient data access by reducing disk I/O operations.
Enhances performance by sharing data across all users connected to
the instance.
Importance:
Essential for query parsing, execution, and result caching.
Plays a key role in Oracle's ability to handle concurrent user sessions
efficiently.
Key Components of the SGA
1. Shared Pool:
Stores parsed SQL statements, PL/SQL code, and execution plans.
Reduces parsing overhead for repetitive queries.
Sub-divisions:
Library Cache: Holds parsed SQL statements and execution plans.
Data Dictionary Cache: Contains metadata about database objects
(tables, indexes).
2. Database Buffer Cache:
Temporarily stores copies of data blocks read from data files.
Speeds up read/write operations by caching frequently accessed data.
Works with LRU (Least Recently Used) algorithms for efficient memory
usage.
3. Redo Log Buffer:
Temporarily stores changes made to the database (DML/DDL operations).
Ensures recoverability by writing to redo log files on disk.
4. Large Pool:
Optional memory pool for large memory operations like:
Backup and restore operations (RMAN).
I/O server processes in shared server mode.
5. Java Pool:
Stores session-specific Java code and data for Java-based applications.
Database Buffer Cache in Depth
Role of the Buffer Cache:
Stores frequently accessed data blocks for faster retrieval.
Improves performance by reducing physical disk reads.
Key Features:
Organized into buffers of consistent size.
Utilizes LRU (Least Recently Used) algorithm to manage memory.
Write Operations:
Changes to data blocks are initially made in the buffer cache.
Modified blocks are marked as dirty and written to disk by the DBWn
process.
Example:
A user requests data from a table.
If the data block is in the buffer cache, it’s served immediately.
Otherwise, Oracle reads the block from disk and stores it in the
buffer cache for subsequent requests.
Redo Log Buffer in Detail
Purpose of the Redo Log Buffer:
Captures all changes made to the database for recovery purposes.
Ensures durability of transactions (ACID property).
How It Works:
User modifies data (INSERT/UPDATE/DELETE).
The changes are recorded in the Redo Log Buffer.
The LGWR (Log Writer) process writes the changes to the redo log
files periodically or during specific triggers (e.g., commit).
Size Configuration:
Adequately sizing the redo log buffer is crucial for maintaining
performance.
Importance for Recovery:
During a crash, redo log files are used to replay changes and restore
consistency.
Large Pool, Java Pool, and Streams Pool
1. Large Pool:
Used for memory-intensive tasks to avoid contention in the Shared
Pool.
Examples:
Parallel execution queries.
RMAN (Recovery Manager) operations.
2. Java Pool:
Required for Java-based applications running within the Oracle
database.
Stores parsed Java code and execution data.
3. Streams Pool:
Supports Oracle Streams for capturing and propagating database
changes.
Required for advanced replication setups.
Configuration Notes:
These pools are optional and should be sized based on application
Managing and Tuning the SGA
Dynamic SGA Management:
Oracle allows resizing of SGA components dynamically without
restarting the database.
Automatic Shared Memory Management (ASMM):
Oracle adjusts memory allocation to SGA components automatically.
Reduces manual tuning efforts.
Performance Considerations:
Ensure adequate memory allocation for frequently used components
like the Shared Pool and Buffer Cache.
Monitor memory contention using tools like AWR (Automatic
Workload Repository) reports.
Avoid over-allocating memory to avoid OS paging and swapping.
Memory Structures of an Instance
Program Global Area (PGA):

1. Sort Area
The Sort Area is a temporary memory space within the PGA that is used to
perform sorting operations required during query execution.
Purpose:
Supports SQL operations such as ORDER BY and GROUP BY that need
data to be sorted in a specific order.
Handles intermediate sorting tasks for complex queries, like those
involving analytical functions or set operations (e.g., UNION,
INTERSECT).
2. Session Information
A dedicated part of the PGA that stores information related to an
individual user session.

Purpose:
Tracks the session state, including variables, login credentials, and
other contextual information unique to the user.
Stores data for session-specific tasks, such as tracking user
transactions or temporary variable values.
3. Hash Area
The Hash Area is a memory region within the PGA used for hash join
operations in SQL queries. A hash join is a method of joining two tables
based on hashing techniques.

Purpose:
Allocated for joining large data sets efficiently, especially when
traditional nested-loop joins would be slow.
Reduces the need to repeatedly access disk by using in-memory hash
structures.
Background Processes of an Instance
Processes that handle routine database tasks automatically.

Key Background Processes:

DBWn (Database Writer): Writes modified data from the buffer cache
to data files on disk.
LGWR (Log Writer): Writes redo log entries from the redo log buffer to
the redo log files.
CKPT (Checkpoint): Signals the database writer to write data to disk
and updates control files.
SMON (System Monitor): Handles instance recovery and cleanups.
Recovers the database after an instance crash by applying
changes in redo logs.
PMON (Process Monitor): Manages failed processes and releases their
resources.
Prevents resource leakage and ensures smooth database
operation.
Additional Background Processes in RAC:

LMS (Lock Manager Services):


In an Oracle RAC environment, each instance has its own buffer cache
(local memory where data blocks are stored). The LMS process
manages cache fusion, which allows instances to synchronize and share
data blocks between their buffer caches efficiently and prevents
conflicts (such as two instances trying to modify the same block of data
at the same time).

LMD (Lock Manager Daemon):


The LMD process is responsible for handling global enqueue services in a RAC
environment. An enqueue is a mechanism for controlling access to shared
resources in the database, such as locks on tables or rows.
Instance and Database Interaction
How an Instance Interacts with a Database:
User Connection:
A user sends a request to the database via the instance.
Query Parsing and Execution:
SQL statements are parsed in the shared pool.
Data is fetched from the buffer cache or disk.
Transaction Management:
Changes are logged in the redo log buffer and applied to the
database files.
Data Consistency and Integrity:
Background processes ensure consistency during crashes or
recovery.

You might also like