当前位置: 代码迷 >> Oracle认证考试 >> 这个题目貌似有点有关问题
  详细解决方案

这个题目貌似有点有关问题

热度:1061   发布时间:2016-04-24 03:51:25.0
这个题目貌似有点问题
49. The ORDERS table belongs to the user OE. OE has granted the SELECT privilege on the ORDERS
table to the user HR.
Which statement would create a synonym ORD so that HR can execute the following query successfully?
SELECT * FROM ord;
A. CREATE SYNONYM ord FOR orders; This command is issued by OE.
B. CREATE PUBLIC SYNONYM ord FOR orders; This command is issued by OE.
C. CREATE SYNONYM ord FOR oe.orders; This command is issued by the database administrator.
D. CREATE PUBLIC SYNONYM ord FOR oe.orders; This command is issued by the database
administrator.
Answer: D

ORDER是OE的表,OE授权查询ORDERS给HR。
哪个语句能可以创建同义词ORD,以便select *  from ord能成功执行?
我觉得B 用OE创建公共同义词ORDfor orders。然后HR执行select *  from ord不也可以吗。

------解决方案--------------------
B应该是可以的。。。题目答案错了。
------解决方案--------------------
误导楼主。首先在说来个懂不懂oracle的。都知道B和D就差那么一点点。B肯定错了。至于我能否给解释清楚。一会我做个例子发上来。现在工作。
------解决方案--------------------
如果多选都可以。
如果单选,那么首先你没法确定OE有没有创建PUBLIC SYNONYM的权限,它也没说执行一定成功。
------解决方案--------------------
引用:
误导楼主。首先在说来个懂不懂oracle的。都知道B和D就差那么一点点。B肯定错了。至于我能否给解释清楚。一会我做个例子发上来。现在工作。


坐等例子
------解决方案--------------------
我实验了一下。但是我觉得我可能给的权限有问题。
首先用户有OE、HR   但是他们有什么权限我们不知道。OE能给HR select的权限。说明OE最低有create session\create table \create user(因为后面需要给HR 赋值select权限
)

创建HR2的时候给了它太大的权限。resource角色。这个角色是授权给开发人员的。


------解决方案--------------------
当然我已HR2 OE2演示的。因为我的数据库里有这个两个用户了。我再试试吧。以上的结果B是可以的。但是我觉得。这不是本道提的出题意义。因为我不确定HR2的权限有多大。
------解决方案--------------------
演示代码:
SSH Secure Shell 3.2.9 (Build 283)
Copyright (c) 2000-2003 SSH Communications Security Corp - http://www.ssh.com/

This copy of SSH Secure Shell is a non-commercial version.
This version does not include PKI and PKCS #11 functionality.


Last login: Mon Apr 22 20:41:28 2013 from 192.168.15.1
[oracle@node1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue Apr 23 03:54:13 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Data Mining and Real Application Testing options

SQL> conn sys/oracle        
ERROR:
ORA-28009: connection as SYS should be as SYSDBA or SYSOPER
  相关解决方案