问题
I have an Oracle 10g database, and now I need to export, if possible, only the schema.
(Only table structures with index etc... without data!)
Is this possible with exp/imp or do I need expdp/impdp?
Greets
回答1:
It is possible with exp, using parameter ROWS=N.
10g documentation is here.
Data pump is preferred these days though; the equivalent parameter is CONTENT=METADATA_ONLY.
回答2:
Check scheme2ddl tool from oracle-ddl2svn bundle.
scheme2ddl is command line utility for export oracle schema in set of ddl scripts. provide lot of configurations via basic command line options or advanced XML configuration
回答3:
If you are only interested in the table definitions with their constraints and indexes you can also do an export using Oracle's SQL Developer.
In SQL Developer 4.0, this is under Tools | Database Export... On the first page of the wizard, ensure that "Export DDL" is checked and "Export Data" is not. Note that this allows you to export all types of database objects; you can limit it to just tables and indices if you like on the "Object Types" page.
来源:https://stackoverflow.com/questions/4049657/oracle-exporting-only-schema