Operating System - HP-UX
1833606 Members
3218 Online
110061 Solutions
New Discussion

create automatic script and run by oracle user

 
SOLVED
Go to solution
Ricky_4
Frequent Advisor

create automatic script and run by oracle user

Hi All,

I would like to create automatic startup script but that script should be run by oracle.
Please assist me how to this so it will start automatically once we reboot the server.

I attached the script so you will have an idea.

Thanks in advance.

Adriatico
4 REPLIES 4
m saravanan
Valued Contributor

Re: create automatic script and run by oracle user

Hi,

Put the following in the first line of your script,

su - oracle

save the script & move it to "/sbin/init.d" directory,
For Ex:
# mv /tmp/script /sbin/init.d/oracle

Link the script to "/sbin/rc3.d" , to start the script in run level 3. The naming convention should be Sxxx<script name>.
For Ex:
# cd /sbin/rc3.d
# ln -s /sbin/init.d/oracle S987oracle

If you any script to halt, put the same in "/sbin/rc2.d" and start the name with "K"

Regds,
Saravanan

Luk Vandenbussche
Honored Contributor
Solution

Re: create automatic script and run by oracle user

Hi,

Create a script in /sbin/init.d/oraclestart which contains

su - oracle -c "startscript"

Then execute the following

cd /sbin/rc2.d
ln -s /sbin/init.d/oraclestart S999oraclestart

You script will be executed when you reboot the server
Susik
Advisor

Re: create automatic script and run by oracle user

file /etc/oratab
instance:/oracle_path:Y


Ricky_4
Frequent Advisor

Re: create automatic script and run by oracle user

All,

Please check procedure below if it will work also as automatic shutdown script by following "Luk Vandenbussche" reply as startup script.

procedure:
cd /sbin/rc2.d
ln -s /sbin/init.d/oraclestart K999oraclestart

Thanks.

Adriactico