Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Referring external file in TNSORANAMES.ora

I am trying to write a VB script to add/edit/delete some entries in tnsnames.ora. It will be convenient to refer/modify an external file (say myProjectOraNames.ora) rather than modifying tnsnames.ora

With this configuration (assuming it is possible), the Oracle client should refer to both the existing tnsnames.ora file and my new myProjectOraNames.ora to get service details.

Is there any option/configuration can be done to achieve this functionality?

like image 354
Lokesh Avatar asked Oct 14 '11 14:10

Lokesh


People also ask

What is the use of Sqlnet Ora in Oracle?

The sqlnet. ora file is the profile configuration file. It resides on the client machines and the database server. Profiles are stored and implemented using this file.


1 Answers

You can configure the primary tnsnames.ora file to use other files as well using the IFILE command.

On my laptop, for example, I have separate tnsnames.ora files for various clients. So my tnsnames.ora file looks something like

JCAVE11G.WORLD =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = <<ip address>>)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = jcave11gr2)
    )
  )


IFILE = c:\oracle\product\11.1.0\db_1\Network\Admin\tnsnames.ora.client1
IFILE = c:\oracle\product\11.1.0\db_1\Network\Admin\tnsnames.ora.client2
IFILE = c:\oracle\product\11.1.0\db_1\Network\Admin\tnsnames.ora.client3

You could do something similar where the primary tnsnames.ora file has an IFILE reference to your myProjectOraNames.ora file

like image 58
Justin Cave Avatar answered Sep 19 '22 17:09

Justin Cave