如何列出 Oracle DB 中的所有上下文命名空间?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8295438/
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
How do I list all context namespaces in Oracle DB?
提问by AppleGrew
If I create a context namespace:-
如果我创建一个上下文命名空间:-
CREATE OR REPLACE CONTEXT hr_security
USING hr.pkg_security
ACCESSED GLOBALLY;
How can I list all such namespaces and look up their properties. For example, hr_security
can be access globally and can be set from pkg_security
package.
我怎样才能列出所有这样的命名空间并查找它们的属性。例如,hr_security
可以全局访问,可以从pkg_security
包中设置。
回答by Justin Cave
You can query the DBA_CONTEXT
(or [ALL_CONTEXT][1]
) view depending on your privileges and what contexts you're looking at. ALL_CONTEXT
will list all the contexts that have attributes set in the current session. DBA_CONTEXT
lists all the contexts in the database. However, you need to have additional privileges to be able to query the DBA_CONTEXT
view (the SELECT ANY DICTIONARY
privilege or SELECT_CATALOG_ROLE
role would be more than sufficient but you can also be granted access to that view specifically)
您可以根据您的权限和您正在查看的上下文查询DBA_CONTEXT
(或[ALL_CONTEXT][1]
) 视图。 ALL_CONTEXT
将列出在当前会话中设置了属性的所有上下文。 DBA_CONTEXT
列出数据库中的所有上下文。但是,您需要具有额外的权限才能查询DBA_CONTEXT
视图(SELECT ANY DICTIONARY
权限或SELECT_CATALOG_ROLE
角色已经绰绰有余,但您也可以被授予对该视图的特定访问权限)
SELECT namespace,
schema,
package,
type
FROM dba_context
will have a row for the HR_SECURITY
namespace showing that it is associated with the PKG_SECURITY
package with a TYPE
of ACCESSED GLOBALLY
.
HR_SECURITY
命名空间将有一行显示它PKG_SECURITY
与具有TYPE
of的包相关联ACCESSED GLOBALLY
。