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