刚装完的数据库报错 ORA-01102 ORA-1102 signalled during....

晨曦之光 发布于 2012/04/25 15:48
阅读 179
收藏 0
昨天刚装完的一个 数据库在启动的时候,报错ORA-01102,而且 安装的时候也没有看到哪里有报错信息,一路都比较顺利,
bW Z$bob s ^ C20674423而且这也是第一次我碰到这个问题,当时我首先就检查了alert日志文件,并把相关的错误信息在metalink上查看过了,
r D8cj,L20674423经过分析后判断是由于进程间通信被争用导致,以下是我处理该问题的一个思路,并在最后附上了metalink原文以及朋友对该
D'J*Z-v"U7bM20674423问题的一个理解和处理办法。
为什么会发生如下错误,原因是多个用户同时去访问同一个资源就会发生独占模式, ITPUB个人空间T7T2u i5Mp&fQ"j7Z
因为在Linux里面默认一个进程只被一个用户访问,要避免这个问题,在创建用户的时候
sYp:F m0N:g9]20674423指定默认去指定不同于其它用户的优先级就可以避免此类问题的发生。
sculkget: failed to lock /orasoft/product/10.2.0/db_1/dbs/lkWWL exclusive   同一个进程被多个用户访问发生了独占模式 ITPUB个人空间w;I5wt7B n;S
sculkget: lock held by PID: 26312 发生独占模式的进程号为pid:26312 ITPUB个人空间+h4[([ VJ f ZRe
ORA-09968: Message 9968 not found; No message file for product=RDBMS, facility=ORA  并且没有找到9968的数据信号,同时了我们该信号的类型
2\*y P kI q{;V20674423Linux Error: 11: Resource temporarily unavailable                           导致资源无法被正常利用
4d Q5Cjx,U20674423Additional information: 26312
"w _Wgj L!H)^ ]20674423Thu Nov 17 15:51:16 2011 ITPUB个人空间/{s:o.r t,IxG+`
ORA-1102 signalled during: ALTER DATABASE   MOUNT...
解决如上错误过程如下:
1、我们可以通过如下命令查看到发生独占的进程名称为ora_dbw0_wwl
zTVL$qb"` db20674423[oracle@ora10g dbs]$ ps -ef|grep 26312 ITPUB个人空间^OpX~5eA
oracle   26312     1  0 15:43 ?        00:00:02 ora_dbw0_wwl ITPUB个人空间 VTAlkc+g l
oracle   26663 26574  0 17:39 pts/1    00:00:00 grep 26312
2、进入数据库,先关闭实例 ITPUB个人空间q auG+aIRA
[oracle@ora10g ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Nov 17 17:45:56 2011
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

#E:{ BjS&n20674423Connected to: ITPUB个人空间yHd$]v
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production ITPUB个人空间.{1I{Q2i.v&B
With the Partitioning, OLAP and Data Mining options
SQL> shutdown immediate ITPUB个人空间a X9Nb q:Z
ORA-01507: database not mounted
ITPUB个人空间0H7G7G/Y\%u ^8w f;S
ORACLE instance shut down. ITPUB个人空间 k#n Uie'I-@
SQL> exit
T MX&B$Z%_?8y [u20674423Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
&}xv Gh(r:p20674423With the Partitioning, OLAP and Data Mining options
进入到 $ORACLE_HOME/dbs,查看到一个名为lkWWL的文件,正常情况下是没有这个文件的
C7x`&]Q C"w4V20674423[oracle@ora10g ~]$ cd $ORACLE_HOME/dbs
"t3gB4Q$o:r){kN20674423[oracle@ora10g dbs]$ ls
S*n ioztt}20674423hc_wwl.dat  initdw.ora  init.ora  lkWWL  orapwwwl  spfilewwl.ora
[oracle@ora10g dbs]$ su - root ITPUB个人空间No]:}'H#H
口令:
通过fuser -u lkWWL 命令一看,果然果然进程没有被释放
#m$u{5A/`5Nf W20674423[root@ora10g ~]# cd /orasoft/product/10.2.0/db_1/dbs ITPUB个人空间:zu1v*h7DMT
[root@ora10g dbs]# fuser -u lkWWL
3X6QW5x(_ X.V An3c20674423lkWWL:               26306 26308 26310 26312 26314 26316 26318 26320 26322 26324 26326 26334 26336 26340 26354 26356
[root@ora10g dbs]# fuser -k lkWWL ITPUB个人空间 Z;z P|R4KM5M o
lkWWL:               26306 26308 26310 26312 26314 26316 26318 26320 26322 26324 26326 26334 26336 26340 26354 26356
[root@ora10g dbs]# fuser -u lkWWL
重新启动数据库看看,这个时候数据库没有报错了,能正常起来。
K4SPP_i V20674423[root@ora10g dbs]# su - oracle ITPUB个人空间1v W%X h3d5j'v
[oracle@ora10g ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Nov 17 17:47:50 2011
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup ITPUB个人空间ad KOt;z0u AS7H2{
ORACLE instance started.
Total System Global Area  285212672 bytes ITPUB个人空间n:SL | E
Fixed Size                  1218992 bytes
/a}3D1Q0_20674423Variable Size              92276304 bytes
Q o0|0ibt"G,Z20674423Database Buffers          188743680 bytes
LjD8p R AO20674423Redo Buffers                2973696 bytes ITPUB个人空间uAWB:{AP%Q/M,b
Database mounted. ITPUB个人空间|0_~sae
Database opened.
SQL> col host_name format a20 ITPUB个人空间*i#[z@qv m8~%XC
SQL> select host_name,instance_name,status from v$instance
HOST_NAME            INSTANCE_NAME    STATUS ITPUB个人空间$b a-`w)g(C5eB
-------------------- ---------------- ------------ ITPUB个人空间7w4q+g"XU9m
ora10g.localdomain   wwl              OPEN
SQL>

xd5g U/h lSp*s20674423Metalink 原文如下:
s v3Z7N4h.v e^$| }20674423analysis:
3H.PWnl\9ja2Y20674423Problem Description:
9t'{uS e7F/sg20674423==================== 
jD:i r e20674423You are trying to startup the database and you receive the following error:
*AZ I Ve7ua20674423     ORA-01102:  cannot mount database in EXCLUSIVE mode ITPUB个人空间3d0} H3[?(m^M
       Cause:  Some other instance has the database mounted exclusive ITPUB个人空间*lu0s0d:{ EkO
               or shared. ITPUB个人空间,ey g(k5j3t
      Action: Shutdown other instance or mount in a compatible mode.
V#w.u RP8^8z'RD v20674423    Problem Explanation: ITPUB个人空间6u v)Xge^
====================  ITPUB个人空间W X-Z$h v T+PZ9]
A database is started in EXCLUSIVE mode by default.  Therefore, the ITPUB个人空间7E,T}%n9g
ORA-01102 error is misleading and may have occurred due to one of the ITPUB个人空间Y&@G)UT
following reasons: 
0R7p0wL%Xz O20674423  - there is still an "sgadef<sid>.dbf" file in the "ORACLE_HOME/dbs" ITPUB个人空间^5i-g v7E1| Z
    directory
2H/j ~C A%`0q:kZ_E20674423  - the processes for Oracle (pmon, smon, lgwr and dbwr) still exist
,X4C5Q#Ezt r20674423  - shared memory segments and semaphores still exist even though the ITPUB个人空间 m9B^to1|Y,C🅱S
    database has been shutdown ITPUB个人空间5eCG4WJyQz
  - there is a "ORACLE_HOME/dbs/lk<sid>" file
$H!~0? \&H!u3Q20674423   Search Words: ITPUB个人空间;tqEa^2| W `l1x
=============  ITPUB个人空间k)F~)^Git$X0@ m,g
ORA-1102, crash, immediate, abort, fail, fails, migration ITPUB个人空间 Kb!P*z E;A+o
Solution Description:
)^'k&K j#Ta s/G20674423=====================  ITPUB个人空间^ mra,G.h'}
Verify that the database was shutdown cleanly by doing the following: ITPUB个人空间$H_p r} z4iJ%`7y lQ
  1. Verify that there is not a "sgadef<sid>.dbf" file in the directory
/N6N M7q4|W9m3o20674423   "ORACLE_HOME/dbs".    ITPUB个人空间;F} `8uhB
        % ls $ORACLE_HOME/dbs/sgadef<sid>.dbf ITPUB个人空间f!s+g4EbbO eY
     If this file does exist, remove it. 
w R1m;dJb2C2E20674423        % rm $ORACLE_HOME/dbs/sgadef<sid>.dbf 
L)u.~ _!`wQ/R206744232. Verify that there are no background processes owned by "oracle"
"xv%[|c^;tV20674423          % ps -ef | grep ora_ | grep $ORACLE_SID ITPUB个人空间D:BN9nu,m8s4f
     If background processes exist, remove them by using the Unix
9^ c7Yr$r JX)y20674423   command "kill".  For example:
7C!g"aAV J20674423          % kill -9 <rocess_ID_Number>
FeU(w$_ a7OG2|'k20674423  3. Verify that no shared memory segments and semaphores that are owned ITPUB个人空间vj6X&hwT#D!k
   by "oracle" still exist
$|,l$^ BVE+?*s20674423          % ipcs -b ITPUB个人空间'c hh C5{.w^4g
     If there are shared memory segments and semaphores owned by "oracle",
.r+m,U+p5D:I1? Y"t$fw20674423   remove the shared memory segments
OcM/d&A8iC)Y6CQ%F?20674423          % ipcrm -m <Shared_Memory_ID_Number> ITPUB个人空间"d ^S#t;O!q `
     and remove the semaphores
-rX)`,K l W Y20674423          % ipcrm -s <Semaphore_ID_Number> ITPUB个人空间MV ^q\.kcG%MV
     NOTE:  The example shown above assumes that you only have one ITPUB个人空间q^ i$X%H
          database on this machine.  If you have more than one ITPUB个人空间NQ(q }"i `*\@/r D
          database, you will need to shutdown all other databases
:O&OZQ4P*u t20674423          before proceeding with Step 4.
;` O8Od D20674423  4. Verify that the "$ORACLE_HOME/dbs/lk<sid>" file does not exist ITPUB个人空间+O5S!B g4A;\ v@r
  5. Startup the instance
V A!PW;A;a20674423    Solution Explanation:
(WY+c.rj.Vz%E2c5d20674423=====================  ITPUB个人空间A9Vr3Y(Z u R h
The "lk<sid>" and "sgadef<sid>.dbf" files are used for locking shared memory.  It seems that even though no memory is allocated, Oracle thinks memory is  still locked.  By removing the "sgadef" and "lk" files you remove any knowledge oracle has of shared memory that is in use. Now the database can start.
我朋友对该问题的理解和解决办法如下: ITPUB个人空间0V W6M9mgg$~9c
出现1102错误可能有以下几种可能:
一、在HA系统中,已经有其他节点启动了实例,将双机共享的资源(如磁盘阵列上的裸设备)占用了;
二、说明Oracle被异常关闭时,有资源没有被释放,一般有以下几种可能,
1、Oracle的共享内存段或信号量没有被释放;
2、Oracle的后台进程(如SMON、PMON、DBWn等)没有被关闭;
3、用于锁内存的文件lk<sid>和sgadef<sid>.dbf文件没有被删除。
solution:
method1:
首先,虽然我们的系统是HA系统,但是备节点的实例始终处在关闭状态,这点通过在备节点上查数据库状态可以证实。
其次、是因系统掉电引起数据库宕机的,系统在接电后被重启,因此我们排除了第二种可能种的1、2点。最可疑的就是第3点了。
查$ORACLE_HOME/dbs目录:
$ cd $ORACLE_HOME/dbs
MSas~"L&a(w,M20674423$ ls sgadef*
aoQ-C&[n9q7D20674423sgadef* not found ITPUB个人空间-DA` On H
$ ls lk* ITPUB个人空间 h j+rC f3M!u i
lkORA92

t-oS h3c5r0k-U20674423果然,lk<sid>文件没有被删除。将它删除掉
$ rm lk*
ITPUB个人空间 k9`K FH9V[C;o2l3L
再启动数据库,成功。
如果怀疑是共享内存没有被释放,可以用以下命令查看:
$ipcs -mop
o&{)Q#]2kt!V'fQz20674423IPC status from /dev/kmem as of Thu Jul  6 14:41:43 2006
.Q(KWJ f&@+M(j4e20674423T      ID     KEY        MODE        OWNER     GROUP NATTCH  CPID  LPID
/G!T\:jM4Y~5s S20674423Shared Memory: ITPUB个人空间u[6f ]+Ej
m       0 0x411c29d6 --rw-rw-rw-      root      root      0   899   899 ITPUB个人空间'u G)b+d3s"]
m       1 0x4e0c0002 --rw-rw-rw-      root      root      2   899   901
/q'\ k5T }3O@G)qg20674423m       2 0x4120007a --rw-rw-rw-      root      root      2   899   901 ITPUB个人空间5g p"QL&mA0MGr*S
m  458755 0x0c6629c9 --rw-r-----      root       sys      2  9113 17065 ITPUB个人空间6Q1_,H'v vS u
m       4 0x06347849 --rw-rw-rw-      root      root      1  1661  9150
IgT-fl20674423m   65541 0xffffffff --rw-r--r--      root      root      0  1659  1659
:o v Z3z#w7y(eGz}20674423m  524294 0x5e100011 --rw-------      root      root      1  1811  1811
_,L*n G? |'i@20674423m  851975 0x5fe48aa4 --rw-r-----    oracle  oinstall     66  2017 25076
ITPUB个人空间(M!u"z:w c
然后它ID号清除共享内存段:
$ipcrm –m 851975
ITPUB个人空间*\~D+z|:P7W d {W
对于信号量,可以用以下命令查看:
$ ipcs -sop ITPUB个人空间 Ayb+VO _
IPC status from /dev/kmem as of Thu Jul  6 14:44:16 2006
n&u U iR0~ F/w20674423T      ID     KEY        MODE        OWNER     GROUP
B-g@S| v d"f*C20674423Semaphores: ITPUB个人空间,yACu/G(d;k`s
s       0 0x4f1c0139 --ra-------      root      root ITPUB个人空间!P/?4na[tK
... ... ITPUB个人空间RD#@veB;R
s      14 0x6c200ad8 --ra-ra-ra-      root      root
:J^+qr9RuZ'k Z20674423s      15 0x6d200ad8 --ra-ra-ra-      root      root
;u"N8c R5Euq20674423s      16 0x6f200ad8 --ra-ra-ra-      root      root
iTg_)oLf2r20674423s      17 0xffffffff --ra-r--r--      root      root
K9t-C,d!a;r4e6}20674423s      18 0x410c05c7 --ra-ra-ra-      root      root ITPUB个人空间/\-L:{3X Jw6`7B V
s      19 0x00446f6e --ra-r--r--      root      root ITPUB个人空间A!m/G@|F'`J
s      20 0x00446f6d --ra-r--r--      root      root ITPUB个人空间#E,Y p rC-`k
s      21 0x00000001 --ra-ra-ra-      root      root ITPUB个人空间,FJA*J t&^'O/W6r
s   45078 0x67e72b58 --ra-r-----    oracle  oinstall
ITPUB个人空间8c;Q@1r\ S E H'r*l0u
根据信号量ID,用以下命令清除信号量:
$ipcrm -s 45078

f.J u eW t i20674423如果是Oracle进程没有关闭,用以下命令查出存在的oracle进程:
$ ps -ef|grep ora ITPUB个人空间V dV5fk1h
  oracle 29976     1  0  Jun 22  ?         0:52 ora_dbw0_ora92 ITPUB个人空间fw|Ts
  oracle 29978     1  0  Jun 22  ?         0:51 ora_dbw1_ora92
U JKq!F%sF20674423  oracle  5128     1  0  Jul  5  ?         0:00 oracleora92 (LOCAL=NO) ITPUB个人空间"L q"G%nk8gQ
... ...
ITPUB个人空间_:S x]b~1U
然后用kill -9命令杀掉进程
$kill -9 <ID>

;Fa\+} k)Zt20674423method 2
[root@qa-oracle dbs]# fuser -u lkNDMSQA ITPUB个人空间/b8F Q ].@\C
lkNDMSQA:             6666(oracle)  6668(oracle)  6670(oracle)  6672(oracle)  6674(oracle)  6676(oracle)  6678(oracle)  6680(oracle)  6690(oracle)  6692(oracle)  6694(oracle)  6696(oracle)  6737(oracle)  6830(oracle) ITPUB个人空间9bH FxOj
果然该文件没释放,用fuser命令kill掉:
Y6Yjhr$w C20674423[root@qa-oracle dbs]# fuser -k lkNDMSQA
gVX1V5zCV20674423lkNDMSQA:             6666  6668  6670  6672  6674  6676  6678  6680  6690  6692  6694  6696  6737  6830 ITPUB个人空间 [%j1n.U'w]4YR
[root@qa-oracle dbs]# fuser -u lkNDMSQA

H8r pQ*F ](ehI20674423总结:
当发生1102错误时,可以按照以下流程检查、排错:
如果是HA系统,检查其他节点是否已经启动实例; ITPUB个人空间7F5X%r's Ix$R(H&_ y
检查Oracle进程是否存在,如果存在则杀掉进程;
&p C:e+h*W3C_20674423检查信号量是否存在,如果存在,则清除信号量;
Yv+x,k#ZP6w ec20674423检查共享内存段是否存在,如果存在,则清除共享内存段;
qg:WW?]&`}20674423检查锁内存文件lk<sid>和sgadef<sid>.dbf是否存在,如果存在,则删除。
ORA-09968: unable to lock file lk$ORACLE_SID (2010-03-04 14:53)
$t#|0z^ B A;ya20674423分类: DBA
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
-V6m$q"KfF0};t5L20674423starting up 1 shared server(s) ...
H \/s$o)a20674423Thu Mar  4 11:48:07 2010 ITPUB个人空间b7b Eu!Fh7t:O%~
ALTER DATABASE   MOUNT
7{QfAfL6t20674423Thu Mar  4 11:48:07 2010 ITPUB个人空间{0?6Y$m } g;xgL2~
sculkget: failed to lock /u01/app/oracle/product/10.2.0/db_1/dbs/lkFDS exclusive ITPUB个人空间Vf)y B Z0vu6F
sculkget: lock held by PID: 3443 ITPUB个人空间s/h;P;g O
Thu Mar  4 11:48:07 2010 ITPUB个人空间 vJ4jW O(W3i@
ORA-09968: unable to lock file
d%tD K)_/? n:~/O(@20674423Linux Error: 11: Resource temporarily unavailable ITPUB个人空间fKLA4f
Additional information: 3443
)CC M EQW5UQlD]20674423Thu Mar  4 11:48:07 2010
q ^ U*pB(_"vG20674423ORA-1102 signalled during: ALTER DATABASE   MOUNT...
提示进程3443锁定该资源,根据上次的启动日志发现该进程是Oracle的后台进程
/hk C.M9dc20674423DBWR,根据文档提示236794.1可能是该进程已经挂死,导致数据库无法正常运行。 ITPUB个人空间+~ E1R%_6oD r4n
fuser -u /u01/app/oracle/product/10.2.0/db_1/dbs/lkFDS
ITPUB个人空间:\'pB)n7ux
PMON started with pid=2, OS id=3437 ITPUB个人空间}*D;g9r ],{Ge,K_%c
MMAN started with pid=4, OS id=3441 ITPUB个人空间U D;R [ @6e$DW-F
PSP0 started with pid=3, OS id=3439 ITPUB个人空间7^_9b"[}
DBW0 started with pid=5, OS id=3443
zo$n#`Y20674423LGWR started with pid=6, OS id=3445
^%T{,CN(`:L~20674423CKPT started with pid=7, OS id=3447 ITPUB个人空间 Rw5zE m
SMON started with pid=8, OS id=3449 ITPUB个人空间c6v"g V R1c$HM
RECO started with pid=9, OS id=3451 ITPUB个人空间'OgW#n$EE0^K d
CJQ0 started with pid=10, OS id=3453 ITPUB个人空间0M q"c0@Zq4MN5X9X
MMON started with pid=11, OS id=3455
$WT5m6jdC/~H20674423Tue Feb 16 11:08:17 2010 ITPUB个人空间 S/R#cfXr b
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'...
H9Seq8Mk1w%C`20674423MMNL started with pid=12, OS id=3457 ITPUB个人空间zWre9x ~ u&H
Tue Feb 16 11:08:17 2010
{ zs P5]n%E-`20674423starting up 1 shared server(s) ...
z8M&|;b o&X20674423Tue Feb 16 11:08:18 2010 ITPUB个人空间,w B k0~)fCN
ALTER DATABASE   MOUNT ITPUB个人空间V$t1{~C
Tue Feb 16 11:08:22 2010 ITPUB个人空间U0r%Eo+W0yo(k
Setting recovery target incarnation to 2
p$X6~CHV2l20674423Tue Feb 16 11:08:22 2010 ITPUB个人空间 ^,[&F-AbB#Q't
Successful mount of redo thread 1, with mount id 1844152034 ITPUB个人空间*s m/o5EK*\
Tue Feb 16 11:08:22 2010
+c9s{_)Z7{&N2t20674423Database mounted in Exclusive Mode ITPUB个人空间k c u&sW
Completed: ALTER DATABASE   MOUNT ITPUB个人空间r-}4o/_(z(A e;y'{Xm
Tue Feb 16 11:08:22 2010
B~EvX(h^20674423ALTER DATABASE OPEN
losf 查看锁定进程
:l0I [+T,vyf20674423# lsof |grep lkFDS                                      
lKLCfR)G X q20674423oracle     4476 oracle   17uR     REG        8,7         24    2911344 /var/oracle/product/10.2.0/db_1/dbs/lkFDS
c9|S0l3^%H20674423oracle     4478 oracle   15uR     REG        8,7         24    2911344 /var/oracle/product/10.2.0/db_1/dbs/lkFDS
b-U8tV'N-v:k+K:s%{20674423oracle     4480 oracle   15uR     REG        8,7         24    2911344 /var/oracle/product/10.2.0/db_1/dbs/lkFDS
K(\(j,nS&x1P$Y ^20674423oracle     4482 oracle   15uR     REG        8,7         24    2911344 /var/oracle/product/10.2.0/db_1/dbs/lkFDS
r/i1t8Y4QZTFm)v6B20674423oracle     4484 oracle   15uR     REG        8,7         24    2911344 /var/oracle/product/10.2.0/db_1/dbs/lkFDS
q+_r+o? G20674423oracle     4486 oracle   15uR     REG        8,7         24    2911344 /var/oracle/product/10.2.0/db_1/dbs/lkFDS
TF Uj \20674423oracle     4488 oracle   15uR     REG        8,7         24    2911344 /var/oracle/product/10.2.0/db_1/dbs/lkFDS ITPUB个人空间3cl g1l0Z3_ c%M_1L
oracle     4490 oracle   15uR     REG        8,7         24    2911344 /var/oracle/product/10.2.0/db_1/dbs/lkFDS ITPUB个人空间6W7yL&F.x
oracle     4492 oracle   15uR     REG        8,7         24    2911344 /var/oracle/product/10.2.0/db_1/dbs/lkFDS
[,b O bv,t20674423oracle     4494 oracle   15uR     REG        8,7         24    2911344 /var/oracle/product/10.2.0/db_1/dbs/lkFDS ITPUB个人空间9mv5tq*zZ
oracle     4496 oracle   15uR     REG        8,7         24    2911344 /var/oracle/product/10.2.0/db_1/dbs/lkFDS
1uJ+kM&WU_Ef20674423oracle     4513 oracle   15u      REG        8,7         24    2911344 /var/oracle/product/10.2.0/db_1/dbs/lkFDS
6D$k9fMc,Nv20674423oracle     4531 oracle   15u      REG        8,7         24    2911344 /var/oracle/product/10.2.0/db_1/dbs/lkFDS ITPUB个人空间 M[H:nj3{8Oq'U
oracle     4534 oracle   15u      REG        8,7         24    2911344 /var/oracle/product/10.2.0/db_1/dbs/lkFDS
-k d2S6z Q-LC20674423oracle     4812 oracle   15u      REG        8,7         24    2911344 /var/oracle/product/10.2.0/db_1/dbs/lkFDS
fuser查看锁定进程
x rl i2G~[4Z#H.p20674423# fuser -u /u01/app/oracle/product/10.2.0/db_1/dbs/lkFDS
L CRAD20674423/u01/app/oracle/product/10.2.0/db_1/dbs/lkFDS:  4476(oracle)  4478(oracle)  4480(oracle)  4482(oracle)  4484(oracle)  4486(oracle)  4488(oracle)  4490(oracle)  4492(oracle)  4494(oracle)  4496(oracle)  4513(oracle)  4531(oracle)  4534(oracle)  4812(oracle) ITPUB个人空间A ^JVW4M
[root@CHN-DG-3-5CE ~]#
请教fuser的作用及具体用法!
}2W{(S5LW3R;{$M20674423fuser Command
Purpose
Identifies processes using a file or file structure.
Syntax
fuser [ -c | -d | -f ] [ -k ] [ -u ] [ -x ] [ -V ]File ...
Description
The fuser command lists the process numbers of local processes that use the ITPUB个人空间 Fu/E,L@Rb
local or remote files specified by the File parameter. For block special
,|3j(b {-S20674423devices, the command lists the processes that use any file on that device.

.]+~ W_x20674423c Uses the file as the current directory.
e Uses the file as a program's executable object.
r Uses the file as the root directory.
s Uses the file as a shared library (or other loadable object).
The process numbers are written to standard output in a line with spaces between
gQGr2Zu Q V!k'k*n20674423process numbers. A new line character is written to standard error after the
{7S&E#Yn20674423last output for each file operand. All other output is written to standard
9Ce3?3A"{1I j3q20674423error.
The fuser command will not detect processes that have mmap regions where that ITPUB个人空间n l-xR"eD
associated file descriptor has since been closed.
Flags
-c Reports on any open files in the file system containing File.
-d Implies the use of the -c and -x flags. Reports on any open files which have ITPUB个人空间sB3hFP1x
been unlinked from the file system (deleted from the parent directory). When ITPUB个人空间D'{ qGe6Q djM
of the deleted file.
-f Reports on open instances of File only.
-k Sends the SIGKILL signal to each local process. Only the root user can kill a
H0m8d`vb1H$D s20674423process of another user.
-u Provides the login name for local processes in parentheses after the process
I2S'{ ?:_,` U"Y20674423number.
-V Provides verbose output.
-x Used in conjunction with -c or -f, reports on executable and loadable objects
#g3i6u%Ee ~d?20674423in addition to the standard fuser output.
Examples
  1. To list the process numbers of local processes using the /etc/passwd file,
3]C}'xjftkQ)S/f20674423     enter:
     fuser /etc/passwd
  2. To list the process numbers and user login names of processes using the
     fuser -u /etc/filesystems
  3. To terminate all of the processes using a given file system, enter:
     fuser -k -x -u /dev/hd1 -OR-
     fuser -kxuc /home
     Either command lists the process number and user name, and then terminates ITPUB个人空间5g,h|.u/DKj7v:~
     each process that is using the /dev/hd1 (/home) file system. Only the root
1]Ml4UR l7R{/c20674423     user can terminate processes that belong to another user. You might want to ITPUB个人空间 U2S L.i*p pXJ
     use this command

原文链接:http://blog.csdn.net/wuweilong/article/details/6990240
加载中
返回顶部
顶部