Operating System - HP-UX
1827728 Members
2703 Online
109968 Solutions
New Discussion

SG/Oracle9i /Toolkit in csh environment.

 
Ed Luster
Occasional Contributor

SG/Oracle9i /Toolkit in csh environment.

We found a problem after installing oracle9i and trying to rebuild the cluster. The toolkit files (specifically haoracle_sql.sh) appears to be built for the oracle id to be run in posix shell. Ours runs in a csh environment so the "su - oracle" sections for the start and stop routines fail, (export is not a valid command, also command="pfile=$PFILE" fails.) Does anyone have a haoracle_sql.sh for csh environment?
3 REPLIES 3
renarios
Trusted Contributor

Re: SG/Oracle9i /Toolkit in csh environment.

Hi Ed,

Why do you use csh on your HP-UX machines? As far as I know, all Oracle scripts are written in Korn/POSIX shell.
A possible workaround is to do the following:
su - oracle -c"
/usr/bin/sh << EOF
/path/to/haoracle_sql.sh
EOF"

Cheerio,

Renarios
Nothing is more successfull as failure

Re: SG/Oracle9i /Toolkit in csh environment.

Ed,

Yes, its rubbish isn't it? I only use the ECMT cos HP support get all whiney if they find you've rolled your own scripts rather than used theirs. I have a much richer and more controlable set of scripts I use myself when the occasion arises, and they certainly handle the situation you describe (as well as many other the toolkit doesn't consider!)

Anyway, as indicated above, to make the script work correctly when using csh as oracles shell locate the two lines in haoracle_sql.sh that look like this:

su - ${ORACLE_ADMIN} <
and change them to:

su - ${ORACLE_ADMIN} -c "/usr/bin/sh" <
that should sort it

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Ed Luster
Occasional Contributor

Re: SG/Oracle9i /Toolkit in csh environment.

Thanks for the suggestions. I tried it in a test script and it works only if I hard code the value of $ORACLE_HOME in the sqlplus line. Looks like the export fails to pass the variable. This fails:

#!/usr/bin/sh
su - oracle -c "/usr/bin/sh" <export ORACLE_HOME=/oracle/9.2.0
${ORACLE_HOME}/bin/sqlplus '/ as sysdba' <select INSTANCE_NAME from v\\\$instance;
exit;
SQLEOF
EOF

but the following works:

#!/usr/bin/sh
su - oracle -c "/usr/bin/sh" <export ORACLE_HOME=/oracle/9.2.0
/oracle/9.2.0/bin/sqlplus '/ as sysdba' <select INSTANCE_NAME from v\\\$instance;
exit;
SQLEOF
EOF

Same goes for the csh option, i.e. setenv ORACLE_HOME /oracle/9.2.0 fails to fill $ORACLE_HOME in the sqlplus line but hard code works.

I know this should work, any other suggestions? The environment is HPUX 11.11, running test script as root.

As far as why csh, there has been too much development by dba staff to change it - just not feasible.