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.
so the user OE don’t have the system privilege to CREATE SYNONYM? Kindly provide explanation.
http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_7001.htm
Does this mean only the DBA can create private and public synonyms?
Thanks in advance.
Create synonym is not a default or standard privilege that you give to database user. Because of security reason you do not grant it to any user. So probably in the question is established that OE does not have that privilege.
The another thing is: it is needed to do select * from ord
not select * from oe.ord os it cannot be ‘private’ synonym of user OE.
If you are granting select on table to some user.
And later if you will create synonym for that table. Then the other user will be able to access that synonym also.
For e.g
SQL> grant select on test to sandeep;
Grant succeeded.
SQL> create synonym te for test;
Synonym created.
SQL> conn
Enter user-name: sandeep
Enter password:
SQL> select * from test1.te;
PROD_ID PROD_PRICE
———- ———-
101 21324314
102 21424314
So the option A is correct.
i don’t think so, because query clause is : select * from ord (not include schema name)