ORA-01950: no privileges on tablespace
参考:https://blog.csdn.net/ch7543658/article/details/40512045
问题描述:在想刚创建的表中插入数据竟然报:ORA-01950: no privileges on tablespace
解决办法:使用sys用户添加用户在某个表空间上的配额,具体如下:
语法执行:
-
SQL> select count(*) from tab_test;
-
-
COUNT(*)
-
----------
-
0
-
-
SQL> insert into tab_test values(1);
-
insert into tab_test values(1)
-
*
-
ERROR at line 1:
-
ORA-01950: no privileges on tablespace 'CHENHAO_TBS'
-
-
SQL> conn / as sysdba
-
Connected.
-
-
SQL> alter user "CHENHAO" quota 50M on "CHENHAO_TBS";
-
-
User altered.
-
-
conn chenhao/oracle
-
Connected.
-
SQL> CREATE OR REPLACE PROCEDURE sp_test
-
2 AS
-
3 BEGIN
-
4 FOR I IN 1 .. 100000 LOOP
-
5 INSERT INTO tab_test VALUES (I);
-
6 END LOOP;
-
7 COMMIT;
-
8 END;
-
9 /
-
-
Procedure created.
-
-
SQL> exec sp_test;
-
-
PL/SQL procedure successfully completed.