User without DROP table privilege [message #126525] |
Tue, 05 July 2005 06:51 |
reemagupta18
Messages: 3 Registered: February 2005 Location: Delhi
|
Junior Member |
|
|
Hi ,
I am in the process of creating users for the database and due to some configuration issues I need to create users which have all the rights except dropping the table.
Can anybody give me any pointers in this direction.It's urgent.
Thanks
Reema
|
|
|
Re: User without DROP table privilege [message #126548 is a reply to message #126525] |
Tue, 05 July 2005 09:41 |
Frank Naude
Messages: 4587 Registered: April 1998
|
Senior Member |
|
|
Hi,
The best solution would be to create a schema level trigger to prevent it. Here is a quick example:
SQL> CREATE OR REPLACE TRIGGER drop_trigger BEFORE DROP ON scott.SCHEMA
2 BEGIN
3 RAISE_APPLICATION_ERROR(-20000, 'You cannot drop anything, ask your DBA.');
4 END;
5 /
Trigger created.
SQL> CONNECT scott/tiger
Connected.
SQL>
SQL> DROP TABLE emp;
DROP TABLE emp
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-20000: You cannot drop anything, ask your DBA.
ORA-06512: at line 2
Best regards.
Frank
|
|
|
|
|