博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Oracle 12c 监控 Result Cache的使用
阅读量:4041 次
发布时间:2019-05-24

本文共 2491 字,大约阅读时间需要 8 分钟。

Oracle 12c 监控 Result Cache的使用

从下面这个ALTER TABLE说起:

ALTER TABLE sales RESULT_CACHE (MODE FORCE);

这条SQL语句是什么意思?

这里使用 FORCE table annotation 强制数据库在表级别缓存查询结果。

例如:

ALTER TABLE sales RESULT_CACHE (MODE FORCE);SELECT prod_id, SUM(amount_sold)  FROM sales  GROUP BY prod_id HAVING prod_id=136;SELECT /*+ NO_RESULT_CACHE */ *   FROM sales ORDER BY time_id DESC;

上面的查询中,第一个SQL查询会缓存查询结果;但是下面的第二个SQL不会使用 Result Cache特性。

 

Oracle 12c 中与 Server端和Client端监控相关的系统视图、动态性能视图如下:

Views and Tables with Information About the Result Cache

View/Table Description

V$RESULT_CACHE_STATISTICS

Lists various server result cache settings and memory usage statistics.

V$RESULT_CACHE_MEMORY

Lists all the memory blocks in the server result cache and their corresponding statistics.

V$RESULT_CACHE_OBJECTS

Lists all the objects whose results are in the server result cache along with their attributes.

V$RESULT_CACHE_DEPENDENCY

Lists the dependency details between the results in the server result cache and dependencies among these results.

CLIENT_RESULT_CACHE_STATS$

Stores cache settings and memory usage statistics for the client result caches obtained from the OCI client processes. This statistics table contains entries for each client process that uses result caching. After the client processes terminate, the database removes their entries from this table. The client table contains information similar to V$RESULT_CACHE_STATISTICS.

DBA_TABLESUSER_TABLESALL_TABLES

Contains a RESULT_CACHE column that shows the result cache mode annotation for the table. If the table is not annotated, then this column shows DEFAULT. This column applies to both server and client result caches.

 

COLUMN name FORMAT a20SELECT name, value  FROM V$RESULT_CACHE_STATISTICS;
SQL> COLUMN name FORMAT a20SQL> SELECT name, value  2    FROM V$RESULT_CACHE_STATISTICS;NAME                 VALUE-------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------Block Size (Bytes)   1024Block Count Maximum  12384Block Count Current  2528Result Size Maximum  619(Blocks)Create Count Success 19Create Count Failure 0Find Count           48Invalidation Count   2Delete Count Invalid 0Delete Count Valid   0Hash Chain Length    0-1Find Copy Count      44Latch (Share)        0已选择 13 行。已用时间:  00: 00: 00.11

 Client端监控:

SELECT stat_id, SUBSTR(name,1,20), value, cache_id  FROM CLIENT_RESULT_CACHE_STATS$ ORDER BY cache_id, stat_id;

 

转载地址:http://yytdi.baihongyu.com/

你可能感兴趣的文章
Oracle DG failover 后恢复
查看>>
mysql 主从同步配置
查看>>
Oracle Database 12c 新特性:RAC Cluster Hub Node 和 Leaf Node
查看>>
Understanding Oracle Flex Clusters
查看>>
Oracle 12.2.0.1 新增的与Oracle数据库性能相关的功能
查看>>
Oracle 12C R2-新特性-多租户:支持本地UNDO模式
查看>>
oracle hanganalyze和systemstate使用测试
查看>>
Oracle Database 12c第2版(12.2)中的自动列表分区
查看>>
Oracle Database 12c第2版(12.2)中的只读分区和子分区
查看>>
12.2: ORA-28040 Followed by ORA-1017 When Client is Under Version 12
查看>>
ORA-01031 TOAD 连接到12c数据库
查看>>
Docker-利用Dockerfile来搭建tomcat服务
查看>>
Docker跨服务器迁移
查看>>
VMware安装centos虚拟机 通过NAT与主机互通并能上网
查看>>
expdp/impdp 数据库迁移详细过程
查看>>
oracle 误删除表的几种恢复方法
查看>>
hadoop、hbase、hive、spark分布式系统架构详细搭建过程
查看>>
Hadoop与Hbase各版本对应关系
查看>>
impdp时ORA-39126: Worker unexpected fatal error in KUPW$WORKER.PUT_DDLS [TABLE_STATISTICS]
查看>>
OracleMTSRecoveryService 启动失败
查看>>