How to export schema level by using expdp
Posted by Mir Sayeed Hassan on October 9th, 2017
How to export schema level by using expdp
Consider the below example tested in our test env & verified
Create the directory at OS Level to place the backup of the dumpfile
[oracle@testdb backup]$ mkdir db_dump_bkp
[root@testdb backup]# chmod -R 777 db_dump_bkp/
Create the directory at DB Level & assign the directory with OS dir name along with require privileges
SQL> create directory db_dump_bkp as '/backup/db_dump_bkp'; Directory created.
SQL> grant read,write on directory db_dump_bkp to system; Grant succeeded.
SQL> grant exp_full_database to system; Grant succeeded. SQL> exit
Syntax to export the full db dump
[oracle@testdb db_dump_bkp]$ expdp username/password directory= dumpfile= logfile= schemas=
Example:
[oracle@testdb db_dump_bkp]$ expdp system directory=db_dump_bkp dumpfile=mir_bkp10oct17.dmp logfile=mir_bkp10oct17.log schemas=mir Export: Release 11.2.0.4.0 - Production on Mon Oct 9 11:51:54 2017 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. Password: ******* Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options FLASHBACK automatically enabled to preserve database integrity. Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01": system/******** directory=db_dump_bkp dumpfile=mir_bkp10oct17.dmp logfile=mir_bkp10oct17.log schemas=mir Estimate in progress using BLOCKS method... Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA Total estimation using BLOCKS method: 128 KB Processing object type SCHEMA_EXPORT/USER Processing object type SCHEMA_EXPORT/SYSTEM_GRANT Processing object type SCHEMA_EXPORT/ROLE_GRANT Processing object type SCHEMA_EXPORT/DEFAULT_ROLE Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA Processing object type SCHEMA_EXPORT/TABLE/TABLE Processing object type SCHEMA_EXPORT/TABLE/AUDIT_OBJ Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS . . exported "MIR"."TEST1" 5.085 KB 5 rows . . exported "MIR"."TEST2" 5.070 KB 3 rows Master table "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded ****************************************************************************** Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_01 is: /backup/db_dump_bkp/mir_bkp10oct17.dmp Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" successfully completed at Mon Oct 9 11:52:11 2017 elapsed 0 00:00:13
To verify the dumpfile backup in specified location
[oracle@ogg-test1 db_dump_bkp]$ ls mir_bkp10oct17.dmp mir_bkp10oct17.log
Note:
If you want to export multiple schemas to exports use the below syntax
Syntax:
schemas=, ……
Example: schemas=mir,scott