Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • get_vmstat.ksh Linux/Unix
  • Renaming Oracle Instance Name Oracle
  • telnet listening Linux/Unix
  • Order by with ROWNUM Oracle
  • Temporary tablespace explaination Oracle
  • block_ident.sql Oracle
  • Optimizer_Index init.ora parameter explaination. Oracle
  • Changing default shell Linux/Unix
  • Find Plan Hash value fphv.sql Oracle
  • ENQ: KO – FAST OBJECT CHECKPOINT tips Oracle
  • get_aix_vmstat.ksh Oracle
  • 276434.1 Modifying the VIP or VIP Hostname of a 10g or 11g Oracle Clusterware Node Oracle
  • check_copy_progress.sh Linux/Unix
  • Import and export statements Oracle
  • useful dg links Oracle

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

  • sess1.sql Oracle
  • Oracle Support Metalink ID 161818.1 Oracle
  • Drop tempfiles from database Oracle
  • DBMS_Shared_pool pinning triggers Oracle
  • findx.sql /* Find Indexes on specified USER.TABLE_NAME */ Oracle
  • Free conference number from http://www.freeconference.com Oracle

Leave a Reply Cancel reply

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

Categories

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

Recent Posts

  • Tutornet.US — Source of excellent learning14-Oct-2026
  • OCI Infrastructure Patching14-Oct-2026
  • Free API credits for AI models14-Oct-2026
  • AMC1020-Sep-2026
  • 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.sh23-Apr-2026
  • Running PDB on single node in RAC09-Apr-2026

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Free API credits for AI models Uncategorized
  • Oracle Material from OTN Oracle
  • EXTPROC Oracle
  • export import with parameter file. Oracle
  • CTAS with LONG Column for 7.x and 8 and 8i Oracle
  • Find Time Consuming SQL Statements in Oracle 10g Oracle
  • TOP-N Sql to find Nth max or Top N rows Oracle
  • executing Function from SQLPLUS prompt Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme