如何将包访问权限给其它用户?用system建了程序包b,程序包里面有存储过程P另有用户user2010,请问如果把程序包的b访问权限给user2010,
让C#程序中
可以用user2010登录后可以执行"system.b.P"存储过程!

解决方案 »

  1.   

    用system登陆 执行下面授权就可以了
    grant execute on b to user2010
      

  2.   

    正解
    具体的你可以查下grant(赋权) 和 revoke (收回)
      

  3.   


    出错的提示
    ORA-00942: table or view does not exist
    ORA-06512: at "SYSTEM.b", line 24
    ORA-06512: at line 1
    我的web.config
    <add name="OracleConnString" connectionString="Server=127.0.0.1;Data Source=GXHURD;User Id=user2010;Password=aaa;" />
      

  4.   

    --刚搞递归去了
    grant select any table to user2010
    grant delete any table to user2010
    grant update any table to user2010
      

  5.   

    grant select any table to user2010
    grant delete any table to user2010
    grant update any table to user2010还是不行
      

  6.   

    报什么  干脆给个dba 呵呵
      

  7.   

    ORA-00942: table or view does not exist
    ORA-06512: at "SYSTEM.b", line 24
    ORA-06512: at line 1还是这个错啦!是否方便加下你!
      

  8.   

    1、将你过程中使用到的表,授权给user2010
    用system登陆 执行下面授权
    grant all on table_name to user20102、将过程的执行权限,授给user2010
    用system登陆 执行下面授权
    grant execute on b to user2010
      

  9.   

    补充一点:
    表授权之后,还要登录user2010给表创建同义词
    create sysnonym table_name for system.table_name
      

  10.   


    table_name这个表我是用user2010建的不存在权限问题的
      

  11.   


    table_name这个表我是用user2010建的不存在权限问题的
      

  12.   

    既然你过程中用的表是在本用户user2010下建的,那你在system账户下创建过程是否有对过程中表的执行权限啊?
      

  13.   

    用system登陆 执行下面授权就可以了
    grant execute any PROGRAM to user2010
      

  14.   

    grant create any table to global with admin option;
      

  15.   


    --你自己再去仔细看看 我刚小小的test下 ,
    SQL> show user
    USER 为 "SCOTT"   --dba权限
    SQL> create or replace package grants_pack is
      2  function fun_name(v_no dept.deptno%type) return varchar2;
      3  end;
      4  /程序包已创建。SQL> create or replace package body grants_pack as
      2  function fun_name(v_no dept.deptno%type) return varchar2
      3  as
      4  v_name dept.dname%type;
      5  begin
      6  select dname into v_name from dept where deptno=v_no;
      7  return v_name;
      8  end;
      9  end;
     10  /程序包体已创建。SQL> drop user test 
      2  /用户已删除。SQL> create user test identified by test
      2  default tablespace users
      3  /用户已创建。SQL> grant select any table to test
      2  /授权成功。SQL> grant alter any table to test
      2  /授权成功。SQL> grant delete any table to test
      2  /授权成功。SQL>  grant update any table to test
      2  /授权成功。SQL> grant connect,resource to test
      2  /授权成功。  1* grant execute on scott.grants_pack to test
    SQL> /授权成功。SQL> conn test/test
    已连接。
    SQL> show user
    USER 为 "TEST"SQL> declare
      2  name varchar2(100);
      3  begin
      4  name:=scott.grants_pack.fun_name(10);
      5  dbms_output.put_line(name);
      6  end;
      7  /PL/SQL 过程已成功完成。SQL> set serveroutput on
    SQL> /
    kkPL/SQL 过程已成功完成。
    SQL> select dname from scott.dept where deptno=10
      2  /DNAME
    --------------
    kk