您的位置:首页 > 数据库

SQL 性能健康检查脚本 (SQLHC) (Doc ID 1626277.1)

2014-07-16 06:20 549 查看
SQLHC一共有3个脚本:sqlhc.sql 和 sqldx.sql 和 sqlhcxec.sql



把这三个脚本放在同一个目录中:

然后就可以在sqlplus里边执行:SQL> START H:\test_a\sqlhc.sql T 51x6yr9ym5hdc

生成出来的文件是存放在 进入sqlplus 之前所在的os目录下。

下面是sqlhc.sql脚本的说明部分,摘录出来。



REM $Header: 1366133.1 sqlhc.sql 12.1.08 2014/04/18 carlos.sierra mauro.pagano $

REM

REM Copyright (c) 2000-2013, Oracle Corporation. All rights reserved.

REM

REM AUTHOR

REM carlos.sierra@oracle.com

REM mauro.pagano@oracle.com

REM

REM SCRIPT

REM sqlhc.sql SQL Health-Check (extract mode)

REM

REM DESCRIPTION

REM Produces an HTML report with a list of observations based on

REM health-checks performed in and around a SQL statement that

REM may be performing poorly.

REM

REM Inputs a memory-resident SQL_ID.

REM

REM In addition to the health_check report, it generates some

REM additional diagnostics files regarding SQL performance.

REM

REM This script does not install any objects in the database.

REM It does not perform any DDL commands.

REM It only performs DML commands against the PLAN_TABLE then it

REM rolls back those temporary inserts.

REM It can be used in Dataguard or any read-only database.

REM

REM PRE-REQUISITES

REM 1. Execute as SYS or user with DBA role or user with access

REM to data dictionary views.

REM 2. The SQL for which this script is executed must be

REM memory-resident.

REM

REM PARAMETERS

REM 1. Oracle Pack license (Tuning or Diagnostics or None) T|D|N

REM 2. SQL_ID of interest.

REM

REM EXECUTION

REM 1. Start SQL*Plus connecting as SYS or user with DBA role or

REM user with access to data dictionary views.

REM 2. Execute script sqlhc.sql passing values for parameters.

REM

REM EXAMPLE

REM # sqlplus / as sysdba

REM SQL> START [path]sqlhc.sql [T|D|N] [SQL_ID]

REM SQL> START sqlhc.sql T 51x6yr9ym5hdc

REM

REM NOTES

REM 1. For possible errors see sqlhc.log.

REM 2. If site has both Tuning and Diagnostics licenses then

REM specified T (Oracle Tuning pack includes Oracle Diagnostics)

REM 3. On a read-only instance, the "Observations" section with the

REM results of the health-checks will be missing.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: