Oracle synonym synonym

Source: Internet
Author: User


A synonym is an alias to another data object, the synonym is dependent on its target object, and the synonym becomes invalid if the target object is changed or deleted.

Synonyms are not a substitute for the privileges of database objects, that is, the object with the schema is queried, executed, deleted, and so on.


To create a private synonym in your own schema, you must have the Create synonym system privilege.

To create a private synonym in another user's mode, you must have the Create any synonym system privilege.

To create a public synonym, you must have the Create public synonym system privilege.

Synonyms for tables

CREATE synonym offices for hr.locations;

Synonyms for Stored procedures

Create or replace synonym Sp_insertxy for ys_adm. Sp_insertxy;

Grant execute on SP_INSERTXY to Ys_app


If the user OA has the offices table object, and the HR offices table has the query permission, then the SELECT * from offices, the query is its own data. If you want to check HR mode, select * from Hr.offices is required

If the user OA does not have the offices table object, and has the query permission to the HR offices table, create synonym offices for hr.offices by creating synonyms; Executes select * from offices; The system returns data for the HR user.

Oracle synonym synonym

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.