In this article, we will try to resolve error ORA-01950:
no privileges on tablespace 'USERS' received during insert command,
I was able to create table under schema TECHNO_USER, but I
was not able to insert data into it (as shown below)
insert
into techno_user.dummy values (10)
*
ERROR
at line 1:
ORA-01950:
no privileges on tablespace 'USERS'
Then I checked default tablespace and quota on default tablespace or any other tablespace
SQL>
select username, default_tablespace from dba_users where
username='TECHNO_USER';
USERNAME DEFAULT_TABLESPACE
------------------------------
------------------------------
TECHNO_USER USERS
SQL>
select distinct tablespace_name, USERNAME from dba_ts_quotas where
USERNAME='TECHNO_USER';
no
rows selected
SQL>
As per output of above commands, we can say this user does not have quota on any tablespace, insert/update command will require quota on tablespace, so I have granted quota on tablespace USERS with below command
SQL>
alter user TECHNO_USER quota unlimited on USERS;
User
altered.
SQL>
select distinct tablespace_name, USERNAME from dba_ts_quotas where
USERNAME='TECHNO_USER';
TABLESPACE_NAME USERNAME
------------------------------
------------------------------
USERS TECHNO_USER
Also
read
changing default tablespace
After
doing this, I was able to resolve error and was able to insert data in the
table
SQL>
insert into techno_user.dummy values (10);
1
row created.
SQL>
insert into techno_user.dummy values (20);
1
row created.
SQL>