grant select, insert on 表 to 用户名;

解决方案 »

  1.   

    我是不想给Select权限,只给Insert权限,这样为什么不能实现Insert操作?
      

  2.   

    revoke select on 表 to 用户名;
    grant insert on 表 to 用户名;
      

  3.   

    我是不想给Select权限,只想给Insert权限。
    这样也无法实现Insert操作,只有多给一个select权限才能Insert, why?
      

  4.   

    SQL> conn scott/tiger
    已连接。
    SQL> grant select on scott.emp to test;授权成功。SQL> revoke select on scott.emp from test;撤销成功。SQL> grant insert on scott.emp to test;授权成功。SQL> conn test/test
    ERROR:
    ORA-01045: 用户 TEST 没有 CREATE SESSION 权限;登录被拒绝
    警告: 您不再连接到 ORACLE。
    SQL> conn sys/sys as sysdba
    已连接。
    SQL> grant create session to test;授权成功。SQL> conn test/test
    已连接。
    SQL> desc emp;
    ERROR:
    ORA-04043: 对象 emp 不存在
    SQL> desc scott.emp;
     名称                                      空?      类型
     ----------------------------------------- -------- -------------------- EMPNO                                     NOT NULL NUMBER(4)
     ENAME                                              VARCHAR2(10)
     JOB                                                VARCHAR2(9)
     MGR                                                NUMBER(4)
     HIREDATE                                           DATE
     SAL                                                NUMBER(7,2)
     COMM                                               NUMBER(7,2)
     DEPTNO                                             NUMBER(2)SQL> insert into scott.emp values(100,'a','','','',100,10,200);
    insert into scott.emp values(100,'a','','','',100,10,200)
                                                         *
    ERROR 位于第 1 行:
    ORA-01438: 值大于此列指定的允许精确度
    SQL> insert into scott.emp values(100,'a','','','',100,10,20);已创建 1 行。SQL> select * from scott.emp;
    select * from scott.emp
                        *
    ERROR 位于第 1 行:
    ORA-01031: 权限不足
    SQL>