[20210126]探究oracle記憶體分配3.txt

lfree 發表於 2021-01-26

[20210126]探究oracle記憶體分配3.txt

--//上午做了一番探究,繼續測試,我手工增加log_buffer看看如何分配.

1.環境:
[email protected]> @ ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

[email protected]> show sga
Total System Global Area  643084288 bytes
Fixed Size                  2255872 bytes
Variable Size             205521920 bytes
Database Buffers          427819008 bytes
Redo Buffers                7487488 bytes

[email protected]> create pfile='/tmp/@.ora' from spfile ;
File created.

--//手工編輯/tmp/book.ora檔案,修改log_buffer,僅僅比原來增加1個位元組.
*.log_buffer=7487489

2.重啟資料庫:
[email protected]> shutdown immediate ;
Database closed.
Database dismounted.
ORACLE instance shut down.
[email protected]> startup pfile='/tmp/@.ora'
ORACLE instance started.

Total System Global Area  647278592 bytes
Fixed Size                  2255872 bytes
Variable Size             205521920 bytes
Database Buffers          427819008 bytes
Redo Buffers               11681792 bytes
Database mounted.
Database opened.
--//Redo Buffers =11681792
--// (11681792-7487488)/4/1024/1024 = 1 ,我僅僅增加1個位元組,就增級1個GRANULE_SIZE=4m.

$ ipcs -m
------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 30605314   oracle    640        16777216   23
0x00000000 30638083   oracle    640        633339904  23
0xe8a8ec10 30670852   oracle    640        2097152    23

$ cat /proc/$(ps -ef | grep smo[n]| awk '{print $2}')/maps | grep SYSV
60000000-61000000 rw-s 00000000 00:0b 30605314                           /SYSV00000000 (deleted)
61000000-86c00000 rw-s 00000000 00:0b 30638083                           /SYSV00000000 (deleted)
86c00000-86e00000 rw-s 00000000 00:0b 30670852                           /SYSVe8a8ec10 (deleted)

--//61000000 -60000000 = 16777216 .
--//佔用4個GRANULE_SIZE.

--//Fixed Size+Redo Buffers = 2255872+11681792 = 13937664
--//13937664/4/1024/1024 = 3.322998046875

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2753149/,如需轉載,請註明出處,否則將追究法律責任。