简体   繁体   中英

How can I export table row as insert into format with exp command in oracle 11g?

exp usr/pss@db file=db.dmp full=y , this creates db.dmp backup file.

exp scott/tiger TABLES=emp QUERY=\"WHERE job=\'SALESMAN\' and sal \<1600\"

this one creates backup as EXPDAT.DMP.

https://docs.oracle.com/cd/B28359_01/server.111/b28319/exp_imp.htm#i1005842

How can I export table row as insert into format with exp command in oracle 11g? I wanted something like expdat.sql

insert into table(c1,c2,c3) values(1,2,3)

You can't. The EXP utility is designed for moving schemas and whole databases. Its file format is optimised for loading large amounts of data through the IMP utility. Same goes for Datapump.

Row-by-row inserts are not optimal for such a task. That's why EXP doesn't have the option. If you really need the insert scripts you can generate them yourself using the data dictionary. However it will be easier to use an IDE like PL/SQL Developer, which supports exporting tables' data in the form of INSERT statements.

If your goal is to get the insert statements for a table, then this question has been already answered here.

Generating sql insert into for Oracle

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM