Oracle Segment Size Report

Displays size information for specified database segments. Useful for checking storage consumption of tables, indexes, and other segments within a schema.

oraclesqlstorage-tablespacesv1.0.0
0 stars0 downloads11 views0 comments
By OracleDba • Created

Code

(22 lines)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- -----------------------------------------------------------------------------------
-- File Name    : https://oracle-base.com/dba/monitoring/segment_size.sql
-- Author       : Tim Hall
-- Description  : Displays size of specified segment.
-- Requirements : Access to the DBA views.
-- Call Syntax  : @segment_size (owner) (segment_name)
-- Last Modified: 15/07/2005
-- -----------------------------------------------------------------------------------
SET LINESIZE 500 VERIFY OFF
COLUMN segment_name FORMAT A30

SELECT owner,
       segment_name,
       segment_type,
       tablespace_name,
       ROUND(bytes/1024/1024,2) size_mb
FROM   dba_segments
WHERE  owner = UPPER('&1')
AND    segment_name LIKE '%' || UPPER('&2') || '%'
ORDER BY 1, 2;

SET VERIFY ON

General Comments(0)

Tip: Click on a line number in the code to add a line-specific comment

No general comments yet. Be the first to comment!