[英]Oracle PLS-00201 error in procedure across users
I have an oracle database shared by both an internal application and our website. 我有一个由内部应用程序和我们的网站共享的oracle数据库。
I know very little about oracle so will explain things how I understand it.. 我对oracle知之甚少,因此将解释我的理解方式。
The database has two users APPUSER and WEBUSER when logged in (using Oracle SQL Developer) as APPUSER you can see all the tables in the database. 该数据库具有两个用户APPUSER和WEBUSER(使用Oracle SQL Developer)作为APPUSER登录时,您可以看到数据库中的所有表。 When logged in as WEBUSER you cannot see anything but a couple of procedures, the APPUSER cannot see these procedures.
以WEBUSER身份登录时,除了几个过程外,您看不到其他任何东西,APPUSER无法看到这些过程。
One procedure starts with: 一个过程开始于:
create or replace PROCEDURE "UPDATE_DETAIL"
(v_ref IN APPUSER.DETAILS.REFERENCE%TYPE
,v_desc IN APPUSER.DETAILS.DESCRIPTION%TYPE
...
Line 2 has a red squiggly with "PLS-00201: identifier APPUSER is not declared" 第2行带有红色的波浪形,带“ PLS-00201:未声明标识符APPUSER”
I believe it has the "APPUSER.TABLE.COLUMN" because WEBUSER does not have direct access to the tables. 我相信它具有“ APPUSER.TABLE.COLUMN”,因为WEBUSER无法直接访问表。
I have executed GRANT ALL ON UPDATE_DETAIL TO APPUSER
logged in as WEBUSER, but that did not fix the issue, WEBUSER is the owner of the procedure, but does not have anything listed in the Grants list (I assume because owner just has the rights be default?) 我已执行以
GRANT ALL ON UPDATE_DETAIL TO APPUSER
以WEBUSER GRANT ALL ON UPDATE_DETAIL TO APPUSER
登录,但这不能解决问题,WEBUSER是该过程的所有者,但Grants列表中未列出任何内容(我想是因为所有者只具有权利默认?)
The Dependencies list for the procedure is also empty, but cannot find how to manually add one to it. 该过程的“依赖项”列表也为空,但是找不到如何手动向其添加一个。
Not sure what else to try to fix this error. 不知道还有什么可以尝试解决此错误。
Thanks. 谢谢。
If you want a procedure owned by WEBUSER
(and I believe from your description that UPDATE_DETAIL
is owned by WEBUSER
) to reference objects owned by APPUSER
, you would need to grant WEBUSER
privileges on those objects. 如果要让
WEBUSER
拥有的WEBUSER
(并且从您的描述中相信UPDATE_DETAIL
由WEBUSER
拥有)来引用APPUSER
拥有的APPUSER
,则需要为这些对象授予WEBUSER
特权。 For example, as APPUSER
例如,以
APPUSER
GRANT SELECT ON appuser.details
TO webuser;
This assumes that WEBUSER
only needs to SELECT
from the APPUSER.DETAILS
table. 这假定
WEBUSER
只需要从APPUSER.DETAILS
表中进行SELECT
。 If your procedure needs to INSERT
, UPDATE
, or DELETE
data in that table, then WEBUSER
would need to be granted additional privileges on the APPUSER.DETAILS
table. 如果您的过程需要对该表中的
INSERT
, UPDATE
或DELETE
数据进行操作,则需要为WEBUSER
授予APPUSER.DETAILS
表其他特权。 You'd need to make similar grants for every table in APPUSER
that the WEBUSER
user needs to reference. 您需要为
WEBUSER
用户需要引用的APPUSER
中的每个表进行类似的授予。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.