SQLHC 是什么东西呢,全称:SQL Tuning Health-Check Script 是 Oracle Server Technologies Center of Expertise 开发的一个工具。该工具也被称为 SQLHC,用于检查单条 SQL 语句运行的环境,包括基于成本的优化器(CBO)的统计数据,用户对象的元数据定义,配置参数和其他可能影响到待分析 SQL 性能的因素。
脚本信息描述:
点击(此处)折叠或打开
- Produces an HTML report with a list of observations based on
- health-checks performed in and around a SQL statement that
- may be performing poorly.
执行条件:
点击(此处)折叠或打开
- 1. Execute as SYS or user with DBA role or user with access
- to data dictionary views.
- 2. The SQL for which this script is executed must be
- memory-resident.
参数说明:
点击(此处)折叠或打开
- 1. Oracle Pack license (Tuning or Diagnostics or None) T|D|N
- 2. SQL_ID of interest.
执行命令(参考) 输入相关SQL_ID:
点击(此处)折叠或打开
- REM # sqlplus / as sysdba
- REM SQL> START [path]sqlhc.sql [T|D|N] [SQL_ID]
- REM SQL> START sqlhc.sql T 51x6yr9ym5hdc
执行完成会生成一个ZIP包,类似以下名字
点击(此处)折叠或打开
- sqlhc_20170716_155643_7b2twsn8vgfsc.zip
里边有健康检查、诊断、sql 执行计划等相关信息,格式为HTML,还有一些日志。 有兴趣的可以自己执行以下试试。
登录 | 立即注册