December 2010
Intermediate to advanced
451 pages
11h 16m
English
You want to trigger on an event related to a change in a database schema. For example, if someone drops a database table on accident, it could cause much time and grief attempting to restore and recover data to its original state. Rather than doing so, you want to place a control mechanism into the database that will ensure that administrators cannot delete essential tables.
Use a PL/SQL database trigger to raise an exception and send an alert to the DBA if someone attempts to drop a table. This will prevent any tables from inadvertently being dropped, and it will also allow the administrator to know whether someone is potentially trying to drop tables.
CREATE OR REPLACE TRIGGER ddl_trigger ...Read now
Unlock full access