Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Goldengate Tutorial Oracle
  • Updated LCK.SQL file. Oracle
  • Renaming Global Name GLOBAL_NAME Oracle
  • Shuffle an array PHP/MYSQL/Wordpress
  • Temporary tablespace explaination Oracle
  • sess_server.sql Oracle
  • RAC 11g with vmware Oracle
  • Jai Shree Ram Oracle
  • Check_recovery.sh program to run sqlplus and return its values remotely. Linux/Unix
  • Configure ssh authentications for RAC Oracle
  • Removing first line Linux/Unix
  • Find Stale DR Physical Standby Oracle
  • copying/removing directory with all its subdirectory Linux/Unix
  • Benefits and Usage of RMAN with Standby Databases Oracle
  • tblwopk.sql tablewopk.sql 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

  • ENQ: KO – FAST OBJECT CHECKPOINT tips Oracle
  • standard Monitoring – 1 Oracle
  • Find Time Consuming SQL Statements in Oracle 10g Oracle
  • Export Import with QUERY Oracle
  • Alter procedure auditing Oracle
  • ORACLE_SID in sqlplus Oracle

Leave a Reply Cancel reply

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

Categories

  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • load SPM baseline from cursor cache05-Jun-2025
  • Drop all SPM baselines for SQL handle05-Jun-2025
  • Load SPM baseline from AWR05-Jun-2025
  • Drop specific SQL plan baseline – spm05-Jun-2025
  • findinfo.sql (SQL for getting CPU and Active session info)27-May-2025
  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • create user with unlimited quota Oracle
  • How to Modify the statistics collection by MMON for AWR repository Oracle
  • Locally Managed Tablespace and Dictionary managed tablespace (LMT-DMT) Oracle
  • telnet listening Linux/Unix
  • Another export with Query Oracle
  • My FTP Job Scheduling for www.pvmehta.com PHP/MYSQL/Wordpress
  • create trigger syntax Oracle
  • Roles and Stored Procs II Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme