from v * ERROR at line 1: ORA-00942: table or view does not exist
时间:2010-08-20 来源:brightking716
在运行一个备份脚本的时候,当执行在v$动态性能视图时,就会报错,如果单独运行该sql语句的时候就不会有问题 ,具体情况如下:
#/bin/bash
$ORACLE_HOME/bin/sqlplus -s "/ as sysdba" << !
… …
spool &fil
select 'host cp ' || name ||' &dir' from v$datafile;
… …
spool off;
exit
!
select 'host cp ' || name ||' /u01/backup/cold' from v
*
ERROR at line 1:
ORA-00942: table or view does not exist
Solution:
Escape the $ in v$datafile with a like this v$datafile,
select 'host cp ' || name ||' &dir' from v$datafile;
相关阅读 更多 +