Oracle caller and definer Permissions

Source: Internet
Author: User


Oracle caller and definer permissions 1. In the first case, the owner or definer of the PL/SQL program reserves all permissions for program execution. You can use the authid definer keyword in the nameprogram www.2cto.com header to enable any user to receive the permission to run the program compiled in this way, the program will run as the program owner. -- Grant the definer permission to create as replace function hr. quarterly_sales authid definer as Begin end; in the second case, using the AUTHID CURRENT_USER keyword in the program header indicates that Oracle uses the caller's permission to execute the program. <Pre class = "SQL" name = "code"> Save point, commit, and transaction rollback DECLARE cursor c_nums is select * from tb_ SQL; BEGIN savepoint assign_nums; for r_num in c_nums loop update tb_ SQL set num5 = num5 + 10000 where id = r_num.id; end loop; Exception when others then rollback to assign_nums; END; lock select for update set transaction read only set transaction isolation level serializable lock table declare lv_num1 number; CURSOR c_nu MS is select * from tb_ SQL for update; begin update tb_ SQL set num4 = num4 + 40000; end; Oracle caller and definer permissions 1. First case, the owner or definer of the PL/SQL program reserves all permissions for executing the program. You can use the authid definer keyword in the naming program header to enable any user to receive the permission to run the program compiled in this way, and then run the program as the program owner. -- Grant the definer permission to create as replace function hr. quarterly_sales authid definer as Begin end; in the second case, using the AUTHID CURRENT_USER keyword in the program header indicates that Oracle uses the caller's permission to execute the program. -- Grant the caller permission to create as replace function hr. quarterly_sales AUTHID CURRENT_USER as Begin end; </pre> <br> -- Grant the caller permission to create as replace function hr. quarterly_salesAUTHID CURRENT_USERasBegin end; <pre> </pre> <br>

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.