What is the use of TNS_ADMIN variable in Oracle?

一世执手 提交于 2019-12-12 12:13:59

问题


Please tell me what is the use of TNS_ADMIN parameter in Oracle? I am working on Unix using oracle database.

Is this parameter is required to locate the sqlplus. I am executing a script in which a update query is executed on Oracle Database.

The script fails with 127 error code when executed with crontab.

The script contents I suspect (eval) failing are

----------
cmd='sqlplus ${ORALOGIN} < SQLS
----------
eval $cmd

回答1:


TNS_ADMIN tells sqlplus where to find the tnsnames.ora file.

If you are running sqlplus from a crontab then the normal reason for having difficulty are:

  1. Incorrect path
  2. Not having the correctly set ORACLE_SID or other Oracle connection information
  3. A startup/login script that is getting executed when you login to the system that is interfering with your cron execution
  4. Some script that you run from the command line when you login that sets up your Oracle environment that is not getting executed in your crontab.

Check these things and other environment related items. It always takes me a number of passes to get crontab and Oracle to work happily together.



来源:https://stackoverflow.com/questions/1818016/what-is-the-use-of-tns-admin-variable-in-oracle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!