最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

crontab对Oracle操作问题处理

来源:动视网 责编:小采 时间:2020-11-09 11:16:51
文档

crontab对Oracle操作问题处理

crontab对Oracle操作问题处理:以上test.sh文件中必须设置ORACLE_HOME环境变量,否则加入到crontab 里不能正常执行(如把环境变量注释掉:#ORACLE_HOME=/oracle/ [root@localhost home]# vi test.sh#!/bin/shOracle_HOME=/oracle/ora10/product
推荐度:
导读crontab对Oracle操作问题处理:以上test.sh文件中必须设置ORACLE_HOME环境变量,否则加入到crontab 里不能正常执行(如把环境变量注释掉:#ORACLE_HOME=/oracle/ [root@localhost home]# vi test.sh#!/bin/shOracle_HOME=/oracle/ora10/product


以上test.sh文件中必须设置ORACLE_HOME环境变量,否则加入到crontab 里不能正常执行(如把环境变量注释掉:#ORACLE_HOME=/oracle/

[root@localhost home]# vi test.sh
#!/bin/sh
Oracle_HOME=/oracle/ora10/product
export ORACLE_HOME
userpwd=test/test@10.11.0.235:1521/ora10g
$ORACLE_HOME/bin/sqlplus -S $userpwd <alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
INSERT INTO test values(1,'test');
COMMIT;
EOF
exit;

以上test.sh文件中必须设置ORACLE_HOME环境变量,否则加入到crontab 里不能正常执行(如把环境变量注释掉:#ORACLE_HOME=/oracle/ora10/product
#export ORACLE_HOME
),即使在sqlplus前加绝对路径/oracle/ora10/product/bin也不行,crontab文件如下test1_crond ,,日志见/var/log/cron

[root@localhost cron.d]# vi test1_crond
* * * * * root sh /home/test.sh >/home/test.log
~
~
SQL> conn test/test
Connected.
SQL> select * from test;
ID NAME
---------- --------------------
1 test
1 test
1 test
SQL>

[root@localhost cron.d]# tail -f /var/log/cron
Aug 17 14:03:01 localhost crond[10718]: (root) CMD (sh /home/x.sh)
Aug 17 14:03:01 localhost crond[10720]: (root) CMD (sh /home/test.sh >/home/test.log)
Aug 17 14:04:01 localhost crond[11102]: (root) CMD (sh /home/x.sh)
Aug 17 14:04:01 localhost crond[11103]: (root) CMD (sh /home/test.sh >/home/test.log)
Aug 17 14:05:01 localhost crond[11449]: (root) CMD (sh /home/x.sh)
Aug 17 14:05:01 localhost crond[11452]: (root) CMD (sh /home/test.sh >/home/test.log)

文档

crontab对Oracle操作问题处理

crontab对Oracle操作问题处理:以上test.sh文件中必须设置ORACLE_HOME环境变量,否则加入到crontab 里不能正常执行(如把环境变量注释掉:#ORACLE_HOME=/oracle/ [root@localhost home]# vi test.sh#!/bin/shOracle_HOME=/oracle/ora10/product
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top