Solved

How to create an Oracle database dump, based on certain conditions

Posted on 2011-03-02
3
296 Views
Last Modified: 2012-05-11
Hi,

I need to create a dump of a database, based on certain criteria.

I only want certain data in the database,  not all, for example " where no=9", that is all the data that should be included in certain tables, and in others for example "where nom=9".

Is this poosible?

Please advise.
0
Comment
Question by:Lalla Belle
  • 2
3 Comments
 
LVL 15

Expert Comment

by:Aaron Shilo
Comment Utility
hi

use datapump with the QUERY option to filter data from the exported table
0
 
LVL 15

Expert Comment

by:Aaron Shilo
Comment Utility
0
 
LVL 12

Accepted Solution

by:
praveencpk earned 500 total points
Comment Utility
hi,

please let us know which version of database you are using.

if it is 10g you can use expdp which is a Server based tool
Before starting data pump you have to create directory as user ‘sys’ and grant ‘sys’ read/write privileges:

connect system/manager@o10f
create directory <directory_name> as '<Directory_Location>';
grant read,write on directory <directory_name>  to <username>;
cross check using below query.
select * from dba_directories;

Execute the expdb
> expdp hr/hr parfile=emp_query.par

The contents of the emp_query.par file are as follows:

QUERY=employees:'"WHERE department_id > 10 AND salary > 10000"'
NOLOGFILE=y
DIRECTORY=<Directory_name>
DUMPFILE=exp1.dmp

for more info check this link.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14215/dp_export.htm#BEHHDHFE
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now