2、调用脚本
我们从网站上可以下载到生成脚本sqlhc.sql(SQL Tuning Health-Check Script. [ID 1366133.1])。之后在sqlplus里调用。
D:\test>sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on 星期三 12月 28 22:10:18 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn sys/Conan2002@orcl as sysdba
已连接。
SQL> @sqlhc.sql
--许可证拥有标识;
Parameter 1:
Oracle Pack license (Tuning or Diagnostics) [Y|N] (required)
输入1 的值: N
PL/SQL 过程已成功完成。
--进行检查的SQL_ID编号;
Parameter 2:
SQL_ID of the SQL to be analyzed (required)
输入2 的值: auurp0v54vjgc
之后就是生成html格式报告的过程,最后会以生成文件名称的方式通知。
SQLTH file has been created:
sqlhc_orcl_ibmvs2a1bhcns0_10.2.0.1.0_auurp0v54vjgc_20111228221121.html.
Review this file and act upon its content.
SQL>
这样在指定目录下,我们就可以找到生成的html格式报告文件。
D:\test>dir
驱动器 D 中的卷没有标签。
卷的序列号是 CA23-1191
D:\test 的目录
2011-12-28 22:11 <DIR> .
2011-12-28 22:11 <DIR> ..
2011-12-28 22:11 101,335 sqlhc.log
2011-12-28 21:49 109,841 sqlhc.sql
2011-12-28 22:11 10,140 sqlhc_orcl_ibmvs2a1bhcns0_10.2.0.1.0_auurp0v
54vjgc_20111228221121.html
3 个文件 221,316 字节
2 个目录 2,439,000,064 可用字节
