create or replace trigger check_beforedrop
before drop on database
declare
oname char(20);
begin
select objectname into oname from secured_objects
where upper(objectname)=ora_dict_obj_name;
if sql%found then
RAISE_APPLICATION_ERROR(-20001,'You did not want this object to be dropped');
end if;
exception
when no_data_found
then dbms_output.put_line('This object will be dropped');
end;
After this trigger is created, you cannot drop an object whose name is entered in the table. In the case where you need to drop an object, remove the entry from the secured_objects table.
Remarkable topic
RépondreSupprimerHi
RépondreSupprimerawesome post - i'm creating video about it and i will post it to youtube !
if you wana to help or just need a link send me email !
hm. hope to see same more info. Can we speake about it?
RépondreSupprimer