What are the different types of synonyms?

There are two types of synonyms or alias:

  1. Private: It can only accessed by the owner.
  2. Public: It can be accessed by any database user.

In Oracle, there are two main types of synonyms: private synonyms and public synonyms.

  1. Private Synonyms:
    • Private synonyms are owned by a specific user.
    • They are only accessible to the user who created them and other users with appropriate privileges.
  2. Public Synonyms:
    • Public synonyms are created with the PUBLIC keyword, making them accessible to all users in the database.
    • They can be used by any user in the database without needing explicit privileges.

These synonyms provide a way to simplify access to database objects and can be useful for security, convenience, and ease of maintenance.