0% found this document useful (0 votes)
13 views6 pages

Oracle DBA Basic

Uploaded by

T A
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)
13 views6 pages

Oracle DBA Basic

Uploaded by

T A
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

Oracle Database Administration (DBA) Concepts

Introduction

Oracle Database Administration (DBA) involves managing and maintaining Oracle databases to
ensure their availability, performance, and security. This document explains fundamental Oracle
DBA concepts including databases, tablespaces, listener, SGA, PGA, and other critical
components.

1. What is an Oracle Database?

An Oracle Database is a collection of data that is treated as a unit. The purpose of a database is to
store and retrieve related information. Oracle databases are known for their high performance,
scalability, and security features.

Key points about Oracle Database: - Stores structured data in relational format. - Supports SQL and
PL/SQL for data manipulation. - Provides transaction management and concurrency control. -
Ensures high availability and disaster recovery options.

2. Tablespaces

Tablespaces are logical storage units within an Oracle Database. They group related logical
structures together and help in efficient database management.

Important types of tablespaces: - SYSTEM tablespace: Stores data dictionary and critical system
objects. - SYSAUX tablespace: Auxiliary tablespace for system-related components. - UNDO
tablespace: Stores undo information for transaction rollback. - TEMP tablespace: Used for
temporary operations like sorting. - USER tablespaces: Used for storing user data and applications.

3. Oracle Net Listener

The Oracle Net Listener is a separate process that runs on the database server and manages
incoming client connection requests. It listens for requests and forwards them to the database.

Key details: - Default listener: LISTENER - Configuration file: [Link] - Supports multiple
databases and services. - Can be monitored with lsnrctl utility.

4. System Global Area (SGA)

The System Global Area (SGA) is a shared memory region that contains data and control
information for one Oracle Database instance. It is allocated at instance startup.

Main components of SGA: - Database Buffer Cache: Stores copies of data blocks. - Shared Pool:
Stores parsed SQL statements and PL/SQL code. - Redo Log Buffer: Holds redo entries before
writing to redo logs. - Large Pool & Java Pool: For special memory allocations.
5. Program Global Area (PGA)

The Program Global Area (PGA) is a memory region used by a single Oracle process. Unlike SGA,
it is not shared across processes.

PGA contains: - Session information. - Sort area. - Private SQL area. - Hash join data structures.

6. Other Important Oracle DBA Components

6.1 Users and Schemas

Users are accounts that can connect to the database. Each user owns a schema, which is a
collection of database objects such as tables, views, and procedures.

6.2 Datafiles, Control Files, and Redo Logs

- Datafiles: Store actual data. - Control Files: Store metadata about database structure. - Redo Log
Files: Record changes made to the database for recovery.

6.3 Archive Logs

When redo log files are full, they can be archived. Archive logs are used for media recovery and
point-in-time recovery.

6.4 Oracle Background Processes

Some important background processes include: - DBWR (Database Writer): Writes modified blocks
to datafiles. - LGWR (Log Writer): Writes redo entries to redo log files. - CKPT (Checkpoint):
Updates control files and datafile headers. - SMON (System Monitor): Performs recovery at startup.
- PMON (Process Monitor): Cleans up failed processes.

6.5 Backup and Recovery Basics

Backup and recovery are critical DBA responsibilities. Oracle provides RMAN (Recovery Manager)
as the primary tool for performing backups, restores, and database recovery.

6.6 Database Monitoring and Performance Tuning

DBAs must monitor performance using tools like AWR reports, ADDM, and Oracle Enterprise
Manager. Tuning involves optimizing SQL queries, memory parameters, and I/O operations.
6.7 Common DBA Troubleshooting

Some typical troubleshooting scenarios include: - Resolving listener connectivity issues. - Managing
tablespace growth. - Handling lock contention. - Investigating slow queries using execution plans.

Conclusion

Oracle DBA plays a vital role in ensuring database stability, security, and performance. By
understanding key components such as tablespaces, listeners, SGA, PGA, and recovery
mechanisms, DBAs can effectively manage enterprise databases.

Oracle Database Administration (DBA) Detailed Guide

Introduction

