-
Hello,
I noticed the following thing :
I have a shell script in which a sql order is executed :
*********************************************************
export ORACLE_SID=$1
$ORACLE_HOME/bin/sqlplus /nolog << EOF
connect / as sysdba
spool sqltest.lst
select * from sys.v$log;
spool off
EOF
The resultat is the following :
**********************************
(c) Copyright 2000 Oracle Corporation. All rights reserved.
SQL> Connected.
SQL> SQL> select * from sys.v
*
ERROR at line 1:
ORA-00942: table or view does not exist
Doing the same thing with a non v$* views, the result is OK.
(for v$*, I have to put the select order in a sql script and call it from the shell).
Do you have an explanation of this behavior ?
Thanks a lot ...
-
your shell script is treating the $log part of you v$log table as a shell variable.
use
select *
from v\$log
Gert
-
In you script file the $ symbol has to be preceded by a escape character.
select * from sys.v\$log;
Regards,
deepa
-
Even when you fix that escape $ character error, you'll still get "ORA-00942: table or view does not exist". That's because there is no such object as SYS.V$LOG.
V$LOG is a public synonym, so it must not be preceeded with schema name. Either use
SELECT * FROM v\$log
or
SELECT * FROM sys.v_\$log
-
Thanks a lot for the reply ...