Skip to content

Commit c322b0e

Browse files
committed
added oracle_show_sessions_using_temp_tablespace.sql
1 parent d32cf41 commit c322b0e

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
--
2+
-- Author: Hari Sekhon
3+
-- Date: 2024-10-17 23:06:57 +0400 (Thu, 17 Oct 2024)
4+
--
5+
-- vim:ts=4:sts=4:sw=4:et:filetype=sql
6+
--
7+
-- https://github.com/HariSekhon/SQL-scripts
8+
--
9+
-- License: see accompanying Hari Sekhon LICENSE file
10+
--
11+
-- If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
12+
--
13+
-- https://www.linkedin.com/in/HariSekhon
14+
--
15+
16+
-- Oracle - Show User Sessions Using Temporary Tablespace
17+
--
18+
-- Check there are none before dropping an old temp tablespace file to avoid disruptions
19+
--
20+
-- Tested on Oracle 19c
21+
22+
SELECT
23+
s.sid,
24+
s.username,
25+
t.tablespace,
26+
t.blocks,
27+
t.segfile#,
28+
t.segblk#,
29+
t.contents,
30+
t.sql_id
31+
FROM
32+
v$sort_usage t,
33+
v$session s
34+
WHERE
35+
t.session_addr = s.saddr;

0 commit comments

Comments
 (0)