Reputation: 819
I am created a new table, wrote package & gave execute access to one user for this package. Is it necessary to create rollback script for these tasks?
When the table is dropped the trigger will be dropped. AM i right?
When the package is dropped the execute rights will automatically get dropped. AM i right?
Upvotes: 0
Views: 585
Reputation: 60292
Yes, a trigger must always be for a table or view - so if you drop the table (or view, as the case may be), all triggers on that object will be automatically dropped as well.*
Yes, privileges are always on an object - if you drop the object (e.g. a package), all privileges on that object will be lost as well.
If you subsequently CREATE
a new object with the same name, the old triggers and privileges will not magically reappear - you would have to add them manually.
Alternatively, if you CREATE OR REPLACE
a package, the privileges on the original package will remain. Similarly, if you ALTER
a table, the triggers will not be affected.
* In Oracle 11g, by default a dropped table gets moved to the Recycle Bin. If the table had any triggers, they get moved to the Recycle Bin as well.
Upvotes: 1