sqlplus /nolog
conn /as sysdba;
SQL> create or replace trigger no_droping_for_you before
2 drop on database
3 begin
4 if(user='ZHANGBIN') then
5 raise_application_error( -20001, 'No dropping allowed');
6 end if;
7 end;
8 /
Trigger created.
SQL> connect zhangbin
Enter password:
Connected.
SQL> drop table t;
drop table t
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-20001: No dropping allowed
ORA-06512: at line 3