10 Advanced Database Features And Tools

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.

Advanced Database Features and Tools: notes

SQL*PLUS definition and functionalities

SQL*Plus is Oracle's command line tool. It runs SQL statements and PL/SQL blocks and also has its own commands.

Functions:

  • Run SQL and PL/SQL.
  • Format query output with commands like COLUMN, SET LINESIZE and SET PAGESIZE.
  • Run script files with @script.sql.
  • Save output with SPOOL.
  • Use substitution variables such as &name.
  • Describe tables with DESCRIBE.
sqlplus scott/tiger@orcl
SET LINESIZE 120 PAGESIZE 50
COLUMN ename FORMAT A15
SPOOL /tmp/emp.txt
SELECT ename, sal FROM emp WHERE deptno = &dept;
SPOOL OFF
DESCRIBE emp

DBA functionalities in SQL*PLUS

A DBA connects with administrative privilege to manage the instance.

sqlplus / as sysdba
STARTUP;
SHUTDOWN IMMEDIATE;
SHOW USER
SHOW PARAMETER db_name
ALTER SYSTEM SET processes = 400 SCOPE = SPFILE;
RECOVER DATABASE;
ARCHIVE LOG LIST

Through SQL*Plus a DBA can start and stop the database, create users and manage tablespaces. The DBA can also run backup scripts, read dictionary views and run scripts such as awrrpt.sql.

Oracle RAC concepts

Oracle Real Application Clusters (RAC) lets many instances on different servers open one shared database. All servers read and write the same datafiles on shared storage.

Features and benefits:

  • High availability: if one node fails, the others keep running.
  • Scalability: add nodes to handle more users.
  • Cache Fusion: nodes pass data blocks to each other over a fast private network, so they avoid writing to disk.

Main parts: the cluster nodes, shared storage, a private interconnect network and the clusterware. Each instance has its own SGA and redo thread. Users connect through a service name, and a failed node's work moves to a live node.

Oracle ASM concepts

Automatic Storage Management (ASM) is Oracle's volume manager and file system for database files. It manages disks directly, so no separate volume manager is needed.

  • Disks are put in disk groups.
  • ASM spreads (stripes) files over all disks for even I/O.
  • It can keep copies (mirror) of data: normal redundancy keeps two copies and high redundancy keeps three.
  • Disks can be added or removed while the database runs, and data is rebalanced.
  • File names start with a plus sign, such as +DATA.

ASM runs as its own instance. The database uses it like this.

CREATE TABLESPACE sales DATAFILE '+DATA' SIZE 500M;

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 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:

ParameterDescription
PROTOCOLNetwork protocol (TCP/IP)
HOSTServer hostname or IP address
PORTPort number (default 1521)
SID_NAMEOracle 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:

ParameterDescription
ORCLNet service name (alias used by client)
HOSTIP address or hostname of the database server
PORTPort number of the listener
SERVICE_NAMEThe Oracle database service name
SERVERConnection type (DEDICATED or SHARED)

Difference Between listener.ora and tnsnames.ora

Featurelistener.oratnsnames.ora
LocationServer sideClient side
PurposeConfigures the listener processMaps alias to connection details
Used byOracle ListenerClient applications
Managed byDBA (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.

Open this answer on its own page →

SQL*PLUS definition and functionalities

2080 · 5 marks

What is SQLPLUS? Also explain the functionalities of SQLPLUS that the ORACLE DBA can use. [5]

SQL\PLUS is an interactive and batch query tool (command-line interface) provided by Oracle Corporation that comes bundled with the Oracle Database software. It allows users and Database Administrators (DBAs) to: - Interact directly with the Oracle database - Execute SQL statements and PL/SQL blo...

Open this answer on its own page →

Oracle RAC concepts

2080 · 5 marks

Explain the term oracle RAC and oracle ASM. [5]

Note: The reference notes did not contain material on this topic. The following answer is based on standard Oracle database concepts as taught in database administration courses. --- Oracle RAC is a cluster database option that allows multiple computers (nodes) to run Oracle Database software sim...

Open this answer on its own page →

Oracle Net service components

2080 · 5 marks

Explain the different oracle net service components. [5]

Note: The reference notes did not contain this topic directly. The following answer is based on standard Oracle Net Services curriculum as taught in TU BSc CSIT Database Administration courses. --- Oracle Net Services is a suite of networking components that enables network connectivity between c...

Open this answer on its own page →

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 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:

ModeDescription
FULL=YExports entire database
SCHEMAS=schema_nameExports specific schema
TABLES=table_nameExports specific tables
TABLESPACES=ts_nameExports 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:

OptionDescription
REMAP_SCHEMAImport into a different schema
REMAP_TABLESPACEMap to a different tablespace
TABLE_EXISTS_ACTIONAction 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

Featureexpdpimpdp
PurposeExport data to dump fileImport data from dump file
Server-sideYesYes
ParallelYesYes

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.

Open this answer on its own page →

0 · 5 marks

Write short notes on: a. Data Pump b. Container Database [5]

Note: Reference notes were not available for this topic. The following answer is based on standard Oracle Database concepts as covered in BSc CSIT Database Administration curriculum. --- Oracle Data Pump is a high-speed utility introduced in Oracle 10g that allows fast bulk data and metadata move...

Open this answer on its own page →

Container database concepts

2081.1 · 5 marks

Explain the concept of Container database and Portable database. [5]

Note: The reference notes did not contain specific content on this topic. The following answer is based on standard Oracle Database 12c and later architecture concepts, which is the standard curriculum topic for TU BSc CSIT Database courses. --- A Container Database (CDB) is a type of Oracle data...

Open this answer on its own page →