新特性:数据库中直接查询tns信息

数据库中直接查询tns信息

SQL> select  dbms_tns.resolve_tnsname('ORCL') from dual;

DBMS_TNS.RESOLVE_TNSNAME('ORCL')
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=catscanip)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)(CID=(PROGRAM=oracle)(HOST=cat1)(USER=oracle))))

比tnsping出来的结果更加详细

[oracle@cat1 admin]$ tnsping ORCL

TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 04-JAN-2021 15:49:02

Copyright (c) 1997, 2019, Oracle.  All rights reserved.

Used parameter files:
/u01/app/oracle/product/19.3.0/db_1/network/admin/sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = catscanip)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))
OK (10 msec)

Related Posts