shmmax
shmmax內核參數定義是系統允許的單個共享內存段的最大值
現在模擬設置shmmax很小:
[root@localhost kernel]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
SQL> select * from v$version where rownum=1;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
[root@localhost ~]# cd /proc/sys/kernel | echo 1000 > shmmax => 注意:該種修改會在os重啟後失效
[oracle@localhost ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 5月 10 23:27:36 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
ERROR:
ORA-12547: TNS: 丟失連接
請輸入用戶名:
告警日志:
......
......
Sun May 10 23:27:42 2015
Process J000 died, see its trace file
kkjcre1p: unable to spawn jobq slave process
Errors in file /u01/app/oracle/diag/rdbms/orcl3939/orcl3939/trace/orcl3939_cjq0_10511.trc:
Process J000 died, see its trace file
kkjcre1p: unable to spawn jobq slave process
Errors in file /u01/app/oracle/diag/rdbms/orcl3939/orcl3939/trace/orcl3939_cjq0_10511.trc:
/u01/app/oracle/diag/rdbms/orcl3939/orcl3939/trace/orcl3939_cjq0_10511.trc:
Trace file /u01/app/oracle/diag/rdbms/orcl3939/orcl3939/trace/orcl3939_cjq0_10511.trc
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1
System name: Linux
Node name: localhost.localdomain
Release: 2.6.18-194.el5
Version: #1 SMP Mon Mar 29 20:06:41 EDT 2010
Machine: i686
Instance name: orcl3939
Redo thread mounted by this instance: 1
Oracle process number: 25
Unix process pid: 10511, image:
[email protected] (CJQ0)
*** 2015-05-10 23:08:21.485
*** SESSION ID:(133.9) 2015-05-10 23:08:21.485
*** CLIENT ID:() 2015-05-10 23:08:21.485
*** SERVICE NAME:(SYS$BACKGROUND) 2015-05-10 23:08:21.485
*** MODULE NAME:() 2015-05-10 23:08:21.485
*** ACTION NAME:() 2015-05-10 23:08:21.485
Setting Resource Manager plan SCHEDULER[0x3009]:DEFAULT_MAINTENANCE_PLAN via scheduler window
Setting Resource Manager plan DEFAULT_MAINTENANCE_PLAN via parameter
*** 2015-05-10 23:27:42.805
Process J000 is dead (pid=11060 req_ver=3 cur_ver=3 state=KSOSP_SPAWNED).
*** 2015-05-10 23:27:43.876
Process J000 is dead (pid=11063 req_ver=16 cur_ver=16 state=KSOSP_SPAWNED).
*** 2015-05-10 23:28:43.621
Process J000 is dead (pid=11106 req_ver=5 cur_ver=5 state=KSOSP_SPAWNED).
*** 2015-05-10 23:28:44.743
Process J000 is dead (pid=11109 req_ver=17 cur_ver=17 state=KSOSP_SPAWNED).
*** 2015-05-10 23:34:43.874
Process J000 is dead (pid=11244 req_ver=6 cur_ver=6 state=KSOSP_SPAWNED).
*** 2015-05-10 23:34:44.888
Process J000 is dead (pid=11247 req_ver=18 cur_ver=18 state=KSOSP_SPAWNED).
*** 2015-05-10 23:35:42.550
Process J000 is dead (pid=11280 req_ver=7 cur_ver=7 state=KSOSP_SPAWNED).
*** 2015-05-10 23:35:43.565
Process J000 is dead (pid=11285 req_ver=19 cur_ver=19 state=KSOSP_SPAWNED).
[oracle@localhost ~]$ ipcs -a
------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 3276801 oracle 600 393216 2 dest
0x00000000 3309571 oracle 600 393216 2 dest
0x00000000 3342340 oracle 600 393216 2 dest
0x00000000 3375109 oracle 600 393216 2 dest
0x00000000 3407878 oracle 600 393216 2 dest
0x00000000 3440647 oracle 600 393216 2 dest
0x00000000 3473416 oracle 600 393216 2 dest
0x00000000 3506185 oracle 600 393216 2 dest
0x00000000 3538954 oracle 600 393216 2 dest
0x00000000 3571723 oracle 600 393216 2 dest
0x05a35eec 4194316 oracle 660 4096 0
0x038880a0 3735567 oracle 755 1079228 0
------ Semaphore Arrays --------
key semid owner perms nsems
0xed251740 622592 oracle 660 154
------ Message Queues --------
key msqid owner perms used-bytes messages
SQL> select * from v$sgainfo;
NAME BYTES RES
-------------------------------- ---------- ---
Fixed SGA Size 1336960 No
Redo Buffers 6094848 No
Buffer Cache Size 79691776 Yes
Shared Pool Size 176160768 Yes
Large Pool Size 4194304 Yes
Java Pool Size 4194304 Yes
Streams Pool Size 4194304 Yes
Shared IO Pool Size 0 Yes
Granule Size 4194304 No
Maximum SGA Size 422670336 No
Startup overhead in Shared Pool 58720256 No
NAME BYTES RES
-------------------------------- ---------- ---
Free SGA Memory Available 146800640
如果shmmax的大小小於SGA設置,那麼sga任然可以創建成功,但是會被分配多個共享內存段,但是這個shmmax的大小要有底線,
否則OS資源被耗盡,Process J000 is dead
通常建議shmmax設置大些,把sga限制在一個共享內存段中。
官方文檔:
Memory Resources
The resources provided by the UNIX default kernels are often inadequate for a medium or large instance of Oracle Database. The maximum size of a shared memory segment (SHMMAX) and maximum number of semaphores available (SEMMNS) may be too low for Oracle Database recommendations.
由UNIX默認內核提供的資源往往是不足的中型或大型的數據庫實例。最大的共享內存段的大小(SHMMAX)和信號量可用的最大數目(SEMMNS)可能太低對Oracle數據庫的建議。
On Windows, fewer resources are needed for interprocess communication (IPC), because the Oracle Database relational database management system is thread-based and not process-based. These resources, including shared memory and semaphores, are not adjustable by the user.
在Windows中,更少的資源用於進程間通信(IPC)所需要的,因為Oracle數據庫的關系型數據庫管理系統是基於線程的而不是進程。這些資源,包括共享內存和信號量,都是用戶不可修改的。