Home Oracle Sample TNSNAMES.ORA file to connect database with oracle client
Sample TNSNAMES.ORA file to connect database with oracle client PDF Print E-mail
Written by Siva   
Sunday, 31 October 2010 02:24

 

For example if your
database machine IP Address is 10.1.1.2 and

database service name is PROD8
database running on listener port 1521
then in your client computer the TNS entry inside the TNSNAMES.ORA file will look like below,

TNS_ALIAS=
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST =10.1.1.2)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = PROD8)
    )
  )


Then you can use TNS_ALIAS name to connect to database server from a client machine.


The following example shows a tnsnames.ora file configured for client load balancing:

sales_server=
(DESCRIPTION=
 (ADDRESS_LIST=
  (LOAD_BALANCE=on)
   (ADDRESS=(PROTOCOL=tcp)(HOST=sales1-server)(PORT=1521))
   (ADDRESS=(PROTOCOL=tcp)(HOST=sales2-server)(PORT=1521)))
   (CONNECT_DATA=
   (SERVICE_NAME=sales.com)))

The following example shows a tnsnames.ora file configured for connect-time failover:

sales_server=
(DESCRIPTION=
 (ADDRESS_LIST=
  (LOAD_BALANCE=off)
  (FAILOVER=ON)
     (ADDRESS=(PROTOCOL=tcp)(HOST=sales1-server)(PORT=1521))
     (ADDRESS=(PROTOCOL=tcp)(HOST=sales2-server)(PORT=1521)))
 (CONNECT_DATA=(SERVICE_NAME=sales.com)))
 
 

Advertisement

Featured Links:
HREmail.com
Looking for job? Try HREmail.com
Want to have CMS based Websites?
Try siliconwebcreators.com to CMS based websites.
VM Solutions Inc
For best VM solutions..
Digital Procedure Inc.
Looking for Oracle /SAP /Weblogic Consulting services? visit digitalprocedure.com