Which two statements are true about Oracle synonyms? (Choose two.)
Which two statements are true about Oracle synonyms? (Choose two.)
A synonym can be created on an object in a package, allowing users to reference the object using the synonym name instead of the full package and object name. Additionally, synonyms can be created for other synonyms, enabling users to reference the underlying object using multiple synonym names. Therefore, these two statements are correct.
A. Any user can create a PUBLIC synonym.( x) Must have Create Publc Syn Priv. B. A synonym has an object number. C. All private synonym names must be unique in the database. (X) Unique in the schema. D. A synonym can be created on an object in a package. (X) A schema object can't be in a package E. A synonym can have a synonym.
D answer is incorrect for another reason, you actually can create synonym on an object in a PL/SQL package but in won't be active(checked): CREATE OR REPLACE PACKAGE long_package_name AS FUNCTION give_me_zero RETURN NUMBER; END; / CREATE OR REPLACE PACKAGE BODY long_package_name AS FUNCTION give_me_zero RETURN NUMBER IS BEGIN RETURN 0; END; END; / CREATE OR REPLACE SYNONYM pkg_func FOR long_package_name.give_me_zero; SELECT pkg_func.give_me_zero FROM dual;
Right!
Synonym can be created for the whole package but not for components of the package.
But for a procedure in a package? a synonym can be created in that case
You have created synonym on the entire package, not on the package object.
But for a procedure in a package? a synonym can be created in that case
BE is correct. syn has object. here is to find object ID. Modify it or remove the owner SELECT s.synonym_name, s.owner, o.object_id, o.object_name, o.object_type FROM dba_synonyms s JOIN dba_objects o ON s.synonym_name = o.object_name AND s.owner = o.owner and S.owner = 'HR' ;
With no so many arguments, I would answer DE in an hypothetical exam since documentation says that a synonym can be created on a Stored procedure, function, or package. Besides, I don't find accurate the way B is written since the creation of a new synonym doesn't envolve a new object id, but the synonim actually "has" the object id of the object it references...
D and E Specify the object for which the synonym is created. The schema object for which you are creating the synonym can be of the following types: Table or object table View or object view Sequence Stored procedure, function, or package Materialized view Java class schema object User-defined object type Synonym https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/CREATE-SYNONYM.html
de should be
b is wrong 1000%
Assuming user has the "CREATE SYNONYM" grant, then: select * from newsyn2 -- produces error create synonym newsyn2 for dual; select * from newsyn2; --returns X select object_name, object_type, object_id from user_objects; This seems to suggest that Oracle synonyms have object ids.
DE for me
A - user need CREATE PUBLIC SYNONYM : false C - must be unique in schema : false D - The schema object cannot be contained in a package for synonyms
D. A synonym can be created on an object in a package. A synonym can be created for an object in a package, allowing users to reference the object using the synonym name instead of the package and object name 1. E. A synonym can have a synonym. A synonym can be created for another synonym, allowing users to reference the underlying object using either synonym name
D and E is true the rest is false