Yesterday, I was given a dump file which was generated from one of my colleague's machine. Since I am new to this import and export thing and I was not involved in the export process when the file was generated, I face the challenge on how to successfully import the dump file to my Oracle XE.
I do my research on the internet but I was overwhelmed with too much information (information overload), and in applying the crowded information that I have gathered, I encountered a bunch of errors some of which are listed below:
Error 1:
ORA-39001: invalid argument value ORA-39000: bad dump file specification ORA-39143: dump file "my_sample_dumpfile.dmp" may be an original export dump fileReason: I used impdp instead of imp command.
Error 2:
IMP-00002:failed to open expdat.dmp for read Import File:EXPDAT.DMP>Reason: I did not specify a full file path.
Error 3:
IMP-00013: only a DBA can import a file exported by another DBAReason: I did not specify '... as sysdba'
But finally, I was able to make it. How? Please see the steps below:
1) I created my target user using the Oracle XE browser base UI (Go To Database Home Page)
2) I run the following command in windows command prompt:
imp 'targetUser/password as sysdba' file=C:/my_sample_dumpfile.dmp fromuser=userWhoExported touser=targetUserwhat to expect as result would be something like this:
.importing USERWHOEXPORTED's object to TARGETUSER importing table ... importing table ... About to enable constraints... Import terminated successfully without warnings.
If you want to know the parameters of the imp command, type:
imp help=y
Now that I realized how easy it is to import a dump file, I became excited on how to do the exporting, and indeed, it was even easier. To generate a dump file, open your command prompt and enter something like the following:
exp username/password file=C:/exported_file.dmp owner=yourschemayourschema is the user/schema that you wanted to export which can be the same with username value.
Cheers!
No comments:
Post a Comment