模拟ORA-00020错误

有些同学会遇到ORA-00020错误,这个错误是怎么来的呢?

我们来在测试机上模拟下

首先减小processes的值

SQL> alter system set processes=39 scope =spfile;

System altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  313159680 bytes
Fixed Size		    2252824 bytes
Variable Size		  180359144 bytes
Database Buffers	  125829120 bytes
Redo Buffers		    4718592 bytes
Database mounted.
Database opened.

SQL> set linesize 300 pagesize 300
SQL> select * from v$resource_limit;

RESOURCE_NAME		       CURRENT_UTILIZATION MAX_UTILIZATION INITIAL_ALLOCATION	LIMIT_VALUE
------------------------------ ------------------- --------------- -------------------- --------------------
processes					24		27	   40			40
sessions					27		30	   82			82
enqueue_locks					22		36	 1140		      1140
enqueue_resources				21		21	  580		 UNLIMITED
ges_procs					 0		 0	    0			 0
ges_ress					 0		 0	    0		 UNLIMITED
ges_locks					 0		 0	    0		 UNLIMITED
ges_cache_ress					 0		 0	    0		 UNLIMITED
ges_reg_msgs					 0		 0	    0		 UNLIMITED
ges_big_msgs					 0		 0	    0		 UNLIMITED
ges_rsv_msgs					 0		 0	    0			 0
gcs_resources					 0		 0  UNLIMITED		 UNLIMITED
gcs_shadows					 0		 0  UNLIMITED		 UNLIMITED
smartio_overhead_memory 			 0		 0	    0		 UNLIMITED
smartio_buffer_memory				 0		 0	    0		 UNLIMITED
smartio_metadata_memory 			 0		 0	    0		 UNLIMITED
smartio_sessions				 0		 0	    0		 UNLIMITED
dml_locks					 0		 0	  360		 UNLIMITED
temporary_table_locks				 0		 0  UNLIMITED		 UNLIMITED
transactions					 0		 0	   90		 UNLIMITED
branches					 0		 0	   90		 UNLIMITED
cmtcallbk					 0		 2	   90		 UNLIMITED
max_rollback_segments				11		11	   90		     65535
sort_segment_locks				 3		 3  UNLIMITED		 UNLIMITED
k2q_locks					 0		 0	  164		 UNLIMITED
max_shared_servers				 1		 1  UNLIMITED		 UNLIMITED
parallel_max_servers				 0		 0	   10		      3600

27 rows selected.

可以看到在11.2中该值最小为40

SQL> select * from v$version where rownum <=1;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

执行下面的脚本测试

[oracle@o11204 ~]$ cat /tmp/test.sh
for i in {1..30}
do

sqlplus -s test/test & <<EOF
set serveroutput on
begin
dbms_lock.sleep(20);
end;
/
EOF

done


这时就会出现提示00020

查看limit会发现最大值达到了40

SQL> select * from v$resource_limit;

RESOURCE_NAME		       CURRENT_UTILIZATION MAX_UTILIZATION INITIAL_ALLOCATION	LIMIT_VALUE
------------------------------ ------------------- --------------- -------------------- --------------------
processes					39		40	   40			40
sessions					43		43	   82			82
enqueue_locks					27		35	 1140		      1140
enqueue_resources				21		49	  580		 UNLIMITED
ges_procs					 0		 0	    0			 0
ges_ress					 0		 0	    0		 UNLIMITED
ges_locks					 0		 0	    0		 UNLIMITED
ges_cache_ress					 0		 0	    0		 UNLIMITED
ges_reg_msgs					 0		 0	    0		 UNLIMITED
ges_big_msgs					 0		 0	    0		 UNLIMITED
ges_rsv_msgs					 0		 0	    0			 0
gcs_resources					 0		 0  UNLIMITED		 UNLIMITED
gcs_shadows					 0		 0  UNLIMITED		 UNLIMITED
smartio_overhead_memory 			 0		 0	    0		 UNLIMITED
smartio_buffer_memory				 0		 0	    0		 UNLIMITED
smartio_metadata_memory 			 0		 0	    0		 UNLIMITED
smartio_sessions				 0		 0	    0		 UNLIMITED
dml_locks					 0		26	  360		 UNLIMITED
temporary_table_locks				 0		 2  UNLIMITED		 UNLIMITED
transactions					 0		 2	   90		 UNLIMITED
branches					 0		 0	   90		 UNLIMITED
cmtcallbk					 0		 2	   90		 UNLIMITED
max_rollback_segments				11		11	   90		     65535
sort_segment_locks				 3		 8  UNLIMITED		 UNLIMITED
k2q_locks					 0		 0	  164		 UNLIMITED
max_shared_servers				 1		 1  UNLIMITED		 UNLIMITED
parallel_max_servers				 0		 0	   10		      3600

27 rows selected.

如果出现这个提示,在资源允许的情况下加大processes的值就可以了



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值