目前,Oracle 11.1数据库中大约有30个表.
有没有办法用一个命令生成所有ddl? (或者一些命令?)
编辑:
根据下面的建议,我试过:
SELECT dbms_Metadata.get_ddl( 'TABLE',table_name,owner ) FROM all_tables;
得到了:
ORA-31603: object "HS_PARTITION_COL_NAME" of type TABLE not found in schema "SYS" ORA-06512: at "SYS.DBMS_SYS_ERROR",line 105 ORA-06512: at "SYS.DBMS_MetaDATA",line 3241 ORA-06512: at "SYS.DBMS_MetaDATA",line 4812 ORA-06512: at line 1 31603. 00000 - "object \"%s\" of type %s not found in schema \"%s\"" *Cause: The specified object was not found in the database. *Action: Correct the object specification and try the call again.
很明显,我不了解dbms_Metadata有一些非常基本的东西.