V $ Instance Resolution Errors

I wanted to create a view similar to the following, but I keep getting ORA-01031 - insufficient permission error

create view v_dbinfo as
Select INSTANCE_NAME,HOST_NAME from v$instance;

      

I can select from an instance v $ and create a view from an existing table without any problem. Any idea as to why this is happening and how I can fix it?

thank

+2


source to share


1 answer


I would like to say that you have access to V $ INSTANCE through a role and not as a direct grant. If you wanted to create a view (or a V $ INSTANCE reference in the qualifier rights stored procedure), you must have been granted access to the specified objects through direct grants, not through a role.

Also, if you intend to share this new view with other users, you will need access to V $ INSTANCE, which will be granted using the WITH GRANT OPTION clause, i.e.



GRANT SELECT ON v$instance
   TO your_user_name
 WITH GRANT OPTION;

      

+3


source







All Articles