Hi Tom,

I wrapped several stored procedures in a package and grant execute privilege on
this package to a role, then everybody having this role would be able to run ANY
PROCEDURES IN THIS PACKAGE. This is not exactly what I want. Is there any
CLEAN way to do the following:

create or replace package pkg_my
as
procedure a;
procedure b;
procedure c;
end;

grant execute on pkg_my.A to USER1;—illegal
grant execute on pkg_my.B to USER2;—illegal
....

I want to be able to assign different execute privilege against different
procedures IN A PACKAGE to different users.

Thanks,

译文:
你好,TOM
我加密了包里面的几个存储过程并且把这个包的执行权限授予一个角色,然后具有这个角色的所有人都能够执行包中的任何存储过程。
这个不是我真正想要的结果,有没有简洁的方法能像下面一样:
create or replace package pkg_my
as
procedure a;
procedure b;
procedure c;
end;

grant execute on pkg_my.A to USER1;—非法命令
grant execute on pkg_my.B to USER2;—非法命令
....
我希望能够将包中不同的存储过程的执行权限赋予不同的用户。

and we said…

You’ll need two packages in order to segregate them out.

The PACKAGE it THE OBJECT. It is what can be granted on (consider the confusion
of:

create package p
as
procedure a;
procedure a( x in date );
procedure a( x in number );
end;

grant execute on p.a to …

now, what does that mean? In anycase, you cannot do it.
Reviews
GOTO a page to Bookmark Review | Bottom | Top
how to create two package ? October 30, 2002
Reviewer: A reader

答:要分开他们,你需要分开成两个包。包是一个对象,只能整体授予权限(考虑一下可能引起的混淆:
create package p
as
procedure a;
procedure a( x in date );
procedure a( x in number );
end;
grant execute on p.a to …

这样是赋予的那一个呢?所以你不能这么做。

I already have one package with 10 procs.

how can I create another pkg that so that I can grant only
5 of them to the another user ?

问:我现在已经有一个包含10个存储过程的包,我怎么才能另外创建一个包使我能够将其中5个存储存储过程的
执行权限赋予另外一个用户呢?

Followup:
umm, just create another package? not sure what you are asking here really.

答:就是创建一个包?不确定你想问的是什么。

GOTO a page to Bookmark Review | Bottom | Top
Is it still true in 10g ? December 21, 2005
Reviewer: W from US

Tom,
We have packages that a new application will use. But we only want the new
application to be able to execute some stored procedures in the packages, not
all of them. Since multiple applications using the packages, separating them
into new packages requires a lot effort on application code. Is there a better
way to do it? We are currently on 8.1.7.4, but will migrate to 10g next year.

Thanks.

问:Tom,我们有一些包给新的应用程序使用,但是我们希望新的程序只能执行其中的一些存储过程,而不是全部。
因为有多个应用程序使用这些包,把他们分割到新的包需要在程序上作较大改动。有没有更好的办法?我们现在使用
的是8.1.7.4,但明年将移植到10g

Followup:
the “exposure” of routines has not changed from release to release.

答: 不同版本的“对象完整性”规则不会发生变化

http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:5180959148368



 

4 Comments to “AskTom翻译一篇–package privilige”


  1. prudence — July 2, 2006 @ 1:06 pm

    It looks like you really had a nice time. nokia6630

  2. Erika — March 14, 2007 @ 11:38 pm

    Good site! I found in google.com t

  3. dtmdvlkitf — June 19, 2007 @ 8:24 am

    Hello! Good Site! Thanks you! jzfgteijfbavnp

  4. Humberto — June 25, 2007 @ 3:42 pm

    Good site I found your site in the google.r



Write a comment

You need tologin.