Oracle Table Partitions Viewer

Displays partition details for a specific table or all tables within a schema, including tablespace, extent settings, row count, and average row length. Useful for partition management, storage analysis, and performance tuning.

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

Code

(30 lines)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
-- -----------------------------------------------------------------------------------
-- File Name    : https://oracle-base.com/dba/monitoring/table_partitions.sql
-- Author       : Tim Hall
-- Description  : Displays partition information for the specified table, or all tables.
-- Requirements : Access to the DBA views.
-- Call Syntax  : @table_partitions (table-name or all) (schema-name)
-- Last Modified: 15/07/2000
-- -----------------------------------------------------------------------------------
SET LINESIZE 500
SET PAGESIZE 1000
SET FEEDBACK OFF
SET VERIFY OFF

SELECT a.table_name,
       a.partition_name,
       a.tablespace_name,
       a.initial_extent,
       a.next_extent,
       a.pct_increase,
       a.num_rows,
       a.avg_row_len
FROM   dba_tab_partitions a
WHERE  a.table_name  = Decode(Upper('&&1'),'ALL',a.table_name,Upper('&&1'))
AND    a.table_owner = Upper('&&2')
ORDER BY a.table_name, a.partition_name
/


SET PAGESIZE 14
SET FEEDBACK 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!