This document provides a detailed explanation of Oracle Database Administration concepts and
practical examples. It covers the database structure, tablespaces, listener, SGA, PGA, and other
important components. It also includes commands and procedures for starting and stopping the
database, managing tablespaces and datafiles, creating users, and performing basic backup and
recovery tasks. The objective is to give DBAs a practical reference guide.

1. Oracle Database

An Oracle Database is a set of files, memory structures, and background processes that work
together to store and manage information. DBAs manage the database to ensure it runs efficiently
and securely.

1.1 Database Startup and Shutdown

A database instance can be started and stopped using SQL*Plus or srvctl (in RAC/Cluster). Startup
goes through several stages:

- NOMOUNT: Instance started, no database mounted. - MOUNT: Control files are read, but
database not open. - OPEN: Database fully available for users.

Example: Startup in SQL*Plus

SQL> STARTUP NOMOUNT; SQL> ALTER DATABASE MOUNT; SQL> ALTER DATABASE
OPEN;

Shutdown modes:

- NORMAL: Waits for all users to disconnect. - IMMEDIATE: Rolls back transactions and
disconnects users. - TRANSACTIONAL: Waits for current transactions to finish. - ABORT:
Immediate shutdown without cleanup.

Example: Shutdown in SQL*Plus


SQL> SHUTDOWN IMMEDIATE;

2. Oracle Net Listener

The listener is a process that enables client connections to the database. It is managed with the
'lsnrctl' utility.

Common Listener Commands:

$ lsnrctl start $ lsnrctl stop $ lsnrctl status $ lsnrctl reload

3. Tablespaces and Datafiles

Tablespaces are logical storage containers in Oracle, and they consist of one or more datafiles.
DBAs manage tablespaces to allocate space for database objects.

3.1 Create Tablespace

Example:

CREATE TABLESPACE users DATAFILE '/u01/app/oracle/oradata/ORCL/[Link]' SIZE 100M


AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED;

3.2 Add Datafile

Example:

ALTER DATABASE ADD DATAFILE '/u01/app/oracle/oradata/ORCL/[Link]' SIZE 200M


AUTOEXTEND ON;

3.3 Resize Datafile

Example:

ALTER DATABASE DATAFILE '/u01/app/oracle/oradata/ORCL/[Link]' RESIZE 500M;

4. Memory Structures (SGA and PGA)

Oracle uses memory structures to manage operations. The System Global Area (SGA) is shared by
all processes, while the Program Global Area (PGA) is private to each process.

SGA Components: - Database Buffer Cache - Shared Pool - Redo Log Buffer - Large Pool - Java
Pool

PGA contains: - Private SQL areas - Sort area - Session memory


5. Users and Security

Each Oracle user owns a schema. DBAs create users and grant privileges.

Example: Create User

CREATE USER hr IDENTIFIED BY hr123 DEFAULT TABLESPACE users TEMPORARY


TABLESPACE temp;

Grant privileges:

GRANT CONNECT, RESOURCE TO hr;

6. Backup and Recovery

DBAs are responsible for database backup and recovery. Oracle provides RMAN as the main tool
for this purpose.

Example: Full Database Backup

RMAN> BACKUP DATABASE PLUS ARCHIVELOG;

Example: Restore and Recover Database

RMAN> RESTORE DATABASE; RMAN> RECOVER DATABASE;

7. Monitoring and Tuning

Performance monitoring is critical. DBAs use dynamic performance views (V$ views) and reports
such as AWR and ADDM.

Examples:

SQL> SELECT tablespace_name, file_name, bytes/1024/1024 AS MB FROM dba_data_files;


SQL> SELECT * FROM v$instance; SQL> SELECT * FROM v$session WHERE status='ACTIVE';

8. Common Troubleshooting

- Resolving listener not starting: check [Link] and port. - ORA-01536: space quota exceeded:
extend tablespace or quota. - ORA-12514: TNS listener does not currently know of service: verify
[Link].

Conclusion

This document has covered Oracle DBA basics in detail, including database startup/shutdown,
listener management, tablespaces, SGA/PGA, user management, and backup/recovery operations.
The commands and examples provided should help DBAs in their day-to-day administrative tasks.

You might also like