1. 程式人生 > >ora-12154 TNS無法處理服務名”的解決辦法之tnsnames.ora模板

ora-12154 TNS無法處理服務名”的解決辦法之tnsnames.ora模板

//------------------------------------------------tnsnames.ora把此檔案copy到D:\plsql developer中

# TNSNAMES.ORA Network Configuration File: D:\oracle\ora92\network\admin\tnsnames.ora

# Generated by Oracle configuration tools.

#XIEHENG_192.168.16.20 =
#  (DESCRIPTION =
#    (ADDRESS_LIST =
#      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.16.20)(PORT = 1521))
#    )
#    (CONNECT_DATA =
#      (SID = XIEHENG)
#      (SERVER = DEDICATED)
#    )
#  )

## 配置說明:
# --XIEHENG_192.168.16.20指的是網路服務名,可用SID_HOST來命名(按個人習慣)
# --HOST指Oracle伺服器的機器名或IP
# --PORT指埠,預設為1521
# --XIEHENG指的是Oracle的SID
# --SERVER = DEDICATED  不用改

# 請參照以下連線的例子

XIEHENG_192.168.16.20 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.16.20)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = XIEHENG)
      (SERVER = DEDICATED)
    )
  )

GCBORA_192.168.1.3 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.3)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = GCBORA)
      (SERVER = DEDICATED)
    )
  )


ORCL29 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.6.29)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )
ORCL10 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.6.10)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )

ORCL11 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 115.29.137.58)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )

ORCL32 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.31.6.32)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )