cancel
Showing results for 
Search instead for 
Did you mean: 

How to write Server Startup & Shutdown Script.....

Former Member
0 Kudos

Hi Experts,

Presently we are startting SAP using manually with following commands in HP-UX.

============================================

PRODUCTION SERVER ‘SWITCH –ON ’ PROCEDURE

( Before proceeding, Check if we are in root or not)

  1. pwd

/

  1. su - oraprd -c lsnrctl start

>start

press Ctrl + d

  1. su - prdadm -c startsap

enter

#exit

PRODUCTION SERVER ‘SWITCH –OFF ’ PROCEDURE

( Before proceding, Check if we are in root or not)

  1. pwd

/

  1. su - prdadm -c stopsap (Enter)

Press Enter Again..

  1. su - oraprd -c lsnrctl stop (Enter)

LSNRCTL> stop (Enter)

Press Ctrl + d

  1. shutdown now To shutdown SAP system

  1. shutdown -hy 0 To shutdown HP Production server

===================================================

How to write HP-UX script for starting and shutdown the SAP in single command ?

Pl. guide us.

Regards,

Yusuf

null

Accepted Solutions (1)

Accepted Solutions (1)

former_member618758
Active Participant
0 Kudos

Hi Yusuf,

2 scripts startup and shutdown:

As root: (assume you have oratab file set)

For startup:

su - oraprd -c "lsnrctl start"

su - oraprd -c dbstart

su - prdadm -c "startsap r3"

For shutdown:

su - prdadm -c "stopsap r3"

su - oraprd -c dbshut

su - oraprd -c "lsnrctl stop"

Hope these help,

George

Former Member
0 Kudos

Hi Chang,

Thanks and also pl. tell me how to set oratab file ?

If it is set, then how and where to see it ?

Yusuf

former_member204746
Active Contributor
0 Kudos

use an editor such as 'vi /etc/oratab' and just change N to Y for wanted entries, then save the file.

Message was edited by:

Eric Brunelle

Former Member
0 Kudos

Hi George

I read script you suggested, i want to know one thing how these commands will execute. like it will issue "stopsap r3" will it wait to finish this command and execute "dbshut". how it is assured.

Bhupendra

former_member618758
Active Participant
0 Kudos

yes it will finish the previous before next command, it's sequential.

of course you can always be more fancy by puttting commands in between like do ps -ef|grep dw, etc... to check sap processes before dbshut, but it's not necessary.

George

Former Member
0 Kudos

Hi Chang,

I have gone in vi /etc/oratab but no entries are found there.

Shall i create a file oratab in /etc ?

Yusuf

former_member618758
Active Participant
0 Kudos

Hello Yusuf,

Sorry for the late reply oratab file usually in /etc or /var/opt/oracle directory when installing database software, yes you can create one if it's not there, format is:

database_sid:oracle_home_dir:Y|N

- database_sid is the system id (SID) of an Oracle instances on the server.

- Oracle_home_dir is the ORACLE_HOME directory associated with this instance.

- The Y|N flags indicate if the instance should automatically start at boot time (Y=yes, N=no).

Oracle's "dbstart" and "dbshut" scripts use this file to figure out which instances are to be start up or shut down (using the third field, Y or N).

Thanks,

George

Former Member
0 Kudos

Hi Chang,

Thanks. Now everything is clear.

Rewarded.

Yusuf.

Answers (0)