转载时请务必以超链接形式标明文章 原始出处和作者信息及本版权声明。
链接:http://www.dbasky.net/archives/2009/02/sysresvoracle.html
从oracle8.1.5起,oracle在unix/linux平台提供了一个叫做sysresv的小工具来查看oracle占用的共享内存段和信号量等系统资源的一些关键信息。
[oracle@localhost ~]$ sysresv
sysresv: error while loading shared libraries: libclntsh.so.11.1: cannot open shared object file: No such file or directory
出现该错误是由于没有设置LD_LIBRARY_PATH环境变量,导致无法找到需要的库文件
[oracle@localhost ~]$ LD_LIBRARY_PATH=$ORACLE_HOME/lib
[oracle@localhost ~]$ export LD_LIBRARY_PATH
[oracle@localhost ~]$ sysresv
IPC Resources for ORACLE_SID "ning" :
Shared Memory:
ID KEY
458763 0x78b6869c
Semaphores:
ID KEY
98304 0x5ed8a0f0
Oracle Instance alive for sid "ning"
根据上述信息,可以通过ipcs查看sid为ning的instance具体的共享内存段和信号量信息:
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x78b6869c 458763 oracle 660 243269632 23
------ Semaphore Arrays --------
key semid owner perms nsems
0x5ed8a0f0 98304 oracle 660 154
------ Message Queues --------
key msqid owner perms used-bytes messages
sysresv命令比较简单,只有几个不同的option,默认只显示$ORACLE_SID指定的instance的信息:
usage : sysresv [-if] [-d <on/off>] [-l sid1 <sid2> ...]
-i : Prompt before removing ipc resources for each sid
-f : Remove ipc resources silently, oevrrides -i option
-d <on/off> : List ipc resources for each sid if on
-l sid1 <sid2> .. : apply sysresv to each sid
Default : sysresv -d on -l $ORACLE_SID
Note : ipc resources will be attempted to be deleted for a
sid only if there is no currently running instance
with that sid.
发表评论