Table analyzed / indexes rebuilt

In data warehouse, we have a contract summarization table. The daily data feed populates this table. It didn't analyzed since 4/25/2007. But its indexes are rebuilt every day when processing data. The questions are:
1. since these indexes are built daily, should we worry about the table performance because the table itself is not analyzed for 3 months?
2. we have a script running each weekend to analyze tables in this database. For some reason, this table didn't get analyzed for 3 months. This table is a very active table and data is changed daily. Any other reasons?
I really appreciate the help if someone can shed some lights.
Jin

1. Why are the indexes rebuilt every day? Are they bitmap indexes that are dropped and re-created before/after loads? There is much discussion on the topic of rebuilding indexes many arguing that it is not a necessary excercise, search asktom.oracle.com. If the stats do not reflect what data is in the table then you should gather statistics.
2. Don't know what version you are using and whether you really are using the analyze command but use DBMS_STATS instead.

Similar Messages

  • When to analyze tables and indexes

    Hello,
    What criteria do I use as to when a table or index should be analyzed? Is there an indication in the data dictionary to use as a guide as to when a table or index should be analyzed? Thank you in advance.

    From http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96533/stats.htm#25018
    You should gather statistics periodically for objects where the statistics become stale over time because of changing data volumes or changes in column values. New statistics should be gathered after a schema object's data or structure are modified in ways that make the previous statistics inaccurate. For example, after loading a significant number of rows into a table, collect new statistics on the number of rows. After updating data in a table, you do not need to collect new statistics on the number of rows, but you might need new statistics on the average row length.

  • "analyze index"  vs  "rebuild index"

    Hi,
    I don't undestand the difference between "analyze index" and "rebuild index".
    I have a table where I do a lot of "insert" and "update" and "query", What is the best thing to do ??
    thanks
    Giordano

    When you use dbms_stats.gather_schema_stats package with cascade=>true option, you are also collecting stats for the indexes, no need to collects stats separately using dbms_stats.gather_index_stats.Of course, but I refered to the rebuild index question. Therefore I only mentioned the GATHER_INDEX_STATS.
    Auto_sample_size has many problems/bugs in 9iOk didn't know that - I'm using 10gR2.
    But this discussion made me curious. So I tried something (10gR2):
    CREATE TABLE BIG NOLOGGING AS
    WITH GEN AS (
    SELECT ROWNUM ID FROM ALL_OBJECTS WHERE ROWNUM <=10000)
    SELECT V1.ID,RPAD('A',10) C FROM GEN V1,GEN V2
    WHERE ROWNUM <=10000000;
    SELECT COUNT(*) FROM BIG;
    COUNT(*)
    10000000
    So I had a Table containing 10 Million rows. Now I indexed ID:
    CREATE INDEX BIG_IDX ON BIG(ID)
    I tested two different methods:
    1.) GATHER_TABLE_STATS with estimate 10%
    EXEC DBMS_STATS.GATHER_TABLE_STATS(TABNAME=>'BIG',OWNNAME=>'DIMITRI',CASCADE=>TRUE,ESTIMATE_PERCENT=>10);
    It took about 6 seconds (I only set timing on in sqlplus, no 10046 trace) Now I checked the estimated values:
    SELECT NUM_ROWS,SAMPLE_SIZE,ABS(10000000-NUM_ROWS)/100000 VARIANCE,'TABLE' OBJECT FROM USER_TABLES WHERE TABLE_NAME='BIG'
    UNION ALL
    SELECT NUM_ROWS,SAMPLE_SIZE,ABS(10000000-NUM_ROWS)/100000 VARIANCE,'INDEX' OBJECT FROM USER_INDEXES WHERE INDEX_NAME='BIG_IDX';
    NUM_ROWS SAMPLE_SIZE VARIANCE OBJEC
    9985220 998522 ,1478 TABLE
    9996210 999621 ,0379 INDEX
    2.) GATHER_TABLE_STATS with DBMS_STATS.AUTO_SAMPLE_SIZE
    EXEC DBMS_STATS.DELETE_TABLE_STATS(OWNNAME=>'DIMITRI',TABNAME=>'BIG');
    EXEC DBMS_STATS.GATHER_TABLE_STATS(TABNAME=>'BIG',OWNNAME=>'DIMITRI',CASCADE=>TRUE,ESTIMATE_PERCENT=>DBMS_STATS.AUTO_SAMPLE_SIZE);
    It took about 1,5 seconds. Now the results:
    NUM_ROWS SAMPLE_SIZE VARIANCE OBJEC
    9826851 4715 1,73149 TABLE
    10262432 561326 2,62432 INDEX
    The estimate 10% was more exact - also a 1,7 and 2,6 percent variance is still ok. It's also very interesting, that using AUTO_SAMPLE_SIZE
    causes oracle to execute a estimate 5% for the index and a estimate 0.5 for the table.
    I tried again with a table containing only 1 Million records and oracle did an estimate with 100% for the index.
    So for me I will continue using AUTO_SAMPLE_SIZE. Its very flexible, fast and accurate.
    Dim
    PS: Is there a way to format code like one can do in HTML using <code> or <pre>?

  • Rebuild index vs Analyze index

    Hi All,
    I am realy confused about rebuilding index versus Analyzing index.
    Could anyone plz help me out what is the diffrence between them.
    How to Perform analyze of indexes and Rebuld of Indexes for both Oracle 9i and 10g databases.
    Thanks a lot

    CKPT wrote:
    You can see the posts of experts by jonathan
    I am realy confused about rebuilding index versus Analyzing index. tell us you are getting confused why we need to ananlyze before reubild index? if so
    if index analyzed the whole statistics of index will be gathered.... then you can check what is the hieght of the index.. according to the height of the index you need to take step is index need to be really rebuild or not...
    lets see furhter posts from experts if not clear..Thanks OK, so you determine the height of an index is (say) 4. What then ? If you decide to rebuild the index and the index remains at a height of 4, what now ? Was it really worth doing and do you rebuild it again as the index height is still 4 and still within your index rebuild criteria ? At what point do you decide that rebuilding the index just because it has a height of 4 is a total waste of time in this case ?
    OK, so you determine the index only has a height of (say) 3, does that mean you don't rebuild the index ? But what if by rebuilding the index, the index now reduces to a height of just 1 ? Perhaps not rebuilding the index even though it has just a height of 3 and doesn't currently meet your index rebuild criteria is totally the wrong thing to do and a rebuild would result in a significantly leaner and more efficient index structure ?
    So what if it's pointless rebuilding an index with a height of 4 but another index with a height of 3 is a perfect candidate to be rebuilt ?
    Perhaps knowing just the height of an index leaves one totally clueless after all as to whether the index might benefit from an index rebuild ...
    Cheers
    Richard Foote
    http://richardfoote.wordpress.com/

  • Missing Tables and Indexes

    Hi all,
    we have checked "missing table and indexs" status with DBACOCKPIT and there it show 362 Indexes are not created.
    all are the standard table indexes.
    we have updated the indexes and statistics with BRCONNECT also.and its complited successfully.after this also "it show 362 Indexes are not created". we are using SOLARIS OS and oracle database.
    Can anybody help me out how to rebuilt the missing indexes .....plz mention the steps.
    Thanks,
    Rableen   khurana

    Hi,
    Refer to the note and lins on how to fix it
    Note 1320008 - DBA Cockpit: Selection in "Missing Tables and Indexes"
    http://wiki.sdn.sap.com/wiki/display/TechTSG/(DB)IndexReportedasMissing
    http://help.sap.com/saphelp_nwpi711/helpdata/en/33/5b277b8b0745b8b60e67ca04c77ebb/content.htm
    Thanks,
    Arjun

  • TABLE SIZE 및 INDEX SIZE(크기) 계산

    제품 : ORACLE SERVER
    작성날짜 : 2002-10-15
    TABLE SIZE 및 INDEX SIZE(크기) 계산
    ===================================
    1. TABLE SIZE 계산 공식(ORACLE BLOCK SIZE : 2K 로 가정)
    $ sqlplus scott/tiger
    SQL> SELECT GREATEST(4, ceil(ROW_COUNT /
    ((round(((1958 - (initrans * 23)) *
    ((100 - PCTFREE) /100)) / ADJ_ROW_SIZE)))) * BLOCK_SIZE)
    TableSize_Kbytes
    FROM dual;
    *. 한 개의 BLOCK에 Available 한 Bytes - 1958
    *. 각 initrans 는 23 Bytes
    *. PCT_FREE : Table 의 pctfree 값(default 10)
    *. ADJ_ROW_SIZE : 각 row 의 평균 SIZE 추정치
    *. ROW_COUNT : table 의 row 의 갯수
    *. BLOCK_SIZE : 1 block의 크기 (단위: K)
    예) table 이름이 EMP 일 경우
    ROW_COUNT : select count(*) from emp;
    ADJ_ROW_SIZE :
    analyze table emp compute statistics;
    (또는 건수가 매우 많을 때에는 compute 대신 estimate 사용)
    select avg_row_len
    from user_tables
    where table_name='EMP';
    2. INDEX SIZE 계산 공식
    SQL> SELECT GREATEST(4, (1.01) * ((ROW_COUNT /
    ((floor(((2048 - 113 - (initrans * 23)) *
    (1 - (PCTFREE/100))) /
    ((10 + uniqueness) + number_col_index +
    (total_col_length)))))) * DB_BLOCK_SIZE))
    IndexSize_Kbytes
    FROM dual;
    *. 한 개의 block에 available 한 bytes ( 1935 or 2048 - 113 )
    *. 각 initrans 는 23 Bytes
    *. ROW_COUNT : table 의 row 의 갯수
    *. PCTFREE : Index 의 pctfree 값(default 10)
    *. number_col_index : Index 에서 column 의 수
    *. total_col_length : Index 의 길이 추정치
    *. uniqueness : 만일 unique index 이면 1, non-unique index 이면 0.
    *. DB_BLOCK_SIZE : 1 block의 크기 (단위: K)

    데이터블록 레이아웃을 보면..
    Data Block Layout
    Block header에는 cache layer와 Transaction layer을 가지고 있습니다.
    Data layer에는 Table directory, Row directory, Free space, Row data
    이렇게 나누어지구요..
    v$type_size를 보면.. KCB와 KTB의 크기가 실제로 헤더의 크기입니다.
    여기서는 92로 계산되었는데..
    2048-92=1956 으로 나옵니다.
    여기서의 값이 아닐지요? 2바이트가 차이나긴 하군요.;
    COMPONENT TYPE DESCRIPTION TYPE_SIZE
    KCB KCBH BLOCK COMMON HEADER 20
    KTB KTBIT TRANSACTION VARIABLE HEADER 24
    KTB KTBBH TRANSACTION FIXED HEADER 48

  • DB02 view is empty on Table and Index analyses  DB2 9.7 after system copy

    Dear All,
                 I did the Quality refresh by System copy export/import method. ECC6 on HP-UX DB29.7.
    After Import Runstats status n Db02 for Table and Index analysis was empty and all value showing '-1'. Eventhough
    a) all standard backgrnd job scheduled in sm36
    b) Automatic runstats are enabled in db2 parameters
    c) Reorgchk all scheduled periodically from db13 and already ran twice.
    4) 'reorgchk update statistics on table all' was also ran on db2 level.
    but Run stats staus in db02 was not getting updated. Its empty.
    Please suggest.
    Regards
    Vinay

    Hi Deepak,
    Yes, that is possible (but only offline backup). But for the new features like reclaimable tablespace (to lower the high watermark)
    it's better to export/import with systemcopy.
    Also with systemcopy you can use index compression.
    After backup and restore you can have also reclaimable tablespace, but you have to create new tablespaces
    and then work with db6conv and online table move to move one tablespace online to the new one.
    Best regards,
    Joachim

  • How to get return type as Table of Index by BINAR from Procedure using JDBC

    Hi,
    We have stored procedure which takes Varchar as input and rerurn muiltiple recored of type Table of index by BINARY
    We created the procedure with in a package, its header part like below:
    CREATE OR REPLACE PACKAGE emp_pkid_pkg
    AS
    TYPE r_emp IS RECORD ( employe_profile_id NUMBER
    , client_profile_id VARCHAR2(240)
    , email VARCHAR2(240)
    , terms_acp VARCHAR2(1)
    TYPE tp_emp_profile IS TABLE OF r_emp INDEX BY BINARY_INTEGER;
    PROCEDURE er_employe_prov_profile ( e_inxid employe_provision_instance.inxid%TYPE
    , e_emp_recs OUT tp_emp_profile
    END emp_pkid_pkg;
    This procedure has body part, wich has origial business logic like below.
    CREATE OR REPLACE PACKAGE BODY emp_pkid_pkg
    AS
    PROCEDURE pr_customer_prov_profile ( e_inxid employe_provision_instance.inxid%TYPE
    , e_emp_recs OUT tp_customer_provision_profile
    IS
    CURSOR c_emp_prov_instance ( c_guid employe_provision_instance.guid%TYPE )
    etc ...
    END emp_pkid_pkg;
    We could execute the below script from oracle client tool and get the response.
    DECLARE
    e_cust emp_pkid_pkg.tp_emp_profile;
    BEGIN
    emp_pkid_pkg.er_employe_prov_profile ( 'ef45t6543y98'
    , e_cust
    FOR i in e_cust.FIRST..e_cust.LAST LOOP
    DBMS_OUTPUT.PUT_LINE ( e_cust(i).employe_profile_id
    ||'#'|| e_cust(i).client_customer_id
    ||'#'|| e_cust(i).email
    ||'#'|| e_cust(i).term_acp);
    END LOOP;
    END;
    We have requirement to get the results from procedure usind JDBC callable statement call.
    We have tried to call the procedure via JDBC callable statement but it didn't work.
    We have constructed it like the following. It was throwing error "java.sql.SQLException: invalid column type: emp_pkid_pkg.tp_emp_profile
    CallableStatement cs2 = con.prepareCall("{call emp_pkid_pkg.er_employe_prov_profile(?,?)}");
    cs2.registerOutParameter(2, OracleTypes.CURSOR, emp_pkid_pkg.tp_emp_profile);
    cs2.setString(1,empId);
    Not sure whether I am doing the logic correctly. But i tryed with diff type. Still am getting same error like above.
    Please point me to the correct approach.
    Thanks
    Edited by: 921689 on 18-Mar-2012 17:20

    >
    We have requirement to get the results from procedure usind JDBC callable statement call.
    >
    Can't be done - the reason has nothing to do with JDBC so you are in the wrong forum.
    Repost in the PL/SQL forum and I can give you an example of what you have to do
    PL/SQL
    First the TYPEs you defined are PL/SQL types so can't be referenced outside PL/SQL; you need to define SQL types.
    Second you will need to use a procedure that returns a REF CURSOR or is a PIPELINED procedure. Since your procedure doesn't fall into either category you can't use it with JDBC to do what you want.
    If your query was a PIPELINED function then you could simply query it like it was a table. I have a PIPELINED function name 'get_emp' so this works.
    select * from table(get_emp(30));Post in the PL/SQL forum and I can give you the code for the procedure. I'm not going to clutter up this forum with inappropriate material.

  • Only a few of rows in the table are indexed without an error message

    When I executed the sql command:"create index ... indextype is ctxsys.context...",
    only a few of rows were indexed.
    The number of rows returned from query clause "select * from table where contains(field,'keyword') " is much less than that returned from "select * from table where field like '%keyword%'",though its speed is very fast.
    I checked the I table,the indexed words was few.The create index command ends in 3 mins on a table with more than 2 millions rows.
    The language setting is Chinese.
    The documentations about the intermedia text services on chinese languages is difficult to find.Can someone give me some or help me to solve this problem?
    Thanks in advance!

    I get the same thing in Mac OSX 10.7.3.  When I control-click on a preview and select 'open in camera raw' I get a dialog that says it's not enabled and requires a qualifying app to have been launched first:
    I've launched bridge and photoshop and if I open an app from the mini-bridge within photoshop, camera raw is launched.

  • 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

  • Missing Tables and Indexes greyed out in DBACOCKPIT

    Hi All,
    I use Solution Manager 7.01 with MS SQL Server 2008 DB.
    I want to monitor with DBACOCKPIT a MS SQL Server 2005 DataBase of a SAP BPC 5.1.
    I connected the DB but in DBACOCKPIT some functionality are greyed out.
    I want to use in Diagnostics section the "MISSING TABLES AND INDEXES" function but this command is greyed out.
    Is it possible to use this function?
    Please, help me!
    Regards,
    Alessandro

    Hi,
    Gray color means that screen is disabled for any reason (authorization, SQL Server release, monitoring remote, etc).
    I believe, those items cannot be monitored unless these limitations are sorted out.
    Please refer to the Document "The SAP DBA Cockpit for Microsoft SQL Server" in SDN.
    You can get the status about the restriction in the bottom of dbacockpit screen.
    Thanks,
    Jagan
    Edited by: jagadheeshan govindasamy on Sep 16, 2009 1:03 PM

  • Missing Tables and Indexes in 3.5

    Hi,
    when i am executing Tcode DB02 then under Missing Tables and Indexes i find 35 Indexes as not created.
    can anybody tell me what does that signify. is this a issue if so how to fix it.
    Indexes not created
    ADCP-I04
    ADCP-I03
    ADCP-I02
    ADCP-I01
    ADCPS-I01
    ADCPS-I02
    ADCPS-I03
    ADCPS-I04
    ADRC-I14
    ADRC-I11
    ADRC-I05
    ADRC-I02
    ADRC-G
    ADRP-I01
    ADRP-I02
    ADRP-I03
    ADRP-I04
    ADRP-I07
    ADRP-I08
    ADRP-I09
    ADRV-I01
    BUT000-PER
    CDHDR-001
    CDHDR-002
    CRMD_ORDERADM_I-PKI
    CRMD_ORDERADM_I-DES
    ISSUE_RELATION-001
    NAST-ADQ
    RMPS_T_RESUB-RAG
    RMPS_T_RESUB-RCU
    SSPICSPRHD-S02
    SSPICSTRHEAD-S01
    SSPICSTRPL-FLD
    STXH-TDN
    SWBRULECOM-RSY
    Rakesh

    Hi Rakesh,
    First thing this is not an issue but an information that says that these indexes are not be created in the System.
    This option Indexes not created is an SAP table maintained from Dev to Prod just to indicate that these indexes cannot be created.
    That's the reason why u have a green mark beside them and this will make clear for you that this is not an issue.
    Hope it helps!!!!
    Thanks & Regards,
    Neelesh Jain.

  • DB02 = Missing Tables and Indexes = Unknown objects in ABAP Dictionary = DB views

    Hi SAP Gurus,
    on our SAP NetWeaver 7.x BW (based on AIX/Oracle) I find via transaction DB02 (path = Diagnostics => Missing Tables and Indexes) under "Unknown objects in ABAP Dictionary" under DB views a BW object /BI0/.....
    When I make a double click on the object, I am getting the popup window "Display not possible for this object":
    How can I identify the object and clarify with the BW application expert, if needed, how to resolve this object?
    I searched already via RSA1 for the object, but I wasn't able to find anything so far ...
    Thanks for your help and ideas.
    Best regards
    Carlos

    Hello Carlos
    The database view in question is a temporary database object created during a query execution.
    Please read this SAP note 449891 - Temporary database objects in BW 3.x to understand what that view is all about and impact if those views are removed.
    The SAP notes 449891 and 1139396 suggests to run the report SAP_DROP_TMPTABLES to drop these temporary objects. Whether the objects are still required or not is a question to be put across to the BW team. If the temporary objects are removed when they are used by a query, then the query will fail.
    Have a nice day
    RB

  • Import dumpfile with seperate tablespaces for table and index

    Hi,
    We have a schema for which the its tables are stored in seperate tablespace and indexes are stored in different tablespace. Now we have take full schema export. Now we want to import it on another schema. Now I want to know if the we have difference in the tablespace name we use REMAP_TABLESPACE clause of the impdp command but what about the seperate tablespace for table and indexes. How would Oracle handle this.
    Regards,
    Abbasi

    Hi,
    I hope you created the same tablespace structure on the target side if not so remap_tablespace option you have to use for specifying different tablespaces.Oracle will take care of putting data and index.Any how if a index is moved from one tablespace to other you have to rebuild them,once you rebuild them than only stattistics are gathered otherwise you
    might face some performance issue.
    Better option is to keep same tablespace structures in source and target environment.
    Best regards,
    Rafi.
    http://rafioracledba.blogspot.com
    Edited by: Rafi (Oracle DBA) on May 9, 2011 7:07 AM

  • Full Table Scans / Index Scans /Index Organized Tables...

    Can anyone give me an example where an index would be the best option to query 99% of data.
    Can anyone give me an example where a FTS is the best option to query 1% of data.
    If IOT are better in terms of performance and also in terms of saving storage space then why cant we always use IOT in the database . Why do we need to follow the regular table and index to store data.
    Responses are appreciated !
    null
    null

    It's easiest to consider extreme cases for thought experiments:
    Can anyone give me an example where an index would
    be the best option to query 99% of data.
    The obvious case would be where you had an order by clause with a matching index. With a well-clustered table, the optimizer might decide to do an index full scan to collect 100% of the data in order rather then doing a tablescan and sort.
    In fact, with first_rows_1 optimization, and certainly with first_rows optimization before it, you would sometimes see the optimizer use such a strategy to read 100% of the data in the right order, discarding 99% of it, rather than selecting 1% of the data through a more precise index and sorting it.
    Can anyone give me an example where a FTS is the
    best option to query 1% of data.
    Consider a table in a tablespace with an 8Kb block size - with short rows (roughly 80 bytes) you can get 100 rows per block. Run a query that wants to get one row from each block (i.e. 1% of the data). A tablescan with a db_file_multiblock_read_count of just 2 would be more efficient than an indexed access. For a more realistic example consider picking one row from every 16th block when your db_file_multiblock_read_count is 128.
    In fact, if you check what Oracle does when you sample 1% of the rows using the sample clause, you may see cases where it actualy uses multiblock reads to scan the whole table, discarding the blocks it doesn't want.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk

Maybe you are looking for

  • Page numbers display as 5 of 1 and 2 of 2121 in a PDF that was created from a Word 2003 document

    We merge several Word 2003 documents into 1 larger document that we then convert to PDF.  The page numbers in the Word document display properly - 1 of 21, 2 of 21, 3 of 21, etc.  We then convert that merged document to PDF by right-clicking the file

  • PPR error with sql with where clause

    dear pakar, why my PPR report error using this query Select process_id, to_char(start_date, 'Dy DD-Mon-YYYY HH24:MI:SS') start_date, to_char(finish_date, 'Dy DD-Mon-YYYY HH24:MI:SS') finish_date, to_char(sysdate, 'Dy DD-Mon-YYYY HH24:MI:SS') timestam

  • Low-quality DVD from SD files

    I'm new to Premiere Pro CS5, and I'm having difficulty creating a good-quality DVD from my SD footage. It may be because my video is too long (2 hr. 14 min.), but I thought maybe I was doing something wrong. I've done similar things (DVDs from plays

  • Oracle Business Rule : Unable to modify the rule at runtime

    Hi I am developing simple Business rule using Oracle jdevelper 11g which displays a message based on two rules. rule1 : If amount <= 100, displays the message "Less than or equal to 100" rule2 : If amount >100 and amount less than 200 display the mes

  • Deleted emails

    How can I make sure deleted emails onmy blackberry are also deleted from my laptop before receiving ? After I delete on blackberry i must once again delete same message on my laptop. Thanks