2012-01-27 174 views
0

我是nohup命令的新手,但我不太了解它。 我有一个名为SQL脚本update_item_loc.sql我和油灰nohup启动sql和日志记录

我也做了以下命令到现在为止

login as: **username** 
[email protected]'s password:**xx** 

[email protected]:~> cd /fs01/app/rms04/external/scripts 
[email protected]:/fs01/app/rms04/external/scripts> sqlplus $UP 

SQL*Plus: Release 11.1.0.7.0 - Production on Fri Jan 27 16:16:50 2012 Copyright (c) 1982, 2008, Oracle. All rights reserved. 

Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 
- 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options 

[email protected]> 

调用它,因此下一个命令将

[email protected]>nohup update_item_loc.sql > /fs01/app/rms04/external/logs/update_item_loc.log & 

它是否正确?

回答

5

嗯,没有。

nohup不是sqlplus命令。您可以在shell提示下使用nohup来执行二进制或shell脚本。

所以,如果你有TEST.SQL看起来像这样:

select * from dual; 
exit 

,你从一个shell脚本来运行它,run_test.sh看起来像这样:

export ORACLE_SID=mysid 
export ORAENV_ASK=NO 
. oraenv 
sqlplus myuser/[email protected]$ORACLE_SID @test.sql 

那么你应该能够禁止它:

$ nohup run_test.sh & 

希望有所帮助。

+0

感谢您的帮助 – Eve 2012-01-30 14:20:53

0

也许你想要做的是避免连接完成,因为没有活动,您可以更改腻子连接设置:保持连接之间

  • 秒到数大于0,我将其设置为360sec
  • 标记启用TCP保持选项