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. PHP5常量

    用函数 define()设置常量 define函数有3个参数 1.必选,常量的名称,标识符 2.必选,常量的值 3.可选,默认不设置,常量名称大小写敏感.如果设置true,常量名称不区分大小写! 下面 ...

  2. 核心运营报表无线端数据,pv,uv相关数据,从9月1号开始就没了,为什么?

    问题现象截图 核心运营报表 从获取数据的api的地址可以看出: http://data.51buy.com/json.php?biz=statistic&mod=OrderKeyData&am ...

  3. vue写请求接口--请求参数的变量要在return里面声明

    //谨记return里面是返回所有声明的变量的名字,数组以及对象等等 export default { data () { return { //所有的变量都是写在data 的return里面的,主要 ...

  4. wpf viewmodel之间的通信

    使用Prism第三方框架实现ViewModel之间的通信 创建类继承自UnityBootstrapper public class Bootstrapper : UnityBootstrapper { ...

  5. 不安装oracle客户端,连接到服务器的oracle (注:针对 odp.net)

    前几天在研究怎样不安装oracle客户端去访问oracle,并把里面的数据同步到本地的Sql Server数据库中. 准备工作:首先你得有如下.dll,我这个是针对oracle10g的,如果是更高的版 ...

  6. SQL使用存儲過程訪問不同服務器

    用openrowset连接远程SQL或插入数据 --如果只是临时访问,可以直接用openrowset --查询示例 select * from openrowset('SQLOLEDB', 'sql服 ...

  7. yieId浅谈

    例子:在不使用yieId时,通常我们都会采取先遍历再把元素加到新的List中 using (var reader = SqlHelper.ExecuteReader("")) { ...

  8. UITableView编写可以添加,删除,移动的物品栏(二)

    MyTableViewCell.h文件(自定义ViewCell)的内容: MyTableViewCell.m的内容

  9. .NET生成静态页面例子

    主要做法如下: 1.创建网站,并创建一个模板页,template.htm 2.添加一个web窗体Default.aspx 3.在网站下新建文件夹htm,设置该文件夹的属性,确保该文件夹具有可写权限 详 ...

  10. ubuntu1404下Apache2.4错误日志error.log路径位置

    首先打开/etc/apache2路径下的apache2.conf文件,找到ErrorLog如下 ErrorLog ${APACHE_LOG_DIR}/error.log 这里{APACHE_LOG_D ...