error running WCC config command wgen using --dbtnspath
search cancel

error running WCC config command wgen using --dbtnspath

book

Article ID: 259219

calendar_today

Updated On:

Products

CA Workload Automation AE

Issue/Introduction

getting an error running the WCC config command below

(drp) <USERNAME>@<HOSTNAME>:/opt/CA/WorkloadAutomationAE/wcc/bin $ ./wcc_config.sh -u <DOMAIN>\\<User>@<DOMAIN>.com -p *** --dbplatform ORACLE --dbuser UNC_WCCDBO --dbpassword *** --dbtnspath /home/<USERNAME> --dbname unc_prd_dr_srv.unc_prd_dr.<DOMAIN>.ca --dbapp WCC
Logging in as '<DOMAIN>\\<User>@<DOMAIN>.com' - SUCCESS

Validating tomcat DB details...
Cannot validate the database using the connection properties below:
TNS name of the database connection: UNCAE
Path to the tnsnames.ora file: /home/<USERNAME>
Schema User: UNC_WCCDBO
Platform: ORACLE
User: UNC_WCCDBO
Password: *****
E190664 - Cannot connect to database. Changes will not be applied.
See log for full exception.

Environment

Autosys 12.X
WCC 12.x

Cause

when using --dbtnspath you must specify the --dbtnsname as well if the new TNSname is different than the one currently in use in the connections.properties file

Resolution

Please find my analysis below:

1. TNS path - only specify the path without the file name (tnsnames.ora)
2. As the user is using TNS configuration, this is how utility needs to be used

./wcc_config.sh -u <DOMAIN>\\<User>@<DOMAIN>.com -p *** --dbplatform ORACLE --dbuser UNC_WCCDBO --dbpassword *** --dbtnspath /home/<USERNAME> --dbtnsname <TNS NAME> --dbapp WCC

NOTE:
that we need to use dbtnsname and not dbname with tns configuration.

you can find example usage for TNS when you issue wcc_config --help

Change reporting database to Oracle database running on remote server using TNS definition:
./wcc_config.sh -u username -p password -dbapp REPORTING --dbplatform oracle --dbtnspath /opt/CA/WorkloadCC/data/config/tns/ --dbtnsname WCC_RPT --dbuser wcc_user --dbpassword wcc_pwd

If we are using TNS configuration tnspath and tnsname will be considered and not dbname .
This is the existing behavior of WCC command line utility that it ignores extra properties which are not required for a particular case(dbame in this case).
dbname and dbport are considered with normal hostname, port configuration.
These parameters will be ignored when we are using tns configuration.
In case of TNS configuration if tnspath or tnsname is not provided in the commandline argument , wcc_config will read the corresponding entries from connection.properties file and try to validate the connection.

In non-working environment 
TNS name in TNS_ADMIN tnsnames.ora is WCC.
But the connection.properties has wcc.database.tnsname=UNCAE
As user had not given --dbtnsname property in command-line it read the property (tnsname) from connection.properties which is UNCAE but this tns identifier is missing in tnsnames.ora file of TNS_ADMIN directory.

Hence the connection failed.

So the command should have been like this --dbtnspath /home/<USERNAME> --dbtnsname WCC
As the tns identifier (WCC) is same as in tnsnames.ora of TNS_ADMIN, connection was successful.