Quota in Oracle Tablespaces

Tablespace Quota:


  1.  A tablespace is a logical storage unit within an Oracle database because it is not visible in the file system of the machine,
  2. The Tablespace quotas are used to assign users with limited size on tablespaces.
  3. Each user can be assigned a tablespace quota for any tablespace (except a temporary tablespace).



Assigning a quota does two things:

1. Users with privileges to create certain types of objects can create those objects in the specified tablespace.
2. Oracle limits the amount of space that can be allocated for storage of a user's objects within the specified tablespace to the amount of the quota.

  • By default, a user has no quota on any tablespace in the database. 
  • The default setting for every user's default tablespace is the SYSTEM tablespace. 
  • If a user does not create objects, and has no privileges to do so, this default setting is fine.
  • However, if a user creates any type of object, you should specifically assign the user a default tablespace.


create user with quota
CREATE USER jward
    IDENTIFIED BY aZ7bC2
    DEFAULT TABLESPACE data_ts
    QUOTA 100M ON test_ts
    QUOTA 500K ON data_ts
    TEMPORARY TABLESPACE temp_ts;

Alter the tablesapce quota:-

ALTER USER xyz QUOTA UNLIMITED ON tablespace_name;

altering user with quoto:-

ALTER USER avyrros
    IDENTIFIED EXTERNALLY
    DEFAULT TABLESPACE data_ts
    TEMPORARY TABLESPACE temp_ts
    QUOTA 100M ON data_ts

View the quota information:-
desc DBA_TS_QUOTAS

Issue on the quota:-

ERROR at line 1:
ORA-01950: no privileges on tablespace 'TTS'.

Note: If you grant or revoke the RESOURCE or DBA role to or from a user,
Oracle implicitly grants or revokes the UNLIMITED TABLESPACE system privilege to or from the user.

Comments

Popular Posts