登录PLSQL Developer时有一个”Database“选项,这是能过tnsnames.ora文件中进行配置的。文件地址在$ORACLE_HOME\NETWORK\ADMIN\文件夹中;
我的是:D:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora。
而在登录PLSQL Developer时,是根据在”环境变量“中变量名为 "TNS_ADMIN" 中得到变量值为“D:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN”这个地址的。
tnsnames.ora中的内容为(本人的):
# tnsnames.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
#以下是你的实例,如:
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)