您好,登錄后才能下訂單哦!
Oracle Study之案例--通過IPCS查看共享內(nèi)存之“怪現(xiàn)象”
在Oracle 11gR2環(huán)境下,通過ipcs命令查看共享內(nèi)存,竟然發(fā)現(xiàn)分配給Oracle的內(nèi)存只有4096Bytes,而在Oracle 10g環(huán)境下從未發(fā)現(xiàn)這種問題!
[root@rh7 ~]# ipcs -a ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x00000000 0 root 644 52 2 0x00000000 32769 root 644 16384 2 0x00000000 65538 root 644 268 2 0x00000000 98307 gdm 600 393216 2 dest 0x00000000 131076 gdm 600 393216 2 dest 0x00000000 163845 gdm 600 393216 2 dest 0x00000000 196614 gdm 600 393216 2 dest 0x00000000 229383 gdm 600 393216 2 dest 0x4b4218ec 557064 oracle 660 4096 0 ------ Semaphore Arrays -------- key semid owner perms nsems 0x00000000 0 root 600 1 0x00000000 98305 root 600 1 0x000000a7 327682 root 600 1 0xbe61d9cc 983043 oracle 660 154 ------ Message Queues -------- key msqid owner perms used-bytes messages
數(shù)據(jù)庫版本:
16:27:09 SYS@ test3 >select * from v$version; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production PL/SQL Release 11.2.0.1.0 - Production CORE 11.2.0.1.0 Production TNS for Linux: Version 11.2.0.1.0 - Production NLSRTL Version 11.2.0.1.0 - Production
Oraccle 11g的通過以下兩個參數(shù)實現(xiàn)內(nèi)存的自動個管理:
16:27:19 SYS@ test3 >show parameter mem NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ hi_shared_memory_address integer 0 memory_max_target big integer 300M memory_target big integer 300M shared_memory_address integer 0
1、會不會是參數(shù)memory_max_target有關(guān)系呢?把它設(shè)為0,然后重啟數(shù)據(jù)庫。
16:28:11 SYS@ test3 >alter system set memory_target=0 ; System altered. 16:36:44 SYS@ test3 >show parameter mem NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ hi_shared_memory_address integer 0 memory_max_target big integer 300M memory_target big integer 0 shared_memory_address integer 0 16:30:51 SYS@ test3 >startup force ; ORACLE instance started. Total System Global Area 313860096 bytes Fixed Size 1336232 bytes Variable Size 205524056 bytes Database Buffers 100663296 bytes Redo Buffers 6336512 bytes Database mounted. Database opened.
再看共享內(nèi)存:
[oracle@rh7 ~]$ ipcs -a ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x00000000 0 root 644 52 2 0x00000000 32769 root 644 16384 2 0x00000000 65538 root 644 268 2 0x4b4218ec 622600 oracle 660 4096 0 ------ Semaphore Arrays -------- key semid owner perms nsems 0xbe61d9cc 1114115 oracle 660 154 ------ Message Queues -------- key msqid owner perms used-bytes messages
發(fā)現(xiàn)分配給Oracle的共享內(nèi)存仍然很小,看來不是memory_target 參數(shù)的問題!
2、嘗試調(diào)整memory_max_target參數(shù),將其恢復(fù)到系統(tǒng)默認(rèn)值:
16:39:49 SYS@ test3 >alter system set sga_max_size=300m scope=spfile; System altered. 16:40:06 SYS@ test3 >alter system reset memory_max_target scope=spfile sid='*'; System altered. 16:40:40 SYS@ test3 >startup force nomount; ORACLE instance started. Total System Global Area 313860096 bytes Fixed Size 1336232 bytes Variable Size 205524056 bytes Database Buffers 100663296 bytes Redo Buffers 6336512 bytes 16:40:52 SYS@ test3 >show parameter mem NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ hi_shared_memory_address integer 0 memory_max_target big integer 0 memory_target big integer 0 shared_memory_address integer 0 16:40:59 SYS@ test3 >show parameter sga NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ lock_sga boolean FALSE pre_page_sga boolean FALSE sga_max_size big integer 300M sga_target big integer 180M
查看系統(tǒng)共享內(nèi)存:
[oracle@rh7 ~]$ ipcs -a ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x00000000 0 root 644 52 2 0x00000000 32769 root 644 16384 2 0x00000000 65538 root 644 268 2 0x4b4218ec 884744 oracle 660 316669952 16 ------ Semaphore Arrays -------- key semid owner perms nsems 0xbe61d9cc 1638403 oracle 660 154 ------ Message Queues -------- key msqid owner perms used-bytes messages
看來是設(shè)置了memory_max_target參數(shù)的原因,導(dǎo)致通過ipcs查看到分配給Oracle的內(nèi)存為4096Bytes!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。