oracle sql and dba tutorial logo

Tutorial for Oracle SQL

Oracle DBA Interview Questions

Most asked Oracle DBA Interview Questions.

60 Technical Questions
42 Backup & Recovery Questions

Unix For Oracle DBA 20 Questions

Oracle DBA Topics

Overview of Oracle Grid Architecture

Difference between cluster and grid

Responsibilities of DBA's

Creating Oracle Database

Creating Database using SQL

Creating DB in 12c using DBCA

Creating DB in 12c using SQL commands

Managing Oracle 12c Container Databases

Creating Users in Oracle 12c

Managing Pluggable Databases in Oracle 12c

Creating Pluggable Database

Cloning Pluggable Database

Unplug and Plug databases in CDB's

Managing Tablespaces and Datafiles

Extending tablespaces

Decreasing size of a tablespace

Coalescing Tablespaces

Taking tablespaces Offline or Online

Making a Tablespace Read only

Renaming Tablespaces

Dropping Tablespaces

Viewing Info about Tablespaces

Renaming Datafiles

Relocating Datafiles

Relocating Datafiles in Multiple Tablespaces

Temporary Tablespace

Changing the size

Tablespace Groups

Creating a Temp. Tablespace Group

Assigning a Tablespace Group

Diagnosing and Repairing LMT

Scenario 1: Fixing Bitmap

Scenario 2: Dropping a Corrupted Segment

Scenario 3: Fixing Bitmap when Overlapped

Scenario 4: Correcting Corruption of Blocks

Scenario 5: Migrating from a Dictionary-Managed to LMT

Transporting Tablespaces

Procedure for transporting tablespaces

Transporting Tablespace Example


Adding New Redo Logfile Group

Adding Members to group

Dropping Members from group

Dropping Logfile Group

Resizing Logfiles

Renaming or Relocating Logfiles


Viewing Info About Logfiles

Managing Control Files

Multiplexing Control File

Changing the Name of a Database

Creating A New Control File

Cloning an Oracle Database


Switching to Automatic Management

Calculate Undo Retention

Altering UNDO Tablespace

Dropping an Undo Tablespace

Switching Undo Tablespaces

Viewing Information

SQL Loader


From Fixed Length file

From MySQL to Oracle

Using WHEN condition

Conventional and Direct Path Load

Direct Path

Restrictions on Using Direct Path Loads

Export and Import

Invoking Export and Import

Parameters of Export tool

Exporting Full Database

Exporting Schemas

Exporting Tables

Exporting Consistent Image of tables

Using Import Utility

Example Importing Tables

Import from One User to another User

Using Pattern Matching

Migrating a Database across platforms


Data Pump Export

Exporting a Full Database

Exporting a Schema

Exporting Individual Tables

Filtering Objects during Export

Filter Rows during Export

Suspending and Resuming Export

Data Pump Import Utility

Importing Full Dump File

Importing Objects between Schemas

Loading Objects between Tablespaces

Generating SQL File of DDL commands

Import objects of a Schema

Importing Only Particular Tables

Interactive Mode

Flash Back Features

Flashback Query

Flashback Version Query

Flashback Table to Past States

Purging Objects from Recycle Bin

Flashback Objects With Same Name

Flashback instead of PIT Recovery

Enabling Flash Back Database

Sizing flash recovery area

How far we can flashback database

Example:Flashing Back Database

Flashback Data Archive (FDA)
(Oracle Total Recall)


Creating FDA tablespace

Creating FDA

Querying historical data

Log Miner

LogMiner Configuration

LogMiner Dictionary Options

Using the Online Catalog

Extracting Dictionary to Log Files

Extracting Dictionary to File

Redo Log File Options

Example: Finding All Modifications

Mining Logfiles in a Time Range


Opening DB in Archivelog Mode

Reverting back to NoArchiveLog mode

Taking Offline (COLD) Backups

Taking Online (HOT) Backups

Recovering from the Loss of a Datafile

When in Noarchivelog Mode

When in Archivelog Mode

Recovering from loss of Control File

Recovery Manager ( RMAN )

Offline Backups using RMAN

Recover DB when in NOARCHIVELOG

Online Backups using RMAN

Backup tablespaces or datafiles

Image Backups in RMAN

Incremental Backup using RMAN

Updating backup copy for fast recovery

View info about RMAN backups

Configuring Retention policy

Configure Options in RMAN

Maintaining RMAN Repository

Recover datafiles (Archivelog mode)

Recover datafiles by renaming

Performing Disaster Recovery










Extending the Size of Tablespace and Datafiles

To Extend the Size of a tablespace

Option 1

 You can extend the size of a tablespace by increasing the size of an existing datafile by typing the following command

SQL> alter  database ica datafile ‘/u01/oracle/data/icatbs01.dbf’ resize 100M;

This will increase the size from 50M to 100M

Option 2

You can also extend the size of a tablespace by adding a new datafile to a tablespace. This is useful if the size of existing datafile is reached o/s file size limit or the drive where the file is existing does not have free space. To add a new datafile to an existing tablespace give the following command.

SQL> alter tablespace add datafile  ‘/u02/oracle/ica/icatbs02.dbf’ size 50M;

Option 3

You can also use auto extend feature of datafile. In this, Oracle will automatically increase the size of a datafile whenever space is required. You can specify by how much size the file should increase and Maximum size to which it should extend.

To make a existing datafile auto extendable give the following command

SQL> alter database datafile ‘/u01/oracle/ica/icatbs01.dbf’ auto extend ON next 5M maxsize 500M;

You can also make a datafile auto extendable while creating a new tablespace itself by giving the following command.

SQL> create tablespace ica datafile ‘/u01/oracle/ica/icatbs01.dbf’ size 50M auto extend ON next 5M maxsize 500M;

To decrease the size of a tablespace

You can decrease the size of tablespace by decreasing the datafile associated with it. You decrease a datafile only up to size of empty space in it. To decrease the size of a datafile give the following command

SQL> alter database datafile ‘/u01/oracle/ica/icatbs01.dbf’      resize 30M;

Coalescing Tablespaces

A free extent in a dictionary-managed tablespace is made up of a collection of contiguous free blocks. When allocating new extents to a tablespace segment, the database uses the free extent closest in size to the required extent. In some cases, when segments are dropped, their extents are deallocated and marked as free, but adjacent free extents are not immediately recombined into larger free extents. The result is fragmentation that makes allocation of larger extents more difficult.

You should often use the ALTER TABLESPACE ... COALESCE statement to manually coalesce any adjacent free extents. To Coalesce a tablespace give the following command

SQL> alter tablespace ica coalesce;

Coalescing free space in tablespace



HomeContact Us

Data Loader

Data Loader is a simple yet powerful tool to
export and import Data between many common database formats

Forms Data Loader

Tool to load data into Oracle E-Business Suite R12 / Oracle Apps using Macros and Forms Record and Playback

Interface Computers Academy © 2007-2017 All Rights Reserved