A good way to test that the JDBC URL being used is valid is via the JDBCConnectionAliveTester test utility (attached here)
(1) Extract the JDBCConnectionAliveTester.zip package into a directory. It will extract two files:
JDBCConnectionAliveTester.class
JDBCConnectionAliveTester.java
(2) Decide which JDBC URL Oracle connection string to test.
The default BCO connection string is:
jdbc:oracle:thin:@$ORACLE_SERVER:$ORACLE_PORT:$ORACLE_SERVICENAME
When the default connection string doesn't properly connect to the database the following connection string modification is frequently successful:
jdbc:oracle:thin:@//$ORACLE_SERVER:$ORACLE_PORT/$ORACLE_SERVICENAME
For example:
jdbc:oracle:thin:@//dbhostname:1521/dbservice
Once you've picked a JDBC URL to test (or received one from the DBA) you can move onto the test steps.
Please, read the readme.txt file in the zip to undersand the options of the script
(2a) If you have CO installed already, then run:
. /opt/cpit/env.sh # This will source the env.sh environment variables into your environment
$JAVA_HOME/bin/java -cp "$ORACLE_HOME/jdbc/lib/ojdbc6.jar:." JDBCConnectionAliveTester [BCO connection string] $DBUSR [CPIT_OWN password] 3600 -t 300 -c 20 > JDBCConnectionAliveTester.out &
For example.
/opt/cpit/env.sh # This will source the env.sh environment variables into your environment
$JAVA_HOME/bin/java -cp "$ORACLE_HOME/jdbc/lib/ojdbc6.jar:." JDBCConnectionAliveTester "$JDBCURL" $DBUSR [CPIT_OWN password] 3600 -t 300 -c 20 > JDBCConnectionAliveTester.out &
(2b) If you do not yet have CO installed
If you don't yet have the CO database account set up (for example, you are testing the JDBC URL before the installation of CO) then you can specify any username or password string (it doesn't need to be a valid database user account). If the connection fails with an invalid username/password error that would indicate that the JDBC URL specified is correct to allow a connection to the database if you had a valid username/password).
But you'll also need to manually set the required JAVA_HOME and ORACLE_HOME environment variables before running the JDBCConnectionAliveTester command
export JAVA_HOME=/[Path to BCO Installation Image]/BCO/jre
export ORACLE_HOME=/[Your Oracle HOME path]
$JAVA_HOME/bin/java -cp "$ORACLE_HOME/jdbc/lib/ojdbc5.jar:." JDBCConnectionAliveTester [BCO connection string] BCO_OWN BCO_OWN 3600 -t 300 -c 20 > JDBCConnectionAliveTester.out &
For example:
export JAVA_HOME=/data1/bco90install/BCO/jre
export ORACLE_HOME=/data1/oracle/product/11.2.0
$JAVA_HOME/bin/java -cp "$ORACLE_HOME/jdbc/lib/ojdbc5.jar:." JDBCConnectionAliveTester [BCO connection string] BCO_OWN BCO_OWN 3600 -t 300 -c 20 > JDBCConnectionAliveTester.out &
If the test will give you an Oracle error, take a look at this article with the common Oracle errors and hints to how solve
Common Oracle errors in TrueSight Capacity Optimization (TSCO): how detect and debug.
Legacy ID:KA363547