Skip to content

Instantly share code, notes, and snippets.

@aryangoti
Created April 1, 2022 15:02
Show Gist options
  • Save aryangoti/e5d9360d1c1f0aa6224d4c1d27a5cfe8 to your computer and use it in GitHub Desktop.
Save aryangoti/e5d9360d1c1f0aa6224d4c1d27a5cfe8 to your computer and use it in GitHub Desktop.
select * from (select p1,p2,p3,count(*) from gv$active_session_history where module='KTSJ' and sample_time between timestamp'2022-04-01 03:30:00' and timestamp'2022-04-01 04:00:00'
group by p1,p2,p3 order by count(*) desc) where rownum <=9;SQL> 2
P1 P2 P3 COUNT(*)
---------- ---------- ---------- ----------
10 2964017 1 5
10 2964007 1 5
24 1795359 1 4
22 42863 1 4
14 216180 1 4
14 767333 1 4
11 2025116 1 4
12 1073236 1 4
10 1921687 1 4
SQL> select owner,segment_name,segment_type,relative_fno from dba_extents
where file_id= &file_id
and &block_id between block_id and block_id + blocks -1;
Enter value for file_id: 10
old 2: where file_id= &file_id
new 2: where file_id= 10
Enter value for block_id: 2964017
old 3: and &block_id between block_id and block_id + blocks -1
new 3: and 2964017 between block_id and block_id + blocks -1
OWNER SEGMENT_NAME SEGMENT_TYPE RELATIVE_FNO
------------------------------ --------------------------------------------------------------------------------- ------------------ ------------
DOC_PERSIST_SECURE SYS_LOB0000020953C00003$$ LOB PARTITION 10
SQL> /
Enter value for file_id: 10
old 2: where file_id= &file_id
new 2: where file_id= 10
Enter value for block_id: 2964007
old 3: and &block_id between block_id and block_id + blocks -1
new 3: and 2964007 between block_id and block_id + blocks -1
OWNER SEGMENT_NAME SEGMENT_TYPE RELATIVE_FNO
------------------------------ --------------------------------------------------------------------------------- ------------------ ------------
DOC_PERSIST_SECURE SYS_LOB0000020953C00003$$ LOB PARTITION 10
SQL> /
Enter value for file_id: 10
old 2: where file_id= &file_id
new 2: where file_id= 10
Enter value for block_id: 1921687
old 3: and &block_id between block_id and block_id + blocks -1
new 3: and 1921687 between block_id and block_id + blocks -1
OWNER SEGMENT_NAME SEGMENT_TYPE RELATIVE_FNO
------------------------------ --------------------------------------------------------------------------------- ------------------ ------------
DOC_PERSIST_SECURE SYS_LOB0000020953C00003$$ LOB PARTITION 10
SQL> /
Enter value for file_id: 24
old 2: where file_id= &file_id
new 2: where file_id= 24
Enter value for block_id: 1795359
old 3: and &block_id between block_id and block_id + blocks -1
new 3: and 1795359 between block_id and block_id + blocks -1
OWNER SEGMENT_NAME SEGMENT_TYPE RELATIVE_FNO
------------------------------ --------------------------------------------------------------------------------- ------------------ ------------
DOC_PERSIST_SECURE SYS_LOB0000020953C00003$$ LOB PARTITION 24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment