What is PUBLIC exactly in Oracle?
Is it a role or a user? And does it have a schema? If it has, can we create objects in it?
I read many documents saying it is a user group as well. But I got confused about what exactly it is.
Any help will be very appreciated.
In the data dictionary, it is defined as a role. You can see this by
However,
PUBLIC
is special - it is not really a role. You cannot, for example,GRANT
orREVOKE
it explicitly. And, in fact, the data dictionary viewDBA_ROLES
explicitly excludes it as a role with this predicate:So, it's really a special case, as evidenced by the special code Oracle included in its data dictionary to handle it.
It does have its own schema, but it can only hold objects whose DDL syntax allows for
CREATE PUBLIC...
. That's only synonyms and database links, as far as I know.