Operating System - Linux
1757412 Members
3224 Online
108860 Solutions
New Discussion юеВ

Running process in background

 
Ragni Singh
Super Advisor

Running process in background

I want to run a clone of a database in the background .. how do I submit stuff to run in background in oracle ? also I want to log the activity ? thanks

Points will be assigned.

7 REPLIES 7
Peter Nikitka
Honored Contributor

Re: Running process in background

Hi,

- put all required commands in shell script e.g. 'do_it'
- first line should be something like
#!/bin/bash
- chmod +x do_it
- ./do_it &

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Ross Minkov
Esteemed Contributor

Re: Running process in background

You can also add "nohup" in front of it, especially if it takes longer; this way if you get disconnected it will continue running (hangup signals are ignored). You can even log out and it will continue running. If you have any output it will go to nohup.out file.

Regards,
Ross
Wilfred Chau_1
Respected Contributor

Re: Running process in background

or after you have executed the script,

press
and then type bg, to put the job in the background.
Justin_99
Valued Contributor

Re: Running process in background

I am a big fan of the screen command.

Just type screen, in the new "screen" run your command then hit ctrl-a d to detach and go back to your original session. This screen will remain there with whatever command you ran. Just run screen -r to reattach to the screen.
I do this when I have large filesystems to fsck and I know it will be after hours when they finish. This way I can log out, take my laptop home and check later.
Ivan Ferreira
Honored Contributor

Re: Running process in background

To send a command into background just add & to the end of the command. To log the activity you need to redirect the "stdout" and "stderr" file descriptors. You have to use a command like this:

command > /tmp/command.log 2>&1 &

That will log activity to /tmp/command.log and send the command to background.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Kapil Jha
Honored Contributor

Re: Running process in background

I think what u want is to run a oracle command in backgroung in shell...
if no then above replies would do...
if yes then use,
export ORACLE_SID=XXXX
sqlplus username/passwd@oracle query

Hope this help
BR,
Kapil
I am in this small bowl, I wane see the real world......
Abhirama.M.V
Occasional Advisor

Re: Running process in background

hi,
by giving '&' symbol u can run it in background. first check out weather that file has 'x' i.e. execution permission or not. if permission is not their give it.