Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to export an Oracle 11g database as a series of SQL statements via the command line. I'd like the functionality of SQL Developer (the process described here but via the command line.

Note that the data must be in a flat file and not a binary format (as with imp/exp or impdp/expdb (Datapump)).

Is this possible? If so, how?

share|improve this question
May I ask why you need to do this? There is no out-of-the-box way to do this from the command line. – Phil Mar 26 '12 at 8:23

Depends what you mean by 'from the command line', but you can generate the DDL via the dbms_metadata package (see here for example).

If you want the data as well then you'd then have to roll your own, unless you find a generic script somewhere on the web. Automating the script with dynamic SQL and the data disctionary is certainly possible - it's what SQL*Developer must do ultimtately - it will just need some work to get right, and to handle things like embedded quotes. No quick fix I'm afraid.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.