ORA-01950: no privileges on tablespace

参考:https://blog.csdn.net/ch7543658/article/details/40512045

问题描述:在想刚创建的表中插入数据竟然报:ORA-01950: no privileges on tablespace

解决办法:使用sys用户添加用户在某个表空间上的配额,具体如下:

语法执行:

  1.  
    SQL> select count(*) from tab_test;
  2.  
     
  3. COUNT(*)
  4. ----------
  5. 0
  6.  
     
  7.  SQL> insert into tab_test values(1);
  8.  insert into tab_test values(1)
  9.   *
  10.  ERROR at line 1:
  11.  ORA-01950: no privileges on tablespace 'CHENHAO_TBS'
  12.  
     
  13.  SQL> conn / as sysdba
  14.  Connected.
  15.  
     
  16.  SQL> alter user "CHENHAO" quota 50M on "CHENHAO_TBS";
  17.  
     
  18.  User altered.
  19.  
     
  20.  conn chenhao/oracle
  21.  Connected.
  22.  SQL> CREATE OR REPLACE PROCEDURE sp_test
  23.   AS 
  24.   BEGIN 
  25.  FOR I IN 1 .. 100000 LOOP 
  26.   INSERT INTO tab_test VALUES (I); 
  27.   6  END LOOP; 
  28.   7  COMMIT; 
  29.  8  END; 
  30.  9  / 
  31.   
  32.  Procedure created.
  33.   
  34.  SQL> exec sp_test;
  35.   
  36.  PL/SQL procedure successfully completed.
posted @ 2020-08-25 16:07  小窝蜗  阅读(1151)  评论(0编辑  收藏  举报