create synonym ora-01031 insufficient privileges

前端 未结 1 650
再見小時候
再見小時候 2021-01-04 23:36

I need help understanding what grants/privileges a user needs to CREATE a SYNONYM when it points to another (different) schema object.

When I try the below, I get or

相关标签:
1条回答
  • 2021-01-05 00:37

    The documentation for the CREATE SYNONYM command includes:

    Prerequisites

    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 schema, you must have the CREATE ANY SYNONYM system privilege.

    To create a PUBLIC synonym, you must have the CREATE PUBLIC SYNONYM system privilege.

    You're trying to create a private synonym in READWRITE's own schema, so you have to have to do:

    GRANT CREATE SYNONYM TO READWRITE;
    

    The object the synonym is pointing to is in a different schema, but that isn't relevant here.


    If your new account is only going to access objects in the GDACS schema, and particularly if you have a lot of objects you want to grant access to, then as an alternative to having to create synonyms for everything you could alter the new user's current_schema in each session - possibly via a logon trigger.

    0 讨论(0)
提交回复
热议问题