有没有办法在 Oracle Sql Developer 中找到用于创建用户的 ddl 脚本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15025762/
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-19 01:28:01  来源:igfitidea点击:

Is there a way to find ddl scripts for creating users in Oracle Sql Developer

oracleoracle-sqldevelopertoad

提问by Delmonte

In Toad, it's easy to look for a ddl script that creates a user with all its grants and roles:

在 Toad 中,很容易找到一个 ddl 脚本来创建一个用户及其所有授权和角色:

enter image description here

在此处输入图片说明

In Oracle SQL Developer, I find a similar option but it's not complete:

在 Oracle SQL Developer 中,我找到了一个类似的选项,但它并不完整:

enter image description here

在此处输入图片说明

Is there a way to have same Toad's information in Oracle SQL Developer?

有没有办法在 Oracle SQL Developer 中拥有相同的 Toad 信息?

回答by Alex Poole

It's a bit more convoluted, and might make more sense with pictures but I can't create those right now... but if you go to the 'View' menu and choose 'DBA' you get a second panel on the left (titled 'DBA', unsurprisingly).

它有点复杂,可能对图片更有意义,但我现在无法创建这些...但是如果您转到“查看”菜单并选择“DBA”,您会在左侧看到第二个面板(标题为“DBA”,不出所料)。

Click the green + button and pick your connection from the drop-down list in the dialog box; it will then appear under 'Connections' in that panel. Expand that connection, then 'Security', then 'Users'. You'll see all the database users listed.

单击绿色 + 按钮并从对话框的下拉列表中选择您的连接;然后它将出现在该面板的“连接”下。展开该连接,然后是“安全”,然后是“用户”。您将看到列出的所有数据库用户。

Right-click on a user and choose 'Create like...' from the contextual menu, which will give a new dialog that's very similar to the one you already found.

右键单击用户并从上下文菜单中选择“创建类似...”,这将提供一个与您已经找到的非常相似的新对话框。

Enter a user name and password to make the next step make more sense, then go go the 'SQL' tab, and you'll see something similar to what Toad produced.

输入用户名和密码以使下一步更有意义,然后转到“SQL”选项卡,您将看到类似于 Toad 生成的内容。

You can also use the DBMS_METADATApackage to extract the DDL manually; that has been covered hereand on DBA.SE.

您也可以使用该DBMS_METADATA包手动提取 DDL;已在此处DBA.SE介绍