Running unix script from putty and DataStage
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 54
- Joined: Thu Oct 18, 2007 4:20 am
- Location: Chennai
Running unix script from putty and DataStage
I have a unix user named:cmtapp
I wrote a script in which i echoed the username, password and SID of a oracle database
Note: tnsadmin is setup good.
It displayed the correct values which where in the cmt.cfg file (cfg file contains all the variables like username, password and SID of a database).
While I run it through the datastage the username was correct but the password was in encrypted format and I had the wrong SID in the director.
I run env in unix, I found username, password and SID to be correct. There is a variable called USER=cmtapp
While I run from datastage USER=dstage
I want to know if I run a unix script and the user is cmtapp and while I run from datastage why user is dstage.
Note:
I am using the execute command.
I am not passing any parameter from datastage to the script
I wrote a script in which i echoed the username, password and SID of a oracle database
Note: tnsadmin is setup good.
It displayed the correct values which where in the cmt.cfg file (cfg file contains all the variables like username, password and SID of a database).
While I run it through the datastage the username was correct but the password was in encrypted format and I had the wrong SID in the director.
I run env in unix, I found username, password and SID to be correct. There is a variable called USER=cmtapp
While I run from datastage USER=dstage
I want to know if I run a unix script and the user is cmtapp and while I run from datastage why user is dstage.
Note:
I am using the execute command.
I am not passing any parameter from datastage to the script
Regards
LakshmiNarayanan
LakshmiNarayanan
-
- Premium Member
- Posts: 54
- Joined: Thu Oct 18, 2007 4:20 am
- Location: Chennai
To be exact
Log from Director:
USER=dstage
BCS_ORA_PWD=LD;@1IVHN9BN0G7I<:J51K04F<>IM1
BCS_ORA_SID=r1d1c
BCS_ORA_USER=bcs_adm
CMT_ORA_PWD=LD:@0;VH=9BN0GFI<KJ<0K04F<>IM1
CMT_ORA_SID=r1d1c
CMT_ORA_USER=cmt_dat
env from Unix user:
USER=cmtapp
BCS_ORA_PWD=bcs_dev_01
BCS_ORA_SID=bcs_dev
BCS_ORA_USER=bcs_adm
CMT_ORA_PWD=cmt_dev_01
CMT_ORA_SID=cmt_dev
CMT_ORA_USER=cmt_dat
Log from Director:
USER=dstage
BCS_ORA_PWD=LD;@1IVHN9BN0G7I<:J51K04F<>IM1
BCS_ORA_SID=r1d1c
BCS_ORA_USER=bcs_adm
CMT_ORA_PWD=LD:@0;VH=9BN0GFI<KJ<0K04F<>IM1
CMT_ORA_SID=r1d1c
CMT_ORA_USER=cmt_dat
env from Unix user:
USER=cmtapp
BCS_ORA_PWD=bcs_dev_01
BCS_ORA_SID=bcs_dev
BCS_ORA_USER=bcs_adm
CMT_ORA_PWD=cmt_dev_01
CMT_ORA_SID=cmt_dev
CMT_ORA_USER=cmt_dat
Regards
LakshmiNarayanan
LakshmiNarayanan
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 54
- Joined: Thu Oct 18, 2007 4:20 am
- Location: Chennai
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
-
- Premium Member
- Posts: 54
- Joined: Thu Oct 18, 2007 4:20 am
- Location: Chennai
you should explain the detail functionality of that script,
whether cmt.cfg is static or generated on run time,
the script name is a.sh and has the following
echo $CMT_ORA_USER
echo $CMT_ORA_PWD
echo $CMT_ORA_SID
cmt.cfg is static or does not change in any point. I have keyed in manually the information about the database. This information will be used in the User-defined Environment variable (i.e., I have not included them in User-defined Environment variable yet)
I am not doing any select, just echoing the information from Unix and DataStageif generated, how
are you selecting it from sys_context/v$ tables?
Regards
LakshmiNarayanan
LakshmiNarayanan
-
- Premium Member
- Posts: 54
- Joined: Thu Oct 18, 2007 4:20 am
- Location: Chennai
Well I am sorry, I did not understand you.You did not understand clearly. And your script is working correctly assuming you want the O/S user rather than the logged in user/schema name.
To be clear, I have logged on to the user=cmtapp and password=xxxxx.
In the $HOME path, I have a file tnsadmin/tnsnames.ora, you know the purpose
In a another folder may be "configuration" I have the cmt.cfg in which I have the variables and their values and I have used the export. Nothing less Nothing more, a very simple UNIX script.
when I do a sh a.sh
It returns the correct values.
when I log on to the Designer using the same user cmtapp
It returns the wrong information
Regards
LakshmiNarayanan
LakshmiNarayanan
No, it does not. It still returns the correct information, just apparently not the information you are expecting. Who you are logged in as has no bearing on what user DataStage jobs run as, so expecting them to match is unrealistic. There also seems to be a confusion with regards to the UNIX user and the Oracle user - $CMT_ORA_USER is the same in both examples, it's only $USER (the UNIX user) that changes.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
From memory, in version 7 job run requests pick up the user ID under which the DataStage services, particularly dsrpcd, were started. Are you running in "impersonation mode"?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.