SQLA的使用__查找top的SQL语句

使用方法:
Execution Environment:
SQL*Plus

Access Privileges:
Requires to access some V$ dynamic views. If used on an Apps instance, connect as APPS.
In general, connect into SQL*Plus as main application schema owner, or as SYSTEM.
If application schema owner (APPS or any other) does not have access to data dictionary
dynamic views, use included script SQLAGRNT.SQL to grant access to required views.

Usage:
sqlplus apps/<pwd>
SQL>START SQLAREAT;

Instructions:

1. Unzip file SQLA.zip into dedicated directory on db server preserving case
on all scripts (UPPER CASE). Example: SQLAREAT.SQL

2. If you are using script SQLAREAT.SQL for the first time, connect as main
application user (APPS if using Oracle Apps) and execute:

# sqlplus apps/<pwd>
SQL> START SQLACREA.SQL;

This step creates a staging repository that is used by SQLAREAT.SQL

If not sure if the staging repository has been created or not, simply
execute SQLACREA.SQL and it will re-create it.

If you get PLS-00201 errors, execute SQLAGRNT.SQL as SYSTEM, SYS or
INTERNAL

3. Once the staging repository is created, execute:

# sqlplus apps/<pwd>
SQL> START SQLAREAT.SQL;

4. SQLAREAT.SQL creates an HTML spool file with most expensive SQL.

Execute this script manually or within a cron job. Suggested frequency
is every 15 minutes during peak time (high system load window).

5. If SQLAREAT.SQL is used over a period of time (i.e. peak hours), use
included SQLAREAR.SQL to extract most expensive SQL observed during a
range of snapshots captured previously by SQLAREAT.SQL:

# sqlplus apps/<pwd>
SQL> START SQLAREAR.SQL <p_process_type> <p_snap_id_from> <p_snap_id_to>;
SQL> START SQLAREAR.SQL LR 1 4;

Where p_process_type is LR for logical reads or PR for physical reads

6. In addition to SQLAREAT.SQL and SQLAREAR.SQL, use the SQLAREAS.SQL to
report additional statistics.

# sqlplus apps/<pwd>
SQL> START SQLAREAS.SQL;

7. If you need to uninstall this tool, execute commands below and remove
scripts SQLA* from dedicated directory

# sqlplus apps/<pwd>
SQL> START SQLADROP.SQL

If you ever executed SQLAGRNT.SQL, use SQLAREVK.SQL when uninstalling

8. For feedback, email author carlos.sierra@oracle.com


PROOFREAD THIS SCRIPT BEFORE USING IT! Due to differences in the way text
editors, e-mail packages, and operating systems handle text formatting (spaces,
tabs, and carriage returns), this script may not be in an executable state
when you first receive it. Check over the script to ensure that errors of
this type are corrected. The script will produce an output file named
SQLAREATnnnn.HTML. This file can be viewed in a browser or uploaded for support
analysis.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值