OCP 1Z0 051 49
49. The ORDERS table belongs to the user OE. OE has granted the SELECT privilege on the ORDERStable 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. CREATEPUBLICSYNONYMordFORoe.orders;This command is issued by the database administrator.
synonym只有public可以被所有用户访问。否则就只能访问本用户创建的
SYS >conn oe/oe
已连接。
OE >grant select on orders to hr;
授权成功。
OE >create or replace synonym ord for orders;
同义词已创建。
OE >conn hr/hr
已连接。
HR >select * from ord where rownum <=1;
select * from ord where rownum <=1
*
第 1 行出现错误:
ORA-00942: 表或视图不存在
OE >create or replace public synonym ord for orders;
同义词已创建。
已用时间:00: 00: 00.01
OE >conn hr/hr
已连接。
HR >select ORDER_id from ord where rownum <=1;
ORDER_ID
----------
2354
已选择 1 行。
已用时间:00: 00: 00.00
HR >
SYS >create or replacesynonym ord for oe.orders;
同义词已创建。
已用时间:00: 00: 00.00
SYS >conn hr/hr
已连接。
HR >select * from ord where rownum <=1;
select * from ord where rownum <=1
*
第 1 行出现错误:
ORA-00942: 表或视图不存在
SYS >create or replace public synonym ord for oe.orders;
同义词已创建。
已用时间:00: 00: 00.09
SYS >conn hr/hr;
已连接。
HR >select ORDER_id from ord where rownum <=1;
ORDER_ID
----------
2354
Answer: 应为B D
版权声明:本文为博主原创文章,未经博主允许不得转载。
页:
[1]