Oracle Data Pump utility is used for exporting data and metadata into set of operating system files and it is newer, faster and flexible alternative to “export/import” utilities.
Oracle Datapump utility introduced in Oracle 10g Release1 and this utility can be invoked using expdp(export) and impdb(import) commands. User need to specify the export/import parameters to determine the operation and you can specify the parameters on the command line or in a parameter file.
The expdp and impdp uses the procedures provided in the DBMS_DATAPUMP package to execute the commands and DBMS_METADATA package is used to move the data.
Please note that it is not possible to start or restart data pump jobs on one instance in Oracle RAC if jobs currently running on other instances.
Oracle Data Pump Export :-
1. Create directory object as SYS user.
SQL> create or replace directory export_dir as '/oradata/export’;
2. Grant Read/Write privilege on the directory to the user, who invokes the Data pump export.
SQL> grant read,write on directory export_dir to test_user;
3. Take Data Pump Export
Click here to see Roles/privileges required for Export modes.
Oracle data pump export examples for all 5 modes.
(i) Full Database Export
$ expdp test_user/test123 full=y directory=export_dir dumpfile=expdp_fulldb.dmp logfile=expdp_fulldb.log
(ii) Schema Export
$expdp test_user/test123 schemas=test_user directory= export _dir dumpfile=expdp_test_user.dmp logfile=expdp_test_user.log
If you want to export more than one schema then specify the schema names separated by comma.
(iii)Table Export
$ expdp test_user/test123 tables=emp,dept directory= export _dir dumpfile=expdp_tables.dmp logfile=expdp_tables.log
You can specify more than one table.
(iv) Tablespace Export
$ expdp test_user/test123 tablespaces=test_user_tbs directory= export _dir dumpfile=expdp_tbs.dmp logfile=expdp_tbs.log
You can specify more than one tablespace.
(v) Transportable tablespace
$ expdp test_user/test123 transport_tablespaces=test_user_tbs transport_full_check=y directory= export _dir dumpfile=expdp_trans_tbs.dmp logfile=expdp_trans_tbs.log
Click here to learn more on Transportable Tablespace with examples.
Oracle Data Pump Import :-
Data Pump Import utility is used for loading an export dump files into a target system and we can load one or more files.
Copy the dump file to the target system where you to import.
1. Create directory object as SYS user.
SQL> create directory import_dir as '/oradata/import';
2. Grant Read/Write privilege on the Directory to the user, who invokes the Data Pump import.
SQL> grant read,write on directory import_dir to test_user;
3. Import the data using Data Pump Import.
Oracle data pump import examples for all 5 modes.
(i) Full Database Import
$ impdp test_user/test123 full=Y directory=imp_dir dumpfile=expdp_fulldb.dmp logfile=imp_fulldb.log
(ii) Schema Import
$impdp test_user/test123 schemas=test_user directory=imp_dir dumpfile=expdp_test_user.dmp Logfile=impdp_test_user.log
(iii) Table Import
$ impdp test_user/test123 tables=emp,dept directory=imp_dir dumpfile=expdp_tables.dmp logfile=impdp_tables.log
From 11g, you can reaname a table during the import
REMAP_TABLE=[schema.]old_tablename[.partition]:new_tablename
$ impdp test_user/test123 remap_table=test_user.emp:emp1 directory=imp_dir dumpfile=expdp_tables.dmp logfile=impdp_tables.log
Tables will not be remapped if they already exist even if the TABLE_EXISTS_ACTION is set to TRUNCATE or APPEND
(iv) Tablespace Import
$ impdp test_user/test123 tablespaces=test_user_tbs directory=imp_dir dumpfile=expdp_tbs.dmp logfile=impdp_tbs.log
Above example imports all tables that have data in tablespaces test_user_tbs and it assumes that the tablespaces already exist.
(v) Transportable Tablespace
Click here to to import data using Transportable Tablespace method.
Common Errors with Data pump import (impdp) utility:-
1. ORA-31631: privileges are required
ORA-39122: Unprivileged users may not perform REMAP_SCHEMA remapping
Cause: A user attempted to remap objects during an import but lacked the IMPORT_FULL_DATABASE privilege.
Action: Retry the job from a schema that owns the IMPORT_FULL_DATABASE privilege.
2. ORA-31631: privileges are required
ORA-39161: Full database jobs require privileges
Cause: Either an attempt to perform a full database export without the EXP_FULL_DATABASE role or an attempt to perform a full database import over a network link without the IMP_FULL_DATABASE role.
Action: Retry the operation in a schema that has the required roles.
3. ORA-01950: no privileges on tablespace "string"
Cause: User does not have privileges to allocate an extent in the specified tablespace.
Action: Grant the user the appropriate system privileges or grant the user space resource on the tablespace.
Click here to learn Roles/ privileges required for Data pump Export and Import.
4. import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
IMP-00017: following statement failed with ORACLE error 3113:
"BEGIN "
"SYS.DBMS_RULE_ADM.GRANT_SYSTEM_PRIVILEGE SYS.DBMS_RULE_ADM.CREATE_EVALUATIO" "N_CONTEXT_OBJ, 'SYS',TRUE);"
Cause: Import fails while executing the following command.
Action: Login as sys and run the following scripts
$ORACLE_HOME/rdbms/admin/dbmsread.sql
$ORACLE_HOME/rdbms/admin/prvtread.plb
5. Import failed with below errors
IMP-00003: ORACLE error 6550 encountered
ORA-06550: line 2, column 1:
PLS-00201: identifier 'CTXSYS.DRIIMP' must be declared
Cause: The user that you are importing does not have privileages on CTXSYS.DRIIMP package or CTXSYS user does not exists
Action: Create CTXSYS user or grant required permissions
Please see the Data pump Export and Import related documents:
Click here for Data Pump Export modes and Interfaces.
Regards,
Satishbabu Gunukula
http://www.oracleracexpert.com/
Subscribe to:
Post Comments (Atom)
Good information about export and import
ReplyDeletesimilar post here :
ReplyDeletehttp://chandu208.blogspot.com/2011/04/oracle-data-pump.html
Dear Satish Sir,
ReplyDeletewhile exporting tablespace iam getting following errors
ORA-39167 : tablespace exptbs was not found
ora- 31655 : no data or metadata obejects selected for job
however i have created the tablespace exptbs before exporting this tablespace also for avoiding privilege issue i am using system/manager login
expdp system/manager dumpfile=exptbs.dmp directory=export tablespaces=exptbs logfile=tbs.log
Please help me sir
Regards
Shabab Rafi
Can you provide the output of below SQL and also provide the expdp log
ReplyDeleteSQL> select tablespace_name,file_name from dba_data_files where tablespace_name like '%EXPTBS%';
I have dump file of remote server version 11.2.0.3.0 using expdp utility and
ReplyDeletethis dump i am importing into local server version 11.2.0.1.0 using impdp utility but
only 5 tables have getting following error :
ORA-31693: Table data object "BEAMNEW"."TRAIN_SAVEPLAN_DETAILS" failed to load/unload and is being skipped due to error:
ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00216: invalid character 0 (0x0)
Error at line 1
Kindly give me solution ASAP....Thanks in advance
Refer below metalink note, it should help
ReplyDeleteMOS Doc 1391688.1 (DataPump Import Of XMLTYPE Fails With Errors ORA-31693 ORA-29913 ORA-31011 ORA-19202 LPX-217 Invalid Character) may be helpful
Regards
Satish
Remote DBA Experts are the professionals who have skills and experience in database administration. Due to these people database administration gets security and it services as bug-free administration.
ReplyDeleteThanks for the information. Helped us to convince most on how this process works and what they could achieve by following these guidelines services web design
ReplyDeletedata pump export and import these are the awesome tools to change the location of huge data in small times. as this tool is best used for oracle data server change. we have oracle fusion tutorial
ReplyDeleteReally very informative and creative contents. This concept is a good way to enhance the knowledge.thanks for sharing please
ReplyDeletekeep it up
Oracle Training in Gurgaon
Hi Satish,
ReplyDeleteThank you! Thank you! Thank you! Your blog was a total game changer!
Hello people, So I am having trouble uploading a file to my bucket. I have the proper credentials all set. The problem is when I try doing a putRequest('bucket', 'keyName', 'fileFullPath') it will only save the file name and not the bytes. So I try sending it as an input stream to a byte array. This way it says there is no such file at specified location? I am running linux so It says no specified file at /home/{user}/pictures/example.jpg This is the problem I believe because it is searching from /home and not /
It was cool to see your article pop up in my google search for the process yesterday. Great Guide.
Keep up the good work!
Thanks a heaps,
Mouni
Full of heavenly and virtuosic words.
ReplyDeletecomo importar produtos
loving your posts.
ReplyDeleteHappy Independence Day SMS 2018
While seeing your way of writing I am dawn sure that you have a great scope as a content creator.
ReplyDeletePHP Training in Chennai
web designing course in chennai
JAVA Training in Chennai
Hadoop Training in Chennai
Selenium Training in Chennai
German Classes in chennai
Digital Marketing Course in Chennai
Digital Marketing Training in Chennai
The blog is very much informative... Thanks for your updates...
ReplyDeletedata analytics courses in bangalore
data analysis courses in bangalore
RPA training in bangalore
Selenium Training in Bangalore
Java Training in Madurai
Oracle Training in Coimbatore
PHP Training in Coimbatore
Very useful post thanks for sharing
ReplyDeleteblue prism training in chennai
The best Blog!!! Thanks for sharing with us... Waiting for your new updates.
ReplyDeleteOracle Training in Coimbatore
best oracle training institute in Coimbatore
Best Java Training Institutes in Bangalore
Hadoop Training in Bangalore
Data Science Courses in Bangalore
CCNA Course in Madurai
Digital Marketing Training in Coimbatore
Digital Marketing Course in Coimbatore
Thus, you ought to consider the above told factors before you go for the choice of logo configuration administration! logo design service
ReplyDeleteI feel satisfied to read your blog, you have been delivering a useful & unique information to our vision.keep blogging.
ReplyDeleteRegards,
Blue Prism Training in Chennai
UiPath Training in Chennai
Machine Learning course in Chennai
Blue Prism Training in Anna Nagar
Blue Prism Training in T Nagar
Blue Prism Training in Velachery
Blue Prism Training in Tambaram
Awesome Article!!!. Thanks for sharing this blog.
ReplyDeleteweb designing course with placement
php course in chennai
magento course in chennai
Mua vé máy bay tại Aivivu, tham khảo
ReplyDeletekinh nghiệm mua vé máy bay đi Mỹ giá rẻ
vé máy bay vinh tphcm
vé máy bay tphcm ra hà nội
vé máy bay huế đà lạt
đã có chuyến bay từ mỹ về việt nam chưa
dịch vụ xe đưa đón sân bay
gói combo flc quy nhơn
lebron 18
ReplyDeleteyeezy boost 350 v2
kyrie 5 spongebob
lebron 17 shoes
golden goose
kobe shoes
nike off white
birkin bag
moncler
jordan shoes