安装oracle数据库plsql也登不上:TNS-12541: TNS: 无监听程序

TNS-12541: TNS: 无监听程序


报错现象:
cmd下:执行tnsping orcl

F:\app\Administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
已使用 TNSNAMES 适配器来解析别名
尝试连接 (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.223.117.71)(PORT =
1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))
TNS-12541: TNS: 无监听程序

注意要保证oracle客户端是多少位的,然后plsql也要是多少位的。

检查以下几点

dbhome_1下的tnsnames.ora、sqlnet.ora、listener.ora;
tnsnames.ora:

ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.223.117.71)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

sqlnet.ora:

SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

listener.ora:

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_NAME = orcl)
(ORACLE_HOME = F:\app\Administrator\product\11.2.0\dbhome_1)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.223.117.71)(PORT = 1521))
)
)
ADR_BASE_LISTENER = F:\app\Administrator

然后把tnsnames.ora、sqlnet.ora文件放到client_1客户端下面
然后cmd,设置环境变量:

C:\Users\Administrator>set ORACLE_HOME=F:\app\Administrator\product\11.2.0\dbhome_1
C:\Users\Administrator>set path=F:\app\Administrator\product\11.2.0\dbhome_1\bin
C:\Users\Administrator>set TNS_ADMIN=F:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN

在cmd下:

C:\Users\Administrator>lsnrctl status
不然可以lsnrctl stop 、 lsnrctl start

使用以下语句检查是否可以连接:

C:\Users\Administrator>tnsping orcl

提示:

已使用的参数文件:
F:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN\sqlnet.ora
已使用 TNSNAMES 适配器来解析别名
尝试连接 (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.223.117.71)(PORT =
1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))
OK (0 毫秒)

你可能感兴趣的:(oracle)