Oracle下 enterprise manager configuration assistant 里面,创建的只读用户,分配的系统权限 只有个 select any tabel可以对数据库里的某几张表创建一个只读用户吗再就是只读用户如何使用,怎么通过这个用户来 select table。。头有点晕,不知道问的着调么

解决方案 »

  1.   

    比如这里有两个用户user1和user2,user1下有一个表A,要想user2能查询A表
    1、登录user1,授权select给user2:grant select on A to user2
    2、登录user2,select * from user1.A;
    你也可以创建同义词 create or replace synonym A for user1.A;
      

  2.   

    谢谢楼上回答,我目前也只能做到这样, 这样的话,假如我要把user2给别人,别人想访问我的数据库表,就得连带user1 也告诉他。。
      

  3.   

    可以用 grant select on A to user2 with grant option
      

  4.   

    创建一个用户user,然后 grant select on table_name to user
    每张表都这样赋给权限
      

  5.   

     grant select any table  to user;
      

  6.   

    就给  grant select any table to username
      

  7.   

    谢谢楼上各位回答给了 select any table之后,如何使用这个 只读用户呢?再者能只对几张表单独建一个只读用户吗。
      

  8.   


    只要建立一个只读用户就可以了
    再赋予该用户connect权限grant connect to user可以参考下:http://blog.csdn.net/ojuju10/archive/2010/09/09/5874200.aspx
      

  9.   

    可以建个trigger禁止用户进行 create update delete truncate等操作.
      

  10.   

    grant select any table to user