1. 先看2个命令执行的结果:

[oracle@localhost ~]$ ps -ef | less

UID        PID  PPID  C STIME TTY          TIME CMD

oracle     469     1  0 May28 ?        00:00:05 oraclenewccs (LOCAL=NO)

oracle     495     1  1 May28 ?        05:57:23 oraclenewccs (LOCAL=NO)

oracle     863     1  1 May28 ?        05:30:25 oraclenewccs (LOCAL=NO)

oracle    1209     1  0 May28 ?        01:19:29 oraclenewccs (LOCAL=NO)

oracle    1479     1  0 May28 ?        01:30:50 oraclenewccs (LOCAL=NO)

oracle    1583     1  0 May28 ?        01:32:50 oraclenewccs (LOCAL=NO)

oracle    2234     1  0 May28 ?        00:16:05 oraclenewccs (LOCAL=NO)

oracle    2285     1  0 May28 ?        00:17:24 oraclenewccs (LOCAL=NO)

oracle    2479     1  0 May28 ?        00:20:57 oraclenewccs (LOCAL=NO)

oracle    2891     1  0 May28 ?        00:03:55 oraclenewccs (LOCAL=NO)

oracle    3213     1  0 May28 ?        00:02:55 oraclenewccs (LOCAL=NO)

oracle    3447     1  0 May28 ?        00:03:58 oraclenewccs (LOCAL=NO)

oracle    3460     1  0 May28 ?        00:00:23 oraclenewccs (LOCAL=NO)

[oracle@localhost ~]$ ps -aux | less

USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND

oracle     469  0.0  0.4 10759972 320408 ?   Ss   May28   0:05 oraclenewccs (LOCAL=NO)

oracle     495  1.2 10.1 10762344 7505684 ?  Rs   May28 356:58 oraclenewccs (LOCAL=NO)

oracle     863  1.1 10.0 10762344 7455964 ?  Ss   May28 330:21 oraclenewccs (LOCAL=NO)

oracle    1209  0.2  7.3 10762216 5485856 ?  Ss   May28  79:28 oraclenewccs (LOCAL=NO)

oracle    1479  0.3  7.5 10762344 5595556 ?  Ss   May28  90:49 oraclenewccs (LOCAL=NO)

oracle    1583  0.3  7.6 10761216 5679140 ?  Ss   May28  92:50 oraclenewccs (LOCAL=NO)

oracle    2234  0.0  5.9 10762212 4398364 ?  Ss   May28  16:05 oraclenewccs (LOCAL=NO)

oracle    2285  0.0  5.8 10762220 4313736 ?  Ss   May28  17:24 oraclenewccs (LOCAL=NO)

oracle    2479  0.0  5.9 10761176 4436164 ?  Ss   May28  20:57 oraclenewccs (LOCAL=NO)

注:1. ps -aux 和 ps -ef 的区别是显示的选项不一样,aux 能显示进程占用的 内存 和CPU.

2. Less 可以对返回结果上下翻动

2. 我们在服务器上用sqlplus 连接数据库,在查看进程,会多出一条记录:

oracle   16007 16006  0 10:27 ?  00:00:00

oraclenewccs (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))

通过上面2个示例,我们可以看出区别在 LOCAL=NO 和 LOCAL=YES。

LOCAL=NO :非本地连接,即网络连接。 它是通过Listener 连接到服务器的。 客户端的应用通过客户端的监听向服务器的监听发送请求,服务器的监听接收后,在与数据库连接,执行相关操作,在把结果返回给客户端。 这是通过监听的流程。 所以在客户端需要配置监听,即配置tnsnames.ora。

LOCAL=YES:本地连接。 本地连接不走监听,所以在服务监听没有启动的情况下,通过本地的sqlplus 还是可以连上数据库的。

现在就有一个问题,假如我们在客户端通过PL/SQL developer 或者 Toad 工具连上服务器后,在执行sql 的过程中死掉了,我们只能结束程序,亦或者我们直接kill 掉toad 的进程,那么在服务器上并不会释放之间建立的监听进程。 没有释放的相关进程还是继续占用系统资源。 所以对于这些已经死掉的进程,我们可以kill 掉这些进程: kill -9 PID。不过在生产库上要慎用,要确认进程是死掉的才可以kill。

LOCAL=NO的进程分析处理
2008-09-01 23:26

