Oracle – Difference Between ALL_OBJECTS and DBA_OBJECTS with DBA Role

oraclepermissions

I am trying to fully understand the difference between ALL_OBJECTS and DBA_OBJECTS.
I am still new in Oracle and get confused by the whole Access/Roles thing.

From here:

  • ALL_OBJECTS shows all objects of current and those object which you have rights to access.
  • DBA_OBJECTS shows all object of all users .

My question is, if you have DBA role, should ALL_OBJECTS be equal to DBA_OBJECTS?
I have DBA role and in the Database I am working on and ALL_OBJECTS returns fewer elements than DBA_OBJECTS.

If I have DBA Role shouldn't I have access to all the objects in DBA_OBJECTS and therefore both views should be equal?

Best Answer

First let's define ALL_OBJECTS and DBA_OBJECTS in oracle:

  • ALL_OBJECTS describes all objects accessible to the current user.
  • DBA_OBJECTS describes all objects in the database

As result if you select everything they are different because there are multiple levels of DBA privileges on Oracle. For example if you have SysDBA privileges then you have much more access than a normal DBA.