Note: Add <content=DATA_ONLY > or <content=METADATA_ONLY > options in expdp command to export only data metadata as per the requirement. If you don't specify either of the two keywords, then the default one would be ALL i.e. it will export both DATA as well METADATA.
DATA_ONLY - To export only DATA, not Metadata.
METADATA_ONLY - To export only METADATA , not DATA..
ALL - To export both DATA and METADATA, both.
#Execute below query to get the all objects of TEST schema. SQL> set lines 300 pages 3000 SQL> col OBJECT_NAME for a20 SQL> col OBJECT_TYPE for a20 SQL> select owner,object_name,object_type from dba_objects where owner='TEST'; OWNER OBJECT_NAME OBJECT_TYPE -------------- -------------------- -------------------- TEST EMP TABLE TEST DEPT TABLE TEST VW_TEST VIEW #Execute below command to export only data, not metadata. This is required in case you already have metadata imported and you don't want to import it again. C:\Windows\System32>expdp directory=DIR_TEST schemas=test dumpfile=schema.dmp logfile=schema.log content=DATA_ONLY Export: Release 19.0.0.0.0 - Production on Fri Mar 15 20:00:42 2024 Version 19.16.0.0.0 Copyright (c) 1982, 2022, Oracle and/or its affiliates. All rights reserved. Username: test Password: Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Starting "TEST"."SYS_EXPORT_SCHEMA_01": test/******** directory=DIR_TEST schemas=test dumpfile=schema.dmp logfile=schema.log content=DATA_ONLY Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA . . exported "TEST"."DEPT" 6.531 KB 5 rows . . exported "TEST"."EMP" 6.531 KB 5 rows Master table "TEST"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded ****************************************************************************** Dump file set for TEST.SYS_EXPORT_SCHEMA_01 is: C:\BACKUP\SCHEMA.DMP Job "TEST"."SYS_EXPORT_SCHEMA_01" successfully completed at Fri Mar 15 20:00:54 2024 elapsed 0 00:00:08 #Execute below command to export only metadata, not data. This is required in case you want to import only metadata, don't want to import the data. C:\Windows\System32>expdp directory=DIR_TEST schemas=test dumpfile=schema.dmp logfile=schema.log content=METADATA_ONLY Export: Release 19.0.0.0.0 - Production on Fri Mar 15 20:10:37 2024 Version 19.16.0.0.0 Copyright (c) 1982, 2022, Oracle and/or its affiliates. All rights reserved. Username: test Password: Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Starting "TEST"."SYS_EXPORT_SCHEMA_01": test/******** directory=DIR_TEST schemas=test dumpfile=schema.dmp logfile=schema.log content=METADATA_ONLY Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS Processing object type SCHEMA_EXPORT/STATISTICS/MARKER 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/TABLESPACE_QUOTA Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA Processing object type SCHEMA_EXPORT/TABLE/TABLE Processing object type SCHEMA_EXPORT/TABLE/COMMENT Processing object type SCHEMA_EXPORT/VIEW/VIEW Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT Master table "TEST"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded ****************************************************************************** Dump file set for TEST.SYS_EXPORT_SCHEMA_01 is: C:\BACKUP\SCHEMA.DMP Job "TEST"."SYS_EXPORT_SCHEMA_01" successfully completed at Fri Mar 15 20:11:36 2024 elapsed 0 00:00:55 #Execute below command to export both data as well as metadata. If you don't specify either of the option i.e. data_only or metadata_only. The default option would be ALL which will export both DATA as well METADATA. C:\Windows\System32>expdp directory=DIR_TEST schemas=test dumpfile=schema.dmp logfile=schema.log Export: Release 19.0.0.0.0 - Production on Fri Mar 15 20:14:12 2024 Version 19.16.0.0.0 Copyright (c) 1982, 2022, Oracle and/or its affiliates. All rights reserved. Username: test Password: Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Starting "TEST"."SYS_EXPORT_SCHEMA_01": test/******** directory=DIR_TEST schemas=test dumpfile=schema.dmp logfile=schema.log Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS Processing object type SCHEMA_EXPORT/STATISTICS/MARKER 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/TABLESPACE_QUOTA Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA Processing object type SCHEMA_EXPORT/TABLE/TABLE Processing object type SCHEMA_EXPORT/TABLE/COMMENT Processing object type SCHEMA_EXPORT/VIEW/VIEW Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT . . exported "TEST"."DEPT" 6.531 KB 5 rows . . exported "TEST"."EMP" 6.531 KB 5 rows Master table "TEST"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded ****************************************************************************** Dump file set for TEST.SYS_EXPORT_SCHEMA_01 is: C:\BACKUP\SCHEMA.DMP Job "TEST"."SYS_EXPORT_SCHEMA_01" successfully completed at Fri Mar 15 20:14:56 2024 elapsed 0 00:00:40 OR C:\Windows\System32>expdp directory=DIR_TEST schemas=test dumpfile=schema.dmp logfile=schema.log content=ALL Export: Release 19.0.0.0.0 - Production on Fri Mar 15 20:19:45 2024 Version 19.16.0.0.0 Copyright (c) 1982, 2022, Oracle and/or its affiliates. All rights reserved. Username: test Password: Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Starting "TEST"."SYS_EXPORT_SCHEMA_01": test/******** directory=DIR_TEST schemas=test dumpfile=schema.dmp logfile=schema.log content=ALL Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS Processing object type SCHEMA_EXPORT/STATISTICS/MARKER 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/TABLESPACE_QUOTA Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA Processing object type SCHEMA_EXPORT/TABLE/TABLE Processing object type SCHEMA_EXPORT/TABLE/COMMENT Processing object type SCHEMA_EXPORT/VIEW/VIEW Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT . . exported "TEST"."DEPT" 6.531 KB 5 rows . . exported "TEST"."EMP" 6.531 KB 5 rows Master table "TEST"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded ****************************************************************************** Dump file set for TEST.SYS_EXPORT_SCHEMA_01 is: C:\BACKUP\SCHEMA.DMP Job "TEST"."SYS_EXPORT_SCHEMA_01" successfully completed at Fri Mar 15 20:20:13 2024 elapsed 0 00:00:25 |
Thank you for visiting my blog ! Thanks for your comment !