0

I am trying to create a view that is referencing to dba_objects table. I can select the dba_objects just fine but when I try to create a view I am getting an insuf priv error.

select * from session_privs //this returns create view privilege 


create view v_test_view 
as 
select * from dba_objects
where owner = 'HR'

ORA-01031: insufficient privileges
user2058738
  • 349
  • 1
  • 6
  • 15

1 Answers1

0

You aren't allowed to select from DBA_OBJECTS. A privileged user (such as SYS) has to grant you select privilege on it.

Alternatively, if it is enough for what you're doing, select from ALL_OBJECTS which contains all objects you have access to.

Littlefoot
  • 131,892
  • 15
  • 35
  • 57