Get the App
SLTechnology News&Howtos  ›  Database  › 

Oracle creates synonyms

Shulou Source: shulou.com Published: 2022-06-01 08:19:52 10月27日 Update

First, you need to create synonym permissions for the user:

SQL > grant create synonym to jhchen

Grant succeeded.

Create synonym syntax:

Create synonym name for owner. Object name

Need to log in with jhchen

SQL > create synonym eos_kpi_usersalary for kpi.eos_kpi_usersalary

Synonym created

To change synonyms in bulk, you need to query the owner first:

SELECT 'create synonym' | | OBJECT_NAME | | 'for kpi.' | | OBJECT_NAME |';'

FROM USER_OBJECTS

WHERE OBJECT_TYPE IN

('TABLE',' VIEW', 'PROCEDURE',' TRIGGER', 'FUNCTION',' PACKAGE')

Copy the following statement and execute it under the jhchen user!

Tags: Synonyms synonyms owners users names objects permissions statements syntax face-to-face queries login Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Xiaomi vpn NVidia MySQL