使執行的sql語句變為Linux後台進程執行

來源:互聯網
上載者:User

前些日子,在操作資料庫時,需要執行操作時間很久的sql語句。但是當時區域網路網路情況不好,經常發生掉線的情況。

此時需要把執行的語句加入到Oracle伺服器上的後台進程中,去執行。操作過程如下:

1、首先把需要執行的sql語句寫成指令碼,儲存到sql.sql中。並放置到資料庫伺服器某路徑下.

2、執行如下linux命令即可:

nohup sqlplus 使用者名稱/密碼@主機串連字串 @建好的可執行檔 &

例如: 【LINUX公社 www.LinuxIDC.com 】

nohup  sqlplus   Oracle/Oracle@orcl   @sql.sql     &

即可。這樣就不怕網路中斷,對sql執行情況的影響。sql執行的結果,可以到nohup檔案中查看。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.