Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

convert Oracle .dmp file to CSV/TSV

I am wondering if there are any tools to convert Oracle .dmp file to CSV/TSV, or other kinds of text format which is easy to be parsed by Python or other script language? Any tool running on Windows or Linux is fine. I prefer when this tool preserves unicode characters.

like image 798
Lin Ma Avatar asked Oct 23 '25 20:10

Lin Ma


1 Answers

convert Oracle .dmp file to CSV/TSV

The only way is to first import the data into the database using IMPDP or IMP depending on the database version.

For example,

impdp username/password@sid DIRECTORY=dmpdir DUMPFILE=dumpfile.dmp

Once your import is done, you can SPOOL the data as CSV file.

For example,

SET colsep ,
spool D:\test.csv
SELECT ename FROM emp;
spool off

There are many ways to spool the data as comma-delimited, have a look at this answer.

like image 85
Lalit Kumar B Avatar answered Oct 25 '25 10:10

Lalit Kumar B