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;
B,D,E are correct.
B and E are obvious.
Why D is correct : Following workd in oracle.livesql.com
CREATE PACKAGE employee_pkg1 AS
PROCEDURE add_employee(p_first_name VARCHAR2, p_last_name VARCHAR2);
END employee_pkg1;
CREATE SYNONYM emp_pkg_syn FOR employee_pkg1;
--Works
CREATE SYNONYM add_emp_addemp_syn FOR employee_pkg1.add_employee;
-- works
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
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.
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
But for a procedure in a package? a synonym can be created in that case
upvoted 1 times
...
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
holdfaststrongly
Highly Voted 2 years, 3 months agokenan_yu
2 years, 3 months agospeedy_vin
2 months agoLee_jong_suk
1 year agobraintop
Most Recent 1 month, 2 weeks agoJanThanh
3 months, 2 weeks agoShahedOdeh
3 months, 3 weeks agoulkaaa
5 months agoArslanAltaf
6 months, 3 weeks agoalelejaja
7 months, 2 weeks agoFredderik91
7 months, 3 weeks agohmatinnn
11 months, 3 weeks agoismoil
11 months, 3 weeks agoid10111110
9 months, 2 weeks agoyaya32
11 months, 3 weeks agomavista
1 year, 2 months agojm9999
1 year, 3 months agoalelejaja
7 months, 2 weeks agozouve
1 year, 6 months agodilshod
1 year, 6 months agoMatvey
1 year, 11 months agoalelejaja
7 months, 2 weeks ago