如何在Oracle建立用户仅能select所有表和视图,而不能insert和update

解决方案 »

  1.   

    //建立用户
    CREATE USER guest IDENTIFIED BY guest DEFAULT TABLESPACE APUBTBS;
    //授予guest用户创建session的权限,即登陆权限      
    grant create session to guest;
    //授予guest用户select所有table的权限
    grant select any table to guest;
    好像没有作用,提示“ORA-00942: table or view does not exist”
      

  2.   

    create user select_only identified by password;
    grant create session to select_only;
    grant select any table to select_only;
      

  3.   

    GRANT   SELECT   ON   表名   TO   用户名; 可以批量执行.示例如下....
    set   feedback   off       --不显示最后的   select   200   rows 
    set   pagesize   0           --不会每隔几条出现一个空行 
    set   heading   off         --不显示查询出来的表头 
    spool   c:\1.sql           --生成一个文件 
    select   'grant   select   on   '   ||   object_name   ||   '   to   b; '   
    from   user_objects   
    where   object_type   =   TABLE   or   object_type   =   VIEW; 
    spool   off 
      

  4.   

    Select * from  表名;
      

  5.   

    我知道了:
    应该Select * from  ACC.acct241000; 就可以了
    “用户名.表名”的方式 
      

  6.   

    还有一个问题:
    如何授予该用户exec所有存储过程的权限?