Skip to content

Commit

Permalink
added oracle_show_sessions_using_temp_tablespace.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
HariSekhon committed Oct 17, 2024
1 parent d32cf41 commit c322b0e
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions oracle_show_sessions_using_temp_tablespace.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
--
-- Author: Hari Sekhon
-- Date: 2024-10-17 23:06:57 +0400 (Thu, 17 Oct 2024)
--
-- vim:ts=4:sts=4:sw=4:et:filetype=sql
--
-- https://github.com/HariSekhon/SQL-scripts
--
-- License: see accompanying Hari Sekhon LICENSE file
--
-- 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
--
-- https://www.linkedin.com/in/HariSekhon
--

-- Oracle - Show User Sessions Using Temporary Tablespace
--
-- Check there are none before dropping an old temp tablespace file to avoid disruptions
--
-- Tested on Oracle 19c

SELECT
s.sid,
s.username,
t.tablespace,
t.blocks,
t.segfile#,
t.segblk#,
t.contents,
t.sql_id
FROM
v$sort_usage t,
v$session s
WHERE
t.session_addr = s.saddr;

0 comments on commit c322b0e

Please sign in to comment.