使用 DBMS_METADATA.GET_DDL 需要什么 Oracle 权限?

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

What Oracle privileges do I need to use DBMS_METADATA.GET_DDL?

oraclemetadataprivilege

提问by

(Excuse any ignorance of mine here - I'm not a seasoned Oracle user.)

(请原谅我的无知 - 我不是经验丰富的 Oracle 用户。)

I'm attempting to use the DBMS_METADATA.GET_DDL function (in conjunction with ALL_OBJECTS or some such) to get the DDL for all of the tables in a particular schema. When I do this (either for all objects or for a single specific object) I get an ORA-31603 error ("object "FOO" of type TABLE not found in schema "SCHEMA").

我正在尝试使用 DBMS_METADATA.GET_DDL 函数(与 ALL_OBJECTS 或类似函数结合使用)来获取特定模式中所有表的 DDL。当我这样做时(对于所有对象或单个特定对象),我收到一个 ORA-31603 错误(在模式“SCHEMA”中找不到类型为 TABLE 的“对象“FOO”)。

I assume this means that the user I'm logged in with doesn't have whatever privilege is necessary to read the metadata needed for GET_DDL. What privilege is this that's needed? Is there a way when logged in to confirm that the current user does/does not have this privilege?

我认为这意味着我登录的用户没有读取 GET_DDL 所需的元数据所需的任何权限。这是需要什么特权?有没有办法在登录时确认当前用户有/没有这个权限?

thanks! Lee

谢谢!李

采纳答案by Joseph Bui

Read this document, but basically, you need SELECT_CATALOG_ROLE

阅读此文档,但基本上,您需要 SELECT_CATALOG_ROLE

http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_metada.htm#i1016867

http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_metada.htm#i1016867