清空共享内存 :alter system flush shared_pool
下面的SQL查询占用share pool 内存大于10m的sql;
select substr(sql_text,1,100) “stmt”,count(*) ,sum(sharable_mem),sum(users_opening),sum(executions) from v$sql group by substr(sql_text,1,100) having sum(sharable_mem)>10000000;
查询share pool的空闲内存;
select a.* ,round(a.bytes/1024/1024,2) M from v$sgastat a where a.name=’free memory’;
查询version count过高的语句
select address,sql_id,hash_value,version_count,users_opening,users_executing,sql_text from v$sqlarea where version_count>10;
获取PGA,SGA使用情况:
select name,total,round(total-free,2) used,round(free,2) free,round((total-free)/total*100,2) pctused from (select ‘SGA’ name,(select sum(value/1024/1024) from v$sga) total,(select sum(bytes/1024/1024) from v$sgastat where name=’free memory’)free from dual) union select name,total,round(服务器托管网used,2) used,round(total-used,2) free,round(used/total*100,2)pctused from(select ‘PGA’ name,(select value/1024/1024 total from v$pgastat where name=’aggregate PGA target parameter’)total,(select value/1024/1024 used from v$pgastat where name=’total PGA allocated’)used from dual);
获取shared pool 使用情况;
select name ,round(total,2) total,round((total-free),2) used,round(free,2) free,round((total-free)/total*100,2) pctused from(select ‘Shared pool’ name,(select sum(bytes/1024/1024) from v$sgastat where pool=’shared pool’) total, (select bytes/1024/1024 from v$sgastat where name=’free memory’ and pool=’shared pool’)free from dual)
查询使用频率最高的5个查询sql;
select sql_text,executions from (select sql_text,executions,rank() over (order by executions desc) exec_rank from v$sql) where exec_rank
查看cpu使用率最高的sql;
select * from (select sql_text,sql_id,cpu_time from v$sql order by cpu_time desc) where rownum 消耗磁盘最多的5个sql;
select d服务器托管网isk_reads,sql_text from (select sql_text,disk_reads,dense_rank() over (order by disk_reads desc) disk_reads_rank from v$sql) where disk_reads_rank 找出需要大量缓冲读取操作的查询:
select buffer_gets,sql_text from (select sql_text,buffer_gets,dense_rank() over (order by buffer_gets desc) buffer_gets_rank from v$sql) where buffer_gets_rank 查询数据字典缓存的命中率和缺失率;
select round(((1-sum(getmisses)/(sum(gets)+sum(getmisses))))*100,3) “HR” ,round(sum(getmisses)/sum(gets)*100,3) “MR” from v$rowcache where gets+getmisses>0;
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
相关推荐: 机器人学、机器视觉与控制 上机笔记(第一版译文版 2.1章节)
机器人学、机器视觉与控制 上机笔记(第一版译文版 2.1章节) 1、前言 2、本篇内容 3、代码记录 3.1、新建se2 3.2、生成坐标系 3.3、将T1表示的变换绘制 3.4、完整绘制代码 3.5、获取点`*`在坐标系1下的表示 3.6、相对坐标获取完整代…