How Does Oracle remove the drop permission of some users!

Source: Internet
Author: User

Sometimes, during project development, database tables may be deleted by mistake. To avoid this problem, how to strictly control whether a user cannot perform the drop permission on his/her own database requires relevant settings. Because the default connect permission also has the table structure of the drop user, you can use product_user_profile to restrict only SQL * Plus operations, but not other third-party Oracle connection tools. The most effective method is to create a trigger under the System user.

The details are as follows:

This trigger is created under the System user, and several temp users cannot DOP their own objects. You can modify the trigger by referring to it.

Create or replace trigger "trg_deny_drop_ubisp" before
Drop on Database
Begin
If (ora_dict_obj_owner = 'temp _ ods 'or
Ora_dict_obj_owner = 'temp _ mid 'or
Ora_dict_obj_owner = 'temp _ DW 'or
Ora_dict_obj_owner = 'temp _ report' or
Ora_dict_obj_owner = 'temp _ web' or
Ora_dict_obj_owner = 'temp _ report_new ')
And ora_login_user <> 'temp _ admin' --- excluded users
And ora_dict_obj_type = 'table' and ora_dict_obj_name not like '% old' then -- tables that can be deleted by Restricted Users
Raise_application_error (-20010, 'You cannot create/delete any table under the temp _ % USER .');
End if;
End trg_deny_drop_ubisp;

Note: To restrict the drop operation on all objects for the current user, you can remove the attributes of ora_dict_obj_type and ora_dict_obj_name in the trigger.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.