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)

  union

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)

union

select name,round(total,2)total,round(total-free,2) used,round(free,2) free,round((total-free)/total,2) pctused from (

select 'Default pool' name,( select a.cnum_repl*(select value from v$parameter where name='db_block_size')/1024/1024 total from x$kcbwds a, v$buffer_pool p

  where a.set_id=p.LO_SETID and p.name='DEFAULT' and p.block_size=(select value from v$parameter where name='db_block_size')) total,

(select a.anum_repl*(select value from v$parameter where name='db_block_size')/1024/1024 free from x$kcbwds a, v$buffer_pool p 

where a.set_id=p.LO_SETID and p.name='DEFAULT' and p.block_size=(select value from v$parameter where name='db_block_size')) free from dual)

union

  select name,nvl(round(total,2),0)total,nvl(round(total-free,2),0) used,nvl(round(free,2),0) free,nvl(round((total-free)/total,2),0) pctused from (

select 'KEEP pool' name,(select a.cnum_repl*(select value from v$parameter where name='db_block_size')/1024/1024 total from x$kcbwds a, v$buffer_pool p

  where a.set_id=p.LO_SETID and p.name='KEEP' and p.block_size=(select value from v$parameter where name='db_block_size')) total,

(select a.anum_repl*(select value from v$parameter where name='db_block_size')/1024/1024 free from x$kcbwds a, v$buffer_pool p 

where a.set_id=p.LO_SETID and p.name='KEEP' and p.block_size=(select value from v$parameter where name='db_block_size')) free from dual)

union

select name,nvl(round(total,2),0)total,nvl(round(total-free,2),0) used,nvl(round(free,2),0) free,nvl(round((total-free)/total,2),0) pctused from (

select 'RECYCLE pool' name,( select a.cnum_repl*(select value from v$parameter where name='db_block_size')/1024/1024 total from x$kcbwds a, v$buffer_pool p

  where a.set_id=p.LO_SETID and p.name='RECYCLE' and p.block_size=(select value from v$parameter where name='db_block_size')) total,

(select a.anum_repl*(select value from v$parameter where name='db_block_size')/1024/1024 free from x$kcbwds a, v$buffer_pool p 

where a.set_id=p.LO_SETID and p.name='RECYCLE' and p.block_size=(select value from v$parameter where name='db_block_size')) free from dual)

union

select name,nvl(round(total,2),0)total,nvl(round(total-free,2),0) used,nvl(round(free,2),0) free,nvl(round((total-free)/total,2),0) pctused from(

select 'DEFAULT 16K buffer cache' name,(select a.cnum_repl*16/1024 total from x$kcbwds a, v$buffer_pool p

  where a.set_id=p.LO_SETID and p.name='DEFAULT' and p.block_size=16384) total,

  (select a.anum_repl*16/1024 free from x$kcbwds a, v$buffer_pool p 

where a.set_id=p.LO_SETID and p.name='DEFAULT' and p.block_size=16384) free from dual)

union

select name,nvl(round(total,2),0)total,nvl(round(total-free,2),0) used,nvl(round(free,2),0) free,nvl(round((total-free)/total,2),0) pctused from(

select 'DEFAULT 32K buffer cache' name,(select a.cnum_repl*32/1024 total from x$kcbwds a, v$buffer_pool p

  where a.set_id=p.LO_SETID and p.name='DEFAULT' and p.block_size=32768) total,

  (select a.anum_repl*32/1024 free from x$kcbwds a, v$buffer_pool p 

where a.set_id=p.LO_SETID and p.name='DEFAULT' and p.block_size=32768) free from dual)

union

select name,total,total-free used,free, (total-free)/total*100 pctused from (

select 'Java Pool' name,(select sum(bytes/1024/1024) total from v$sgastat where pool='java pool' group by pool)total,

( select bytes/1024/1024 free from v$sgastat where pool='java pool' and name='free memory')free from dual)

union

select name,Round(total,2),round(total-free,2) used,round(free,2) free, round((total-free)/total*100,2) pctused from (

select 'Large Pool' name,(select sum(bytes/1024/1024) total from v$sgastat where pool='large pool' group by pool)total,

( select bytes/1024/1024 free from v$sgastat where pool='large pool' and name='free memory')free from dual)

order by pctused desc;

