Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • column level grant syntax Oracle
  • Running select from V$ views from remote server Linux/Unix
  • Trace a SQL session from another session using ORADEBUG Oracle
  • To find explain plan for a statement that occurred in past. Oracle
  • AWR settings- MMON is not taking snapshot. Oracle
  • EXTPROC Oracle
  • Add new columns in dataframe Python/PySpark
  • find_du.ksh to find # of files, their sizes in current folder and its subdolder Linux/Unix
  • move_arch_files.ksh Linux/Unix
  • ORA-4031 issue and solution on 09-MAY-2008 Oracle
  • Temporary Tablespsace Temp tablespace behaviour Oracle
  • compile_inv.sql Oracle
  • Explain Plan Output 2 Oracle
  • export import with parameter file. Oracle
  • tblwopk.sql /* Find Tables Without PK */ 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

  • OEM-Commnds Oracle
  • DETERMINING WHICH INSTANCE OWNS WHICH SHARED MEMORY & SEMAPHORE SEGMENTS Oracle
  • Global Unique Identifier Generation in Oracle 9.2 SYS_GUID() Oracle
  • create PLAN_TABLE command. Oracle
  • currwaitobj.sql SQl_ID and SQL statement you can get from currwaitobj.sql Oracle
  • load SPM baseline from cursor cache 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 (400)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (18)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (348)
  • SQL Server (6)
  • Uncategorized (3)
  • Videos (0)

Recent Posts

  • 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
  • Creating a Container Database using dbaascli08-Apr-2026
  • track_autoupgrade_copy_progress.sql01-Apr-2026
  • refre.sql for multitenant01-Apr-2026
  • prepfiles.sh for step by step generating pending statistics files10-Mar-2026
  • tracksqltime.sql05-Mar-2026

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • How to Modify the statistics collection by MMON for AWR repository Oracle
  • segment_wise_space.sql segspace.sql Segment wise space usage (allocated and used) Oracle
  • How to stop OCSSD Daemon Oracle
  • move_arch_files.ksh Linux/Unix
  • restarting network in linux Linux/Unix
  • UNderstand and eliminate Latch contention. Oracle
  • Adding Datafile on Primary Server and Impact on Standby Server Oracle
  • oracle Dba site Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme