Find a tables size in bytes

Hi, how do I find the size in MB of a table in my database.
thanks

Here a simple sql to get the size of the table in KB and the number of extents.
SELECT nvl(b.bytes,0)/1024,nvl(b.extents,0) from dba_segments b where b.owner='<owner>' and b.segment_name='<table name>' and b.SEGMENT_TYPE = 'TABLE';
I just posted a set of graphical tools to manage, monitor and tune the Oracle database. One of the many functions is to display all relevant statistics for a given table. It is free and can be downloaded from www.odbtools.com - I will appreciate any comments.
Michel
www.odbtools.com

Similar Messages

  • Urgent: How to find out the size in bytes of java object

    Hi Experts,
    We've a requirement that we need to find out the size of a java object at run time, is there a direct java API to get the size of a composite object in memory?
    Here is my requirement: We are adding string objects (which is an xml string of considerable size) into a List. After reaching certain size limit (lets say 5MB) of the list i need to put this data into DB as a CLOB. So every time I add a string object to the list, I need to see if the total size of the list exceeds the limit and if yes, flush the results into DB.
    I am not sure if java has a direct API for this, if not what is the beast way to do it, it s critical requirement for us.
    It would be really great if someone could help us out.
    Thank you,
    -Shibu.

    >
    We've a requirement that we need to find out the size of a java object at run time, is there a direct java API to get the size of a composite object in memory?
    Here is my requirement: We are adding string objects (which is an xml string of considerable size) into a List. After reaching certain size limit (lets say 5MB) of the list i need to put this data into DB as a CLOB. So every time I add a string object to the list, I need to see if the total size of the list exceeds the limit and if yes, flush the results into DB.
    I am not sure if java has a direct API for this, if not what is the beast way to do it, it s critical requirement for us.
    It would be really great if someone could help us out.
    >
    Could you explain your actual requirement a little more fully.
    1. Is each individual string a separate XML string? Or is it just a fragment? Why would you just concatenate them together into a CLOB? That won't produce valid XML and it won't let you easily separate the pieces again later. So provide a simple example showing some strings and how you need to manipulate them.
    2. Are you using these xml strings in Java at all? Or are you just loading them into the database?
    For example if you are just loading them into the database you don't need to create a list. Just create a CLOB in Java and append each string to the CLOB. Before you append each one you can check to see if the new string will put you over your length limit. If it will then you write the CLOB to the database, empty the CLOB and start appending again to the new clob instance.
    If you explain what you are really trying to do we might be able to suggest some better ways to do it.

  • Report to find all table and index sizes

    Hi all,
    Good day..
    Is there any report.sql or so to find out the sizes of all the tables and indexes in a database.
    thanks,
    baskar.l

    1.To get table size
    What will be the table size if?
    <or>
    break on report
    set line 200
    COMPUTE SUM LABEL "Total Reclaimable Space" OF "KB Free Space" ON REPORT
    column "Table Size" Format a20
    column "Actual Data Size" Format a20
    column "KB Free Space" Format "9,99,999.99"
    select table_name,
    round((blocks*8),2)||'kb' "Table size",
    round((num_rows*avg_row_len/1024),2)||'kb' "Actual Data size",
    pct_free,
    round((blocks*8),2) - (round((blocks*8),2)*pct_free/100) - (round((num_rows*avg_row_len/1024),2)) "KB Free Space"
    from user_tables
    where round((blocks*8),2) - (round((blocks*8),2)*pct_free/100) - (round((num_rows*avg_row_len/1024),2)) > 0
    order by round((blocks*8),2) - (round((blocks*8),2)*pct_free/100) - (round((num_rows*avg_row_len/1024),2)) desc
    2.To get index size
    How to size the Index
    Hth
    Girish Sharma

  • How to find our PSA Tables Size in my BI System Database ?

    How can we discover the size of PSA Tables  in out BI System.
    my  PSAPSR3 Table space size is 1 TB and want to identify the PSAP size in 1 TB
    Rgds
    PR

    Hi Srinivas
    you can set the amount of space the table is thought to need in the database.Five categories are available in the input help. You can also see here how many data records correspond to each individual category. When creating the table, the system reserves an initial storage space in the database. If the table later requires more storage space, it obtains it as set out in the
    size category. Correctly setting the size category prevents there being too many small extents (save areas) for a table. It also prevents the wastage of storage space when creating extents that are too large.
    You can use the maintenance for storage parameters to better manage databases
    For PSA tables, the maintenance of database storage parameters can be found in the transfer rules maintenance, in the Extras menu. (Go to Change Mode .--> extras --> Maintain DBstorage Parameter)
    You can also assign storage parameters for a PSA table already in the system. However, this has no effect on the existing table. If the system generates a new PSA version, that is, a new PSA table, due to changes in the transfer structure,
    this is created in the data area for the current storage parameters.
    Last Option is
    Go to st14.
    Choose Business WareHouse. now you will find the total size of Bw objects and  you get the size in last 1 month
    If you want full size ...change the date range .
    Pleasure Answering your Question.Assign Points if this is help full
    Santosh Nagaraj
    Edited by: Santosh Nagaraj on Aug 5, 2009 6:25 PM
    Edited by: Santosh Nagaraj on Aug 5, 2009 6:25 PM
    Edited by: Santosh Nagaraj on Aug 5, 2009 6:27 PM

  • Query to find indexes bigger in size than tables sizes

    Team -
    I am looking for a query to find the list of indexes in a schema or in a entire database which are bigger in size than the respective tables size .
    Db version : Any
    Thanks
    Venkat

    results are the same in my case
      1  select di.owner, di.index_name, di.table_name
      2  from dba_indexes di, dba_segments ds
      3  where ds.blocks > (select dt.blocks
      4               from dba_tables dt
      5               where di.owner = dt.owner
      6               and  di.leaf_blocks > dt.blocks
      7               and   di.table_name = dt.table_name)
      8*  and ds.segment_name = di.index_name
    SQL> /
    OWNER                      INDEX_NAME                TABLE_NAME
    SYS                      I_CON1                     CON$
    SYS                      I_OBJAUTH1                OBJAUTH$
    SYS                      I_OBJAUTH2                OBJAUTH$
    SYS                      I_PROCEDUREINFO1            PROCEDUREINFO$
    SYS                      I_DEPENDENCY1                DEPENDENCY$
    SYS                      I_ACCESS1                ACCESS$
    SYS                      I_OID1                     OID$
    SYS                      I_PROCEDUREC$                PROCEDUREC$
    SYS                      I_PROCEDUREPLSQL$           PROCEDUREPLSQL$
    SYS                      I_WARNING_SETTINGS           WARNING_SETTINGS$
    SYS                      I_WRI$_OPTSTAT_TAB_OBJ#_ST     WRI$_OPTSTAT_TAB_HISTORY
    SYS                      I_WRI$_OPTSTAT_H_OBJ#_ICOL#_ST WRI$_OPTSTAT_HISTGRM_HISTORY
    SYS                      WRH$_PGASTAT_PK                WRH$_PGASTAT
    SYSMAN                      MGMT_STRING_METRIC_HISTORY_PK  MGMT_STRING_METRIC_HISTORY
    DBADMIN                  TSTNDX                     TSTTBL
    15 rows selected

  • How to find table size in run time ?

    Hi all
    I am using JTable problem is. �table data is being changed frequently� I waana method or any idea by which I could find the preferred size of table at run time�
    Thanks & Regards

    but my problem is I have written one renderer for increase the row height at run time behalf of data.. And we are supposed to guess what you are doing from your original question?
    I changed the code in my actionPerformed() method as follows:
    table.setRowHeight(0, table.getRowHeight(0) + 10);
    System.out.println(table.getPreferredSize());
    The preferred size still changes.
    I have no idea what your problem is or why you even care what the table preferred size is. You just add the table to a scroll pane and scroll bars will appear when required.

  • To find top tables in size to archive a database

    Dear Sir,
    I have to archive top 20 tables of our production database, for this can anybody please provide me some documents/links so i can accomplish my task.
    Regards,
    Mushtaq

    To see the tables sizes...
    Just go to DB02 -> Detailed Analisys -> Choose all object -> Order by SIze. 
    Now for archiving... Read the documentation available in SAP Marketplace. Archiving is not as simple as throw your data in a separate repository you need to analize why?, how much data?, retention periods?, benefits... etc.
    Also, read this overview,
    http://help.sap.com/SAPHELP_NW04S/helpdata/EN/8f/f3b142304cc511e10000000a1550b0/frameset.htm
    Regards
    Juan

  • Table size difference?

    we have 2 db's called UT & ST.. with same setup and data also same
    running on hp-ux itanium 11.23 with same binary 9.2.0.6
    one of schema called arb contain only materialised views in both db's and with same name of db link connect to same remote server in both db's...
    in that schema of one table called rate has tablesize as 323 mb and st db, has same table rate has 480mb of tablesize, by querying the bytes of dba segement of table i found the difference.. query has follows
    In UT db
    select sum(bytes)/1024/1024 from dba_segments where segment_name='RATE'
    output
    323
    In ST db
    select sum(bytes)/1024/1024 from dba_segments where segment_name='RATE'
    output
    480mb
    its quite strange, both of table, contain same ddl and same counts of records and initalextent and next extents, all storage parameter are same and same uniform size of 160k tablespace with both db..
    ddl table of ut enviornment
    SQL> select dbms_metadata.get_ddl('TABLE','RATE','ARB') from dual;
    CREATE TABLE "ARB"."RATE"
    ( "SEQNUM" NUMBER(10,0) NOT NULL ENABLE,---------- ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 163840 NEXT 163840 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "AB_DATA"
    ddl table of st enviornment
    CREATE TABLE "ARB"."RATE"
    ( "SEQNUM" NUMBER(10,0) NOT NULL ENABLE,---------- ) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 163840 NEXT 163840 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
    TABLESPACE "AB_DATA"..
    tablespace of st db
    SQL> select dbms_metadata.get_ddl('TABLESPACE','AB_DATA') from dual;
    CREATE TABLESPACE "AB_DATA" DATAFILE
    '/koala_u11/oradata/ORST31/ab_data01ORST31.dbf' SIZE 1598029824 REUSE
    LOGGING ONLINE PERMANENT BLOCKSIZE 8192
    EXTENT MANAGEMENT LOCAL UNIFORM SIZE 163840 SEGMENT SPACE MANAGEMENT MANUAL
    tablespace of ut db
    SQL> select dbms_metadata.get_ddl('TABLESPACE','AB_DATA') from dual;
    CREATE TABLESPACE "AB_DATA" DATAFILE
    '/koala_u11/oradata/ORDV32/ab_data01ORDV32.dbf' SIZE 1048576000 REUSE
    LOGGING ONLINE PERMANENT BLOCKSIZE 8192
    EXTENT MANAGEMENT LOCAL UNIFORM SIZE 163840 SEGMENT SPACE MANAGEMENT MANUAL
    why table size is difference?

    If everything is the same as you stated, i would guess the bigger table might have some free blocks. If you truncate the bigger one and insert /*+ append */ into bigger (select * from smaller) then check the size of bigger table, see what you can find. By the way, dba_segments, or dba_extents only gives the usage to extents level granulity, withing a extent, there are blocks might not be fully occupied. In order to get exact bytes of the space, you 'll need to use dbms_space package.
    You may get some idear from the extream example I created below :
    SQL>create table big (c char(2000));
    Table created.
    SQL>select sum(bytes)/1024 kb from user_segments
    SQL>where segment_name='BIG';
    KB
    128               -- my tablespace is LMT uniform sized 128KB
    1 row selected.
    SQL>begin
    SQL> for i in 1..100 loop
    SQL> insert into big values ('A');
    SQL> end loop;
    SQL>end;
    SQL>/
    PL/SQL procedure successfully completed.
    SQL>select sum(bytes)/1024 kb from user_segments
    SQL>where segment_name='BIG';
    KB
    256               -- 2 extents after loading 100 records, 2KB+ each record
    1 row selected.
    SQL>commit;
    Commit complete.
    SQL>update big set c='B' where rownum=1;
    1 row updated.
    SQL>delete big where c='A';
    99 rows deleted.          -- remove 99 records at the end of extents
    SQL>commit;
    Commit complete.
    SQL>select sum(bytes)/1024 kb from user_segments
    SQL>where segment_name='BIG';
    KB
    256               -- same 2 extents 256KB since the HWM is not changed after DELETE
    1 row selected.
    SQL>select count(*) from big;
    COUNT(*)
    1               -- however, only 1 record occupies 256KB space(lots of free blocks)
    1 row selected.
    SQL>insert /*+ append */ into big (select 'A' from dba_objects where rownum<=99);
    99 rows created.          -- insert 99 records ABOVE HWM by using /*+ append */ hint
    SQL>commit;
    Commit complete.
    SQL>select count(*) from big;
    COUNT(*)
    100
    1 row selected.
    S6UJAZ@dor_f501>select sum(bytes)/1024 kb from user_segments
    S6UJAZ@dor_f501>where segment_name='BIG';
    KB
    512               -- same 100 records, same uniformed extent size, same tablespace LMT, same table
                        -- now takes 512 KB space(twice as much as what it took originally)
    1 row selected.

  • How to find out Cube Size (Step by step process)

    Hi all,
    Can any body tell me How can i find out the Cube size ?
    Thanks in advance.
    Vaibhav A.

    Hi,
    try Tcode DB02
    and
    A simplified estimation of disk space for the BW can be obtained by using the following formula:
    For each cube:
    Size in bytes =
    (n + 3) x 10 bytes + (m x 17 bytes) *
    http:// rows of initial load + rows of periodic load * no. of periods
    n = number of dimensions
    m = number of key figures
    For more details please read the following:
    Estimating an InfoCube
    When estimating the size of an InfoCube, tables like fact and dimension tables are considered.
    However, the size of the fact table is the most important, since in most cases it will be 80-90% of the
    total storage requirement for the InfoCube.
    When estimating the fact table size consider the effect of compression depending on how many
    records with identical dimension keys will be loaded.
    The amount of data stored in the PSA and ODS has a significant impact on the disk space required.
    If data is stored in the PSA beyond a simply temporary basis, it could be possible that more than 50%
    of total disk space will be allocated for this purpose.
    Dimension Tables
    u2022 Identify all dimension tables for this InfoCube.
    u2022 The size and number of records need to be estimated for a dimension table record. The size of
    one record can be calculated by summing the number of characteristics in the dimension table at
    10 bytes each. Also, add 10 bytes for the key of the dimension table.
    u2022 Estimate the number of records in the dimension table.
    u2022 Adjust the expected number of records in the dimension table by expected growth.
    u2022 Multiply the adjusted record count by the expected size of the dimension table record to obtain
    the estimated size of the dimension table.
    Fact Tables
    u2022 Count the number of key figures the table will contain, assuming a key figure requires 17 bytes.
    u2022 Every dimension table requires a foreign key in the fact table, so add 6 bytes for each key. Donu2018t
    forget the three standard dimensions.
    u2022 Estimate the number of records in the fact table.
    u2022 Adjust the expected number of records in the fact table by expected growth.
    u2022 Multiply the adjusted record count by the expected size of the fact table record to obtain the
    estimated size of the fact table.
    Regards,
    Marasa.

  • How to find out the size of a database?

    I'm not an oracle dba but a report developer. I'd like to find out the size of my database.
    Is this possible using simple query?

    An oracle database consists of data files, redo log files, control files, temporary files. Whenever you say the size of the database this actually means the summation of these files.
    select a.data_size+b.temp_size+c.redo_size+d.controlfile_size "total_size in MB"
    from
    ( select sum(bytes)/1024/1024 data_size from dba_data_files ) a,
    ( select nvl(sum(bytes),0)/1024/1024 temp_size from dba_temp_files ) b,
    ( select sum(bytes)/1024/1024 redo_size from sys.v_$log ) c,
    ( select sum(BLOCK_SIZE*FILE_SIZE_BLKS)/1024/1024 controlfile_size from v$controlfile) d;
    here
    a is megabytes allocated to ALL datafiles
    b is megabytes allocated to ALL TEMP files
    c is megabytes allocated to ALL redo-logs
    d is megabytes allocated to ALL control files
    Nimish Garg
    Software Developer
    *(Oracle & ASP.NET)*
    Indiamart Intermesh Limited, Noida
    To Get Free Oracle & ASP.NET Code Snippets
    Follow: http://nimishgarg.blogspot.com

  • Table size exceeds Keep Pool Size (db_keep_cache_size)

    Hello,
    We have a situation where one of our applications started performing bad since last week.
    After some analysis, it was found this was due to data increase in a table that was stored in KEEP POOL.
    After the data increase, the table size exceeded db_keep_cache_size.
    I was of the opinion that in such cases KEEP POOL will still be used but the remaining data will be brought in as needed from the table.
    But, I ran some tests and found it is not the case. If the table size exceeds db_keep_cache_size, then KEEP POOL is not used at all.
    Is my inference correct here ?
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE    11.2.0.2.0      Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - ProductionSetup
    SQL> show parameter keep                    
    NAME                                 TYPE        VALUE
    buffer_pool_keep                     string
    control_file_record_keep_time        integer     7
    db_keep_cache_size                   big integer 4M
    SQL>
    SQL>     
    SQL> create table t1 storage (buffer_pool keep) as select * from all_objects union all select * from all_objects;
    Table created.
    SQL> set autotrace on
    SQL>
    SQL> exec print_table('select * from user_segments where segment_name = ''T1''');
    PL/SQL procedure successfully completed.
    SQL> set serveroutput on
    SQL> exec print_table('select * from user_segments where segment_name = ''T1''');
    SEGMENT_NAME                  : T1
    PARTITION_NAME                :
    SEGMENT_TYPE                  : TABLE
    SEGMENT_SUBTYPE               : ASSM
    TABLESPACE_NAME               : HR_TBS
    BYTES                         : 16777216
    BLOCKS                        : 2048
    EXTENTS                       : 31
    INITIAL_EXTENT                : 65536
    NEXT_EXTENT                   : 1048576
    MIN_EXTENTS                   : 1
    MAX_EXTENTS                   : 2147483645
    MAX_SIZE                      : 2147483645
    RETENTION                     :
    MINRETENTION                  :
    PCT_INCREASE                  :
    FREELISTS                     :
    FREELIST_GROUPS               :
    BUFFER_POOL                   : KEEP
    FLASH_CACHE                   : DEFAULT
    CELL_FLASH_CACHE              : DEFAULT
    PL/SQL procedure successfully completed.DB_KEEP_CACHE_SIZE=4M
    SQL> select count(*) from t1;
      COUNT(*)
        135496
    Execution Plan
    Plan hash value: 3724264953
    | Id  | Operation          | Name | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |   538   (1)| 00:00:07 |
    |   1 |  SORT AGGREGATE    |      |     1 |            |          |
    |   2 |   TABLE ACCESS FULL| T1   |   126K|   538   (1)| 00:00:07 |
    Note
       - dynamic sampling used for this statement (level=2)
    Statistics
              9  recursive calls
              0  db block gets
           2006  consistent gets
           2218  physical reads
              0  redo size
            424  bytes sent via SQL*Net to client
            419  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL> /
      COUNT(*)
        135496
    Execution Plan
    Plan hash value: 3724264953
    | Id  | Operation          | Name | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |   538   (1)| 00:00:07 |
    |   1 |  SORT AGGREGATE    |      |     1 |            |          |
    |   2 |   TABLE ACCESS FULL| T1   |   126K|   538   (1)| 00:00:07 |
    Note
       - dynamic sampling used for this statement (level=2)
    Statistics
              0  recursive calls
              0  db block gets
           1940  consistent gets
           1937  physical reads
              0  redo size
            424  bytes sent via SQL*Net to client
            419  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processedDB_KEEP_CACHE_SIZE=10M
    SQL> connect / as sysdba
    Connected.
    SQL>
    SQL> alter system set db_keep_cache_size=10M scope=both;
    System altered.
    SQL>
    SQL> connect hr/hr@orcl
    Connected.
    SQL>
    SQL> show parameter keep
    NAME                                 TYPE        VALUE
    buffer_pool_keep                     string
    control_file_record_keep_time        integer     7
    db_keep_cache_size                   big integer 12M
    SQL>
    SQL> set autotrace on
    SQL>
    SQL> select count(*) from t1;
      COUNT(*)
        135496
    Execution Plan
    Plan hash value: 3724264953
    | Id  | Operation          | Name | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |   538   (1)| 00:00:07 |
    |   1 |  SORT AGGREGATE    |      |     1 |            |          |
    |   2 |   TABLE ACCESS FULL| T1   |   126K|   538   (1)| 00:00:07 |
    Note
       - dynamic sampling used for this statement (level=2)
    Statistics
              0  recursive calls
              0  db block gets
           1940  consistent gets
           1937  physical reads
              0  redo size
            424  bytes sent via SQL*Net to client
            419  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL> /
      COUNT(*)
        135496
    Execution Plan
    Plan hash value: 3724264953
    | Id  | Operation          | Name | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |   538   (1)| 00:00:07 |
    |   1 |  SORT AGGREGATE    |      |     1 |            |          |
    |   2 |   TABLE ACCESS FULL| T1   |   126K|   538   (1)| 00:00:07 |
    Note
       - dynamic sampling used for this statement (level=2)
    Statistics
              0  recursive calls
              0  db block gets
           1940  consistent gets
           1937  physical reads
              0  redo size
            424  bytes sent via SQL*Net to client
            419  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processedDB_KEEP_CACHE_SIZE=20M
    SQL> connect / as sysdba
    Connected.
    SQL>
    SQL> alter system set db_keep_cache_size=20M scope=both;
    System altered.
    SQL>
    SQL> connect hr/hr@orcl
    Connected.
    SQL>
    SQL> show parameter keep
    NAME                                 TYPE        VALUE
    buffer_pool_keep                     string
    control_file_record_keep_time        integer     7
    db_keep_cache_size                   big integer 20M
    SQL> set autotrace on
    SQL> select count(*) from t1;
      COUNT(*)
        135496
    Execution Plan
    Plan hash value: 3724264953
    | Id  | Operation          | Name | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |   538   (1)| 00:00:07 |
    |   1 |  SORT AGGREGATE    |      |     1 |            |          |
    |   2 |   TABLE ACCESS FULL| T1   |   126K|   538   (1)| 00:00:07 |
    Note
       - dynamic sampling used for this statement (level=2)
    Statistics
              0  recursive calls
              0  db block gets
           1943  consistent gets
           1656  physical reads
              0  redo size
            424  bytes sent via SQL*Net to client
            419  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    SQL> /
      COUNT(*)
        135496
    Execution Plan
    Plan hash value: 3724264953
    | Id  | Operation          | Name | Rows  | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT   |      |     1 |   538   (1)| 00:00:07 |
    |   1 |  SORT AGGREGATE    |      |     1 |            |          |
    |   2 |   TABLE ACCESS FULL| T1   |   126K|   538   (1)| 00:00:07 |
    Note
       - dynamic sampling used for this statement (level=2)
    Statistics
              0  recursive calls
              0  db block gets
           1943  consistent gets
              0  physical reads
              0  redo size
            424  bytes sent via SQL*Net to client
            419  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processedOnly with 20M db_keep_cache_size I see no physical reads.
    Does it mean that if the db_keep_cache_size < table size, there is no caching for that table ?
    Or am I missing something ?
    Rgds,
    Gokul

    Hello Jonathan,
    Many thanks for your response.
    Here is the test I ran;
    SQL> select buffer_pool,blocks from dba_tables where owner = 'HR' and table_name = 'T1';
    BUFFER_     BLOCKS
    KEEP          1977
    SQL> select count(*) from v$bh where objd = (select data_object_id from dba_objects where owner = 'HR' and object_name = 'T1');
      COUNT(*)
          1939
    SQL> show parameter db_keep_cache_size
    NAME                                 TYPE        VALUE
    db_keep_cache_size                   big integer 20M
    SQL>
    SQL> alter system set db_keep_cache_size = 5M scope=both;
    System altered.
    SQL> select count(*) from hr.t1;
      COUNT(*)
        135496
    SQL> select count(*) from v$bh where objd = (select data_object_id from dba_objects where owner = 'HR' and object_name = 'T1');
      COUNT(*)
           992I think my inference is wrong and as you said I am indeed seeing the effect of tail end flushing the start of the table.
    Rgds,
    Gokul

  • How to find the db size

    Hi ,
    Please tell me how to find the db size.
    Thanks,
    Kumar.

    If I understand correctly, the above query will give the space allocated to the database. This isn't necessarily the same as the space used by the database. Or do I need to clean my glasses ?
    I use the following to get sizes for tablespaces (may need some formatting done - works in 9i and 10g) :
    SELECT
         Total.name "TABLESPACE_NAME",
         total_space "TABLESPACE_SIZE",
         nvl(Free_space, 0) Free_space,
         nvl(total_space-Free_space, 0) Used_space
    FROM
         select
              tablespace_name,
              sum(bytes/1024/1024) Free_Space
         from
              sys.dba_free_space
         group by
              tablespace_name
         ) Free,
         select
              b.name,
              sum(bytes/1024/1024) TOTAL_SPACE
         from
              sys.v_$datafile a,
              sys.v_$tablespace B
         where
              a.ts# = b.ts#
         group by
              b.name
         ) Total
    WHERE
         Free.Tablespace_name(+) = Total.name
    ORDER BY
         Total.name
    ;

  • Give me the sql query which calculte the table size in oracle 10g ecc 6.0

    Hi expert,
    Please  give me the sql query which calculte the table size in oracle 10g ecc 6.0.
    Regards

    Orkun Gedik wrote:
    select segment_name, sum(bytes)/(1024*1024) from dba_segments where segment_name = '<TABLE_NAME>' group by segment_name;
    Hi,
    This delivers possibly wrong data in MCOD installations.
    Depending on Oracle Version and Patchlevel dba_segments does not always have the correct data,
    at any time esp. for indexes right after being rebuild parallel (Even in DB02 because it is using USER_SEGMENTS).
    Takes a day to get the data back in line (never found out, who did the correction at night, could be RSCOLL00 ?).
    Use above statement with "OWNER = " in WHERE for MCOD or connect as schema owner and use USER_SEGMENTS.
    Use with
    segment_name LIKE '<TABLE_NAME>%'
    if you like to see the related indexes as well.
    For partitioned objects, a join from dba_tables / dba_indexes to dba_tab_partitions/dba_ind_partitions to dba_segments
    might be needed, esp. for hash partitioned tables, depending on how they have been created ( partition names SYS_xxxx).
    Volker

  • How to find the Model size in Semantics

    Hi All,
    Please can you tell me how to find the model size in Semantics.
    Thanks,
    Indu

    Hi,
    Instead of looking up the ID for the Entailment in DB_VIEWS you can better use MDSYS.SEM_NETWORK_INDEX_INFO
    For example:
    select name, type, id from MDSYS.SEM_NETWORK_INDEX_INFO;
    NAME TYPE ID
    MYMODEL MODEL 60
    MYMODEL_INF ENTAILMENT 69
    *** Space about the B-tree indexes on models and entailments ***
    Indexes created in RDF_LINK$ for a specific model:
    SQL> select name, type, id, index_name from MDSYS.SEM_NETWORK_INDEX_INFO;
    NAME TYPE ID INDEX_NAME
    MYMODEL MODEL 60 RDF_LNK_PCSGM_IDX
    FAMILY100 MODEL 59 RDF_LNK_PSCGM_IDX
    FAMILY100 MODEL 59 RDF_LNK_PCSGM_IDX
    FAMILY2 MODEL 56 RDF_LNK_PCSGM_IDX
    FAMILY2 MODEL 56 RDF_LNK_PSCGM_IDX
    FAMILY MODEL 57 RDF_LNK_PCSGM_IDX
    FAMILY MODEL 57 RDF_LNK_PSCGM_IDX
    OTHERMODEL MODEL 58 RDF_LNK_PSCGM_IDX
    OTHERMODEL MODEL 58 RDF_LNK_PCSGM_IDX
    0 NETWORK 0 RDF_LNK_PCSGM_IDX
    0 NETWORK 0 RDF_LNK_PSCGM_IDX
    MYMODEL_INF ENTAILMENT 69 RDF_LNK_PCSGM_IDX
    MYMODEL_INF ENTAILMENT 69 RDF_LNK_PSCGM_IDX
    Then get the size from DBA_SEGMENTS
    select bytes/1024/1024 MB, partition_name from dba_segments where segment_name in ('RDF_LNK_PSCGM_IDX','RDF_LNK_PCSGM_IDX');
    Specifically for our model 60 and Entailment 69:
    select bytes/1024/1024 MB, partition_name from dba_segments where segment_name in ('RDF_LNK_PSCGM_IDX','RDF_LNK_PCSGM_IDX') and partition_name in ('MODEL_60','MODEL_69');
    MB PARTITION_NAME
    192 MODEL_60
    192 MODEL_60
    60.0625 MODEL_69
    62.375 MODEL_69
    You would add them all for the size of the indexes

  • Index size keep growing while table size unchanged

    Hi Guys,
    I've got some simple and standard b-tree indexes that keep on acquiring new extents (e.g. 4MB per week) while the base table size kept unchanged for years.
    The base tables are some working tables with DML operation and nearly same number of records daily.
    I've analysed the schema in the test environment.
    Those indexes do not fulfil the criteria for rebuild as follows,
    - deleted entries represent 20% or more of the current entries
    - the index depth is more then 4 levels
    May I know what cause the index size keep growing and will the size of the index reduced after rebuild?
    Grateful if someone can give me some advice.
    Thanks a lot.
    Best regards,
    Timmy

    Please read the documentation. COALESCE is available in 9.2.
    Here is a demo for coalesce in 10G.
    YAS@10G>truncate table t;
    Table truncated.
    YAS@10G>select segment_name,bytes from user_segments where segment_name in ('T','TIND');
    SEGMENT_NAME              BYTES
    T                         65536
    TIND                      65536
    YAS@10G>insert into t select level from dual connect by level<=10000;
    10000 rows created.
    YAS@10G>commit;
    Commit complete.
    YAS@10G>
    YAS@10G>select segment_name,bytes from user_segments where segment_name in ('T','TIND');
    SEGMENT_NAME              BYTES
    T                        196608
    TIND                     196608We have 10,000 rows now. Let's delete half of them and insert another 5,000 rows with higher keys.
    YAS@10G>delete from t where mod(id,2)=0;
    5000 rows deleted.
    YAS@10G>commit;
    Commit complete.
    YAS@10G>insert into t select level+10000 from dual connect by level<=5000;
    5000 rows created.
    YAS@10G>commit;
    Commit complete.
    YAS@10G>select segment_name,bytes from user_segments where segment_name in ('T','TIND');
    SEGMENT_NAME              BYTES
    T                        196608
    TIND                     327680Table size is the same but the index size got bigger.
    YAS@10G>exec show_space('TIND',user,'INDEX');
    Unformatted Blocks .....................               0
    FS1 Blocks (0-25)  .....................               0
    FS2 Blocks (25-50) .....................               6
    FS3 Blocks (50-75) .....................               0
    FS4 Blocks (75-100).....................               0
    Full Blocks        .....................              29
    Total Blocks............................              40
    Total Bytes.............................         327,680
    Total MBytes............................               0
    Unused Blocks...........................               0
    Unused Bytes............................               0
    Last Used Ext FileId....................               4
    Last Used Ext BlockId...................          37,001
    Last Used Block.........................               8
    PL/SQL procedure successfully completed.We have 29 full blocks. Let's coalesce.
    YAS@10G>alter index tind coalesce;
    Index altered.
    YAS@10G>select segment_name,bytes from user_segments where segment_name in ('T','TIND');
    SEGMENT_NAME              BYTES
    T                        196608
    TIND                     327680
    YAS@10G>exec show_space('TIND',user,'INDEX');
    Unformatted Blocks .....................               0
    FS1 Blocks (0-25)  .....................               0
    FS2 Blocks (25-50) .....................              13
    FS3 Blocks (50-75) .....................               0
    FS4 Blocks (75-100).....................               0
    Full Blocks        .....................              22
    Total Blocks............................              40
    Total Bytes.............................         327,680
    Total MBytes............................               0
    Unused Blocks...........................               0
    Unused Bytes............................               0
    Last Used Ext FileId....................               4
    Last Used Ext BlockId...................          37,001
    Last Used Block.........................               8
    PL/SQL procedure successfully completed.The index size is still the same but now we have 22 full and 13 empty blocks.
    Insert another 5000 rows with higher key values.
    YAS@10G>insert into t select level+15000 from dual connect by level<=5000;
    5000 rows created.
    YAS@10G>commit;
    Commit complete.
    YAS@10G>select segment_name,bytes from user_segments where segment_name in ('T','TIND');
    SEGMENT_NAME              BYTES
    T                        262144
    TIND                     327680Now the index did not get bigger because it could use the free blocks for the new rows.

Maybe you are looking for

  • Can we use select options in smartform

    can we use select options in smartform if so can any one send me a sample code... Thanks bhaskhar

  • How do I get a good line level from the headphone jack from my latest model iMac?

    My house is wired for analog sound and have for years used my iPod and iPhone to send an analog signal to my amplifier which drives speakers in multiple rooms. When I try this on my brand new iMac I get a buzz. Is there a setting or patch cable that

  • Preloader not working in Internet Explorer

    Hi there friends I'm pulling my hair out! I cannot get the preloader to work in IE. It works fine in firefox. Here's the details Preloader is set to 5% and is the default Project is 66 slides in length, but I've had this problem with projects much sm

  • Why are some files missing from import screen?

    I'm trying to import some files into LR, but the import screen isn't showing all of the files that are in the folder I've selected. I've notice this only when there are multiple files with the same base filename.  For example, when the folder contain

  • Pop Up windows -  Apache Beehive Vs Weblogic workshop

    Hi, I was going through this open source project called Beehive by apache. and they have a very much similar model of pageflows as weblogic workshop using struts and netui tag library. But, their netui tag library has more tags and options too. I was