杀死运行3天以上LOCAL=NO的进程
---------------------------------------------------------------------------------------
1.脚本
--------------------------------------------------------------------------------------
HNDBSVR-3-/opt/oracle8/tools> touch kill3DPro.sh
HNDBSVR-3-/opt/oracle8/tools> chmod +x kill3DPro.sh
HNDBSVR-3-/opt/oracle8/tools> vi kill3DPro.sh
HNDBSVR-3-/opt/oracle8/tools> cat kill3DPro.sh
#!/bin/sh
ps -e -o pid -o etime -o args|grep oracle|grep LOCAL=NO|grep ->/tmp/tmpfile
# ps -e -o pid -o etime -o args|grep oracle|grep LOCAL=NO|grep -|awk '{print $2}'|awk -F- '{print $1}' 
cat /tmp/tmpfile|while read LINE 
do 
TIME=`echo $LINE|awk '{print $2}'` 
TIME=`echo $TIME|awk -F- '{print $1}'` 
if [ $TIME -gt 3 ] 
then 
echo $LINE|awk '{print $1}'|xargs -t -n1 kill -9 
fi 
done 
rm -f /tmp/tmpfile

--------------------------------------------------------------------------------------
2.实例分析
--------------------------------------------------------------------------------------
ps -e -o pid -o etime -o args|grep oracle|grep LOCAL=NO
27897 4-04:45:50 oraclegpnms4 (LOCAL=NO)
2804    05:47:03 oraclegpnms4 (LOCAL=NO)
20078    01:14:52 oraclegpnms4 (LOCAL=NO)
19556    06:01:56 oraclegpnms4 (LOCAL=NO)
27855 4-04:45:52 oraclegpnms4 (LOCAL=NO)
12976 4-05:47:28 oraclegpnms4 (LOCAL=NO)
2414    05:47:51 oraclegpnms4 (LOCAL=NO)
8656    05:40:43 oraclegpnms4 (LOCAL=NO)
15656 11-06:21:13 oraclegpnms4 (LOCAL=NO)
2410    05:47:52 oraclegpnms4 (LOCAL=NO)
19083 28-11:42:58 oraclegpnms4 (LOCAL=NO)
10259 52-08:23:39 oraclegpnms4 (LOCAL=NO)
15620 11-06:21:15 oraclegpnms4 (LOCAL=NO)
20232 6-12:03:09 oraclegpnms4 (LOCAL=NO)
24844 1-07:54:46 oraclegpnms4 (LOCAL=NO)
2552    05:47:45 oraclegpnms4 (LOCAL=NO)
4338 17-19:23:28 oraclegpnms4 (LOCAL=NO)
3778 28-11:24:14 oraclegpnms4 (LOCAL=NO)
2412    05:47:52 oraclegpnms4 (LOCAL=NO)
3316    05:45:40 oraclegpnms4 (LOCAL=NO)
2939    05:46:40 oraclegpnms4 (LOCAL=NO)
3302    05:45:44 oraclegpnms4 (LOCAL=NO)
12662 30-11:37:37 oraclegpnms4 (LOCAL=NO)
24254 24-06:38:27 oraclegpnms4 (LOCAL=NO)
16504 55-13:42:30 oraclegpnms4 (LOCAL=NO)
2416    05:47:51 oraclegpnms4 (LOCAL=NO)
2530    05:47:45 oraclegpnms4 (LOCAL=NO)
2491    05:47:46 oraclegpnms4 (LOCAL=NO)
3585    05:44:53 oraclegpnms4 (LOCAL=NO)
29661 26-03:36:02 oraclegpnms4 (LOCAL=NO)
5409    02:35:57 oraclegpnms4 (LOCAL=NO)
23442 51-22:23:46 oraclegpnms4 (LOCAL=NO)
19204 3-13:14:05 oraclegpnms4 (LOCAL=NO)
10602 40-11:45:35 oraclegpnms4 (LOCAL=NO)
29541       56:16 oraclegpnms4 (LOCAL=NO)
19805       18:08 oraclegpnms4 (LOCAL=NO)
--------------------------------------------------------------------------------------
3.参数说明
--------------------------------------------------------------------------------------

ps -e -o pid -o etime -o args

-e Lists information about every process now running;
-o Prints information according to the format specifica-
           tion given in format. This is fully described in
           DISPLAY FORMATS. Multiple -o options can be specified;
           the format specification will be interpreted as the
           space-character-separated concatenation of all the
           format option-arguments.
-A Lists information about all processes most frequently
           requested: all those except process group leaders and
           processes not associated with a terminal.
-e etime In the POSIX locale, the elapsed time since the pro-
           cess was started, in the form:

[[dd-]hh:]mm:ss
args 
     The command with all its arguments as a string. The
           implementation may truncate this value to the field
           width; it is implementation-dependent whether any
           further truncation occurs. It is unspecified whether
           the string represented is a version of the argument
           list as it was passed to the command when it started,
           or is a version of the arguments as they may have been
           modified by the application.   Applications cannot
           depend on being able to modify their argument list and
           having that modification be reflected in the output of
           ps. The Solaris implementation limits the string to
           80 bytes; the string is the version of the argument
           list as it was passed to the command when it started.
--------------------------------------------------------------------------------------
4.其它
--------------------------------------------------------------------------------------—          
           
ps -e -o pid -o etime -o args|grep oracle|grep LOCAL=NO|grep -|awk '{print $2}'|awk -F: '{print $1}'

