Find the size of a table with partitions; Two questions

DB version: 11.2.0.4

Platform: Oracle Linux 6.4

The slot table MH_PKT_HEADR in UTMSBL schema has more than 5000 partitions.

Because there partitions, you cannot use just view DBA_SEGMENTS to determine the size of the table.

So, I tried to use 2 SQLs mentioned below. Query1 returned 5 GB. But Query2 has returned a value zero. Query2 is actually a note metalink mentioned below, so he cannot deceive you, I guess.

That is the reliable accurate query: Query1 or Query2?

No idea why Query2 returns a Null value?

- Query1

fixed lines 200

Col TABLE_NAME format a18

with

BaseData as)

Select the owner

nom_segment

segment_type

, round (sum (bytes) / 1024/1024/1024) GB

sum (bytes) bytes

count (*) segment_count

of s dba_segments

Group by owner, nom_segment, segment_type

)

,

LOB type as data)

Select the owner

table_name

nom_segment

of dba_lobs

)

,

all_segs like)

Select coalesce (lobs.table_name, basedata.segment_name) table_name

basedata.*

of basedata

left outer join

type LOB data

on (basedata.segment_name = lobs.segment_name

and basedata.owner = lobs.owner)

)

Select table_name

sum (bytes) bytes

sum (gb) GB

of all_segs

where table_name = 'MH_PKT_HEADR'.

and owner = 'UTMSBL. '

Table_name group;

TABLE_NAME BYTES GB

------------------ ---------- ----------

5869469696 5 MH_PKT_HEADR

- Request 2

-Source: how to calculate the size of a Table that contains outline CLOB and BLOB (Doc ID 118531.1()

SELECT

(SELECT SUM (S.BYTES) - the Segment of Table size

FROM DBA_SEGMENTS S

WHERE S.OWNER = UPPER ('UTMSBL') AND

(S.SEGMENT_NAME = UPPER ('MH_PKT_HEADR'))) +

(SELECT SUM (S.BYTES) - the size of the Lob Segment

FROM DBA_SEGMENTS S, DBA_LOBS L

WHERE S.OWNER = UPPER ('UTMSBL') AND

(L.SEGMENT_NAME = S.SEGMENT_NAME AND L.TABLE_NAME = UPPER('MH_PKT_HEADR') AND L.OWNER = UPPER('UTMSBL'))) +

(SELECT SUM (S.BYTES) - the size of the Lob Index

FROM DBA_SEGMENTS S, DBA_INDEXES I

WHERE S.OWNER = UPPER ('UTMSBL') AND

(I.INDEX_NAME = S.SEGMENT_NAME AND I.TABLE_NAME = UPPER('MH_PKT_HEADR') AND INDEX_TYPE = 'LOB' AND I.OWNER = UPPER('UTMSBL')))

"TOTAL TABLE SIZE.

FROM DUAL;

TOTAL TABLE SIZE

----------------

SELECT

(SELECT nvl (SUM (S.BYTES), 0)-dimensions of the Segment Table)

FROM DBA_SEGMENTS S

WHERE S.OWNER = UPPER ('UTMSBL') AND

(S.SEGMENT_NAME = UPPER ('MH_PKT_HEADR'))) +

(SELECT nvl (SUM (S.BYTES), 0)-Segment Lob size)

FROM DBA_SEGMENTS S, DBA_LOBS L

WHERE S.OWNER = UPPER ('UTMSBL') AND

(L.SEGMENT_NAME = S.SEGMENT_NAME AND L.TABLE_NAME = UPPER('MH_PKT_HEADR') AND L.OWNER = UPPER('UTMSBL'))) +

(SELECT nvl (SUM (S.BYTES), 0)-size of the Lob Index)

FROM DBA_SEGMENTS S, DBA_INDEXES I

WHERE S.OWNER = UPPER ('UTMSBL') AND

(I.INDEX_NAME = S.SEGMENT_NAME AND I.TABLE_NAME = UPPER('MH_PKT_HEADR') AND INDEX_TYPE = 'LOB' AND I.OWNER = UPPER('UTMSBL')))

"TOTAL TABLE SIZE.

FROM DUAL;

David Fitzjarrell

Tags: Database

