oracle lsof,[Oracle工程师手记] 通过 lsof 命令查找oracle client 端和 server 端进程

5268f80b9b1e01f982625ef6fac83ca1.png

通过 lsof 命令,可以找到 Oracle 的 client 端 和 server 端的进程。

例如,我从远端连接到 oracle 数据库:

-bash-4.1$ sqlplus sys/oracle@my19c as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Sat Apr 10 03:45:20 2021

Copyright (c) 1982, 2016, Oracle. All rights reserved.

Connected to:

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

SQL>

在 server 端,我可以通过 LOCAL=NO 关键字,找到为远端client 服务的进程:

[oracle@celvpvm06027 ~]$ ps -ef | grep oracle | grep LOCAL

oracle 4609 1 0 02:45 ? 00:00:00 oracledb193cdb (LOCAL=NO)

oracle 29721 29696 0 02:55 pts/0 00:00:00 grep --color=auto LOCAL

[oracle@celvpvm06027 ~]$

可以看到,服务器端进程ID 是 4609。

这时,通过 lsof ,可以找到与之进行网络通信的client 端进程:

[oracle@celvpvm06027 ~]$ lsof -p 4609 | grep ESTABLISHED

oracle_46 4609 oracle 16u IPv6 492894739 0t0 TCP my06027.mytst.com:ncube-lm->my05200.mytst.com:62311 (ESTABLISHED)

[oracle@celvpvm06027 ~]$

我在client 端,用上面查询得到的 62311 ,通过 lsof 来查询:

-bash-4.1$ lsof | grep 62311

sqlplus 6123 oracle 9u IPv4 4946370 0t0 TCP my05200.mytst.com:62311->my06027.mytst.com:ncube-lm (ESTABLISHED)

-bash-4.1$

-bash-4.1$ ps -ef | grep 6123

oracle 6123 5861 0 03:45 pts/0 00:00:00 sqlplus as sysdba

oracle 7031 6183 0 03:58 pts/1 00:00:00 grep 6123

-bash-4.1$

可以得知,client 端进程 ID 是 6123。

[Oracle工程师手记] 通过 lsof 命令查找oracle client 端和 server 端进程

标签:ase   client   oracle   ted   nec   ora   nbsp   连接   ash

1428d0e076c3959ab11d28a39bc84fab.png

5268f80b9b1e01f982625ef6fac83ca1.png

本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉

本文系统来源:https://www.cnblogs.com/gaojian/p/14640168.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值