文件位置  $ORACLE_HOME/network/admin/tnsnames.ora


===单实例配置===

SINGLE_PROD =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.88)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = testdb)
    )
  )

 

===RAC SCAN方式配置===

TESTDB_DOMAIN =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL=TCP)(HOST=testdb.us.oracle.com )(PORT=1521))
    (CONNECT_DATA=
      (SERVER = DEDICATED)
      (SERVICE_NAME = testdb)
    )
  )

 

===RAC VIP方式配置===

TESTDB_PROD =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.100)PORT = 1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.101)(PORT = 1521))
      (LOAD_BALANCE = yes)
      (FAILOVER = yes)
    )
    (CONNECT_DATA=
      (SERVER = DEDICATED)
      (SERVICE_NAME = testdb)
    )
  )

 

 

RAC中SCAN NAME:testdb.us.oracle.com

nslookup testdb.us.oracle.com (可以轮询解析不同的SCAN VIP)

 

 

 

Focus On Technology,Thanks To My Family And Friends ! 

                     ---Elegent_Shu---