2

I need to query the values of V$OSSTAT and am able to do so using tools like dbVisualizer. But when I take the identical query and put it into some Javacode I fail to find the table.

I had this problem before with specific application schemas and was able to solve this by putting the applications schema name in front of the table simiar to this: SELECT NAME FROM FOOAPP.USERS.

But in this case I simply don't know which schema to use for gaining access to V$OSSTAT. I tried prefixing the view / table with SYS and SYSTEM already.

SELECT STAT_NAME, VALUE, COMMENTS FROM SYS.V$OSSTAT
SELECT STAT_NAME, VALUE, COMMENTS FROM SYSTEM.V$OSSTAT

1 Answer 1

2

There is no such object as SYS.V$OSSTAT, because V$OSSTAT is a public synonym. Because of this, there is no need to use a schema specifier for it. The actual view is called V_$OSSTAT (same for other V$ views as well). If you want a user to be able to select from that view, grant the privilege on that:

grant select on sys.v_$osstat to user;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.