我想在 oracle 10 G 中为整个模式生成 DDL?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2971758/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 20:45:39  来源:igfitidea点击:

I want to generate DDL for entire schema in oracle 10 G?

oracle

提问by NareshKumar

I am using Oracle 10G.

我正在使用 Oracle 10G。

I am new to oracle, I have little bit regarding dbms_metadata.get_ddl, now using this utility i want to generate a DDL for my entire schema.

我是 oracle 的新手,我对 dbms_metadata.get_ddl 有一点了解,现在使用这个实用程序我想为我的整个模式生成一个 DDL。

I mean what ever DDL operations done on my schema (testschema).

我的意思是在我的模式(testschema)上做过什么 DDL 操作。

Please help me out.

请帮帮我。

Thanks

谢谢

Nash.

纳什。

回答by Gary Myers

Suggest you look into EXPDP. That can produce a full export of all the objects (with or without data) in a schema.

建议你看看EXPDP。这可以生成模式中所有对象(带或不带数据)的完整导出。

If it is a fairly 'plain' schema (no exotic objects and dependencies), you could script something based on

如果它是一个相当“普通”的模式(没有外来对象和依赖项),您可以基于以下内容编写脚本

SELECT DBMS_METADATA.GET_DDL(object_type, object_name) FROM user_objects

回答by devio

Have a look at my command-line tool oraddlscript, which calls the GET_DLL() function for every object of a given user. The result can be written to one file per each object.

看看我的命令行工具oraddlscript,它为给定用户的每个对象调用 GET_DLL() 函数。结果可以写入每个对象的一个​​文件中。

回答by David Atkinson

A really simple way is to create a new blank schema, compare your existing schema (testschema) against this using Schema Compare for Oracle, and click on the Deployment button to generate the DDL automatically.

一个非常简单的方法是创建一个新的空白模式,使用Schema Compare for Oracle将现有模式 (testschema) 与此模式进行比较,然后单击部署按钮以自动生成 DDL。