大家都知道
,我们使用ORACLE数据库时
,常常会为实例配置一个processes参数,此参数故名思意,就是设置整个数据库系统可以启动多少个进程(包括系统自己的后台进程)设置不合理的processes参数值,会导致实例无法启动
。此参数还有其它许许多多的含义和作用,影响着数据库系统的运行
。比如,ORACLE在哪里为其分配内存,分配多大内存?此内存信息在ORACLE instance级的作用?为什么processes参数是一个静态参数?通过本文,相信大家能找到一个的答案。下面是通过一些测试,来回答上述问题。
SQL> startup nomount;
ORACLE 例程已经启动。
Total System Global Area 201326592 bytes
Fixed Size 1289676 bytes
Variable Size 130023988 bytes
Database Buffers 62914560 bytes
Redo Buffers 7098368 bytes
SQL>
SQL> show parameter processes
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
aq_tm_processes integer 0
db_writer_processes integer 1
gcs_server_processes integer 0
job_queue_processes integer 10
log_archive_max_processes integer 2
processes integer 100
SQL>
SQL> alter system set processes=5000 scope=spfile;
系统已更改。
SQL> shutdown abort;
ORACLE 例程已经关闭。
SQL> startup nomount;
ORA-00371: not enough shared pool memory, should be atleast 439686348 bytes
从上面的错误说明,oracle会根据processes参数的值在共享池中分配一定数量的内存,参数值越大,分配的内存也越多。
将processes参数调整到100个,重新启动系统
SQL> show parameter processes;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
aq_tm_processes integer 0
db_writer_processes integer 1
gcs_server_processes integer 0
job_queue_processes integer 10
log_archive_max_processes integer 2
processes integer 100
SQL> select * from v$sgastat where pool='shared pool' and name like '%process%';
POOL NAME BYTES
------------ -------------------------------------------------- ----------
shared pool generic process shared st 12
shared pool ksb ci process list (each 348
shared pool process count for each CI 288
shared pool ksb cic process list 288
shared pool Background process state 48
shared pool process group array 25352
shared pool ksb process so list 288
shared pool processes 400
已选择8行。
修改processes参数的值,再次启动系统
SQL> alter system set processes=300 scope=spfile;
系统已更改。
shutdown immediate;
startup;
SQL> select * from v$sgastat where pool='shared pool' and name like '%process%';
POOL NAME BYTES
------------ -------------------------------------------------- ----------
shared pool generic process shared st 12
shared pool ksb ci process list (each 348
shared pool process count for each CI 288
shared pool ksb cic process