oracle 将规范和正文导出到单个文件中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10953222/
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
Export the specification and body in a single file
提问by HY.
I am using SQL Developer 3.0.04 and am trying to export a package. I have 2 questions:
我正在使用 SQL Developer 3.0.04 并尝试导出包。我有两个问题:
Can I export both package specification and body in a single export (resulting in 1 export.sql file)?
The export.sql file is somewhat compressed, any way I can have it in text format with linefeeds etc so I can read it better?
我可以在一次导出中同时导出包规范和正文吗(生成 1 个 export.sql 文件)?
export.sql 文件有点压缩,我可以用带有换行符等的文本格式将它压缩,这样我就可以更好地阅读它吗?
回答by JWK
In SQL-Developer right click the Package Specification and select Save Package Spec and Body...
This will generate one file with both the spec and body.
在 SQL-Developer 中,右键单击包规范并选择Save Package Spec and Body...
这将生成一个包含规范和正文的文件。
回答by HY.
Instead of navigating to the package object and doing export there, use \Tools\Database Export to generate a single file.
不要导航到包对象并在那里进行导出,而是使用 \Tools\Database Export 生成单个文件。
回答by hbpatrick81
You have to right click on the package and select : "Save Package Spec And Body"
您必须右键单击包并选择:“保存包规范和正文”
回答by Pawel Solarski
Yes you can. Just navigate to package body -> export -> check "Include Dependants"
是的你可以。只需导航到包体 -> 导出 -> 选中“包含依赖项”
As a result, export.sql will be generated with package declaration and package body.
因此,export.sql 将与包声明和包体一起生成。
Additionally, you will get all DDL of used tables in package extra (you cannot switch it off); this can be treated as advantage or disadvantage of this method.
此外,您将在包 extra 中获得已使用表的所有 DDL(您无法将其关闭);这可以被视为这种方法的优点或缺点。
However, if you plan to export packages and tables anyway, you may take use of the above method, and after that use sql scripts generated by exporting tables+data, that will recreate the tables anyway.
但是,如果您打算导出包和表,则可以使用上述方法,然后使用导出表+数据生成的sql脚本,无论如何都会重新创建表。