Solved

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

Posted on 2011-03-02
3
298 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
ID: 35016228
hi

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

Expert Comment

by:Aaron Shilo
ID: 35016237
0
 
LVL 12

Accepted Solution

by:
praveencpk earned 500 total points
ID: 35016344
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
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 video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.

861 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