There are two types of synonyms or alias:
- Private: It can only accessed by the owner.
- Public: It can be accessed by any database user.
In Oracle, there are two main types of synonyms: private synonyms and public synonyms.
- 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.
- 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.
- Public synonyms are created with the
These synonyms provide a way to simplify access to database objects and can be useful for security, convenience, and ease of maintenance.