Similar Questions

  • How to find the size of a table with CLOB

    Hello

    I have a table with CLOB as follows:

    SQL > desc INFO_MESSAGES

    Name                                      Null?    Type

    ----------------------------------------- -------- ----------------------------

    CLNT_OID NOT NULL VARCHAR2 (16)

    USR_OID NOT NULL VARCHAR2 (16)

    LAST_client_msg_ID VARCHAR2 (36)

    LAST_client_msg_DATE DATE

    LAST_client_msg CLOB

    LAST_USR_MSG_BOD_ID VARCHAR2 (36)

    DATE OF LAST_USR_MSG_DATE

    CLOB LAST_USR_MSG

    Now I just want to find out what is the size/area total absorbed by the table (including the CLOB columns), so how can I find? I think that the usual command does not - the

    Select format from dba_segments where nom_segment = "INFO_MESSAGES" is only showing 7 MB, while I think that the table has several GB of space due to the CLOB.

    Also to add one more detail: when dba_segments seeking, I see a result like this:

    Select * of dba_segments order by bytes DESC;

    MIGRTN SYS_LOB0000111131C00008$ $ LOBSEGMENT SAMS DATA1 20690 6 1963 14528000 119013376000 <-the top row

    MIGRTN this is the schema where this INFO_MESSAGES table is present.

    Thanks,

    OrauserN

    you will need to add the segment_size of the LOB segments to the segment_size of the table. The connection between the two pieces of information you find in USER_LOBS (or the corresponding ALL_, DBA_ objects).

  • GetLength errors on CLOB. Retrieves the size of a table with CLOB columns

    Hello

    I try to find the size of a CLOB to a table column and get the error

    PLS-00306: wrong number or types of arguments in the call to "GETLENGTH.

    When you try to use dbms_lob.getlength. Here is the code


    declare
    number num.
    Start
    for rec in (select xmlupload from FILE_TABLE where file_table_id = 33635) loop
    NUM: = dbms_lob.getLength (rec.xmlupload);
    end loop;
    dbms_output.put_line (num);
    end;

    Database version: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi


    I'm actually trying to find the size of a table with CLOB columns, is there an easy way to do this Besides using getlength and without having to contact the Administrators (they are outsourced)?

    It works fine on my computer, the version is also 10g.

    SQL> declare
      2  num number;
      3  begin
      4  for rec in (select cntnt from ims_toms_msge where rownum<3) loop
      5  num := dbms_lob.getLength(rec.cntnt);
      6  dbms_output.put_line(num);
      7  end loop;
      8
      9  end;
     10  /
    3837
    3837
    
    PL/SQL procedure successfully completed.
    

    You should check if xmlupload is the CLOB data type.
    In addition, if you just want to get the CLOB size, you can use LENGTH() as well, you will get the same result;

    SQL>  select length(cntnt), dbms_lob.getLength(cntnt) from ims_toms_msge where rownum<2;
    
    LENGTH(CNTNT) DBMS_LOB.GETLENGTH(CNTNT)
    ------------- -------------------------
             3837                      3837
    

    Published by: PhoenixBai on September 24, 2009 13:40

  • How to find the size of the partitioned tables?

    How to find the size of the partitioned tables?

    Select nom_segment, sum (bytes) /(1024*1024) 'Size in MB' from dba_segments
    where owner = 'owner name' and segment_type like '% PARTITION % '.
    Group by nom_segment;

  • How to find the size of the table?

    Hi all

    Can anyone suggest how to find the size of the table? I had a few (15272 selected lines) on the name of "CMPT_" How can I check only 'CMPT_' size tables?





    Please someone help give the SQL query to run.


    Thanks in advance.


    Vincent

    madala03 wrote:

    Hi thanks for the reply

    I'm out like below

    SUM(BYTES/1024/1024)

    --------------------

    25383.25

    But how to check all the name of tables CMPT and their sizes?

    Select nom_segment, dba_Segments sum(bytes/1024/1024) where nom_segment like ' % CMPT GROUP BY nom_segment;

  • How to find the size of the downloaded image on a column of type blob in a table?

    How to find the size of the downloaded image on a column of type blob in a table?

    Vidya,

    You can use the built in function dbms_lob.getlength to get the length (size) of a LOB column or a bfile type.
    Check out this link.

    http://download.Oracle.com/docs/CD/B10501_01/AppDev.920/a96612/d_lob2.htm#1008995

  • How to find the size of the scheme with or without fragmentation

    Hello Sir,
    How to find the size of the scheme with or without fragmentation?

    to find all of the bytes used by a schema, you can add the bytes for the owner of the dba_segments views.

    for fragmentation, I guess you want to know about the space left between the segments.

    finding depends on the design and standards of your database.

    Each scheme has its own storage space? If Yes, then you can take the total space used in storage and then subtract the number of the dba_segments.

  • possible to find the size of a view


    Hi guys,.

    How do you guys normally find the size of the view?

    I had a situation here.

    DB_1 enjoys a view (created by selecting in tables via the union..)

    DB_2 has a procedure that will refresh a materialized view (select * from < the_table_from _db_1) @DB_1_database; )

    Question 1:

    How can I find the size of the view which is called DB_1. I don't think that if I can use dba_segments to find the size that I can't find a segment_type which is = 'DISPLAY '.

    Question2: the error below were reported by the team of apps.

    *

    ERROR on line 1:

    ORA-12008: error path refresh materialized view

    ORA-01652: unable to extend segment temp of 128 in tablespace TEMP

    ORA-02063: preceding line DB_1

    ORA-06512: at "SYS." DBMS_SNAPSHOT", line 2256

    ORA-06512: at "SYS." DBMS_SNAPSHOT", line 2462

    ORA-06512: at "SYS." DBMS_SNAPSHOT", line 2431

    ORA-06512: at "FWSS. < Procedures > r_", line 6

    ORA-06512: at line 1

    I tried to look for similair error on both of my database alert log but it could not be found. The above error must be charged on the alert logs.

    I saw many of the errors of the DB_1 alert log below.

    ORA-1652: unable to extend segment temp of 128 in tablespace TEMP

    So here's my question, getting the above error on DB_1 when DB_2 procedure call a refresh of its point of view of materliized which is to select the view via a link db DB_1?

    I suspect that the view is too large, which is at the origin of the temp will apear error.

    Hello

    Yes, the temporary tablespaces are generally used for the sort operation or join operations that cannot be handled in RAM and should use the disk (temporary file). as you say, your MV is on DB_2 and extracted data DB_1, where the sqls are merged and executed and according to the size of the data, the class union itself causes trained him in the use of the temp space and since you don't have enough room temp the ORA-01652 survey database

    for temporary tablespace all the sorting operations for instance share a single sort segment and this segment of the sort is assigned when the first statement ask the instance and can be communicated with the judgment. When the sort operation uses temp space extends the awarded are not automatically désallouées, however,

    those are mark them as free and will be available for later use.

    To your question, there could be a large operation that caused the tempfile to grows well in the database and once the operation is finished, the space

    is not automatically released, so in managed locally temporary tablespace, you can reduce the tablespace temporary for free those allocated unused space.

    In your situation you need not to shrink but to add tempfiles more.

    Kind regards

  • How to find the size of the list box

    Hello

    I have a list with 4itmes in that box. I want the list box size, just to busy data in the listbox. Is it possible that we can find the size of the list box? Help, please.

    Here you go

  • How to find the size of the virtual server?

    Hello

    We intend to pass our applications 4 virtual servers has 2 physical servers. In this process, we need to identify the size of the current virtual servers to use as a starting point to configure or add the size in physical server. can anyone provide information on whats stats to be noticed and how to find the size of the current virtual servers?

    Thank you

    Hi Sekhar, there.

    in general, it is a fairly complex task if you want to size the new platform correctly, i.e. not to oversize it and have very low use below, i.e. spend too much on equipment.

    In fact, it's the first thing to consider the level of use of the new platform. Most likely your organization (HW and infrastructure) has targets to a minimum. optimal and maximum usage levels.

    In the case where you do not have this as a starting point, and then you continue with load average and the current peak (CPU, RAM, NW). To these basic lines, you can use the statistics of WLS Admin Console, where the use of CPU and memory statistics are presented since the server was last started. For more detailed statistics, you can use WLDF to capture measures key at regular intervals, and then base your analysis of these data.

    Finally and above all, the size of FS, but I've seen some comments above related to the size of the FS.

    HTH,

    A.

  • How to find the size of the semantic model

    Hi all

    Please can you tell me how to find the size of the semantic model.

    Thank you
    INDU

    Hi Indu,

    A couple of several things:

    1 we still need an application, in order to account for the storage of the Table in the Application

    This query gives you the name of application table

    Select the table table_name from mdsys.sem_model$
    where model_name = '';

    This will give you the size in MB

    Select semmodel.table_name, dbaseg.bytes/1024/1024 MB
    of mdsys.sem_model$ semmodel, dba_segments dbaseg
    where semmodel.table_name = dbaseg.segment_name
    and semmodel.model_name = '';

    2. If the model is the only one of the semantic network, you can get the space used by the table of $ RDF_VALUE using this query

    Select bytes/1024/1024 MB dba_segments where nom_segment = '$RDF_VALUE ';

    If there are several models, this space is shared between all of them.

    Kind regards!
    Jorge

  • How to find the size of the plsql packages

    Oracle: 10.2.0.4
    Operating system: Solaris

    Question: DB has about 2000 packages that are in development mode. In the case where if we want to find the size of the package what is the mechanism of the dictionary tables. ?

    Is there a way, that the size is stored in the tables of the dictionary?

    PL. Let me know.

    Hello
    Have you checked PARSED_SIZE column in the USER_OBJECT_SIZE data dictionary view, in my response above?

    concerning

  • How to read/select only the records from a table with non-English characters

    Hello
    I need to find all records in a table with non-English (mainly Chinese) characters in at least one of the varchar2 columns. Let me kow if someone knows a way by which it can be done using SQL/PLSQL.

    Best regards
    Imran
    select * from your table
    where your_column != convert(your_column, 'UTF8', 'US7ASCII)
    

    Replace UTF8 with your database character set

    Published by: thtsang on October 15, 2009 03:53 - unequal sign change of! =

  • Newbie Question on the use of the size of a table in a schema

    Hi all,

    Newbie Alert!

    I tried to work on the size of a table in a schema and struggled to get the exact number. Could someone help me please with getting an exact figure.

    Thanks to all who responded!

    SELECT sum (blocks) * db_block_size/1024 MB of dba_extents
    where owner = SCHEMA_OWNER and nom_segment = TABLE_NAME;

    http://Waqas-DBA.blogspot.com

  • Where can I find the size of my file in iPhoto

    Where can I find the size of my file in iPhoto. I want to save my 7000 photos on a flash drive, but don't know what size drive to buy?

    Choose home in the Finder Go menu, double-click the images folder, select the library and choose read information in the file menu.

    The volume that contains the iPhoto library should be in Mac OS Extended format.

    (143187)

Maybe you are looking for