Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • SQL Server: How to see historical transactions SQL Server
  • V$CONTROLFILE_RECORD_SECTION reference notes. Oracle
  • Jai Shree Ram PHP/MYSQL/Wordpress
  • Drop specific SQL plan baseline – spm Oracle
  • Paste command syntax Linux/Unix
  • Adding addidional hard drive and attach it to a linux box. Linux/Unix
  • Reading parameter file and printing Linux/Unix
  • Very clear article about oracle dataguard Oracle
  • RMAN : Consistent Backup, Restore and Recovery using RMAN Oracle
  • online_bkup.sql Oracle
  • Removing Ctrl-M from end of line using vi Linux/Unix
  • setting prompt display with .profile Linux/Unix
  • First Entry in RAC Oracle
  • Set Role explaination. Oracle
  • Global Unique Identifier Generation in Oracle 9.2 SYS_GUID() 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

  • logminer and my_lbu Oracle
  • Find Multiple levels of object dependencies : depen.sql Oracle
  • Handling LOB data in Oracle Oracle
  • Oracle 11g RAC on OEL 5 and Vmware 2 Oracle
  • How to know current SID Oracle
  • find_pk.sql /* Find Primary Key */ Oracle

Leave a Reply Cancel reply

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

Categories

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

Recent Posts

  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • check_copy_progress.sh Linux/Unix
  • Renaming Oracle Instance Name Oracle
  • How to Modify the statistics collection by MMON for AWR repository Oracle
  • get_ratio.sql get the ratio of users from v$session and this uses CASE-WHEN-THEN clause Oracle
  • For Search and replace unix command. Linux/Unix
  • findobj.sql Oracle
  • remove archfiles only when it is applied to DR rm_archfiles.sh Linux/Unix
  • Goldengate document from Porus Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme