[20190104]ipcs檢視共享記憶體段.txt
[20190104]ipcs檢視共享記憶體段.txt
--//資料庫啟動異常,有時候會留下一些共享記憶體段沒有清理,需要使用ipcrm清理.
--//由於伺服器上跑2個例項,必須選擇正確的共享記憶體段,否則會導致別的資料庫crash.
--//在我工作中,這是遇到的第2次,做一些複習與整理:
--//在linux下有一個命令sysresv可以檢視某例項使用的共享記憶體段.
$ ipcs
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 287440897 oracle 600 12288 2 dest
0x00000000 287473666 oracle 600 196608 2 dest
0x00000000 287506435 oracle 600 12288 2 dest
0x00000000 287211524 oracle 600 393216 2 dest
0x00000000 287244293 oracle 600 393216 2 dest
0x00000000 287277062 oracle 600 393216 2 dest
0x00000000 287309831 oracle 600 196608 2 dest
0x00000000 287342600 oracle 600 393216 2 dest
0x00000000 287375369 oracle 600 196608 2 dest
0x00000000 287408138 oracle 600 393216 2 dest
0x00000000 301334539 oracle 640 12582912 25
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x00000000 301367308 oracle 640 633339904 25
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0xe8a8ec10 301400077 oracle 640 2097152 25
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x790209cd 294617102 oracle 666 808 0
0x79020002 294649871 oracle 666 808 0
------ Semaphore Arrays --------
key semid owner perms nsems
0x6aa88594 275578880 oracle 640 184
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x790209cd 269713409 oracle 666 1
0x79020002 269746178 oracle 666 1
------ Message Queues --------
key msqid owner perms used-bytes messages
$ export ORACLE_SID=book
$ sysresv
IPC Resources for ORACLE_SID "book" :
Shared Memory:
ID KEY
301334539 0x00000000
301367308 0x00000000
301400077 0xe8a8ec10
Semaphores:
ID KEY
275578880 0x6aa88594
Oracle Instance alive for sid "book"
--//下劃線內容可以對上.
--//注意執行前最好指定確認ORACLE_SID環境變數.
man ipcrm
-m shmid removes the shared memory segment identified by shmid after the last detach is performed.
--//ipcrm 引數-m 對應 shmid.
--//另外ipcs有一個引數-t參看time.
$ ipcs -t
------ Shared Memory Attach/Detach/Change Times --------
shmid owner attached detached changed
287440897 oracle Dec 12 17:37:06 Dec 12 17:37:07 Dec 5 17:32:14
287473666 oracle Dec 12 17:37:06 Dec 12 17:37:07 Dec 5 17:32:14
287506435 oracle Dec 12 17:37:06 Dec 12 17:37:07 Dec 5 17:32:14
287211524 oracle Dec 12 17:37:06 Dec 12 17:37:07 Dec 5 15:42:08
287244293 oracle Dec 12 17:37:06 Dec 12 17:37:07 Dec 5 15:42:08
287277062 oracle Dec 12 17:37:06 Dec 12 17:37:07 Dec 5 15:42:08
287309831 oracle Dec 12 17:37:06 Dec 12 17:37:07 Dec 5 15:42:08
287342600 oracle Dec 12 17:37:06 Dec 12 17:37:07 Dec 5 15:42:09
287375369 oracle Dec 12 17:37:06 Dec 12 17:37:07 Dec 5 15:42:17
287408138 oracle Dec 12 17:37:06 Dec 12 17:37:07 Dec 5 15:42:17
301334539 oracle Jan 4 10:13:32 Jan 4 10:14:02 Jan 4 09:53:20
301367308 oracle Jan 4 10:13:32 Jan 4 10:14:02 Jan 4 09:53:20
301400077 oracle Jan 4 10:13:32 Jan 4 10:14:02 Jan 4 09:53:20
294617102 oracle Dec 24 09:22:37 Dec 24 09:22:37 Dec 24 09:22:37
294649871 oracle Dec 24 10:03:22 Dec 24 10:08:55 Dec 24 09:23:01
------ Semaphore Operation/Change Times --------
semid owner last-op last-changed
275578880 oracle Fri Jan 4 10:14:43 2019 Fri Jan 4 10:14:43 2019
269713409 oracle Mon Dec 24 09:22:37 2018 Mon Dec 24 09:22:37 2018
269746178 oracle Mon Dec 24 10:08:55 2018 Mon Dec 24 09:23:01 2018
------ Message Queues Send/Recv/Change Times --------
msqid owner send recv change
--//我仔細看了一下.如果有使用者連上attached會變化,退出後detached時間也會變化.說明有使用者使用.
--//最後一列changed視乎都不變,不知道是否對應oracle例項的啟動時間.
SYS@book> select startup_time from v$instance ;
STARTUP_TIME
-------------------
2019-01-04 09:53:21
--//視乎可以對上.
--//另外使用oradebug ipc命令也可以檢視.
SYS@book> oradebug setmypid
Statement processed.
SYS@book> oradebug ipc
IPC information written to the trace file
SYS@book> oradebug tracefile_name
/u01/app/oracle/diag/rdbms/book/book/trace/book_ora_7252.trc
*** 2019-01-04 10:25:15.026
Processing Oradebug command 'ipc'
Dump of unix-generic skgm context
areaflags 000000f7
realmflags 0000001f
mapsize 00000800
protectsize 00001000
lcmsize 00001000
seglen 00200000
largestsize 0000000480000000
smallestsize 0000000000400000
stacklimit 0x7fffc0268300
stackdir -1
mode 640
magic acc01ade
Handle: 0x7f0b488e40b0 `/u01/app/oracle/product/11.2.0.4/dbhome_1book'
--//注意這是控制程式碼,還記得環境變數ORACLE_HOME後面帶斜線的設定導致無法連上資料庫的問題嗎?11.2.0.4已經沒有這個問題了.
$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0.4/dbhome_1
--//參看連結:http://blog.itpub.net/267265/viewspace-2055052/=>[20160310]神奇的斜線.txt
Dump of unix-generic realm handle `/u01/app/oracle/product/11.2.0.4/dbhome_1book', flags = 00000000
Area #0 `Fixed Size' containing Subareas 0-0
Total size 0000000000226c00 Minimum Subarea size 00000000
Area Subarea Shmid Stable Addr Actual Addr
0 0 301334539 0x00000060000000 0x00000060000000
Subarea size Segment size
0000000000227000 0000000000c00000
Area #1 `Variable Size' containing Subareas 4-4
Total size 0000000025c00000 Minimum Subarea size 00400000
Area Subarea Shmid Stable Addr Actual Addr
1 4 301367308 0x00000060c00000 0x00000060c00000
Subarea size Segment size
0000000025c00000 0000000025c00000
Area #2 `Redo Buffers' containing Subareas 1-1
Total size 0000000000724000 Minimum Subarea size 00000000
Area Subarea Shmid Stable Addr Actual Addr
2 1 301334539 0x00000060227000 0x00000060227000
Subarea size Segment size
0000000000724000 0000000000c00000
Area #3 `Base Allocator Control' containing Subareas 3-3
Total size 0000000000002000 Minimum Subarea size 00000000
Area Subarea Shmid Stable Addr Actual Addr
3 3 301334539 0x00000060bfe000 0x00000060bfe000
Subarea size Segment size
0000000000002000 0000000000c00000
Area #4 `Slab Allocator Control' containing Subareas 2-2
Total size 00000000002b3000 Minimum Subarea size 00000000
Area Subarea Shmid Stable Addr Actual Addr
4 2 301334539 0x0000006094b000 0x0000006094b000
Subarea size Segment size
00000000002b3000 0000000000c00000
Area #5 `skgm overhead' containing Subareas 5-5
Total size 0000000000002000 Minimum Subarea size 00000000
Area Subarea Shmid Stable Addr Actual Addr
5 5 301400077 0x00000086800000 0x00000086800000
Subarea size Segment size
0000000000002000 0000000000200000
Dump of Linux-specific skgm context
-------------- system semaphore information -------------
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 287440897 oracle 600 12288 2 dest
0x00000000 287473666 oracle 600 196608 2 dest
0x00000000 287506435 oracle 600 12288 2 dest
0x00000000 287211524 oracle 600 393216 2 dest
0x00000000 287244293 oracle 600 393216 2 dest
0x00000000 287277062 oracle 600 393216 2 dest
0x00000000 287309831 oracle 600 196608 2 dest
0x00000000 287342600 oracle 600 393216 2 dest
0x00000000 287375369 oracle 600 196608 2 dest
0x00000000 287408138 oracle 600 393216 2 dest
0x00000000 301334539 oracle 640 12582912 26
0x00000000 301367308 oracle 640 633339904 26
0xe8a8ec10 301400077 oracle 640 2097152 26
0x790209cd 294617102 oracle 666 808 0
0x79020002 294649871 oracle 666 808 0
------ Semaphore Arrays --------
key semid owner perms nsems
0x6aa88594 275578880 oracle 640 184
0x790209cd 269713409 oracle 666 1
0x79020002 269746178 oracle 666 1
------ Message Queues --------
key msqid owner perms used-bytes messages
--//僅僅前面部分的顯示該例項使用共享記憶體段.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2305466/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 共享記憶體相關(ipcs/ipcrm)記憶體
- aix 共享記憶體段大小限制AI記憶體
- linux共享記憶體段研究Linux記憶體
- aix 共享記憶體段問題AI記憶體
- [20210412]分析會話佔用的共享記憶體段.txt會話記憶體
- 檢視swap記憶體記憶體
- [20210407]分析sql語句的共享記憶體段3.txtSQL記憶體
- [20210421]分析會話佔用的共享記憶體段2.txt會話記憶體
- Linux釋放記憶體及手動釋放Oracle共享記憶體段Linux記憶體Oracle
- 共享記憶體記憶體
- 在C++Builder中建立共享記憶體段 (轉)C++UI記憶體
- [20191220]關於共享記憶體段相關問題.txt記憶體
- [20210902]為什麼會使用多個共享記憶體段.txt記憶體
- 共享記憶體段未釋放導致資料庫記憶體被耗盡記憶體資料庫
- GDB檢視記憶體(x 命令)記憶體
- 檢視linux可用記憶體Linux記憶體
- SUSE檢視CPU和記憶體記憶體
- Linux檢視記憶體資訊Linux記憶體
- Golang 共享記憶體Golang記憶體
- POSIX共享記憶體記憶體
- oracle 共享記憶體Oracle記憶體
- POSIX 共享記憶體記憶體
- [20191223]關於共享記憶體段相關問題3.txt記憶體
- adbshelldumpsys命令檢視記憶體記憶體
- UNIX系統記憶體檢視方法記憶體
- Aix下檢視記憶體命令 -- 轉AI記憶體
- SOLARISE檢視記憶體使用情況記憶體
- 用GDB檢視記憶體內容記憶體
- 如何檢視linux系統中空閒記憶體/實體記憶體使用/剩餘記憶體Linux記憶體
- nginx共享記憶體分析Nginx記憶體
- QT之共享記憶體QT記憶體
- 共享記憶體函式記憶體函式
- shmget() -- 建立共享記憶體記憶體
- SGA與共享記憶體記憶體
- linux共享記憶體Linux記憶體
- live555實現共享記憶體視訊直播記憶體
- Python記憶體檢視是什麼Python記憶體
- java中如何檢視記憶體洩露Java記憶體洩露