Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Distributed Transaction Troubleshooting. Oracle
  • Oracle 10g for solaris 10 Oracle
  • Passing from Unix to PLSQL using bind variables Linux/Unix
  • oracle fast start failover best practice Oracle
  • CTAS with LONG Column for 9i and higher Oracle
  • temp_use.sql diplays usage of temp ts Oracle
  • get_vmstat.ksh Linux/Unix
  • Find average Row Length and other table size calculation. metalink notes Oracle
  • Kill a session dynanically using execute immediate Oracle
  • My FTP Job Scheduling for www.pvmehta.com PHP/MYSQL/Wordpress
  • 10g RAC: Troubleshooting CRS Root.sh Problems Oracle
  • Pending Distributed Transations Oracle
  • db_status.sql Oracle
  • Processes parameter and its dependencies on OS kernel parameters Linux/Unix
  • T-SQL Vs PL/SQL Syntax SQL Server

Find_table_size.sql

Posted on 09-Dec-2009 By Admin No Comments on Find_table_size.sql

set lines 120 pages 500

col owner format a30

col segment_name format a30

col tab_sum format 999999999999999

col indx_sum format 999999999999999

col MB format 999999999

accept pvm_owner prompt ‘Enter Owner Name -> ‘

accept pvm_table prompt ‘Enter Table Name -> ‘

select tab.owner, tab.segment_name, tab.tablespace_name, (tab_sum+indx_sum)/(1024*1024) MB from

(select p.owner, p.segment_name, p.tablespace_name, sum(p.bytes) tab_sum

from dba_segments p

where p.segment_type = ‘TABLE’

group by p.owner, p.segment_name, p.tablespace_name) tab,

(select b.owner, b.table_name, sum(a.bytes) indx_sum

from dba_segments a, dba_indexes b

where a.SEGMENT_NAME = b.index_name

and a.segment_type = ‘INDEX’

and a.owner = b.owner

group by b.owner, b.table_name) indx

where tab.owner = indx.owner

and tab.segment_name = indx.table_name

and tab.owner = upper(‘&pvm_owner’)

and tab.segment_name = upper(‘&pvm_table’)

order by 1, 2;

Oracle, SQL scripts

Post navigation

Previous Post: Database link password in user_db_links
Next Post: checking redhat linux version

Related Posts

  • Is It Recommended To Apply Patch Bundles When PSU Is Available? -ID 743554.1 Oracle
  • Jai Shree Ram Oracle
  • Facts about SCN and Rollback Segment Oracle
  • How to see which patches are applied. Oracle
  • Changing unix system clock when Oracle database is running. Oracle
  • ORA-00064: object is too large to allocate on this O/S during startup Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (403)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (18)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (350)
  • SQL Server (6)
  • Uncategorized (5)
  • Videos (0)

Recent Posts

  • Key Management in Oracle: The Core Issue: Missing Master Key12-May-2026
  • SAT Mathematics 10 questions and answer at the end.30-Apr-2026
  • top 10 AI news today30-Apr-2026
  • runon_allpdbs_show_conname.sh23-Apr-2026
  • runon_allcdbs_find_pdbs.sql23-Apr-2026
  • Running PDB on single node in RAC09-Apr-2026
  • find_arc.sql09-Apr-2026
  • pvm_pre_change.sql08-Apr-2026
  • find_encr_wallet.sql08-Apr-2026
  • find_pdbs.sql08-Apr-2026

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Trace a SQL session from another session using ORADEBUG Oracle
  • Useful Solaris Commands on 28-SEP-2005 Linux/Unix
  • usnsql.sql Displays information about UNDO segments with sql statements Oracle
  • Changing Instance Name ( No DB_NAME) Oracle
  • Identical Dblink Issue… Oracle
  • Roles and Stored Procs II Oracle
  • Which environment is used by currently running process ( Very good) Linux/Unix
  • track_autoupgrade_copy_progress.sql Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme