• SGA、PGA使用情况
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);

  • 内存使用率
-- pctused: 使用率
select * from (
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 pwhere 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)
unionselect 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 pwhere 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 pwhere 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 pwhere 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 pwhere 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);

select * from v$sga_dynamic_components;
select * from v$pgastat;-- 查询share pool的空闲内存
select a.*,round(a.bytes/1024/1024,2) M from v$sgastat a where a.NAME = 'free memory';-- 通过下面的sql查询占用share pool内存大于10M的sql
SELECT substr(sql_text,1,100) "Stmt", count(*),sum(sharable_mem)    "Mem",sum(users_opening)   "Open",sum(executions)      "Exec"FROM v$sqlGROUP BY substr(sql_text,1,100)HAVING sum(sharable_mem) > 10000000;-- 查询一下version count过高的语句
SELECT address,sql_id,hash_value,version_count,users_opening,users_executing,sql_textFROM v$sqlarea WHERE version_count > 10;

转载于:https://www.cnblogs.com/ios9/p/9633259.html

Oracle数据库内存使用情况分析查看相关推荐

  1. aix查看oracle进程内存使用情况,AIX 查看进程的内存使用情况

    svmon-P命令显示系统上当前正在运行的所有进程的内存使用情况统计信息. 下面是 svmon -P 命令的示例: # svmon -P ------------------------------- ...

  2. 如何用oracle查看内存使用情况,oracle运维08内存使用情况分析查看

    1.SGA.PGA应用状况查问:select name,total,round(total-free,2) used, round(free,2) free,round((total-free)/to ...

  3. Linux下的十个好用的命令工具:查看系统版本,显示目录的大小,查看硬盘HDD/SSD,硬盘测速,ssh时自动输入密码,查看程序的内存使用情况,查看I/O的速度,查看ssh密码错误日志,查找文件

    文章目录 1.查看系统版本 2.显示目录的大小 3.查看硬盘是HDD还是SSD 4.硬盘测速 5.在ssh的时候自动输入密码 6.查看程序的内存使用情况 7.查看I/O的速度 8.查看ssh密码错误日 ...

  4. android手机内存使用情况分析

    android手机内存使用情况分析         通常客户经常纠结手机内存的使用率不合理,占有的内存太大,可用内存很少,客户往往需要给出解决方案或在给出原因,那么你首先需要知道手机的内存都被什么应用 ...

  5. TCGA数据库的基因表达情况分析

    TCGA数据库的基因表达情况分析 数据内容 TCGA.GTEX数据库下载的数据内容形式如下: A:样品 B:表达水平 C:样品类型(正常组织和癌组织) D:数据源 乳腺癌的基因表达情况 以乳腺癌为例: ...

  6. oracle数据库内存结构pga/sga/uga做比较分析

    oracle数据库的内存结构比较复杂,下面对pga/sga/uga做比较分析. 1. sga组成: database buffer cache:包括 default pool,keep pool,re ...

  7. 查看oracle数据库的连接情况

    DBA要定时对数据库的连接情况进行检查,看与数据库建立的会话数目是不是正常,如果建立了过多的连接,会消耗数据库的资源.同时,对一些"挂死"的连接,可能会需要DBA手工进行清理. 以 ...

  8. Oracle ——数据库 SQL 分页性能分析

    本文内容 创建测试表 test 及其数据 创建 test 表索引 创建 test 表的统计数据 测试数据分布情况 演示三种数据库分页的性能 总结 参考资料 本文内容并不新鲜,很早就有人写过,但那毕竟是 ...

  9. oracle数据库优化-IO性能分析优化

    在部署了ORACLE数据库的服务器上,我们大家或多或少的遇到过下列情况: 1. 业务系统运行缓慢,作为系统管理员需要检查包括IO在内的系统资源,这时系统管理员.存储管理员可能得到DBA(数据库管理员) ...

  10. LINUX进程内存占用情况如何查看的方法

    在系统维护的过程中,随时可能有需要查看 CPU 使用率,并根据相应信息分析系统状况的需要.在 CentOS 中,可以通过 top 命令来查看 CPU 使用状况.运行 top 命令后,CPU 使用状态会 ...

最新文章

  1. 白噪音和粉红噪音煲机_白噪音真的有助于睡眠?这款可以自定义的应用给你答案...
  2. Server.MapPath()目录详解
  3. 权限操作-springSecurity快速入门-使用自定义页面
  4. 或许是单选的飞鸽传书
  5. 只显示小方格_魔力科学小实验 | 只能剪一刀,如何将图片中的红白方块分开?...
  6. 金三银四 | 吃透这套题,面试更有底气
  7. IE代理服务器出错导致浏览器无法上网
  8. 上粱正,下粱不歪——网吧母盘制作流程(转)
  9. 基于Java生鲜蔬菜食品商城系统详细设计和实现
  10. 不登陆QQ也能使用QQ截图工具
  11. Python转exe神器pyinstaller
  12. 【matlab图像处理】图像处理工具箱(1)
  13. 郭盛华与米特尼克,中美两大顶尖电脑高手,两人竟有太多相似之处
  14. 二、AFD-Net: Aggregated Feature Difference Learning for Cross-Spectral Image Patch Matching论文阅读
  15. bootstrap制作一个优美的导航栏
  16. luogu P4238 【模板】多项式乘法逆
  17. 磊科路由器信号按键_超简单的磊科路由器重置方法
  18. PHP 简单日历功能的实现
  19. detectron研读
  20. 了解Python 一

热门文章

  1. 全数字FM接收机 --(1)结构
  2. 并发容器Map之一:ConcurrentHashMap原理(jdk1.8)
  3. 智能优化算法总结-数字孪生下的车间调度-APS预告
  4. 基于稀疏大规模矩阵的多目标进化算法简介
  5. 从零基础入门Tensorflow2.0 ----六、27 卷积神经网络(2)
  6. dotween路径移动_使用DOTween Pro插件设置物体移动的位置、移动的方式、以及动画结束时执行方法...
  7. C语言复习一(内存对齐、大小端)
  8. Spring读书笔记(一)
  9. MMP,我兄弟转正前一天,一个垃圾公司把他辞退了!
  10. 正在做鸡肋事情的你,准备好了奔赴下一个战场么?