NOHUP is a Linux Command to run a job in the background. Why is it important to DBA and developer? NOHUP stands for "No Hang Up" which will make sense when you are done reading this article. Whenever, I push a change to production database, we do it during off hours when there are no or minimum traffics that is mostly at midnight, early morning or weekends depending on the nature of business. I hate to go to office during those off hours to implement db changes therefore, I work from home using my VPN connection.
What are the risks of running your script from home? Well, I can list over dozens but I am going to point out just the main one. You may loose your VPN connection anytime! What do you think? What will happen to the script you are running on your SQL Developer or SQL*Plus when you loose connection? Limbo right? Well, one of two things will happen, either the script will continue to run or the change gets rollback. Do you really want this to happen when you are working on a strict maintenance window? Well, I am going to show you how you can run your script in the background and not worry about your loosing VPN connection on both Linux & Window's Server.
Linux Server: Linux command <nohup> runs your script in the background. You don't have to wait for your script to be done running it. Just run the script in the background and move on to your next project. Next, we will do a demo on how <nohup> command is used while running Linux shell script and in SQL*Plus to run SQL query.
Foreground to Background: There may be a time where your script runs longer than expected time and you may need to leave for the day. In such case you must switch your foreground jobs to background and then log out.
Windows: Linux Server has a cool <nohup> utilities that takes care of everything we are trying to accomplish? What does Microsoft offer for their windows user? Well, there is no equivalent that I am aware of but I would always RDP into the Window's host where my database sits and run the deployment script using SQL*Plus from the command. You may even use SQL Developer if that is installed. If anyone knows the better alternatives, please post a comment below. Since, the query is running on the host, you can logout of your pc and then monitor from home later.
Others: What options do you have beside <nohup> and RDP? There are two other options that I am aware of but they require additional work. You may schedule your script to run via Cron Schedular. Cron runs all the process in the background. The second options is to run Oracle Query using DBMS Scheduler which runs the job in the background like Cron. When Linux is not your OS these are the second best options to run your scripts.
Now, you know the risk of running SQL queries from SQL Developer and SQL*Plus especially when working from home. If I am working on queries that is going to take a long time at 4:00 pm, I will run my sql using <nohup>, exit my laptop, go home and then start monitor from home. I hope you find this article helpful and I encourage you make to use it if you are working from home/remotely or deploying the critical changes.
What are the risks of running your script from home? Well, I can list over dozens but I am going to point out just the main one. You may loose your VPN connection anytime! What do you think? What will happen to the script you are running on your SQL Developer or SQL*Plus when you loose connection? Limbo right? Well, one of two things will happen, either the script will continue to run or the change gets rollback. Do you really want this to happen when you are working on a strict maintenance window? Well, I am going to show you how you can run your script in the background and not worry about your loosing VPN connection on both Linux & Window's Server.
Linux Server: Linux command <nohup> runs your script in the background. You don't have to wait for your script to be done running it. Just run the script in the background and move on to your next project. Next, we will do a demo on how <nohup> command is used while running Linux shell script and in SQL*Plus to run SQL query.
vi demoscript.ksh
#!/bin/ksh
echo " no hup demo exercise"
echo "back from 1 min sleep"
sleep 60
echo "back from 5 min sleep"
sleep 300
exit
## making script executable
chmod 775 demoscript.ksh
## Running script in background
nohup ./demoscript.ksh &
## viewing background jobs
jobs
Foreground to Background: There may be a time where your script runs longer than expected time and you may need to leave for the day. In such case you must switch your foreground jobs to background and then log out.
## executing demoscript.ksh
./demoscript.ksh
## suspending execution of demo script.ksh
"CTRL +Z"
## switching foreground jobs to background
bg
## viewing background jobs
jobs
## bring background job back to foreground
fg %1
Running SQL Query in the Background:nohup sqlplus username/password@oracleserver @query_file.sql &
Windows: Linux Server has a cool <nohup> utilities that takes care of everything we are trying to accomplish? What does Microsoft offer for their windows user? Well, there is no equivalent that I am aware of but I would always RDP into the Window's host where my database sits and run the deployment script using SQL*Plus from the command. You may even use SQL Developer if that is installed. If anyone knows the better alternatives, please post a comment below. Since, the query is running on the host, you can logout of your pc and then monitor from home later.
Others: What options do you have beside <nohup> and RDP? There are two other options that I am aware of but they require additional work. You may schedule your script to run via Cron Schedular. Cron runs all the process in the background. The second options is to run Oracle Query using DBMS Scheduler which runs the job in the background like Cron. When Linux is not your OS these are the second best options to run your scripts.
Now, you know the risk of running SQL queries from SQL Developer and SQL*Plus especially when working from home. If I am working on queries that is going to take a long time at 4:00 pm, I will run my sql using <nohup>, exit my laptop, go home and then start monitor from home. I hope you find this article helpful and I encourage you make to use it if you are working from home/remotely or deploying the critical changes.
Interested in working with me? I can be reached at pbaniya04[at]gmail.com for any questions, consulting opportunities or you may drop a line to say HELLO. Thank your again for visiting my blog and looking forward to serving you more.
Have a Database-ious Day!
Have a Database-ious Day!
![](https://2.bp.blogspot.com/-0jRmAWVsalw/WEy-7m4mkzI/AAAAAAAAIvI/mujUV7JtZQMm4RMwVso3FK_xfFmBeQdpgCLcB/s1600/http---signatures.mylivesignature.com-54494-378-BF44FE05175A4960EE5C9A4B6BC174BF.png)
This comment has been removed by a blog administrator.
ReplyDeleteUseful post.
ReplyDeleteOracle Apps Training
This comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeletevery useful really good information thanks for posting such a good information it will hepls the people a lot keep it up.. Best MATLAB Training Center In Chennai|
ReplyDeleteWow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.and once again thanks for sharing.….. Best PMI Certification In Chennai|
ReplyDeleteThanks for sharing this informative blog. I have read your blog and I gathered some valuable information from this blog. Keep posting. Best ISTQB BCS Certification In Chennai|
ReplyDeletevery nice post what a fantastic information you sharing. Keep sharing your post regularly.. Best CISM Certification in Chennai |
ReplyDeleteThis post was quite awesome and interesting to read. Congrats for your work. Thanks a lot for providing this with us. Keep on updating this with us regularly: Best CISA Certification in Chennai |
ReplyDeleteGood Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge. Best CCNA Training Center in Chennai |
ReplyDeleteWonderful post. Thank you for updating such a good post.. Best Linux administration Training Center in Chennai |
ReplyDeleteYour blog was so informative, Really I thanks a lot for sharing such a awesome blog., Best RHCSA Training Institute In Chennai |
ReplyDeleteExcellant post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it. Best Tally Training Center in chennai |
ReplyDeleteReally an amazing post..! By reading your blog post i gained more information. Best Microsoft Advanced Excel Training Center in chennai |
ReplyDeleteThanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing. Best CCNA Training institute in chennai |
ReplyDeleteReally it was an awesome article...very interesting to read..You have provided an nice article....Thanks for sharing.. Best Software Testing Training Center in chennai
ReplyDelete|
this blog is really useful and it is very interesting thanks for sharing , it is really good and exclusive. Best Prince 2 Exam center in chennai|
ReplyDeleteGreat and useful post.Thanks for taking time to share this post. Best Machine Learning Training in chennai|
ReplyDeleteGreat tips and its so easy to understand. really You explain everything in detailed manner and it was very interesting to read. Thank you. Best Data Science Training in chennai|
ReplyDeleteThanks for another great post. The place else may anyone get that type of information in such a perfect way of writing? I’ve a presentation next week, and I’m at the look for such information. Best CCNA Training Institute in Chennai
ReplyDeleteWow, interesting and informative topic. Helps to gain a lot of knowledge . Thanks for posting such an informative post in this blog. Best Tally Training Institute in Chennai
ReplyDeleteThis is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information and it is very useful to me... RHCSA Training Center in Chennai|
ReplyDeleteGreat the given information and after refer that post,i get new energy because of all given information very excellent and real words to implemented for you.Thank you so much shared that valuable information. PCB Design Training Center in Chennai ! velachery|
ReplyDelete
ReplyDeleteThese provided information was really so nice,thanks for giving that post and the more skills to develop after refer that post. Your articles really impressed for me,because of all information so nice. JAVA Training Center in Chennai |
Thank you so much for sharing such an amazing post with useful information with us. Keep updating such a wonderful blog…. Photoshop Training institute in Chennai |
ReplyDeleteVery nice blogs!!! I have to learning for lot of information for this sites...Sharing for wonderful information. Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.… Tally Training Center in Chennai |
ReplyDeleteVery happy to see this blog. Gives a wonderful information with coded explanaion. Thank you for this blog. very useful to me. Prince2 Certification Center in Chennai |
ReplyDeleteThanks for your informative Information.Your post helped me to understand the future and career prospects. Keep on updating your blog with such awesome article. Agile Scrum Master Certification Center in Chennai |
ReplyDeleteThanks for sharing this informative blog. I have read your blog and I gathered some valuable information from this blog. Keep posting. BBA Project center in chennai and velachery |
ReplyDeleteAwesome post. Really you have shared a very informative concept... Thank you for sharing. Keep on updating... EEE Project center in chennai and velachery |
ReplyDeleteWell Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas. UFT Training center in chennai |
ReplyDeleteHi, you have given really informative post. Thanks for sharing this post to our vision. MCSE Training institute in chennai |
ReplyDeleteIt is really a great and useful piece of information. I am glad that you shared this helpful info with us. Please keep us up to date like this. Thank you for sharing. Azure Training institute in Chennai and Velachery |
ReplyDeleteAmazing write up. You have delivered useful information. Thanks for posting and keep blogging. PCB Design Training Center in Chenna |
ReplyDeleteExcellent blog with useful concept. Really I feel very happy to see this informative blog, Thanks for sharing such a nice blog.. Tally Training Institute in Chennai|
ReplyDeleteVery nice post here and thanks for it .I always like and such a super blog of these post.Excellent and very cool idea and great blog of different kinds of the valuable information's. Python Training Institute in Chennai |
ReplyDeleteawesome way to get exert tips from everyone,not only i like that post all peoples like that post,because of all given information was wonderful and it's very helpful for me. CCNA Exam Center in Chennai |
ReplyDeleteIn the beginning, I would like to thank you much about this great post.I like your writing style and I hope you will keep doing this good working AWS Exam Center in Chennai |
ReplyDeleteWow...Excellent informative blog, really helpful. Thank you. Final Year Projects For Phd in Chennai |
ReplyDeleteIt is really a great work and the way in which u r sharing the knowledge is excellent.Thanks for helping me to understand basic concepts. Final year projects For Engineering Students in Chennai |
ReplyDeleteThank you for sharing the information here. Its much informative and really i got some valid information. You had posted the amazing article. Final year projects For CSE Students in Chennai |
ReplyDeleteExcellant post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it. Final year projects For CS in Chennai |
ReplyDeleteI am joyful to read this post, its an attractive one. Thanks for this amazing post.. Final year projects For IT in Chennai |
ReplyDeleteI found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing.. Final year projects For EEE in Chennai |
ReplyDeleteThis is excellent information. It is amazing and wonderful to visit your site.Thanks for
ReplyDeletesharing this information, this is useful to me. Photoshop Training institute in Chennai |
Really an awesome post. I wondered by reading this blog post. Thanks a lot for posting this unique post which you have shared with us. Keep on posting like this exclusive post with us. Photoshop Training institute in Chennai |
ReplyDeleteI really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Hardware and Networking Training institute in Chennai |
ReplyDeleteThis is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information and it is very useful to me... Microsoft Azure Certification Center in Chennai |
ReplyDeleteReally very great information to be provided and the All points discussed were worth reading and i’ll surely work with them all one by one. TOGAF Certification Center in Chennai |
ReplyDeleteWonderful blog.. Thanks for sharing informative blog.. its very useful to me.. Selenium Training Center in Chennai |
ReplyDeleteYour blog was so informative, Really I thanks a lot for sharing such a awesome blog. Tally Erp9 Training Center in Chennai |
ReplyDeleteI am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly. Graphic Designing Training Center in Chennai |
ReplyDeleteNice Post! It is really interesting to read from the beginning & I would like to share your blog to my circles, keep your blog as updated. JAVA Training Institute In Chennai |
ReplyDeletevery nice blogs!!! i have to learning for lot of information for this sites...Sharing for wonderful information. Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing. Final year projects For EEE in Chennai |
ReplyDeleteImpressive blog with lovely information. really very useful article for us thanks for sharing such a wonderful blog... Final year projects For BCA in Chennai |
ReplyDeleteYour blog is awesome..You have clearly explained about it ...Its very useful for me to know about new things..Keep on blogging.. Final year projects For MCA in Chennai |
ReplyDeleteI learned so many things from your blog, keep sharing.. Final year projects For IT in Chennai |
ReplyDeletePython is a dynamic and object-oriented programming language, widely used for web application development. 90% of people prefer Python over other technology because of its simplicity, reliability and easy interfacing. unindent does not match any outer indentation level python
ReplyDeleteI found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work... online marketing outsourcing services
ReplyDeleteThat appears to be without doubt terrific. A good number of teeny facts are meant experiencing great deal of background abilities. I will be interested the thing a large amount. Smart contract software development chennai
ReplyDeleteGreat blog.
ReplyDeleteMLM Software
This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post
ReplyDeleteCustom MLM Software jaipur
I Read your artical.your post is very is very useful.so thankyou so much for sharing...Smart contract development company mirzapur
ReplyDeleteGreat Post…This Article is very unique. Thanks for sharing and very informative!!!MLM Software Development Company Mumbai
ReplyDeleteThanks for writing such a good article.I stumbled into your especially.Really ts inconceivable article keep it up!!!crypto exchange software development mumbai
ReplyDeleteAmazing article I like to read your blog very useful keep it up thanks for share.
ReplyDeleteERC20 Token Developer in Mumbai
Thanks for providing such an Interesting blog.
ReplyDeleteSMART CONTRACT SOFTWARE DEVELOPMENT
Such an amazing blog.
ReplyDeleteMLM PLAN VIDEO MAKER
Great Post…This Article is very unique. Thanks for sharing and very informative!!gupt rog in Allahabad
ReplyDeletefantastic artical.thanks for a sharing and i read this blog..gupt rog doctors in allahabad
ReplyDelete
ReplyDeleteThis blog is really awesome. I learned lots of informations in your blog. Keep posting like this...
German Classes in Bangalore
German Language Course in Bangalore
German Language Course in Hyderabad
German Language Course in Delhi
German Language Classes in Pune
I found your this post while searching for some related information on blog search...Its a good post..keep posting and update the information. palm hills alexandria
ReplyDeleteWonderful beat ! I wish to apprentice while you amend
ReplyDeleteyour web site, how can i subscribe for a blog site? The account helped me a acceptable deal.
I had been a little bit acquainted of this your broadcast
provided bright clear idea.대구오피
부산오피
This post is really nice thanks for it keep posting.Best Sexologist in Prayagraj
ReplyDeletei really try these steps its very helpful to me , thanks for this amazing blog ..Sexologist in Allahabad
ReplyDeleteExcellent post. I certainly appreciate this website. Keep writing!top 10 sexologist doctors in allahabad
ReplyDeletevery informative blogs posting thanks you so much sharing me information.
ReplyDeleteGerman Language Course In Gurgaon
This is just the information I am finding everywhere. Thanks for your blog, I just subscribe your blog. This is a nice blog.
ReplyDeleteZirconia Crown Manufacturer In India
Thank you so much for such a well-written article. It’s full of insightful information.
ReplyDeletebestzirconia crowns in india
Your Blog is very nice.
ReplyDeleteWish to see much more like this. Thanks for sharing your information
Buy Peripherals Online at Best Prices | MyBogo | Free Shipping
Wow this blog is very nice …
ReplyDeleteBest SSB Coaching Allahabad
It is amazing and wonderful to visit your site...gupt rog doctors in allahabad
ReplyDeletei really try these steps its very helpful to me , thanks for this amazing blog . Best Sexologist in Prayagraj
ReplyDeletevery nice article thank you
ReplyDeleteBest MNS Coaching Allahabad
It is amazing and wonderful to visit your site.. erectile dysfunction specialist in allahabad
ReplyDeleteAmazing post.Thanks for sharing a valuable information......
ReplyDeleteDevOps Tools
Technologies used by Devops and its Tools
thanks for sharing valid information and a blog post.
ReplyDeleteStudy In Germany
This post is really nice thanks for it keep posting. top 10 sexologist doctors in allahabad
ReplyDeleteI really appreciate the kind of topics you post here, a great information that is actually helpful for us and you can also visit our link for best zirconia crowns in india
ReplyDeleteMega Downloader crack offers user measured scrambled cloud stowing planetary and dialogue as of side to adjacent regular network browsers. Mega Downloader Pc
ReplyDeleteamazing articel thankyou general management course in Germany
ReplyDeleteThanks for sharing the informative data. Keep sharing…
ReplyDeleteSwift Developer Certification Training in Chennai
Swift Online Course
Swift Developer Course in Bangalore
ReplyDeleteI always felt uplifted after reading this blog's posts.
K7 Total Security
thanks for sharing a valid information and a blog post .
ReplyDeleteGerman Language Institute In Chandigarh
Excellent post. I certainly appreciate this website. Keep writing !!!!!!!!! top 10 sexologist doctors in Allahabad ayurvedic clinic
ReplyDelete