如有个表空间下创建了3个用户
admin, user1 ,user21,如何让user1,user2可以查看admin用户创建的表,存储过程等和修改/删除表的数据.2,怎么做到user1,user2不能drop掉admin创建的表.

解决方案 »

  1.   

    conn as admin/password
    create table t(id int);
    grant select,update,delete on t to user1,user2;
    create or replace procedure p as
    begin
    dbms_output.put_line('test');
    end;
    /
    grant execute on p to user1, user2;conn as user1/password
    select * from admin.t;
    exec admin.p;这样就可以了.
      

  2.   


    测试在user1 下
    select * from admin.t for update;
    提示权限不足
      

  3.   


    不会吧,我做了一遍,没问题,你参考一下,还有问题的话,把你的测试过程贴出来.sys@ORA11GR2> conn / as sysdba
    已连接。
    sys@ORA11GR2> create user admin identified by oracle;用户已创建。sys@ORA11GR2> grant connect, resource to admin;授权成功。sys@ORA11GR2> create user user1 identified by oracle;用户已创建。sys@ORA11GR2> grant connect, resource to user1;授权成功。sys@ORA11GR2> conn admin/oracle
    已连接。
    admin@ORA11GR2> create table t(id int);表已创建。admin@ORA11GR2> insert into t values(111);已创建 1 行。admin@ORA11GR2> commit;提交完成。admin@ORA11GR2> grant select,update,delete on t to user1;授权成功。admin@ORA11GR2> conn user1/oracle
    已连接。
    user1@ORA11GR2> select * from admin.t for update;        ID
    ----------
           111user1@ORA11GR2>