Page 1 of 1

How to add TNS_ADMIN in Project

Posted: Tue Jan 21, 2014 8:53 am
by Amit_111
Hi,

I need to store the tnsnames.ora file in other location and let DS use the same from there.

When my Job executes I am not able to see this parameter in the Environment Variables list in DS Director logs.

I added this $TNS_ADMIN in dsenv with the new path where I want this file to be but after i execute ./dsenv and then echo $TNS_ADMIN, it still shows the old path and also I cannot see it still in the job log in director.

My job is aborting giving the error
The connector could not establish a connection to the default Oracle server. Method: OCIServerAttach, Error code: 12,162, Error message ORA-12162: TNS:net service name is incorrectly specified.
Kindly request you to provide some pointers to add this ENv variable in the job.

Thank You !!!

Posted: Tue Jan 21, 2014 9:21 am
by chulett
Add it as a User Defined variable to the project... but adding it to dsenv should also work. Show us your syntax, you may not be exporting it.

Posted: Tue Jan 21, 2014 10:03 am
by Amit_111
This is what is written in the dsenv file
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
I have added the TNS entry in the file tnsnames.ora at this location but somehow it is still not showing in the DS Director log and the job is aborting giving the error
Exception thrown from CC_OraConnection::verifyConnection, file CC_OraConnection.cpp, line 4398: The connector could not establish a connection to the default Oracle server. Method: OCIServerAttach, Error code: 12,162, Error message ORA-12162: TNS:net service name is incorrectly specified.

Posted: Tue Jan 21, 2014 10:18 am
by chulett
First off, that's the default location so there's no need to have $TNS_ADMIN set. Have you verified your TNS entry is correct?

Posted: Tue Jan 21, 2014 10:47 am
by Amit_111
Hi Craig,

Yes, thats the default path but I was more focusing on trying to bring the TNS_ADMIN env variable to be seen in DS Director logs in the Environment Lists.

Also the tns entry is proper, I will check further on it but I was concerned why that parameter is not shown in DS Environment list logs.

Posted: Tue Jan 21, 2014 9:55 pm
by chulett
Again, if you want to add it to the project, create a User Defined variable with that name. You could set it to $ENV and then override it in a job, or just set your other path in the project so all jobs use it, if that's what you need.

Posted: Tue Jan 21, 2014 11:34 pm
by ray.wurlod
Open the Administrator client, select your project on the Projects tab, click Properties then click Environment. You'll now be in the workspace of which Craig speaks. Open the User Defined branch and add TNS_ADMIN and any other environment variables you may required (such as ORACLE_SID).