1834297 Members
2084 Online
110066 Solutions
New Discussion

Switching id in script

 
Ridzuan Zakaria
Frequent Advisor

Switching id in script

Hi,

I have written the following code to allow an id which in dba group to switch to oracle id while running "checklsnr.sh" script.

The below command worked fine on Sun and Linux (Red Hat) but it doesn't seems to be working on HP-UX:

#############################################
#!/usr/bin/ksh
set -x
echo "Test Begin"
(echo touch /oracle/dba/checklsnr.sh ) | sw oracle

#############################################

Oracle id is a NoLogin id. We switch to oracle id using "sw" utility.

Here is the output when ran on HP-UX. It immediately close the connection with running the script.

########################################
+ echo Test Begin
Test Begin
+ echo touch /oracle/dba/checklsnr.sh
+ sw oracle
Switching to oracle
Closed connection.
##########################################

Any ideas why the script not able to switch to Oracle id on HP-UX?

Thanks.
quest for perfections
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor

Re: Switching id in script

Well, sw is not a standard command. You need to examine sw (if it is a script) and trobleshoot from there.
If it ain't broke, I can fix that.
Ridzuan Zakaria
Frequent Advisor

Re: Switching id in script

Thanks for the feedback. I have decided not to pursue this solution. We might be using sudo instead.

Thanks.
quest for perfections