重庆思庄Oracle、Redhat认证学习论坛

标题: 插入数据时报错 ORA-01950: no privileges on tablespace 'T1' [打印本页]

作者: jiawang    时间: 2020-4-3 17:40
标题: 插入数据时报错 ORA-01950: no privileges on tablespace 'T1'
SQL> create table wangjia(id number,name varchar2(10));
Table created.

SQL> insert into wangjia values (1,'LISA');
insert into wangjia values (1,'LISA')
            *
ERROR at line 1:
ORA-01950: no privileges on tablespace 'T1'

报错原因:没有分配表空间配额

查看当前连接用户
SQL> show user;
USER is "C##T1"

解决办法:使用sys用户添加用户在表空间上的配额
[oracle@strong ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Fri Apr 3 17:39:47 2020
Copyright (c) 1982, 2016, Oracle.  All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL>  alter user c##t1 quota unlimited on t1;
User altered.

再切换用户插入表数据:
SQL> conn c##t1/oracle;
Connected.
SQL> insert into wangjia values (1,'LISA');

1 row created.

SQL> insert into wangjia values (2,'TOM');

1 row created.

SQL> select * from wangjia;

        ID NAME
---------- ----------
         1 LISA
         2 TOM







欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2