1.查看SQLT是否收集
[oracle@node01:/home/oracle]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Apr 14 08:43:36 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> select username,user_id,account_status,created from dba_users where username ='SQLTXPLAIN';
no rows selected
select username,user_id,created from all_users where username ='SQLTXPLAIN';
2.如果没有安装,需要下载SQLT
https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=302413267696795&parent=SrDetailText&sourceId=3-28805353411&id=215187.1&_afrWindowMode=0&_adf.ctrl-state=17bhh1f84g_68
https://support.oracle.com/epmos/faces/DocumentDisplay?_afrLoop=332013410410615&parent=SrDetailText&sourceId=3-28805353411&id=1677588.1&_afrWindowMode=0&_adf.ctrl-state=n9ymyauoi_120
sqlt_10g_11g_12c_18c_19c_5th_June_2020.zip放入/tmp下
unzip sqlt_10g_11g_12c_18c_19c_5th_June_2020.zip
chmod -R 777 sqlt
3.执行SQL收集
[root@node01:/tmp]$ su - oracle
Last login: Wed Apr 13 13:31:06 CST 2022 on pts/0
[oracle@node01:/home/oracle]$ cd /tmp/sqlt/install
[node01:oracle]:/tmp/sqlt/install>sqlplus sys/wwwwww@PDB01 as sysdba
SQL> START sqcreate.sql
Password for user SQLTXPLAIN: <wwwwww>
Default tablespace [UNKNOWN]:USERS
Temporary tablespace [UNKNOWN]: TEMP
Main application user of SQLT: <<hbhe
Oracle Pack license [T]:T
SQL> GRANT INHERIT PRIVILEGES ON USER SYS TO SQLTXADMIN;
Grant succeeded.
2) get the sql_id or hash_value in v$sql, for example: 2xrsxubduv07c
if not , re-run your SQL use bind variable
3) Run SQLT with sqltxtract method:
$ cd sqlt
$ sqlplus hbhe/wwwwww@xx.xx.xx.xx:1521/PDB01 <<--application user
SQL> START run/sqltxtract.sql 4yqbu8dp8ajc7
Password: <password> <<-- step1's SQLTXPLAIN password
4) Upload the generated sqlt_s*.zip file to this SR
$ ls sqlt_s*
sqlt_s95236.zip
版权声明:本文为博主原创文章,未经博主允许不得转载。
oracle
- 上一篇:oracle查看当前正在执行的SQL并kill
- 下一篇:oracle 统计信息收集