• 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. linux下查看文件命令小结
  2. java web乱码_【SpringBoot WEB 系列】RestTemplate 之中文乱码问题 fix
  3. std::future详解
  4. 超详细步骤 | 如何用小程序 SDK 实现电商评价模
  5. pandas 时间序列分析(一)—— 基础
  6. apollo重要服务之metaService
  7. 非极大值抑制(NMS)讲解
  8. 天猫精灵服务器修改密码,天猫精灵怎么解绑 天猫精灵解绑账号方法
  9. lighttpd服务器404页修改,教你学会Lighttpd的安装配置
  10. 巨潮网怎么下载年报_如何下载上市公司的年度报告
  11. sumo交通流仿真软件的使用说明
  12. VR 、SR 轴矢冠三个切面的显示
  13. daliu_IT学习Android笔记第一篇--Android是什么?安卓的logo来源?安卓的发展过程?
  14. ISO8583接口的详细资料
  15. android设备怎么支持8021x,android WiFi ASSOC_REJECT 流程跟踪
  16. 量子力学(4) 全同粒子
  17. 教你如果恢复硬盘直接删除的视频资料
  18. RDS Mysql Single-AZ和Multi-AZ性能差异
  19. [kuangbin带你飞]专题十二 基础DP1 题解+总结
  20. c语言批量修改文件名称,C语言实现批量文档名修改

热门文章

  1. [转载]下载rtmpe协议的视频文件
  2. 《机器学习Python实践》第7章——数据可视化
  3. Anaconda下载的包在Spyder内导入报错
  4. day6--pandas
  5. ArcMAP 设置图层透明度
  6. java中web错误返回码,Java-Web3j Transfer.sendFunds()返回错误“天然气...
  7. 每天一点正则表达式积累(三)
  8. android swf游戏下载工具,安卓swf游戏播放器下载
  9. 原理解析 | Apache Flink 结合 Kafka 构建端到端的 Exactly-Once 处理
  10. 接口自动化测试框架搭建(3、excel的设计excel文件的读取)--python+HTMLTestRunnerCN+request+unittest+mock+db