手工执行没有问题:
 
[etl@node1 shell]$ ./test.sh
SQL*Plus: Release 11.2.0.3.0 Production on Fri Mar 7 11:29:19 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
SQL> SQL> SQL> Connected.
SQL> SQL>   2    3    4    5    6    7    8    9  
PL/SQL procedure successfully completed.
SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
99
[etl@node1 shell]$
crontab内容:
 
crontab中无法执行:
 
经检查是环境变量问题(相关阅读:linux环境变量的设置与查看  设置Linux环境变量的三种方法  Linux环境变量配置小结  了解Linux环境变量),将如下两句添加到脚本中,即可解决问题: