Jenkins - Sqlplus plugin: Cannot connect to oracle database. TNSNAMES.ORA missing -
i'm making way through jenkins i'm stuck @ moment trying connect remote oracle database in final step of job.
environment vars oracle_home , ld_library_path ok , sqlplus running correctly. connection string seems ok too, endeed connected using same parameters through command line @ same machine, not inside job.
here trace:
sql*plus: release 12.2.0.1.0 production testing directory /usr/lib/oracle/12.2/client64 -------------------------------------------------------------------------- using oracle_home =/usr/lib/oracle/12.2/client64 -------------------------------------------------------------------------- running defined script on dweb/********@10.10.20.52:1521/******* temp script: /tmp/temp-script-15029865208104609348613017529755.sql -------------------------------------------------------------------------- oracle_home = /usr/lib/oracle/12.2/client64 ld_library_path = /usr/lib/oracle/12.2/client64/lib:/usr/lib/oracle/12.2/client64 java.lang.runtimeexception: tnsnames.ora missing! @ org.jenkinsci.plugins.sqlplusscriptrunner.sqlplusrunner.invoke(sqlplusrunner.java:231) @ org.jenkinsci.plugins.sqlplusscriptrunner.sqlplusrunner.invoke(sqlplusrunner.java:16) @ hudson.filepath.act(filepath.java:998) @ hudson.filepath.act(filepath.java:976) @ org.jenkinsci.plugins.sqlplusscriptrunner.sqlplusrunnerbuilder.perform(sqlplusrunnerbuilder.java:98) @ hudson.tasks.buildstepmonitor$1.perform(buildstepmonitor.java:20) @ hudson.model.abstractbuild$abstractbuildexecution.perform(abstractbuild.java:735) @ hudson.model.build$buildexecution.build(build.java:206) @ hudson.model.build$buildexecution.dorun(build.java:163) @ hudson.model.abstractbuild$abstractbuildexecution.run(abstractbuild.java:490) @ hudson.model.run.execute(run.java:1735) @ hudson.model.freestylebuild.run(freestylebuild.java:43) @ hudson.model.resourcecontroller.execute(resourcecontroller.java:97) @ hudson.model.executor.run(executor.java:405) error: tnsnames.ora missing! finished: failure
i tried setting oracle_sid environment var same result. idea?
for record: running jenkins docker image
https://wiki.jenkins.io/display/jenkins/sqlplus+script+runner+plugin
can plugin (sqlplusrunner) supports local naming (tns)? in case, have create tnsnames.ora file placed in favorite folder , set export tns_admin=/my/favorite/folder
cat tnsnames.ora my_tns_alias=(description=(address_list=(address=(protocol=tcp)(host=myip)(port=1521)))(connect_data=(service_name=my_service_name)))
now can configure connection
instance: <my_tns_alias>
tip: make sure have succesful connection through sqlplus (cli) before continue jenkins.
for scenario, think oracle runtime client have been better option install. instantclient work though.
best of luck!
bjarte
Comments
Post a Comment