Sonal
Sonal

Reputation: 21

Can't insert a row ORA-01950: no privileges on tablespace

Oracle 11G

I granted all the privileges to user

ALTER USER CWS_APP quota unlimited on CWS_APP;
grant RESOURCE,CONNECT,UNLIMITED TABLESPACE to CWS_APP;

But still unable to insert a row into table:

insert into CWS_RULES.pr4_base(pzinskey, pxcommitdatetime) values('abc',sysdate)
Error report -
SQL Error: ORA-01950: no privileges on tablespace 'CWS_RULES'
01950. 00000 -  "no privileges on tablespace '%s'"
*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.

Upvotes: 2

Views: 6839

Answers (1)

Justin Cave
Justin Cave

Reputation: 231651

The owner of an object owns the data and needs to have appropriate quota in the appropriate tablespace(s). The user that caused the insert is not relevant. That's a good thing-- it would be a royal pain if Oracle had to track which rows in a particular table were inserted by a particular user to count just those rows against its quota.

The table is owned by cws_rules. Therefore the cws_rules user needs to have enough quota on the cws_rules tablespace to accomodate the data. It doesn't matter what quota cws_app has because it doesn't own the data.

Upvotes: 2

Related Questions