Operating System - HP-UX
1747985 Members
4735 Online
108756 Solutions
New Discussion юеВ

rc shut/start script problems

 
p7
Frequent Advisor

rc shut/start script problems

hi all

we recently rebooted our rp8400 and the system
got stuck on the oracle startup script. right after the kernal was booting it started getting "stty ...." repeatedly. i rebooted in single user mode removed the links in /sbin/rc2.d for oracle startup and the system came up find. then i tested the oracle script in crontab and from a command line and it worked fine. so it must have been the rc links somehow. anybody have an easy way to to startup scripts for oracle on a standalone box

thx in advance
8 REPLIES 8
DCE
Honored Contributor

Re: rc shut/start script problems

If the oracle startup script in /sbin/init.d works from the command line (ie. /sbin/init.d/oracle start), then the issue may very well be when you start oracle during the boot process. Make sure the link is one of the last, if not the last, command issued at run level two (i.e. S999ORACLE) By having a lower number, you may have tried to start oracle before all of the subsytems were up.
baiju_3
Esteemed Contributor

Re: rc shut/start script problems

Please post your startup script.
Good things Just Got better (Plz,not stolen from advertisement -:) )
p7
Frequent Advisor

Re: rc shut/start script problems

hi

here is the script in /sbin/init.d. it calls another longer script. i just made a link to this in /sbin/rc2.d:


# Invoke the script to issue the commands as the
# Oracle user.

loc="/ora2db01/app/oracle/admin/bin"
script="${loc}/ora2_startup_dbs_ipl.ksh"
/usr/bin/su - oracle -c ${script}
#
DCE
Honored Contributor

Re: rc shut/start script problems

There is a template script in /sbin/init.d that can used to generate a start/stop script for oracle. copy /sbin/init.d/template to /sbin/init.d/oracle, and modify the appropriate portions for your app. You should always use a script based on the template whenever you want an app to start/stop wtih the system startup/shutdown
Devender Khatana
Honored Contributor

Re: rc shut/start script problems

Hi,

Also keep the starting no. the last & stopping no. the first in its run level for proper functioning. This will start oracle in the end while machine boots & stop oracle first while shutting down.

The problem here seems due to not using the template file as indicated above.

HTH,
Devender
Impossible itself mentions "I m possible"
A. Clay Stephenson
Acclaimed Contributor

Re: rc shut/start script problems

Part of your problem is the "su - oracle" rather than "su oracle". I know you want to use oracle's .profile but that is almost certainly the problem. The .profile contains command like tput, sttty, tabs, etc. which expect stdin to be a terminal. The better way todeal with this is to create a file, e.g. /usr/local/bin/oraenv.sh and set and export the environment there. Now both your rc'ed script AND oracle'. .profile should source (using the dot "." operator)
./usr/local/bin/oraenv.sh
this file to set and export these variables.

This sourced file must not contain a return or exit statement.

Plan B.
Surround those commands in oracle' .profile with
if [[ -t 0 ]] # is stdin a tty device?
then
tset ...
stty ...
fi
If it ain't broke, I can fix that.
Yogeeraj_1
Honored Contributor

Re: rc shut/start script problems

hi,

can you try this:
=============================================
echo "/u01/app/oracle/product/8.1.7/bin/sqlplus /nolog <
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
vinod_25
Valued Contributor

Re: rc shut/start script problems

hi Patti

Do the following steps:

step 1: edit /etc/oratab file

ORACLE_SID:ORACLE_HOME: {Y|N}
y -> for dbstart and dbshut scripts to startup and shutdoen the database

step 2: Create dbora script in the /etc/init.d

see attachment for the script

step 3: Create symbolic links to the dbora script in the appropriate run-level
script directories

# ln -s /etc/init.d/dbora /sbin/rc2.d/K10dbora
# ln -s /etc/init.d/dbora /sbin/rc3.d/S99dbora

step 4: avoidance of "stty is not a typewriter" error message

The not-a-typewriter error is caused by running commands where there is no
controlling tty device; that is, no interactive terminal is present. This would
be true for a script that runs in cron or has su - to run a batch job.

Uncomment all stty commands in /home/$ORA_OWNER/.profile as $ORA_OWNER
Example:
# Set up the terminal:
# if [ "$TERM" = "" ]
# then
# eval ` tset -s -Q -m ':?hp' `
# else
# eval ` tset -s -Q `
# fi
# stty erase "^H" kill "^U" intr "^C" eof "^D"
# stty hupcl ixon ixoff
# tabs

Recheck the scripts before applying...
Any suggestions warmly welcomed...

Good Luck !!

Vinod K