Objectname - Table, View, Sequence, Materialized view, Type, Procedure, Function - Oracle

Q.  The syntax to create a synonym is:

CREATE [PUBLIC] synonym_name
FOR [schema.]object_name[@database_link_name];

In this syntax what specifies either a table, view, sequence, materialized view, type, procedure, function or package as appropriate?

- Published on 04 Aug 15

a. PUBLIC
b. Synonym_name
c. Schema
d. Object_name

ANSWER: Object_name
 

    Discussion

  • Nirja Shah   -Posted on 27 Aug 15
    - Synonyms provide both data independence and location transparency.

    - Synonyms permit applications to function without modification regardless of which user owns the table or view and regardless of which database holds the table or view.

    - However, synonyms are not a substitute for privileges on database objects.

    - Appropriate privileges must be granted to a user before the user can use the synonym.

    -The syntax to create a synonym in Oracle is:

    CREATE [OR REPLACE] [PUBLIC] SYNONYM [schema .] synonym_name
    FOR [schema .] object_name [@ dblink];

    - OR REPLACE - Allows you to recreate the synonym (if it already exists) without having to issue a DROP synonym command.

    - PUBLIC - It means that the synonym is a public synonym and is accessible to all users. Remember though that the user must first have the appropriate privileges to the object to use the synonym.

    - schema - The appropriate schema. If this phrase is omitted, Oracle assumes that you are referring to your own schema.

    - object_name - The name of the object for which you are creating the synonym. It can be one of the following:
    table, view, sequence, stored procedure, function, package, materialized view, java class schema object, user-defined object, synonym

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)