|
Home >> FAQs/Tutorials >> Oracle DBA FAQ >> Index
Oracle DBA FAQ - Loading and Exporting Data
By: FYIcenter.com
Part:
1
2
3
4
5
6
7
(Continued from previous part...)
Where Is the Export Dump File Located?
If you are not specifying the dump directory and file name,
the dump file will be stored in the default dump directory
with the default file name. The tutorial exercise below tells you
find what is your default dump directory and locate the dump file.
>sqlplus /nolog
SQL> connect SYSTEM/fyicenter
SQL> COL owner FORMAT A8;
SQL> COL directory_name FORMAT A16;
SQL> COL directory_path FORMAT A40;
SQL> SELECT * FROM dba_directories;
OWNER DIRECTORY_NAME DIRECTORY_PATH
----- -------------- -------------------------------------
SYS DATA_PUMP_DIR \oraclexe\app\oracle\admin\XE\dpdump\
SYS TEST_DIR /oraclexe/test
SYS ORACLECLRDIR \oraclexe\app\oracle\product\10.2.0\
server\bin\clr
Obviously, the default dump directory is directory object defined
to \oraclexe\app\oracle\admin\XE\dpdump\. If you go to that directory,
you will find the full database dump file is called "expdat.dmp".
How To Export Your Own Schema?
If you have a non-system user account and you want to export all data objects
in the schema associated with your account, you can use the "expdp" command
with the SCHEMAS parameter. Running "expdp" command with a non-system user account
requires a directory object granted to this user account. The following tutorial
exercise shows you how to define a directory object and export a schema:
>mkdir \oraclexe\hr_dump
>cd \oraclexe\app\oracle\product\10.2.0\server\BIN
>sqlplus /nolog
SQL> connect SYSTEM/fyicenter
SQL> CREATE DIRECTORY hr_dump AS '\oraclexe\hr_dump';
Directory created.
SQL> GRANT READ ON DIRECTORY hr_dump TO hr;
Grant succeeded.
SQL> GRANT WRITE ON DIRECTORY hr_dump TO hr;
Grant succeeded.
SQL> quit
>expdp hr/fyicenter SCHEMAS=hr
DIRECTORY=hr_dump DUMPFILE=schema.dmp LOGFILE=schema.log
Starting "HR"."SYS_EXPORT_SCHEMA_01":
hr/******** SCHEMAS=hr DIRECTORY=hr_dump
DUMPFILE=schema.dmp
LOGFILE=schema.log
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 960 KB
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCH
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
......
. . exported "HR"."COUNTRIES" 6.085 KB 25 rows
. . exported "HR"."DEPARTMENTS" 6.632 KB 27 rows
. . exported "HR"."EMPLOYEES" 15.76 KB 107 rows
. . exported "HR"."EMPLOYEES_TEMP" 15.86 KB 107 rows
......
Master table "HR"."SYS_EXPORT_SCHEMA_01" loaded/unloaded
*********************************************************
Dump file set for HR.SYS_EXPORT_SCHEMA_01 is:
C:\ORACLEXE\HR_DUMP\SCHEMA.DMP
Job "HR"."SYS_EXPORT_SCHEMA_01" successfully completed
How To Export Several Tables Together?
If you don't want to export the entire schema and only want to export
several tables only, you can use the "expdp" command with the "TABLES"
parameter as shown in the following tutorial exercise:
>cd \oraclexe\app\oracle\product\10.2.0\server\BIN
>expdp hr/fyicenter TABLES=employees,departments
DIRECTORY=hr_dump DUMPFILE=tables.dmp LOGFILE=tables.log
Starting "HR"."SYS_EXPORT_TABLE_01": hr/********
TABLES=employees,departments DIRECTORY=hr_dump
DUMPFILE=tables.dmp
LOGFILE=tables.log
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 128 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CON...
Processing object type TABLE_EXPORT/TABLE/INDEX/STATISTI...
Processing object type TABLE_EXPORT/TABLE/COMMENT
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF...
Processing object type TABLE_EXPORT/TABLE/TRIGGER
Processing object type TABLE_EXPORT/TABLE/STATISTICS/TAB...
. . exported "HR"."DEPARTMENTS" 6.632 KB 27 rows
. . exported "HR"."EMPLOYEES" 15.76 KB 107 rows
Master table "HR"."SYS_EXPORT_TABLE_01" loaded/unloaded
***********************************************************
Dump file set for HR.SYS_EXPORT_TABLE_01 is:
C:\ORACLEXE\HR_DUMP\TABLES.DMP
Job "HR"."SYS_EXPORT_TABLE_01" successfully completed
(Continued on next part...)
Part:
1
2
3
4
5
6
7
|