Database Administration (MOSC)

MOSC Banner

V$SESSION "ORA-00942: table or view does not exist"

edited Aug 13, 2012 6:16AM in Database Administration (MOSC) 3 commentsAnswered
 Hi All,
This is a very simple query, the interesting part is why it wont run under shell script.

I have a *nix shell script which will run following query under DBA account. I get the ORA-00942.

CASE 1:

with A AS
( select nvl(osuser,'Unknown') as osuser, machine, count(*) counts from v$session group by nvl(osuser,'Unknown'), machine)
select decode(osuser,'oracle','oracle-internal',osuser) as osuser,machine,counts from A
order by 1,2;

The same query runs under normal sqlplus session.

I explicitly granted select on V_$SESSION to this user and it still wont run.


CASE 2: Thinking that my here-doc shell script could be a problem, I replaced the query with following, and script runs fine from the command line.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center