V$SESSION "ORA-00942: table or view does not exist"
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.
0