Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • 556976.1 Oracle Clusterware: Components installed Oracle
  • This is from Temi Oracle
  • on IBM-AIX for display Linux/Unix
  • The most important Tuning Notes Oracle
  • 10g oem configuration Oracle
  • findobj.sql Oracle
  • myfile Oracle
  • create database syntax Oracle
  • good linux notes Linux/Unix
  • catall.sh Linux/Unix
  • find_string_in_database.sql Oracle
  • S3 Basic info AWS
  • Best approach for Oracle database patching sequence to latest/required patchset along with CPU/PSU/any-other-one-off patch ID 865255.1 Oracle
  • Oracle Identifiers Oracle
  • Removing Ctrl-M from end of line using vi Linux/Unix

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

  • Renaming the column name Oracle
  • Pending Distributed Transations Oracle
  • arch_configUOCIOTTO.ora Oracle
  • Jai Shree Ram Oracle
  • Find execution plan from dba_hist_sql_plan for a specific SQL_ID and PLAN_HASH_VALUE fplan.sql Oracle
  • My Minimum Tuning Programs 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 (394)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (343)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • tracksqltime.sql05-Mar-2026
  • Complete Git Tutorial for Beginners25-Dec-2025
  • Postgres DB user and OS user.25-Dec-2025
  • 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

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Optimizer_Index init.ora parameter explaination. Oracle
  • temp_use.sql diplays usage of temp ts Oracle
  • Oracle Data Direct to TAPE Oracle
  • Drop all SPM baselines for SQL handle Oracle
  • Is It Recommended To Apply Patch Bundles When PSU Is Available? -ID 743554.1 Oracle
  • Composite Index creation tip from Vivek Oracle
  • Check_recovery.sh program to run sqlplus and return its values remotely. Linux/Unix
  • Drop specific SQL plan baseline – spm Oracle

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme