Running unix script from putty and DataStage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
thanush9sep
Premium Member
Premium Member
Posts: 54
Joined: Thu Oct 18, 2007 4:20 am
Location: Chennai

Running unix script from putty and DataStage

Post by thanush9sep »

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
Regards
LakshmiNarayanan
thanush9sep
Premium Member
Premium Member
Posts: 54
Joined: Thu Oct 18, 2007 4:20 am
Location: Chennai

Post by thanush9sep »

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
Regards
LakshmiNarayanan
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Your DataStage jobs are running as dstage. I suspect this is the user ID under which DataStage services are started.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
thanush9sep
Premium Member
Premium Member
Posts: 54
Joined: Thu Oct 18, 2007 4:20 am
Location: Chennai

Post by thanush9sep »

If I understood clearly, this should not be dstage but cmtapp user.
How can this be rectified?
I am not a Admin person, however I would like to know if possible.
Regards
LakshmiNarayanan
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

you should explain the detail functionality of that script,
whether cmt.cfg is static or generated on run time, if generated, how

are you selecting it from sys_context/v$ tables?
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

thanush9sep wrote:If I understood clearly, this should not be dstage but cmtapp user.
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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
thanush9sep
Premium Member
Premium Member
Posts: 54
Joined: Thu Oct 18, 2007 4:20 am
Location: Chennai

Post by thanush9sep »

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)
if generated, how
are you selecting it from sys_context/v$ tables?
I am not doing any select, just echoing the information from Unix and DataStage
Regards
LakshmiNarayanan
thanush9sep
Premium Member
Premium Member
Posts: 54
Joined: Thu Oct 18, 2007 4:20 am
Location: Chennai

Post by thanush9sep »

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.
Well I am sorry, I did not understand you.

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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
Post Reply