查看SGA和PGA使用率的更多相关文章

  1. oracle实例内存(SGA和PGA)调整

    修改oracle内存占用 >show parameter sga; (查看内存占用情况) NAME                                   TYPE          ...

  2. oracle实例内存(SGA和PGA)调整-xin

    一.名词解释 (1)SGA:System Global Area是Oracle Instance的基本组成部分,在实例启动时分配;系统全局域SGA主要由三部分构成:共享池.数据缓冲区.日志缓冲区. ( ...

  3. 对oracle实例的内存(SGA和PGA)进行调整,优化数据库性

    一.名词解释 (1)SGA:SystemGlobal Area是OracleInstance的基本组成部分,在实例启动时分配;系统全局域SGA主要由三部分构成:共享池.数据缓冲区.日志缓冲区. (2) ...

  4. oracle实例的内存(SGA和PGA)调整,优化数据库性能

    一.名词解释 (1)SGA:SystemGlobal Area是OracleInstance的基本组成部分,在实例启动时分配;系统全局域SGA主要由三部分构成:共享池.数据缓冲区.日志缓冲区. (2) ...

  5. oracle12c之 控制pdb中sga 与 pga 内存使用

    Memory Management using Resource Manager Oracle数据库资源管理器(资源管理器)现在可以在多租户容器数据库(CDB)中管理可插入数据库(PDBs)之间的内存 ...

  6. oracle12c之二 控制PDB中SGA 与 PGA 内存使用

    oracle12c之 控制pdb中sga 与 pga 内存使用 Memory Management using Resource Manager Oracle数据库资源管理器(资源管理器)现在可以在多 ...

  7. 修改Oracle数据库SGA和PGA大小

    SGA的大小:一般物理内存20%用作操作系统保留,其他80%用于数据库.SGA普通数据库可以分配40%-60%之间,PGA可以分配20%-40%之间.1.以dba身份登录并查看SGA信息:SQL> ...

  8. Oracle sga、pga介绍改动

    oracle推荐OLTP(on-line TransactionProcessing)系统oracle占系统总内存的80%,然后再分配80%给SGA,20%给PGA.也就是 SGA=system_to ...

  9. Oracle 自己主动内存管理 SGA、PGA 具体解释

    ASMM自己主动共享内存管理: 自己主动依据工作量变化调整 最大程度地提高内存利用率 有助于消除内存不足的错误 SYS@PROD>show parameter sga NAME          ...

随机推荐

  1. 解锁Scott过程中出现的问题及解决办法

    一.conn sys/sys as sysdba; //以DBA的身份登录 出现以下错误 经查 协议适配器错误的问题的原因有三个 监听服务没有起起来.windows平台个一如下操作:开始---程序-- ...

  2. get方式请求会出现中文乱码。post方式不会。

    get方式请求会出现中文乱码.post方式不会.   如果是要解决get方式中文乱码问题,就需要做一个拦截器,或者在web.xml做一个get请求的配置 来自为知笔记(Wiz)

  3. asp.net pagebase获取缓存的方法

    public string GetSysConfigByKey(string key) { if (object.Equals(HttpContext.Current.Cache["Cach ...

  4. 更多隐式Intent用法

    上几篇无论是显示的Intent或者隐式的Intent,都是要跳转的自己添加指定的页面,如果想要跳转到百度首页或者跳转到联系人面板等,前面的知识显然是很不实用的.这里,将要针对其它的一些Intent用法 ...

  5. [Excel] C#DataToExcel帮助类 (转载)

    点击下载 DataToExcel.rar 看下面代码吧 /// <summary> /// 类说明:DataToExcel /// 编 码 人:苏飞 /// 联系方式:361983679 ...

  6. Spring处理id相同的bean

    http://www.360doc.com/content/13/1018/05/41237_322247510.shtml(应该可以解决) http://www.2cto.com/kf/201601 ...

  7. Spring Boot笔记(一)

    Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程.该框架使用了特定的方式来进行配置,从而使开发人员不再需要定义样板化的配置.通过 ...

  8. Java中报错No enclosing instance of type caiquan is accessible. Must qualify the allocation with an enclosing instance of type caiquan (e.g. x.new A() where x is an instance of caiquan).

    package test;import java.util.Scanner;import java.util.Random;public class caiquan { public static v ...

  9. PAT_1010 一元多项式求导

    题目描述: 设计函数求一元多项式的导数.(注:xn(n为整数)的一阶导数为n*xn-1.) 输入格式: 以指数递降方式输入多项式非零项系数和指数(绝对值均为不超过1000的整数).数字间以空格分隔. ...

  10. 一个由IsPrime算法引发的细节问题

    //******************************* // //    2014年9月18日星期四,于宿舍撰写 //    作者:夏华林 // //******************* ...