服务器监听配置文件路径:
/data/oracle/product/11.2.0/network/admin/listener.ora
内容:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /data/oracle
HOST = localhost.localdomain 不能简单写成loaclhost
需用查询语句查询得出:
select HOST_NAME from v$instance;
查询sid:
select instance_name from v$instance;
客户端连接配置(F:\app\client\ly\product\12.1.0\client_1\Network\Admin\tnsnames.ora):
ORCL11G = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.198)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SID = orcl) ) )
ORCL11G 前不能有空格. (SID = orcl) 这个orcl就是查询出的instance_name