OCP-1Z0-052-V8.02-183题

183. The HR user creates a stand-alone procedure as follows and grants the EXECUTE privilege on the procedure to many database users: 

CREATE OR REPLACE PROCEDURE create_dept ( v_deptno NUMBER, v_dname VARCHAR2, v_mgr NUMBER, v_loc NUMBER) 

BEGIN 

INSERT INTO hr.departments VALUES (v_deptno, v_dname, v_mgr, v_loc);

END; 

The users having permission to execute the procedure are able to insert records into the DEPARTMENTS

table even though they do not have the INSERT privilege on the table. You want only those users who

have privileges on the DEPARTMENTS table to be able to execute the procedure successfully.

What would you suggest to the PL/SQL developers to achieve this? 

A.Create the procedure with definer's right.

B.Create the procedure with invoker's right.

C.Grant the EXECUTE privilege with GRANT OPTION on the procedure to selected users. 

D.Create the procedure as part of a PL/SQL package and grant the EXECUTE privilege on the package

to selected users.

Answer: B  

答案解析:

参考:http://blog.csdn.net/rlhua/article/details/12652569

用户有执行procedure 的权限以至于能够把记录插入到DEPARTMENTS,即使这些用户没有插入DEPARTMENTS表的权限。

你只想只有能够插入DEPARTMENTS表的数据的那些用户执行procedure 成功。

有什么建议来实现?


PL/SQL  还提供的数据保护功能。 调用方不必知道要读取或处理的数据结构便可进行调用
另外,调用方不必具有访问这些对象的权限,只需要具有执行PL/SQL  程序的权限就足够了。
可以选择使用另一种模式的权限来调用PL/SQL,这种情况下, 调用方必须有权执行 调用程序运行期间执行的每个语句


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值