<small id='PHQOh'></small><noframes id='PHQOh'>

      1. <tfoot id='PHQOh'></tfoot>
          <bdo id='PHQOh'></bdo><ul id='PHQOh'></ul>

        <i id='PHQOh'><tr id='PHQOh'><dt id='PHQOh'><q id='PHQOh'><span id='PHQOh'><b id='PHQOh'><form id='PHQOh'><ins id='PHQOh'></ins><ul id='PHQOh'></ul><sub id='PHQOh'></sub></form><legend id='PHQOh'></legend><bdo id='PHQOh'><pre id='PHQOh'><center id='PHQOh'></center></pre></bdo></b><th id='PHQOh'></th></span></q></dt></tr></i><div id='PHQOh'><tfoot id='PHQOh'></tfoot><dl id='PHQOh'><fieldset id='PHQOh'></fieldset></dl></div>

        <legend id='PHQOh'><style id='PHQOh'><dir id='PHQOh'><q id='PHQOh'></q></dir></style></legend>

        如何计算 Oracle 中的表大小

        时间:2023-09-19

          <bdo id='HJy2O'></bdo><ul id='HJy2O'></ul>

        • <i id='HJy2O'><tr id='HJy2O'><dt id='HJy2O'><q id='HJy2O'><span id='HJy2O'><b id='HJy2O'><form id='HJy2O'><ins id='HJy2O'></ins><ul id='HJy2O'></ul><sub id='HJy2O'></sub></form><legend id='HJy2O'></legend><bdo id='HJy2O'><pre id='HJy2O'><center id='HJy2O'></center></pre></bdo></b><th id='HJy2O'></th></span></q></dt></tr></i><div id='HJy2O'><tfoot id='HJy2O'></tfoot><dl id='HJy2O'><fieldset id='HJy2O'></fieldset></dl></div>
        • <legend id='HJy2O'><style id='HJy2O'><dir id='HJy2O'><q id='HJy2O'></q></dir></style></legend>

          <small id='HJy2O'></small><noframes id='HJy2O'>

            1. <tfoot id='HJy2O'></tfoot>
                <tbody id='HJy2O'></tbody>
                  本文介绍了如何计算 Oracle 中的表大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  习惯于(并可能被)MSSQL,我想知道如何在 Oracle 10g 中获得表大小.我在谷歌上搜索过它,所以我现在意识到我可能没有 sp_spaceused 那样简单的选项.我得到的潜在答案大部分时间都已经过时或不起作用.可能是因为我不是我正在使用的架构的 DBA.

                  Being used to (and potentially spoiled by) MSSQL, I'm wondering how I can get at tables size in Oracle 10g. I have googled it so I'm now aware that I may not have as easy an option as sp_spaceused. Still the potential answers I got are most of the time outdated or don't work. Probably because I'm no DBA on the schema I'm working with.

                  有人有解决方案或建议吗?

                  Would anyone have solutions and or recommendations?

                  推荐答案

                  您可能对此查询感兴趣.它告诉您为每个表分配了多少空间,同时考虑了表上的索引和任何 LOB.通常,您想知道采购订单表占用多少空间,包括任何索引",而不仅仅是表本身.您可以随时深入了解细节.请注意,这需要访问 DBA_* 视图.

                  You might be interested in this query. It tells you how much space is allocated for each table taking into account the indexes and any LOBs on the table. Often you are interested to know "How much spaces the the Purchase Order table take, including any indexes" rather than just the table itself. You can always delve into the details. Note that this requires access to the DBA_* views.

                  COLUMN TABLE_NAME FORMAT A32
                  COLUMN OBJECT_NAME FORMAT A32
                  COLUMN OWNER FORMAT A10
                  
                  SELECT
                     owner, 
                     table_name, 
                     TRUNC(sum(bytes)/1024/1024) Meg,
                     ROUND( ratio_to_report( sum(bytes) ) over () * 100) Percent
                  FROM
                  (SELECT segment_name table_name, owner, bytes
                   FROM dba_segments
                   WHERE segment_type IN ('TABLE', 'TABLE PARTITION', 'TABLE SUBPARTITION')
                   UNION ALL
                   SELECT i.table_name, i.owner, s.bytes
                   FROM dba_indexes i, dba_segments s
                   WHERE s.segment_name = i.index_name
                   AND   s.owner = i.owner
                   AND   s.segment_type IN ('INDEX', 'INDEX PARTITION', 'INDEX SUBPARTITION')
                   UNION ALL
                   SELECT l.table_name, l.owner, s.bytes
                   FROM dba_lobs l, dba_segments s
                   WHERE s.segment_name = l.segment_name
                   AND   s.owner = l.owner
                   AND   s.segment_type IN ('LOBSEGMENT', 'LOB PARTITION')
                   UNION ALL
                   SELECT l.table_name, l.owner, s.bytes
                   FROM dba_lobs l, dba_segments s
                   WHERE s.segment_name = l.index_name
                   AND   s.owner = l.owner
                   AND   s.segment_type = 'LOBINDEX')
                  WHERE owner in UPPER('&owner')
                  GROUP BY table_name, owner
                  HAVING SUM(bytes)/1024/1024 > 10  /* Ignore really small tables */
                  ORDER BY SUM(bytes) desc
                  ;
                  

                  这篇关于如何计算 Oracle 中的表大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何找到工资第二高的员工? 下一篇:如何在 Oracle SQL Developer 中找到哪些表引用了给定的表?

                  相关文章

                    <tfoot id='cq7iw'></tfoot>

                    <legend id='cq7iw'><style id='cq7iw'><dir id='cq7iw'><q id='cq7iw'></q></dir></style></legend>

                    <small id='cq7iw'></small><noframes id='cq7iw'>

                    1. <i id='cq7iw'><tr id='cq7iw'><dt id='cq7iw'><q id='cq7iw'><span id='cq7iw'><b id='cq7iw'><form id='cq7iw'><ins id='cq7iw'></ins><ul id='cq7iw'></ul><sub id='cq7iw'></sub></form><legend id='cq7iw'></legend><bdo id='cq7iw'><pre id='cq7iw'><center id='cq7iw'></center></pre></bdo></b><th id='cq7iw'></th></span></q></dt></tr></i><div id='cq7iw'><tfoot id='cq7iw'></tfoot><dl id='cq7iw'><fieldset id='cq7iw'></fieldset></dl></div>

                        <bdo id='cq7iw'></bdo><ul id='cq7iw'></ul>