ORA-01950: no privileges on tablespace ‘USERS’
While inserting data into the table we are getting the following error:
SQL> insert into testing values (1,'RAM');
insert into testing values (1,'RAM')
*
ERROR at line 1:
ORA-01950: no privileges on tablespace 'USERS'
ORA Error:
Error: ORA-01950: no privileges on tablespace “string”
Cause: User does not have privileges to allocate an extent in the specified tablespace.
Action: Grant the user the appropriate system privileges or grant the user space resource on the tablespace.
Solution:
You need to assign the permission to the user on the tablespace mentioned in error:
1. Login with sysdba user:
SQLPLUS / as sysdba
2. Assign the Privileges on the table-space.
I am using TEST user.
SQL> grant unlimited tablespace to test;
Grant succeeded.
3. You can also assigned with ALTER user command.
ALTER USER username QUOTA 500M ON tablespace_name
ALTER USER username QUOTA UNLIMITED ON tablespace_name;
4. After assign then verify with insert query and query to DBA_TS_QUOTAS view.
-- insert
SQL> insert into testing values (1,'RAM');
1 row created.
SQL> insert into testing values (2,'SHAM');
1 row created.
-- View
select (bytes)/1024/1024,MAX_BYTES/1024/1024 from dba_ts_quotas where username='TEST';