在数据库用有一用户 A(方案A),A有数据表 t_1,t_2, 视图 v_1,v2, 我想再建一用户B,用户B只有对方案A中的视图v_1,v_2只有浏览的权限,
我的办法是这样的:重新建了一个用户,赋给UNDER ANY VIEW 这个权限,但无法访问A中的视图与数据表。
请教各位达人,如何去创建用户B,及设置他的权限!
也就是新增用户只能访问方案A中的视图,其它资源都不能访问。谢谢!

解决方案 »

  1.   

    grant select on v_1,v_2 to 新用户;
      

  2.   

    create一个user然后用grant就可以了吧
      

  3.   

    显示的授权grant select on v_1,v_2 to 新用户;
      

  4.   

    SQL> conn gkl/gkl@orcl
    Connected.
    SQL> create view testrol as select * from dept;View created.SQL> select * from testrol;    DEPTNO DNAME                        LOC
    ---------- ---------------------------- --------------------------
            11 Sales                        Texas
            22 Accounting                   Washington
            33 Finance                      MaineSQL> create user testrow identified by testrow default tablespace user
    create user testrow identified by testrow default tablespace user
                                                                 *
    ERROR at line 1:
    ORA-02155: invalid DEFAULT tablespace identifier
    SQL> create user testrow identified by testrow default tablespace userUser created.SQL> conn testrow/testrow@orcl
    ERROR:
    ORA-01045: user TESTROW lacks CREATE SESSION privilege; logon denied
    Warning: You are no longer connected to ORACLE.
    SQL> conn gkl/gkl@orcl
    Connected.
    SQL> grant select on testrol to testrow;Grant succeeded.SQL> conn testrow/testrow@orcl
    ERROR:
    ORA-01045: user TESTROW lacks CREATE SESSION privilege; logon denied
    Warning: You are no longer connected to ORACLE.
    SQL> conn gkl/gkl@orcl
    Connected.
    SQL> grant resource to testrow;Grant succeeded.SQL> conn testrow/testrow@orcl
    ERROR:
    ORA-01045: user TESTROW lacks CREATE SESSION privilege; logon denied
    Warning: You are no longer connected to ORACLE.
    SQL> conn gkl/gkl@orcl
    Connected.
    SQL> GRANT create session to testrow;Grant succeeded.SQL> conn testrow/testrow@orcl
    Connected.
    SQL> select * from gkl.testrol;    DEPTNO DNAME                        LOC
    ---------- ---------------------------- --------------------------
            11 Sales                        Texas
            22 Accounting                   Washington
            33 Finance                      MaineSQL> select * from gkl.dept;
    select * from gkl.dept
                      *
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL>
      

  5.   

    新建用户test,只给默认权限。
    grant select  on  view_name to test
    只有检索权限