oracle-databasecsvtextsasdmp

Need to import .dmp file into Oracle Express, export it as a flat CSV or TXT file for importation into SAS


Does anyone know how to write a specific command line that imports a .dmp file into an Oracle Express database, and then exports the data as a CSV file?

Any help would be greatly appreciated. Thank you!


Solution

  • Import using impdp:

    impdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR dumpfile=EMP_DEPT.dmp logfile=impdpEMP_DEPT.log
    

    Then spool to csv:

    set heading off
    spool myfile.csv
    select col1|','||col2 from my_tables;
    set colsep ','
    select * from my_table;
    spool off;
    

    Follow below links for help.

    import: https://oracle-base.com/articles/10g/oracle-data-pump-10g spool to csv: http://www.dba-oracle.com/t_export_to_csv_file.htm