e10835 net reference
/u01/app/oracle/diag/tnslsnr/oracle1/listener/trace/listener.log
TIMESTAMP * CONNECT DATA [* PROTOCOL INFO] * EVENT [* SID] * RETURN CODE
#######################################
tnsping时会出现下面的日志项
Thu Mar 30 16:45:52 2017
30-MAR-2017 16:45:52 * ping * 0
#######################################
每30秒update一次
Wed Mar 29 17:15:49 2017
29-MAR-2017 17:15:49 * service_update * aa * 0
Wed Mar 29 17:16:19 2017
29-MAR-2017 17:16:19 * service_update * aa * 0
Wed Mar 29 17:16:49 2017
29-MAR-2017 17:16:49 * service_update * aa * 0
Wed Mar 29 17:17:10 2017
29-MAR-2017 17:17:10 * service_update * aa * 0
Wed Mar 29 17:17:49 2017
29-MAR-2017 17:17:49 * service_update * aa * 0
Wed Mar 29 17:18:19 2017
29-MAR-2017 17:18:19 * service_update * aa * 0
#######################################
29-MAR-2017 17:58:44 * service_register * aa * 0
15-NOV-2016 08:39:32 * service_died * DBUA3838241 * 12537
WARNING: Subscription for node down event still pending
#######################################
有客户端连接时,就会有下面的日志项
29-MAR-2017 17:14:20 * (CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=aa)(CID=(PROGRAM=D:Program?Files??x86?IPinstantclient-basic-windows.x64-11.2.0.4.0instantclient_11_2sqlplus.exe)(HOST=DESKTOP-NMUHAH0)(USER=fgy))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.10.99)(PORT=50901)) * establish * aa * 0
运行下面的命令时会有下面的日志项
lsnrctl>services
Wed Mar 29 17:20:46 2017
29-MAR-2017 17:20:46 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=oracle1)(USER=oracle))(COMMAND=services)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=186647552)) * services * 0
用admin通过浏览器访问时,就会有下面的日志项
Wed Mar 29 18:27:21 2017
29-MAR-2017 18:27:21 * (CONNECT_DATA=(SID=testdb)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=root))) * (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.60.14)(PORT=56553)) * establish * testdb * 0
#######################################
通过程序去连接时时,就会有下面的日志项
好像分两部分
30-MAR-2017 17:21:52 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=songlin_xie_n22))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=songlin_xie_n22))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=58056)) * establish * stbaoka * 0
30-MAR-2017 17:21:52 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=songlin_xie_n22))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=songlin_xie_n22))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=63405)) * establish * stbaoka * 0
30-MAR-2017 17:21:52 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=songlin_xie_n22))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=songlin_xie_n22))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=26675)) * establish * stbaoka * 0
30-MAR-2017 17:21:52 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=songlin_xie_n22))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=songlin_xie_n22))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=37961)) * establish * stbaoka * 0
30-MAR-2017 17:21:52 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=songlin_xie_n22))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=songlin_xie_n22))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=44298)) * establish * stbaoka * 0
30-MAR-2017 17:21:52 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=songlin_xie_n22))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=songlin_xie_n22))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=2647)) * establish * stbaoka * 0
30-MAR-2017 17:21:52 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=songlin_xie_n22))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=songlin_xie_n22))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=56995)) * establish * stbaoka * 0
30-MAR-2017 17:21:52 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=songlin_xie_n22))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=songlin_xie_n22))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=16633)) * establish * stbaoka * 0
30-MAR-2017 17:22:17 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=47311)) * establish * stbaoka * 0
30-MAR-2017 17:22:17 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=16602)) * establish * stbaoka * 0
30-MAR-2017 17:22:17 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=15513)) * establish * stbaoka * 0
30-MAR-2017 17:22:17 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=54723)) * establish * stbaoka * 0
30-MAR-2017 17:22:17 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=63255)) * establish * stbaoka * 0
30-MAR-2017 17:22:17 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=30379)) * establish * stbaoka * 0
30-MAR-2017 17:22:17 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=4706)) * establish * stbaoka * 0
30-MAR-2017 17:22:17 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=24433)) * establish * stbaoka * 0
30-MAR-2017 17:22:17 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=6087)) * establish * stbaoka * 0
30-MAR-2017 17:22:17 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=43191)) * establish * stbaoka * 0
#######################################
Fri Jan 20 14:39:28 2017
20-JAN-2017 14:39:28 * (CONNECT_DATA=(SID=stbaoka)(CID=(PROGRAM=null)(HOST=__jdbc__)(USER=null))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=18459)) * establish * stbaoka * 0
20-JAN-2017 14:39:28 * (CONNECT_DATA=(SID=stbaoka)(CID=(PROGRAM=SQL Developer)(HOST=__jdbc__)(USER=fgy))) * (ADDRESS=(PROTOCOL=tcp)(HOST=124.115.229.210)(PORT=20065)) * establish * stbaoka * 0
16-FEB-2017 17:38:54 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=root))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=root))) * (ADDRESS=(PROTOCOL=tcp)(HOST=117.34.72.196)(PORT=45530)) * establish * stbaoka * 0
16-FEB-2017 17:38:55 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=root))(SERVICE_NAME=stbaoka)(CID=(PROGRAM=)(HOST=__jdbc__)(USER=root))) * (ADDRESS=(PROTOCOL=tcp)(HOST=117.34.72.196)(PORT=45531)) * establish * stbaoka * 0
#######################################
[oracle@cn-111-testdb trace]$ oerr tns 12537
12537, 00000, "TNS:connection closed"
// *Cause: "End of file" condition has been reached; partner has disconnected.
// *Action: None needed; this is an information message.
[oracle@cn-111-testdb trace]$ oerr help
Usage: oerr facility error
Facility is identified by the prefix string in the error message.
For example, if you get ORA-7300, "ora" is the facility and "7300"
is the error. So you should type "oerr ora 7300".
If you get LCD-111, type "oerr lcd 111", and so on.
服务器端的sqlnet.log
/u01/app/oracle/product/11.2/db_1/network/log/sqlnet.log
客户端的sqlnet.log
/u01/app/oracle/diag/clients/user_oracle/host_839358077_80/trace/sqlnet.log
C:UsersfgyOracleoradiag_fgydiagclientsuser_fgyhost_3210449687_80 race
Directory does not exist for read/write [/u01/app/oracle/product/11.2.0/dbhome_1/log] [/u01/app/oracle/product/11.2.0/dbhome_1/log/diag/clients]
***********************************************************************
Fatal NI connect error 12520, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.20.102)(PORT=1521))(CONNECT_DATA=(SERVER=shared)(SERVICE_NAME=wode)(CID=(PROGRAM=sqlplus@cu-kvm1)(HOST=cu-kvm1)(USER=oracle))))
VERSION INFORMATION:
TNS for Linux: Version 11.2.0.4.0 - Production
TCP/IP NT Protocol Adapter for Linux: Version 11.2.0.4.0 - Production
Time: 02-APR-2017 11:46:45
Tracing not turned on.
Tns error struct:
ns main err code: 12564
TNS-12564: TNS:connection refused
ns secondary err code: 0
nt main err code: 0
nt secondary err code: 0
nt OS err code: 0
#######################################
16-22
in the log file by the network layer
16-44
session layer controls the connection
#######################################
select * from v$queue;
select * from v$dispatcher;
select * from v$dispatcher_config;
select * from v$dispatcher_rate;
select * from V$SHARED_SERVER;
#######################################
SQL> connect lcpsys@(description=(address=(protocol=tcp)(host=192.168.10.104)(port=1521))(connect_data=(sid=aa)))
Enter password:
Connected.
SQL>
#######################################
动态非默认端口
1tnsnames.ora
2local_listener参数
alter system set local_listener='testdb';
立即注册,而不是等待60秒,pmon进程周期性的联系listener
SQL> alter system register;
#######################################
sqlnet.ora
存储在两个位置
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/
或者TNS_ADMIN环境变量指定的位置
###################################
Non-ADR parameters listed in the sqlnet.ora file are ignored
when ADR is enabled. ADR is enabled by default.
The default value of DIAG_ADR_ENABLED is on. Therefore,
the DIAG_ADR_ENABLED parameter must explicitly be set to off in order
for non-ADR tracing to be used.
###################################
具体参数
与防火墙类似的功能,Oracle 提供限制与允许特定的IP或主机名通过Oracle Net来访问数据库。这个功能由sqlnet.ora配置文件来实
现。该文件通常$ORACLE_HOME/network/admin/ 目录下,与tnsnames.ora以及listener.ora位于同一路径。用法也比较简单。通过监听器的
限制,实现轻量级访问限制,比在数据库内部通过触发器进行限制效率要高。
1.通常情况下,更倾向于使用excluded_nodes参数。
tcp.validnode_checking = yes
tcp.invited_nodes = (hostname1,hostname2,ip1,ip2)
tcp.excluded_nodes = (10.103.11.17,hostname1,hostname2)
使用excluded_nodes与invited_nodes的一些特性
不支持通配符的使用(如hostname不能写为svhs0*,IP地址不能写为10.103.11.*)
excluded_nodes与invited_nodes为互斥方式,要么使用前者,要么使用后者
如果tcp.invited_nodes与tcp.excluded_nodes都存在,则tcp.invited_nodes优先
要将本地地址,或者Cluster群集其他节点的地址都加入到允许列表,否则监听器可能无法启动
修改之后,一定要重起监听或reload才能生效,而不需要重新启动数据库
仅提供对TCP/IP协议的支持
#######################
To specify the order of the naming methods used for client name resolution lookups.
NAMES.DIRECTORY_PATH=(tnsnames, ldap, ezconnect)
#######################