告警日志或者应用报错后,可以看看相关trc,也许能看到以下:
导致ora-4031的原因:
* sga 太小
select pool,round(sum(bytes)/(1024*1024),2) size_mb  from v$sgastat group by pool order by 1;
* 内存自动调优问题
* 应用设计导致的碎片(比如没使用绑定变量)
* bug或内存泄漏
先来个脚本压压惊
ora-04031 如果想深入看看到底什么原因导致
	
		- 
			--设置事件
 
		 
		- 
			sqlplus /nolog
		 
		- 
			connect / as sysdba
		 
		- 
			alter system set events '10235 level 65536';
		 
		- 
			exit
		 
		- 
			
		 
		- 
			then wait a while for the ora-4031 (or at least the memory allocations) to occur, and then execute:
		 
		- 
			sqlplus /nolog
		 
		- 
			connect / as sysdba
		 
		- 
			oradebug setmypid
		 
		- 
			oradebug unlimit
		 
		- 
			oradebug dump heapdump 536870914
		 
		- 
			oradebug tracefile_name
		 
		- 
			oradebug close_trace
		 
		- 
			
		 
		- 
			执行完后关闭事件
		 
		- 
			alter system set events '10235 off'; 
		
 
	
 
在转储的trc文件中搜 
heapdump shows 看是什么函数导致
有这一堆脚本应该够用了 。
参考:
ora-4031 错误故障排除与诊断[视频] (doc id 2016002.1)                                   
 
            
            
              
              阅读(564) | 评论(0) | 转发(0) |