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










Using Oracle Export and Import

These tools are used to transfer data from one oracle database to another oracle database. You Export tool to export data from source database, and Import tool to load data into the target database. When you export tables from source database export tool will extracts the tables and puts it into the dump file. This dump file is transferred to the target database. At the target database the Import tool will copy the data from dump file to the target database.

From Ver. 10g / 11g Oracle has also released Data Pump Export and Import tools, which are enhanced versions of original Export and Import tools.

The export dump file contains objects in the following order:

  1. Type definitions
  2. Table definitions
  3. Table data
  4. Table indexes
  5. Integrity constraints, views, procedures, and triggers
  6. Bitmap, function-based, and domain indexes

When you import the tables the import tool will perform the actions in the following order, new tables are created, data is imported and indexes are built, triggers are imported, integrity constraints are enabled on the new tables, and any bitmap, function-based, and/or domain indexes are built. This sequence prevents data from being rejected due to the order in which tables are imported. This sequence also prevents redundant triggers from firing twice on the same data

Invoking Export and Import

You can run Export and Import tool in two modes

            Command Line Mode

            Interactive Mode

When you just type exp or imp at o/s prompt it will run in interactive mode i.e. these tools will prompt you for all the necessary input. If you supply command line arguments when calling exp or imp then it will run in command line mode

Command Line Parameters of Export tool

You can control how Export runs by entering the EXP command followed
by various arguments. To specify parameters, you use keywords:

     Format:  EXP KEYWORD=value or KEYWORD=(value1,value2,...,valueN)


               or TABLES=(T1:P1,T1:P2), if T1 is partitioned table

Keyword                               Description (Default)
USERID                                 username/password
BUFFER                                 size of data buffer
FILE                                         output files (EXPDAT.DMP)
COMPRESS                          import into one extent (Y)
GRANTS                               export grants (Y)
INDEXES                               export indexes (Y)
DIRECT                                  direct path (N)
LOG                                       log file of screen output
ROWS                                   export data rows (Y)
CONSISTENT                     cross-table consistency(N)
FULL                                    export entire file (N)
OWNER                               list of owner usernames
TABLES                                 list of table names
RECORDLENGTH              length of IO record
 INCTYPE                              incremental export type
 RECORD                              track incr. export (Y)
TRIGGERS                            export triggers (Y)
STATISTICS                         analyze objects (ESTIMATE)
PARFILE                               parameter filename
CONSTRAINTS                   export constraints (Y)
OBJECT_CONSISTENT    transaction set to read only during object export (N)
FEEDBACK                           display progress every x rows (0)
FILESIZE                                maximum size of each dump file
FLASHBACK_SCN             SCN used to set session snapshot back to
FLASHBACK_TIME           time used to get the SCN closest to the specified time
QUERY                                  select clause used to export a subset of a table
RESUMABLE                       suspend when a space related error is encountered(N)
RESUMABLE_NAME       text string used to identify resumable statement
TTS_FULL_CHECK             perform full or partial dependency check for TTS
TABLESPACES                    list of tablespaces to export
TRANSPORT_TABLESPACE           export transportable tablespace metadata (N)
TEMPLATE                           template name which invokes iAS mode export


The Export and Import tools support four modes of operation

  FULL                   :Exports all the objects in all schemas
 OWNER           :Exports objects only belonging to the given OWNER
 TABLES           :Exports Individual Tables
 TABLESPACE  :Export all objects located in a given TABLESPACE.

Example of Exporting Full Database

The following example shows how to export full database

$exp USERID=scott/tiger FULL=y FILE=myfull.dmp

In the above command, FILE option specifies the name of the dump file, FULL option specifies that you want to export the full database, USERID option specifies the user account to connect to the database. Note, to perform full export the user should have DBA or EXP_FULL_DATABASE privilege. 

Example of Exporting Schemas

To export Objects stored in a particular schemas you can run export utility with the following arguments

$exp USERID=scott/tiger OWNER=(SCOTT,ALI) FILE=exp_own.dmp

The above command will export all the objects stored in SCOTT and ALI’s schema.

Exporting Individual Tables

To export individual tables give the following command

$exp USERID=scott/tiger TABLES=(scott.emp,scott.sales) FILE=exp_tab.dmp

This will export scott’s emp and sales tables.

Exporting Consistent Image of the tables

If you include CONSISTENT=Y option in export command argument then, Export utility will export a consistent image of the table i.e. the changes which are done to the table during export operation will not be exported.





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