ps -e -o pid -o etime -o args|grep oracle|grep LOCAL=NO|grep -|awk '{print $2}'|awk -F- '{print $1}'

Oracle 服务器 进程中的 LOCAL=NO 和 LOCAL=YES相关推荐

  1. oracle smon 执行记录,Oracle SMON进程中系统监视进程SMON

    在Oracle中有很多的东西值得我们大家学习的地方,在这里我们主要描述的是Oracle SMON进程,也包括介绍归档进程ARCH等相关方面的内容.在Oracle数据库中有两个进程非常的渺小,但是其作用 ...

  2. linux服务器 常驻,如何让 Python 代码常驻在服务器进程中

    一.nohup nohup,即 no hangup,nohup 的用途就是让提交的命令忽略 hangup 信号,从而使我们的进程避免中途被中断.它可以让 python 脚本和服务器连接端的 sessi ...

  3. Oracle数据库在进程中是,由浅入深讲解Oracle数据库进程的相关概念

    Oracle数据库进程概述: Database buffer cache主要用于存储数据文件中的数据块 数据库高速缓存的数据块是高速缓存与数据文件进行信息交换的基本单位.在Oracle数据库8i以前, ...

  4. oracle 服务器硬盘满了,【案例】Oracle服务器diag进程占据了12g的磁盘空间分析解决办法...

    [案例]Oracle服务器diag进程占据了12g的磁盘空间分析解决办法 时间:2016-11-13 20:10   来源:Oracle研究中心   作者:网络   点击: 次 天萃荷净 Oracle ...

  5. day06 : 01 Oracle 体系结构概念,内存结构,内存结构(服务器进程和用户进程)

    一    概念: 1. 实例/instance: 后台进程+共享内存 用于管理和控制数据库  数据库/database: 物理文件的集合 为实例提供数据,如数据文件,控制文件,参数文件,日志文件等   ...

  6. oracle多线程类连接数,数据库连接数,服务器进程,线程之间什么关系?

    服务器进程--spid 大部分系统都表示server process在OS层面的process ID==操作系统进程ID: 数据库进程--这里用Oracle做例子 pid 这里可以理解为Oracle自 ...

  7. 【DB笔试面试755】在Oracle的DG中,RFS、LNSn、MRP、LSP进程的作用分别是什么?

    ♣ 题目部分 在Oracle的DG中,RFS.LNSn.MRP.LSP进程的作用分别是什么? ♣ 答案部分 这几个进程是DG结构中日志传输.接受和应用的关键性进程,下面分别介绍这几个进程. (一)RF ...

  8. ORACLE内存结构:PGA And UGA,ORACLE用户进程、服务器进程

    执行一个SQL语句 执行查询语句的过程: 用户进程执行一个查询语句如select * from emp where empno=7839 用户进程和服务器进程建立连接,把改用户进程的信息存储到PGA的 ...

  9. linux守护进程中多线程实现,Linux下实现多线程客户/服务器

    在传统的Unix模型中,当一个进程需要由另一个实体执行某件事时,该进程派生(fork)一个子进程,让子进程去进行处理. Unix下的大多数网络服务器程序都是这么编写的,即父进程接受连接,派生子进程,子 ...

最新文章

  1. c语言求占用内存sizeof,C语言中sizeof的用法
  2. 28岁适合转嵌入式开发吗?
  3. javaFX中解决填充(拉伸)问题
  4. CSS3 3D的总结(初学者易懂)
  5. 用python一键批量压缩备份文件,不必再用鼠标点点点
  6. hdu 3018 Ant Trip
  7. curd什么意思中文_每日一句英译英:She's a ten什么意思?
  8. 从SharePoint 2013迁移到SharePoint Online - 评估工具
  9. java捕获异常和抛出异常_Java捕获多个异常,重新抛出异常
  10. python hello world
  11. LeetCode Remove K Digits
  12. python获取图片大小_Python实现获取本地及远程图片大小的方法示例_python_脚本中心...
  13. Excel日期转换mysql_EXCEL与MySQL日期格式转换
  14. Python接口自动化
  15. 用js企业微信推送通知
  16. Nodebb 开发1
  17. 置剪辑板文本_实验背景剪辑:文本
  18. 基于opencv的图片人像移除
  19. 进程之joinableQueue
  20. three.js重新计算UV

热门文章

  1. linux下安装微信wechat
  2. vue - blog开发学习6
  3. iOS Base64转码(使用ios7系统自带编码库 和 GMTBase64 两种方式)
  4. 页面滚动到指定class样式位置
  5. 通过rpm安装postgresql-9.6无法远程连接的问题
  6. 基本Socket通信流程
  7. jQuery(function(){...})与(function($){...})(jQuery)的“兄弟”情结
  8. 戴尔笔记本win8全新安装
  9. STM32 C/C++ uCOSII 函数调用return 无法返回或者函数无法正常反回上一层函数的问题
  10. 部署Apache服务器