Which statement would create a synonym ORD so that HR can execute the following query successfully?

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;

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.



Leave a Reply 11

Your email address will not be published. Required fields are marked *


bogdan

bogdan

it should be B and D

B works just fine given as long as OE was granted ‘create public synonym’ privilege

ming

ming

Yep, B is also correct

abdel

abdel

No B its wrong because OE it not to be able to create public synonym.
The D answer its correct.

bogdan

bogdan

create user lisa identified by 123456;

grant create session, unlimited tablespace, create table to lisa;

grant create public synonym to lisa;

create user henry identified by 123456;

grant create session to henry;

——————————————–

user LISA created.
grant succeeded.
grant succeeded.
user HENRY created.
grant succeeded.

——————————————–

show user; — lisa

create table webinars (webinar varchar2(20));

insert into webinars values (‘online demo’);

grant select on webinars to henry;

create public synonym lessons for webinars;

——————————————–

USER is LISA
table WEBINARS created.
1 rows inserted.
grant succeeded.
public synonym LESSONS created.

——————————————–

show user; — henry

select * from lisa.webinars;

select * from lessons; — public synonym for lisa.webinars

——————————————–

USER is HENRY

WEBINAR
——————–
online test

WEBINAR
——————–
online test

john

john

Creating a Synonym for an Object
To refer to a table that is owned by another user, you need to prefix the table name with the name
of the user who created it, followed by a period. Creating a synonym eliminates the need to qualify
the object name with the schema and provides you with an alternative name for a table, view,
sequence, procedure, or other objects.
This method can be especially useful with lengthy object names, such as views.

Sandhya

Sandhya

B is incorrect.

CREATE PUBLIC SYNONYM ord FOR oe.orders; If this command is issued by OE.
Then HR can execute the following query successfully
SELECT*FROM ord;

mr_tienvu

mr_tienvu

I have the same idea. D

Elizabeta

Elizabeta

B and D are correct

9jansen

9jansen

Tricky, indeed.

A synonym created with the CREATE SYNONYM command would be a private one.

To create a PUBLIC synonym, one must have the CREATE PUBLIC SYNONYM system privilege.

The reason to avoid the use of the CREATE PUBLIC SYNONYM command to create public synonyms is that public synonyms have security and performance issues associated with them unless it is absolutely necessary.
[Reference: http://www.dba-oracle.com/t_oracle_create_synonym.htm%5D

Thus, with the above reasons and to choose between a rock and a hard place, one might be better to select choice D. šŸ™‚

Yana disconzi

Yana disconzi

USUƁRIO OWNER yanadba
TABELA teste2
USUƁRIO ACESSO testes

A.CREATE SYNONYM t2 FOR teste2; by yanadba
B.CREATE PUBLIC SYNONYM t2 FOR teste2; by yanadba
C.CREATE SYNOYM t2 FOR yanadba.teste2; by administrator database
D.CREATE PUBLIC SYNONYM t2 FOR yanadba.teste2; by administrator database

SQL> GRANT SELECT ON teste2 TO testes;
Grant succeeded.

A.CREATE SYNONYM t2 FOR teste2; by yanadba
yandba SQL> CREATE SYNONYM t2 FOR teste2;
CREATE SYNONYM t2 FOR teste2
*
ERROR at line 1:
ORA-01031: insufficient privileges

B.CREATE PUBLIC SYNONYM t2 FOR teste2;
yanadba SQL> CREATE PUBLIC SYNONYM t2 FOR teste2;
CREATE PUBLIC SYNONYM t2 FOR teste2
*
ERROR at line 1:
ORA-01031: insufficient privileges

C.CREATE SYNONYM t2 FOR yanadba.teste2; by administrator database
yanadba SQL> CREATE SYNONYM t2 FOR yanadba.teste2;
Synonym created.

testes SQL> SELECT * FROM t2;
SELECT * FROM t2
*
ERROR at line 1:
ORA-00942: table or view does not exist

D.CREATE PUBLIC SYNONYM t2 FOR yanadba.teste2;
yanadba SQL> CREATE PUBLIC SYNONYM t2 FOR yanadba.teste2;
Synonym created.

testes SQL> SELECT * FROM t2;

ID NUM
———- ———-
20 50

SOULUTION JUST ->>>>>>> D.
CREATE PUBLIC SYNONYM ord FOR oe.orders; This command is issued by the database administrator.