Type in command line 'crontab -e'
and insert line like that:
00 8-20 * * * su -l oracle --command="/home/oracle/shell/recync.sh"
where 00 - minutes, 8-20 - hours, ...
Read that: http://www.nvision.com/support/unix/...x/crontab.html
You can surely automate these tasks to come up when the system comes up.You will need to write a shell script and put all the commands and test it to doulbe check weather it is performing the task.After performing the above task you will have to copy the above file to the following directory
/etc/init.d
Name the file as
S100nameofthefile
The letters S is used to execute the file during startup and the no 100 is the sequence in which the files should be executed
Why are you Invoking the listener twice beacause whatever no of listener services you create they are all in listener.ora file so thru one command you should be able to start all the services in the listener.ora file and that is
lsnrctl start
Why dont you try the following code
su -c user1
lsnrctl start
svrmgrl @first.sql
cd /home/app/oracle/admin/xxx/scripts
./ap.sh start all
exit
su -c user2
cd /home/app/oracle/1103/admin/xxx/scripts
./apcm.sh start
./apfrm.sh start
Create the following file and remember to input the exact path in ur script file
After logging in as root...
# pwd
/
I ran the script
# ./home/app/oracle/admin/xxx/scripts/back/ssstart.sh
Sun Microsystems Inc. SunOS 5.6 Generic August 1997
$
It comes to the prompt as above and stop there, how to make it continue the execution of the script?
When I type exit at the prompt the result is as follows...
$ exit
./home/app/oracle/admin/xxx/scripts/back/ssstart.sh: lsnrctl: not found
./home1/app/oracle/admin/VIS/scripts/back/ssstart.sh: svrmgrl: not found
Yeah you'll need to make sure the script sets up all the required environment variables, if you run it yourself your environment might already be set up, but when crontab runs it, nothing is.
But, the problem I'm facing is that after loggging in as dba user(user1) the script does not continue to execute! How to make the script continue to execute after logging in?
The reason the errors svrmgrl, lsnrctl not found comes is, as nothing happens after logging in as dba user(user1), I type exit at the prompt and so it comes to root n continues to execute the script and gives these error.
THE PROBLEM NOW IS 'HOW TO MAKE THE SCRIPT CONTINUE TO EXECUTE AFTER LOGGING IN'
Bookmarks