Database Administration · Unit 10
Advanced Database Features and Tools
Exam-focused notes for Advanced Database Features and Tools (Database Administration, BIT352): what the TU syllabus asks and how it has actually been tested, with 7 solved past questions from this unit.
Advanced Database Features and Tools in short
This chapter covers tools and features a DBA uses every day: SQL*Plus, clustering, storage management, data movement, multitenant databases and network setup.
What this unit covers
- SQL*PLUS definition and functionalities
- DBA functionalities in SQL*PLUS
- Oracle RAC concepts
- Oracle ASM concepts
- Oracle Data Pump overview
- Data Pump export procedures
- Data Pump import procedures
- Container database concepts
- Portable database concepts
- Oracle Net service components
- Listener definition and purpose
- Listener.ora file configuration
- Tnsnames.ora file configuration
Listener definition and purpose
2081 · 5 marks
What is listener? Explain about listener.ora and tnsnames.ora file in oracle database. [5]
Show solved answerHide answer
Listener, listener.ora, and tnsnames.ora in Oracle Database
Listener
A listener is a server-side network process in Oracle Database that listens for incoming client connection requests on a specific network protocol (usually TCP/IP) and a specific port (default port: 1521).
When a client wants to connect to an Oracle database, it sends a connection request to the listener. The listener receives the request, verifies it, and then hands off (redirects) the connection to the appropriate Oracle database instance.
Key points about Listener:
- It runs on the database server machine.
- It is managed using the lsnrctl (Listener Control) utility.
- Common commands:
lsnrctl start,lsnrctl stop,lsnrctl status - Without a running listener, remote clients cannot connect to the Oracle database.
listener.ora File
The listener.ora file is a server-side configuration file that defines the listener's properties and settings.
Location: $ORACLE_HOME/network/admin/listener.ora
It contains:
- The name of the listener (default:
LISTENER) - The protocol, host, and port on which the listener listens
- The Oracle database services/SIDs it serves
Example:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = myserver.example.com)
(PORT = 1521)
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = ORCL)
(ORACLE_HOME = /u01/app/oracle/product/19c/dbhome_1)
)
)
Key parameters:
| Parameter | Description |
|---|---|
PROTOCOL | Network protocol (TCP/IP) |
HOST | Server hostname or IP address |
PORT | Port number (default 1521) |
SID_NAME | Oracle System Identifier |
tnsnames.ora File
The tnsnames.ora file is a client-side configuration file that maps logical service names (aliases) to Oracle database connection descriptors (host, port, service name).
Location: $ORACLE_HOME/network/admin/tnsnames.ora
When a client application uses a connect string like sqlplus user/pass@ORCL, Oracle looks up ORCL in tnsnames.ora to find the actual connection details.
Example:
ORCL =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = myserver.example.com)
(PORT = 1521)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.example.com)
)
)
Key parameters:
| Parameter | Description |
|---|---|
ORCL | Net service name (alias used by client) |
HOST | IP address or hostname of the database server |
PORT | Port number of the listener |
SERVICE_NAME | The Oracle database service name |
SERVER | Connection type (DEDICATED or SHARED) |
Difference Between listener.ora and tnsnames.ora
| Feature | listener.ora | tnsnames.ora |
|---|---|---|
| Location | Server side | Client side |
| Purpose | Configures the listener process | Maps alias to connection details |
| Used by | Oracle Listener | Client applications |
| Managed by | DBA (server) | DBA / end user (client) |
In summary: The listener acts as a gatekeeper on the server; listener.ora tells the listener how to operate; and tnsnames.ora tells the client where and how to connect to the database.
SQL*PLUS definition and functionalities
2080 · 5 marks
What is SQLPLUS? Also explain the functionalities of SQLPLUS that the ORACLE DBA can use. [5]
Oracle RAC concepts
Oracle Net service components
2080 · 5 marks
Explain the different oracle net service components. [5]
Oracle Data Pump overview
2081.1 · 5 marks
What is Data Pump? Explain the procedure of exporting and importing data using Oracle Data Pump. [5]
Show solved answerHide answer
Data Pump in Oracle
What is Data Pump?
Oracle Data Pump is a high-speed utility introduced in Oracle 10g that allows fast bulk data and metadata movement between Oracle databases. It is an improved replacement for the older exp/imp utilities. Data Pump uses server-side processing, meaning the export/import operations are performed on the database server rather than the client side, making it significantly faster and more efficient.
Key features:
- Supports parallel execution for faster performance
- Allows fine-grained object selection
- Supports network-based data transfer (no dump file needed)
- Provides restart/resume capability for failed jobs
Exporting Data Using Data Pump (expdp)
The export utility is called expdp (Export Data Pump).
Step-by-Step Procedure:
Step 1: Create a Directory Object A directory object must be created in Oracle pointing to a physical OS directory where dump files will be stored.
CREATE OR REPLACE DIRECTORY dp_dir AS '/u01/backup/';
GRANT READ, WRITE ON DIRECTORY dp_dir TO scott;
Step 2: Run the expdp Command
expdp scott/tiger \
DIRECTORY=dp_dir \
DUMPFILE=scott_export.dmp \
LOGFILE=scott_export.log \
SCHEMAS=scott
Common Export Modes:
| Mode | Description |
|---|---|
FULL=Y | Exports entire database |
SCHEMAS=schema_name | Exports specific schema |
TABLES=table_name | Exports specific tables |
TABLESPACES=ts_name | Exports specific tablespace |
Importing Data Using Data Pump (impdp)
The import utility is called impdp (Import Data Pump).
Step-by-Step Procedure:
Step 1: Ensure Directory Object Exists The same or a new directory object must be available (as created above).
Step 2: Run the impdp Command
impdp scott/tiger \
DIRECTORY=dp_dir \
DUMPFILE=scott_export.dmp \
LOGFILE=scott_import.log \
SCHEMAS=scott
Common Import Options:
| Option | Description |
|---|---|
REMAP_SCHEMA | Import into a different schema |
REMAP_TABLESPACE | Map to a different tablespace |
TABLE_EXISTS_ACTION | Action if table exists (SKIP, REPLACE, APPEND) |
Example with remapping:
impdp system/manager \
DIRECTORY=dp_dir \
DUMPFILE=scott_export.dmp \
REMAP_SCHEMA=scott:hr \
TABLE_EXISTS_ACTION=REPLACE
Summary
| Feature | expdp | impdp |
|---|---|---|
| Purpose | Export data to dump file | Import data from dump file |
| Server-side | Yes | Yes |
| Parallel | Yes | Yes |
Note: The notes for this topic were not available; this answer is based on standard Oracle Data Pump documentation and is consistent with TU BSc CSIT Database curriculum coverage.
0 · 5 marks
Write short notes on: a. Data Pump b. Container Database [5]
Container database concepts
2081.1 · 5 marks
Explain the concept of Container database and Portable database. [5]
Make Unit 10 stick
Practice BIT352 with flashcards & quizzes