<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: schema table storage size in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323013#M877448</link>
    <description>select&lt;BR /&gt;  tablespace_name,&lt;BR /&gt;  segment_type,&lt;BR /&gt;  segment_name,&lt;BR /&gt;  sum(bytes)/(1024*1024) size_gb&lt;BR /&gt;from&lt;BR /&gt;  dba_segments&lt;BR /&gt;group by&lt;BR /&gt;  tablespace_name,&lt;BR /&gt;  segment_type,&lt;BR /&gt;  segment_name;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
    <pubDate>Mon, 05 Jul 2004 09:46:41 GMT</pubDate>
    <dc:creator>Fred Ruffet</dc:creator>
    <dc:date>2004-07-05T09:46:41Z</dc:date>
    <item>
      <title>schema table storage size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323012#M877447</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;We have a DB schema with many daily tables within a specific tablespace, what formula can one use to determine&lt;BR /&gt;what the space capacity(in GB/GB) a particular table is consuming within its tablespace.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!</description>
      <pubDate>Mon, 05 Jul 2004 08:40:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323012#M877447</guid>
      <dc:creator>Edgar_8</dc:creator>
      <dc:date>2004-07-05T08:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: schema table storage size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323013#M877448</link>
      <description>select&lt;BR /&gt;  tablespace_name,&lt;BR /&gt;  segment_type,&lt;BR /&gt;  segment_name,&lt;BR /&gt;  sum(bytes)/(1024*1024) size_gb&lt;BR /&gt;from&lt;BR /&gt;  dba_segments&lt;BR /&gt;group by&lt;BR /&gt;  tablespace_name,&lt;BR /&gt;  segment_type,&lt;BR /&gt;  segment_name;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Jul 2004 09:46:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323013#M877448</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-07-05T09:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: schema table storage size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323014#M877449</link>
      <description>Hi Edgar,&lt;BR /&gt;&lt;BR /&gt;In addition to what Fred said, to determine Real Space used by a Table ie. are not empty,&lt;BR /&gt;you can do by the ROWID.&lt;BR /&gt;&lt;BR /&gt;Each row in the table has pseudocolumn called ROWID. This pseudo contains information about physical location of the row in format block_number.row.file &lt;BR /&gt; &lt;BR /&gt;If the table is stored in a tablespace which has one datafile, all we have to do is to get DISTINCT number of block_number from ROWID column of this table. &lt;BR /&gt; &lt;BR /&gt;But if the table is stored in a tablespace with more than one datafile then you can have the same block_number but in  different datafiles so we have to get DISTINCT number of  block_number+file from ROWID. &lt;BR /&gt; &lt;BR /&gt;The SELECT statements which give us the number of "really used" blocks is below. They are different for ORACLE 7 and ORACLE 8  because of different structure of ROWID column in these versions. &lt;BR /&gt;For ORACLE 7: &lt;BR /&gt; &lt;BR /&gt;    SELECT COUNT(DISTINCT SUBSTR(rowid,15,4)|| &lt;BR /&gt;                          SUBSTR(rowid,1,8)) "Used" &lt;BR /&gt;     FROM schema.table; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;For ORACLE 8+: &lt;BR /&gt; &lt;BR /&gt;   SELECT COUNT (DISTINCT  &lt;BR /&gt;           DBMS_ROWID.ROWID_BLOCK_NUMBER(rowid)|| &lt;BR /&gt;           DBMS_ROWID.ROWID_RELATIVE_FNO(rowid)) "Used" &lt;BR /&gt;     FROM schema.table; &lt;BR /&gt;or &lt;BR /&gt; &lt;BR /&gt;     SELECT COUNT (DISTINCT SUBSTR(rowid,1,15)) "Used" &lt;BR /&gt;     FROM schema.table; &lt;BR /&gt; &lt;BR /&gt;You could ask why the above information could not be determined by using the ANALYZE TABLE command. The ANALYZE TABLE command only identifies the number of 'ever' used blocks or the high water mark for the table. &lt;BR /&gt;&lt;BR /&gt;I hipe this helps.&lt;BR /&gt;&lt;BR /&gt;Indira A&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Jul 2004 20:07:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323014#M877449</guid>
      <dc:creator>Indira Aramandla</dc:creator>
      <dc:date>2004-07-05T20:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: schema table storage size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323015#M877450</link>
      <description>Hi Indira,&lt;BR /&gt;&lt;BR /&gt;Thanks for the info. The value returned is it the no. of bytes/kb/Mb/Gb? Or does one have to do a conversion?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!</description>
      <pubDate>Tue, 06 Jul 2004 06:18:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323015#M877450</guid>
      <dc:creator>Edgar_8</dc:creator>
      <dc:date>2004-07-06T06:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: schema table storage size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323016#M877451</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;some more clarifications and summary.&lt;BR /&gt;&lt;BR /&gt;consider the attached script free.sql&lt;BR /&gt;&lt;BR /&gt;it will generate a report like:&lt;BR /&gt;Tablespace Name        KBytes         Used         Free   Used      Largest&lt;BR /&gt;________________ ____________ ____________ ____________ ______ ____________&lt;BR /&gt;DRSYS                  86,016        4,232       81,784    4.9       81,784&lt;BR /&gt;OEM_REPOSITORY         30,728       27,912        2,816   90.8        2,816&lt;BR /&gt;...&lt;BR /&gt;                 ------------ ------------ ------------&lt;BR /&gt;sum                25,699,592   19,860,136    5,839,456&lt;BR /&gt;&lt;BR /&gt;which shows us:&lt;BR /&gt;&lt;BR /&gt;Kbytes = space allocated to the tablespace currently.&lt;BR /&gt;Used   = space allocated within the tablespace to specific objects&lt;BR /&gt;Free   = space NOT yet allocated to any objects&lt;BR /&gt;Used   = % of space allocated to objects in tablespace&lt;BR /&gt;Largest= Largest free contigous extent available (NEXT_EXTENTS larger then this will FAIL)&lt;BR /&gt;&lt;BR /&gt;and now, to find the amount of free space within the allocated space, we have 2 choices:&lt;BR /&gt;&lt;BR /&gt;a. analyze tables frequently.  Then the "EMPTY_BLOCKS" column in user_tables will be populated&lt;BR /&gt;&lt;BR /&gt;b. use the dbms_space package to find the free space available.&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj</description>
      <pubDate>Wed, 07 Jul 2004 03:42:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323016#M877451</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2004-07-07T03:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: schema table storage size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323017#M877452</link>
      <description>free.sql&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jul 2004 03:44:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323017#M877452</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2004-07-07T03:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: schema table storage size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323018#M877453</link>
      <description>Hi Yogee,&lt;BR /&gt;&lt;BR /&gt;We need to find out the storage space of a table, not the tablespace size.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!</description>
      <pubDate>Wed, 07 Jul 2004 03:59:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323018#M877453</guid>
      <dc:creator>Edgar_8</dc:creator>
      <dc:date>2004-07-07T03:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: schema table storage size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323019#M877454</link>
      <description>Edgar,&lt;BR /&gt;&lt;BR /&gt;About Indira's answer : Result is given in blocks. So you will need to convert. Bock size is given in bytes by the oracle parameter db_block_size :&lt;BR /&gt;show parameter db_block_size&lt;BR /&gt;&lt;BR /&gt;Note, that it may be a little more complex if you have different block size on your tablespaces.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jul 2004 06:07:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323019#M877454</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-07-07T06:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: schema table storage size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323020#M877455</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The db_block_size is 8192.Any idea of what the conversion formula would be?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!</description>
      <pubDate>Wed, 07 Jul 2004 06:27:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323020#M877455</guid>
      <dc:creator>Edgar_8</dc:creator>
      <dc:date>2004-07-07T06:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: schema table storage size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323021#M877456</link>
      <description>to take one example from Indira's answer :&lt;BR /&gt;&lt;BR /&gt;SELECT 8192*(COUNT (DISTINCT DBMS_ROWID.ROWID_BLOCK_NUMBER(rowid)||DBMS_ROWID.ROWID_RELATIVE_FNO(rowid))) "bytes" FROM table_name;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Wed, 07 Jul 2004 06:47:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323021#M877456</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-07-07T06:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: schema table storage size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323022#M877457</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;do you want to:&lt;BR /&gt;a. know how much space a table is occupying in a tablespace? or&lt;BR /&gt;b. the exact number of Kbytes a table is currently using?&lt;BR /&gt;&lt;BR /&gt;for a:&lt;BR /&gt;Total space (bytes)=initial_extent+(number of extents x next_extent)&lt;BR /&gt;&lt;BR /&gt;for b:&lt;BR /&gt;Total space (bytes)=num_rows x avg_row_len&lt;BR /&gt;&lt;BR /&gt;These will give you a pretty good approximation.&lt;BR /&gt;&lt;BR /&gt;to be able to use these table statistics, you should first of all gather them using, preferrably, DBMS_STATS.&lt;BR /&gt;e.g. exec dbms_stats.gather_table_stats( ownname =&amp;gt; user,tabname =&amp;gt; 'T');&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj</description>
      <pubDate>Wed, 07 Jul 2004 07:16:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/schema-table-storage-size/m-p/3323022#M877457</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2004-07-07T07:16:37Z</dc:date>
    </item>
  </channel>
</rss>

