I have a task to export data from database using data pump. I have successfully exported database using subquery in QUERY clause. But I want to know can we expdp using joins in QUERY clause?


The QUERY parameter is used to restrict data in the export job. If you want to export number of rows that are exist in another table then you can use subquery in QUERY parameter.

If you want to join two tables and export you can create table by joining two tables. As shown below.

SQL> create table export_tbl as select e.first_name FN, d.department_name DN from employees e join departments d on(e.department_id=d.department_id);

Table created.

Then can export it.

[oracle@testsrv Desktop]$ expdp hr/hr directory=user_dir dumpfile=export.dmp tables=export_tbl logfile=export.log

Alternatively, you can create a view by joining tables and export views(INCLUDE=VIEWS). You have to filter views during import.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.