QuestionQ122

VerifiedLoading and Unloading Data

Examine the following steps:

CONNECT / AS SYSDBA -  
CREATE DIRECTORY dumpdir AS '/u01/app/';  
Directory created.  
GRANT READ, WRITE ON DIRECTORY dumpdir TO PUBLIC;  
Grant succeeded.  
CREATE USER TEST IDENTIFIED BY test;  
User created.  
GRANT CREATE SESSION, RESOURCE, UNLIMITED TABLESPACE TO test;  
Grant succeeded.  
  
CONN test/test -  
Connected.  
CREATE TABLE test_employees (id NUMBER(3), name VARCHAR2(20), salary NUMBER(7));  
Table created.  
SQL> CREATE SYNONYM emp FOR test_employees;  
Synonym created.  

Now examine this command:

$ expdp test/test DIRECTORY=dumpdir DUMPFILE=test_emp.dmp LOGFILE=test.log TABLES=emp CONTENT=data_only query='EMP:"WHERE salary=12000"'  

What is true about the execution of this command?

Explanation

Oracle Data Pump Export does not support synonyms as values of the TABLES parameter. Because EMP is a synonym rather than an actual table named TEST.EMP, the export fails when it attempts to locate TEST.EMP. Empty tables can be exported with CONTENT=DATA_ONLY, and a QUERY filter is valid even when it returns no rows.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!