签到成功

知道了

CNDBA社区CNDBA社区

oracle收集SQLT

2022-04-14 16:57 1006 0 原创 oracle
作者: hbhe0316

1.查看SQLT是否收集http://www.cndba.cn/hbhe0316/article/107925http://www.cndba.cn/hbhe0316/article/107925

[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.如果没有安装,需要下载SQLThttp://www.cndba.cn/hbhe0316/article/107925http://www.cndba.cn/hbhe0316/article/107925

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收集http://www.cndba.cn/hbhe0316/article/107925http://www.cndba.cn/hbhe0316/article/107925http://www.cndba.cn/hbhe0316/article/107925

[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 SRhttp://www.cndba.cn/hbhe0316/article/107925http://www.cndba.cn/hbhe0316/article/107925

http://www.cndba.cn/hbhe0316/article/107925

$ ls sqlt_s*
sqlt_s95236.zip

版权声明:本文为博主原创文章,未经博主允许不得转载。

oracle

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
hbhe0316

hbhe0316

关注

1.只有承认无知,才能装下新的东西; 2.进步来自一点点滴滴的积累; 3.广博让你更优秀,而专业让你无法替代; 4.挫折和失败能够转换为一种财富。

  • 889
    原创
  • 1
    翻译
  • 13
    转载
  • 24
    评论
  • 访问:1138192次
  • 积分:1523
  • 等级:核心会员
  • 排名:第6名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