A technical troubleshooting blog about Oracle with other Databases & Cloud Technologies.

Connect String

1 min read

This property specifies connection information used to connect to an Oracle database.

The Oracle installer generally places a sample tnsnames.ora file in your $ORACLE_HOME/network/admin directory, but you can see many sample tnsnames.ora file for use as a template. 

############################
#### RAC Connect String ####
############################

prod =
  (DESCRIPTION =
    (ENABLE=BROKEN)
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = sprod)
    )
  )


prod1 =
  (DESCRIPTION =
    (ENABLE=BROKEN)
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = sprod)
      (INSTANCE_NAME = cdbprod1)
    )
  )

 
prod2 =
  (DESCRIPTION =
    (ENABLE=BROKEN)
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = sprod)
      (INSTANCE_NAME = cdbprod2)
    )
  )


  
cdbprod =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cdbprod)
      (UR = A)
    )
  )


cdbprod1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cdbprod)
      (INSTANCE_NAME = cdbprod1)
      (UR = A)
    )
  )


cdbprod2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cdbprod)
      (INSTANCE_NAME = cdbprod2)
      (UR = A)
    )
  )