Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can I prevent DB users creating tables?

Christopher76Oct 8 2019 — edited Oct 14 2019

I've created the following user (in Oracle 12c), assuming they wouldn't be able to create new tables in the schema...

CREATE USER myuser

  IDENTIFIED BY somePassword

  DEFAULT TABLESPACE myTablespace

  QUOTA UNLIMITED on myTablespace;   

GRANT CONNECT TO myuser;

GRANT CREATE SESSION TO myuser;

GRANT UNLIMITED TABLESPACE TO myuser;

GRANT SELECT ANY TABLE TO myuser;

This user can "create table" which wasn't granted.

I've tried the following...

REVOKE create table from myuser;

...but I get ...

ORA-01952: system privileges not granted to 'myuser'

...which is because they don't have that grant.  I can grant them "create table" and then revoke works - but it appears pointless, as the user can create tables either way.

Is it possible to prevent "create table" for my user?

Any help appreciated.

This post has been answered by John Thorton on Oct 8 2019
Jump to Answer
Comments
Post Details
Added on Oct 8 2019
7 comments
1,606 views