Oracle PL/SQL:检索帐户的权限过程列表
我在这里和其他地方进行了研究,但没有找到以下问题的答案。
我想获取我的应用程序的 Oracle 帐户可用的所有过程的列表(据我所知,它们是一个包的一部分),并在 sqlplus 中尝试了以下命令:
SELECT * from user_procedures;
但是,这仅返回一行/过程,而实际上app 可能有 20 多个定期(成功)调用的过程。我可以查看源代码并提取所有存储过程名称,但我想使用上面的内容并查看它的工作原理,并作为进一步检查数据库以协助调试的基础(而不是总是需要例如,运行应用程序或编写测试客户端代码)。
上述语句是否仅返回我的帐户明确拥有的程序,还是应该显示该帐户有权访问的任何内容? [我对 Oracle 的具体功能不是很熟悉。]
我尝试过其他变体;例如,引用“dba_procedures”会导致“表或视图不存在错误”。
所有这些症状都是由于我的应用程序的 Oracle 帐户(我用于通过 sqlplus 连接)的权限有限造成的吗?
[背景:功能失调的环境——对 DBMS 及其外部所有者的直接访问极其有限,因此我希望能够增加对数据库设计的理解,并在没有帮助的情况下获得我需要的信息。]
I've researched here and elsewhere but haven't found an answer for the following.
I'd like to get a list of all procedures available to my application's Oracle account (AFAIK they're part of one package), and have tried the following command in sqlplus:
SELECT * from user_procedures;
However this only returns one row/procedure, when in fact the app has probably 20+ procedures it calls (successfully) on a regular basis. I can just look through the source code and extract all the stored procedure names, but I'd like to use the above and see it working, and as a basis for further examination of the db to assist in debugging (instead of always needing to run the app or write test client code, for example).
Does the above statement only return procedures my account owns explicitly, or should it show anything the account has access to? [I'm not very familiar with Oracle's specific features.]
I've tried other variations; for example, referencing 'dba_procedures' results in a 'table or view does not exist error.'
Are all of these symptoms the result of limited permissions on my app's Oracle account (which I'm using to connect via sqlplus)?
[Background: Dysfunctional environment--direct access to the DBMS and its external owners is extremely limited, so I'd like to be able to increase my understanding of the db design and get the information I need without assistance.]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用以下命令查看可以执行哪个独立过程:
但是,如果它们位于包中,您将无法直接看到过程名称,据我所知,但是您可以使用以下命令查看可以执行哪个包:
然后您可以 desc [ribe] 包以查看其中的各个程序和函数。我想这可能保存在数据字典中的某个地方,但不知道在哪里......
You can see which stand-alone procedure you can execute with this:
But if they are in a package you can't directly see the procedure names, AFAIK, but you can see which package you can execute with this:
And then you can desc[ribe] the package to see the individual procedures and functions within it. I guess that is probably held somewhere in the data dictionary but don't knwo where off-hand...
user_procedures
是一个系统视图,保存特定模式(用户)拥有的所有过程。不是授予模式(用户)执行的那些。您可以尝试
DBMS_METADATA.GET_GRANTED_DDL
存储过程。您可能会在那里找到一些有用的东西。但我不知道您需要什么样的权限才能在应用程序中运行它。希望有帮助。
user_procedures
is a system view that holds all the procedures owned by certain schema (user). Not the ones that the schema (user) is granted to execute.You can try
DBMS_METADATA.GET_GRANTED_DDL
stored procedure. You might find something useful there. But I don't know what kind of privileges you need to run it within your application.Hope it helps.
如果这些过程是程序包的一部分(即您通过 PACKNAME.PROCNAME 调用它们,那么您对程序包(而不是程序包内的各个过程)拥有全有或全无的授权。
If the procedures are part of a package (i.e. you're calling them by PACKNAME.PROCNAME, then you have an all-or-nothing grant on the package, not individual procedures within the package.