Operating System - HP-UX
1748226 Members
4396 Online
108759 Solutions
New Discussion юеВ

Re: Auto Shutdown and Startup script for Oracle8.1.7

 
SOLVED
Go to solution
Jesse Delk
Frequent Advisor

Auto Shutdown and Startup script for Oracle8.1.7

I'm running HP-UX 11.11 Version1 and Oracle 8.1.7. Does anyone have any scripts I could have for:

/sbin/init.d/oracle
/etc/rc.config.d/oracle

From what I've read the second one maybe only

ORACLE_START=1
export ORACLE_START

but I'm not sure. I have oratab set up and able to create symbolic links that I need once the first script is created.
13 REPLIES 13
Rita C Workman
Honored Contributor
Solution

Re: Auto Shutdown and Startup script for Oracle8.1.7

Here's a little note I wrote for myself on setting up Oracle to start when a server reboots. It 'assumes' that the box does not run MC/SG. Now remember, they are my old notes, and on these small old boxes we would do a nightly shutdown and run cold backups. So you may want to exclude things like that.

How to start Oracle D/B on UNIX system startup automatically
Three steps

First:
set up Oracle start up scripts ( see DBA for this ) and edit the cronfile to include these
Cronfile for most systems is : /var/spool/cron/crontabs/root
then remember to crontab the root cronfile and ensure that this 'took' by doing a crontab -l.

Second:
create a file for the system to trigger on and start the Oracle d/b by creating a file (ex:
start_oracle.sh) it should include the following line(s):

su - oracle -c /home/oracle/start_oracle_db.sh

Note: spacing in above is exactly as it should be; the user is oracle; the -c forces it to run
the script on the line; /home/...is the location of the oracle start script from first step (see DBA)
save this file (start_oracle.sh) in /usr/local/bin

Third:
Go to /sbin/rc3.d (this is the default sbin startup routines)
create a symbolic link file to startup here by entering the following:

ln -s /usr/local/bin/start_oracle.sh S123start_oracle_db.sh

(where 123 equal the number for filing purposes of this routine, be careful
to file it properly for processing purposes)

OK...that's pretty much it.

Rgrds,
Rita

Thayanidhi
Honored Contributor

Re: Auto Shutdown and Startup script for Oracle8.1.7

You can copy lp script (/sbin/lp) or similar one and modify accrdingly.
source the variable file (. /etc/rc.config.d/oracle) and call Oracle utility to start or stop the DB.
Remember that sbin processes are started by root user. So you use su - -c <script>.

Hope this helps.

Regds
TT
It's not necessary to have /etc/rc.config.d/oracle unless you want to control time to time. Simply keeping the script in /sbin/init.d and linking t rc3.d & rc2.d would be sufficient.
Attitude (not aptitude) determines altitude.
DCE
Honored Contributor

Re: Auto Shutdown and Startup script for Oracle8.1.7

There is a template file in /sbin/init.d that you can use to construct the oracle start/stop script. copy it to an new name (oracle) and place the appropriate start and stop commands in the start/stop areas.

The /etc/rc.config.d/oracle file is a flag file to disable/enable the start and/or stopping of oracle at system startup/shutdown. It is very benficial to use when you are doing multiple boots (patching, upgrading, etc) and do not want to wait for oracle to load each time - you just set the flag to 0.

Remember that when you make the links to use the "rule of 1000" the numbers in the S and K links should add up to 1000. i.e. S900oracle and K100oracle. This means oracle will be one of the last started, and one of the first shutdown.
Victor Fridyev
Honored Contributor

Re: Auto Shutdown and Startup script for Oracle8.1.7

Hi,

You can use the attached script. The script looks for the file called /etc/rc.config.d/oraconf, which should contain the following:
ORACLE_START=1

Please take into account that the script uses Oracle standard procedures dbstart and dbshut. The procedures require /etc/oratab file, which must contain all used SIDs.


HTH
Entities are not to be multiplied beyond necessity - RTFM
Eric Antunes
Honored Contributor

Re: Auto Shutdown and Startup script for Oracle8.1.7

Hi Jesse,

Here are my scripts:

dbora817 is the script you must put at /sbin/init.d

start_boot_db.sh and start_boot_db.sh are the scripts you must have at the $ORA_BASE/.../ in dbora817.

Finally, you create links to dbora817 at the run level you want them to start and stop: rc2.d/S866dbora817 and rc3.d/K133dbora817 are respectively the links I use here at my servers. Note that 866+133=1000...

Best Regards,

Eric Antunes
Each and every day is a good day to learn.
Eric Antunes
Honored Contributor

Re: Auto Shutdown and Startup script for Oracle8.1.7

Better spelling:

...

start_boot_db.sh and start_boot_db.sh are the scripts you must have at the $ORA_BASE/... (see dbora817).

Finally, you create links to dbora817 at the run level you want them to start and stop: /sbin/rc2.d/S866dbora817 and /sbin/rc3.d/K133dbora817 are respectively the links I use here at my servers. Note that 866+133=1000...

Eric Antunes
Each and every day is a good day to learn.
Jesse Delk
Frequent Advisor

Re: Auto Shutdown and Startup script for Oracle8.1.7

One more thing........

about the links..some document from Oracle Metalink suggested....create /K100oracle in /sbin/rc1.d

It looks as though most of you said create it in /sbin/rc3.d

Which should it be or does it matter?
DCE
Honored Contributor

Re: Auto Shutdown and Startup script for Oracle8.1.7

Application scripts usualy are started at run level3, and brought down at run level 2

You want to bring up the application after all the basic subsystems are started, and they are a started at run level 2, and you want your application down before basic services are terminated, again at run level 2 Which is why you want a a low K number on the link i.e. K100oracle, so that the app is brought down before, say, networking.

Dave
Sandman!
Honored Contributor

Re: Auto Shutdown and Startup script for Oracle8.1.7

Jesse,

If you'ave a valid oratab file in the /var/opt/oracle directory and the ORACLE_HOME variable is defined and exported, use the attached script and follow the steps below:

1. Install the script in the /sbin/init.d directory, name it oracle.

2. make symbolic links to the 2 and 3 run-levels for stopping and starting oracle respectively like...

ln -s /sbin/init.d/oracle /sbin/rc3.d/S900oracle
ln -s /sbin/init.d/oracle /sbin/rc2.d/K100oracle