Oracle - What TNS Names file am I using?

前端 未结 11 665
长发绾君心
长发绾君心 2020-12-07 13:50

Sometimes I get Oracle connection problems because I can\'t figure out which tnsnames.ora file my database client is using.

What\'s the best way to figure this out?

11条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 14:18

    For linux:

    $ strace sqlplus -L scott/tiger@orcl 2>&1| grep -i 'open.*tnsnames.ora'
    

    shows something like this:

    open("/opt/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora",O_RDONLY)=7
    

    Changing to

    $ strace sqlplus -L scott/tiger@orcl 2>&1| grep -i 'tnsnames.ora'
    

    will show all the file paths that are failing.

提交回复
热议问题