OCP 1Z0 051 49

来源:互联网 发布:网络卫星电视 编辑:程序博客网 时间:2024/06/06 08:54
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. 

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.01OE >conn hr/hr已连接。HR >select ORDER_id from ord where rownum <=1;  ORDER_ID----------      2354已选择 1 行。已用时间:  00: 00: 00.00HR >

SYS >create or replace  synonym ord for oe.orders;同义词已创建。已用时间:  00: 00: 00.00SYS >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.09SYS >conn hr/hr;已连接。HR >select ORDER_id from ord where rownum <=1;  ORDER_ID----------      2354

Answer: 应为B D 
0 0