2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

RAT の DB Replay でキャプチャされた SQL をディクショナリから確認する(Oracle Database)

Posted at

軽めのネタ、RAT(Real Application Testing) の DB Replay でキャプチャされたワークロードについて、下記のディクショナリから参照できます。
彡(゚)(゚)

6.116 DBA_WORKLOAD_CAPTURE_SQLTEXT
https://docs.oracle.com/cd/F19136_01/refrn/DBA_WORKLOAD_CAPTURE_SQLTEXT.html#GUID-F592BDB0-09EB-47CF-80E0-3B28E6D034FE

実行結果のサンプルは下記の通り、sql_id や SQLテキストを確認できます。

SET LINESIZE 200
SET LONG 10000000
SET LONGC 10000000
COLUMN SQL_TYPE FORMAT A20;
COLUMN SQL_TEXT FORMAT A50;
SELECT * FROM DBA_WORKLOAD_CAPTURE_SQLTEXT;
CAPTURE_ID SQL_ID        SQL_TYPE             SQL_TEXT                                           SQL_LENGTH S
---------- ------------- -------------------- -------------------------------------------------- ---------- -
       123 fsh834d0nbur4 INSERT               INSERT INTO TBL_A VALUES(45, 'VAL045', SYSDATE)            47 Y
       123 3jqqxd1yw5d81 INSERT               INSERT INTO TBL_A VALUES(41, 'VAL041', SYSDATE)            47 Y
       123 6kqsp1mbfdhd8 INSERT               INSERT INTO TBL_A VALUES(8, 'VAL008', SYSDATE)             46 Y
       123 8f70qpyq6axcp INSERT               INSERT INTO TBL_A VALUES(78, 'VAL078', SYSDATE)            47 Y
       123 98297myprh1j0 INSERT               INSERT INTO TBL_A VALUES(88, 'VAL088', SYSDATE)            47 Y
       123 0cj98x5u90qjf INSERT               INSERT INTO TBL_A VALUES(75, 'VAL075', SYSDATE)            47 Y
       123 afyrrun9sd5vh INSERT               INSERT INTO TBL_A VALUES(21, 'VAL021', SYSDATE)            47 Y
       123 97xcptb3gtwm9 INSERT               INSERT INTO TBL_A VALUES(6, 'VAL006', SYSDATE)             46 Y
       123 8ggw94h7mvxd7 COMMIT               COMMIT                                                      6 Y
       123 2c63v9uw11354 INSERT               INSERT INTO TBL_A VALUES(91, 'VAL091', SYSDATE)            47 Y
       123 f4urhpa0xg32p INSERT               INSERT INTO TBL_A VALUES(98, 'VAL098', SYSDATE)            47 Y

CAPTURE_ID SQL_ID        SQL_TYPE             SQL_TEXT                                           SQL_LENGTH S
---------- ------------- -------------------- -------------------------------------------------- ---------- -
       123 gh9d3f15ap549 PL/SQL EXECUTE       BEGIN DBMS_LOCK.SLEEP(0.1); END;                           33 Y
       123 abgqpvdhv3ay8 INSERT               INSERT INTO TBL_A VALUES(11, 'VAL011', SYSDATE)            47 Y
       123 6u5zqzz2nm55c SELECT               SELECT DECODE(USER, 'XS$NULL',  XS_SYS_CONTEXT('XS         93 Y
                                              $SESSION','USERNAME'), USER) FROM SYS.DUAL

       123 16abyqn3cugx6 INSERT               INSERT INTO TBL_A VALUES(48, 'VAL048', SYSDATE)            47 Y
       123 44mn68x9v6n4k INSERT               INSERT INTO TBL_A VALUES(83, 'VAL083', SYSDATE)            47 Y

1000文字を超えるSQL文の場合はDBMS_WORKLOAD_REPLAY.LOAD_LONG_SQLTEXTプロシージャを使用してDBA_WORKLOAD_LONG_SQLTEXTビューから見れるようですが、これは後日
彡(゚)(゚)

RAT(Real Application Testing) の概要や実際に動かして見た記事は下記を参照してくださいね。
彡(^)(^)

Oracle Database Real Application Testing入門
https://speakerdeck.com/oracle4engineer/oracle-database-real-application-testingru-men

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?