When should database synonyms be used?

后端 未结 6 1583
借酒劲吻你
借酒劲吻你 2021-02-03 20:59

I\'ve got the syntax down but I\'m wondering if somebody can provide an illustrative use case where database synonyms are very useful.

6条回答
  •  情深已故
    2021-02-03 21:50

    I usually see synonyms used when the DBA wishes to separate database objects into different schemas, but wants/needs some of these objects to be visible to other schemas (but doesn't want to give direct access to them).

    An example I've seen most recently: Several web apps run by the same company. Users usually have access to more than one of these apps, and the will only have one user account to access these apps. User-account information is stored in a USER_ACCOUNTS schema, and all other apps are in their own schemas and access the USER_ACCOUNTS schema via synonyms.

提交回复
热议问题