So, the problem is that I have the .DMP file that was exported by a customer using exp or expdp. I want to get some of the .dmp properties, as I do in SQLServer using the following command:
RESTORE HEADERONLY FROM DISK = N"C:tempmyfile.bak";
The original tablespace and schema are the infos I need to remap to a new file without using any graphical tool such as SQL Developer, and then, with the right property values, import this into my environment programatically.
I tried to build a StreamReader using CSharp, and reading the dump, I get a lot of info but i didn’t see a pattern to get the schemas. Is it possible to run a command like “RESTORE HEADERONLY” in Oracle?
Advertisement
Answer
You should use SQLFILE parameter of impdp. Just put your dump into DATA_PUMP_DIR on the server and use impdp:
impdp hr DIRECTORY=DATAP_PUMP_DIR DUMPFILE=expfull.dmp SQLFILE=DATAP_PUMP_DIR:expfull.sql