DELETE STATISTICS

I was wondering if we delete statistics on a table is it possible to restore those old statistics back to the table?? Thank you in advance.

Prior to the delete of the statistics, you can export them using DBMS_STATS.EXPORT_TABLE_STATS and restore them later if needed using the corresponding import procedures.

Similar Messages

  • Delete statistics data

    hi
    i deleted statistics data for my cube, now i created query, now i went st03, expertmode, but i havent find any timings for my query there, what is db time, olap time....

    hi,
    Please chk the links
    ST03 no data
    About SAP standard reference value of the statistics data ST03N or ST03
    http://help.sap.com/saphelp_nw70/helpdata/en/43/e39fd25ff502d2e10000000a1553f7/frameset.htm
    Ramesh

  • Table statistics delete

    Hi
    Is there any command to delete gathered statistics of a table
    suppose : I have gather table statistics as under
    exec dbms_stats.gather_table_stats('TEST1','EMP');
    now I want to delete the statistics from the above table EMP
    Regards
    Jewel

    The package dbms_stats is fully documented in the Oracle supplied package and type reference manual for your unknown version of Oracle.
    It has a call to delete statistics.
    As per forums etiquette, please do the obvious first and consult documentation.
    Sybrand Bakker
    Senior Oracle DBA

  • Query is not working properly when statistics are computed (XE 11g Windows 7 32 bits)

    Hi,
    We have an application with a Oracle XE 11.2 database on a Windows 7 32 bits plateform.
    We have a query wich access 4 tables end use a user defined package function.
    When the statistics are computed the query is returning no rows, (with the data in the tables it should return 349 rows).
    When the statistics are deleted (with ANALYZE TABLE xxx DELETE STATISTICS) the query is working fine.
    I tried different statistics calculation methods, and sometimes the query is working, sometimes it is not!
    I don't understand how the statistics caluclation method can change the query results.
    Has anybody already encountered such an issue?
    Regards,
    Yves

    I understand how the statistics are working.
    What i don't undestand is why the number of rows returned is different with or without statistics.
    I tried yesterday to had a hint /*+ RULE */ and with the hint, rows are correctly returned!
    Here is the query:
    SELECT l_activite.copaip, l_activite.nunati, l_activite.numeul, obsoff.dapaul,
                                        obsoff.lai24h / 10 * DECODE (coefat, NULL, 1, 0, 1, coefat / 200) lai24h, obsoff.etfeob, obsoff.tplaco / 10 tplaco,
                                        obsoff.tblaco / 10 tblaco, l_lactoff.nulact, obsoff.dapaul - l_lactoff.dadela + 1 dulact, l_lactoff.dadela,
                                        l_activite.dcenul,
                                        (  obsoff.tblaco
                                         / 10
                                         * (DECODE (obsoff.tblaco, 0, 0, NULL, 0, obsoff.lai24h * DECODE (coefat, NULL, 1, 0, 1, coefat / 200) / 10))
                                        ) mg,
                                        (  obsoff.tplaco
                                         / 10
                                         * (DECODE (obsoff.tplaco, 0, 0, NULL, 0, obsoff.lai24h * DECODE (coefat, NULL, 1, 0, 1, coefat / 200) / 10))
                                        ) mp,
                                        DECODE (obsoff.tblaco, 0, 0, NULL, 0, obsoff.lai24h * DECODE (coefat, NULL, 1, 0, 1, coefat / 200) / 10) lait_mg,
                                        DECODE (obsoff.tplaco, 0, 0, NULL, 0, obsoff.lai24h * DECODE (coefat, NULL, 1, 0, 1, coefat / 200) / 10) lait_mp,
                                        pck_f_valorises.f_present_mul (obsoff.etfeob,
                                                                       obsoff.nulact,
                                                                       (SELECT MAX (l_obsoff.dapaul)
                                                                          FROM l_obsoff
                                                                         WHERE TRIM (l_obsoff.copaip) = TRIM (l_activite.copaip)
                                                                           AND TRIM (l_obsoff.nunati) = TRIM (l_activite.nunati)
                                                                           AND l_obsoff.dapaul < obsoff.dapaul
                                                                           AND l_obsoff.etfeob <> 'T'),
                                                                       obsoff.dapaul,
                                                                       l_lactoff.dadela
                                                                      ) as OK
                                   FROM l_activite, l_obsoff obsoff, l_lactoff, l_passage
                                  WHERE TRIM (l_activite.copaul) = TRIM ('FR')
                                    AND TRIM (l_activite.numeul) = TRIM ('61323017') || '    0'
                                    AND TRIM (l_activite.copaip) = TRIM (obsoff.copaip)
                                    AND TRIM (l_activite.nunati) = TRIM (obsoff.nunati)
                                    AND TRIM (l_activite.copaip) = TRIM (l_lactoff.copaip)
                                    AND TRIM (l_activite.nunati) = TRIM (l_lactoff.nunati)
                                    AND TRIM (l_passage.copaul) = TRIM (l_activite.copaul)
                                    AND TRIM (l_passage.numeul) = TRIM (l_activite.numeul)
                                    AND (   (DECODE (l_activite.dacosu, TO_DATE ('01/01/0001', 'dd/MM/YY'), 'VIDE', NULL, 'VIDE', l_activite.dacosu) = 'VIDE')
                                         OR (l_activite.dacosu >= l_passage.dapaul)
                                    AND l_passage.dapaul = obsoff.dapaul
                                    AND obsoff.nulact = l_lactoff.nulact
                                    AND obsoff.dapaul >= l_activite.dcenul
                                    AND l_passage.dapaul <= to_date('24/04/2013')
                                    AND l_passage.dapaul >= to_date('24/04/2012') - 50
                                    AND pck_f_valorises.f_present_mul (obsoff.etfeob,
                                                                       obsoff.nulact,
                                                                       (SELECT MAX (l_obsoff.dapaul)
                                                                          FROM l_obsoff
                                                                         WHERE TRIM (l_obsoff.copaip) = TRIM (l_activite.copaip)
                                                                           AND TRIM (l_obsoff.nunati) = TRIM (l_activite.nunati)
                                                                           AND l_obsoff.dapaul < obsoff.dapaul
                                                                           AND l_obsoff.etfeob <> 'T'),
                                                                       obsoff.dapaul,
                                                                       l_lactoff.dadela
                                                                      ) = 1
    and the function :
    FUNCTION F_PRESENT_MUL(p_etat IN CHAR,p_nulact IN NUMBER,
    p_derniere_obs_lait IN DATE, p_date_passage IN DATE,p_dadela IN DATE)
    RETURN NUMBER IS
       NAME:       F_PRESENT_MUL
       PURPOSE:    Retourne 1 si présent MUL 0 sinon
       REVISIONS:
       Ver        Date        Author           Description
       1.0        01/12/2006  Mathieu GUIDEL        1. Created this function.
       NOTES:
    BEGIN
       IF p_derniere_obs_lait IS NULL THEN /* vache présente MUL */
        RETURN 1;
       END IF;
       IF p_etat='P' THEN /* vache présente MUL */
       RETURN 1;
       ELSE
        IF p_etat = 'N' THEN /* NC ou FV */
         IF (p_date_passage - p_dadela + 1) <= 7 THEN /* FV */
          IF p_nulact=1 THEN
          RETURN 0;
          ELSE /* considérée comme tarie */
           IF (p_date_passage - p_derniere_obs_lait) < 100 THEN /* derniere obs lait inférieur à 100 jour, présente MUL */
           RETURN 1;
           ELSE /* FV tarie depuis trop longtemps : non présente MUL */
           RETURN 0;
           END IF;
          END IF;
         ELSE /* NC */
         RETURN 1;
         END IF;
        ELSE
         IF p_etat = 'T' THEN /* Tarie */
          IF (p_date_passage - p_derniere_obs_lait) < 100 THEN /* derniere obs lait inférieur à 100 jour, présente MUL */
          RETURN 1;
          ELSE /* tarie depuis trop longtemps : non présente MUL */
          RETURN 0;
          END IF;
          ELSE /* etat différent de P, N, T donc etat = S */
          /*vérification du contrôle précédent non FV*/
          IF (p_derniere_obs_lait - p_dadela + 1) <= 7 THEN /* FV au contrôle précédent*/
          RETURN 0;
          ELSE
            IF (p_date_passage - p_derniere_obs_lait) < 30 THEN /* derniere obs lait ou NC inférieur à 30 jour, présente MUL */
            RETURN 1;
            ELSE /* sortie sans lait depuis trop longtemps : non présente MUL */
            RETURN 0;
            END IF;
          END IF;
         END IF;
        END IF;
       END IF;
    END F_PRESENT_MUL;
    Regards

  • Help,why brconnect do not collect statistics for mseg table?

    I found "MSEG" table`s statistics is too old.
    so i check logs in db13,and the schedule job do not collect statistics for "MSEG".
    Then i execute manually: brconnect -c -u system/system -f stats -t mseg  -p 4
    this command still do not collect for mseg.
    KS1DSDB1:oraprd 2> brconnect -c -u system/system -f stats -t mseg u2013f collect -p 4
    BR0801I BRCONNECT 7.00 (46)
    BR0154E Unexpected option value 'u2013f' found at position 8
    BR0154E Unexpected option value 'collect' found at position 9
    BR0806I End of BRCONNECT processing: ceenwjre.log 2010-11-12 08.41.38
    BR0280I BRCONNECT time stamp: 2010-11-12 08.41.38
    BR0804I BRCONNECT terminated with errors
    KS1DSDB1:oraprd 3> brconnect -c -u system/system -f stats -t mseg -p 4
    BR0801I BRCONNECT 7.00 (46)
    BR0805I Start of BRCONNECT processing: ceenwjse.sta 2010-11-12 08.42.04
    BR0484I BRCONNECT log file: /oracle/PRD/sapcheck/ceenwjse.sta
    BR0280I BRCONNECT time stamp: 2010-11-12 08.42.11
    BR0813I Schema owners found in database PRD: SAPPRD*, SAPPRDSHD+
    BR0280I BRCONNECT time stamp: 2010-11-12 08.42.12
    BR0807I Name of database instance: PRD
    BR0808I BRCONNECT action ID: ceenwjse
    BR0809I BRCONNECT function ID: sta
    BR0810I BRCONNECT function: stats
    BR0812I Database objects for processing: MSEG
    BR0851I Number of tables with missing statistics: 0
    BR0852I Number of tables to delete statistics: 0
    BR0854I Number of tables to collect statistics without checking: 0
    BR0855I Number of indexes with missing statistics: 0
    BR0856I Number of indexes to delete statistics: 0
    BR0857I Number of indexes to collect statistics: 0
    BR0853I Number of tables to check (and collect if needed) statistics: 1
    Owner SAPPRD: 1
    MSEG     
    BR0846I Number of threads that will be started in parallel to the main thread: 4
    BR0126I Unattended mode active - no operator confirmation required
    BR0280I BRCONNECT time stamp: 2010-11-12 08.42.16
    BR0817I Number of monitored/modified tables in schema of owner SAPPRD: 1/1
    BR0280I BRCONNECT time stamp: 2010-11-12 08.42.16
    BR0877I Checking and collecting table and index statistics...
    BR0280I BRCONNECT time stamp: 2010-11-12 08.42.16
    BR0879I Statistics checked for 1 table
    BR0878I Number of tables selected to collect statistics after check: 0
    BR0880I Statistics collected for 0/0 tables/indexes
    BR0806I End of BRCONNECT processing: ceenwjse.sta 2010-11-12 08.42.16
    BR0280I BRCONNECT time stamp: 2010-11-12 08.42.17
    BR0802I BRCONNECT completed successfully
    the log says:
    Number of tables selected to collect statistics after check: 0
    Could you give some advices?  thanks a lot.

    Hello,
    If you would like to force the creation of that stats for table MSEG you need to use the -f (force) switch.
    If you leave out the -f switch the parameter from stats_change_threshold is taken like you said correctly:
    [http://help.sap.com/saphelp_nw70ehp1/helpdata/EN/02/0ae0c6395911d5992200508b6b8b11/content.htm|http://help.sap.com/saphelp_nw70ehp1/helpdata/EN/02/0ae0c6395911d5992200508b6b8b11/content.htm]
    [http://help.sap.com/saphelp_nw70ehp1/helpdata/EN/cb/f1e33a5bd8e934e10000000a114084/content.htm|http://help.sap.com/saphelp_nw70ehp1/helpdata/EN/cb/f1e33a5bd8e934e10000000a114084/content.htm]
    You have tried to do this in your second example :
    ==> brconnect -c -u system/system -f stats -t mseg u2013f collect -p 4
    Therefore you received:
    BR0154E Unexpected option value 'u2013f' found at position 8
    BR0154E Unexpected option value 'collect' found at position 9
    This is the correct statement, however the hyphen in front of the f switch is not correct.
    Try again with the following statement (-f in stead of u2013f) you will see that it will work:
    ==> brconnect -c -u system/system -f stats -t mseg -f collect -p 4
    I hope this can help you.
    Regards.
    Wim

  • Statistics Analysis on Tables that are often empty

    Right now I'm dealing with a user application that was originally developed in Ora10g. Recently the database was upgraded to Ora11g, and the schema and data was imported successfully.
    However, since the user started using Ora11, some of their applications have been running slower and slower. I'm just wondering if the problem could be due to statistics.
    The application has several tables which contains temporary data. Usually these tables are empty, although when a user application runs they are populated, and queried against, and then at the end the data is deleted. (Its this program that's running slower and slower.)
    I'm just wondering if the problem could be due to a problem with user statistics.
    When I look at the 'last_analyzed' field in user_tables, the date goes back to the date of last import. I know Oracle regularly updates statistics, so what I suspect is happening is that, by luck, Oracle has only been gathering statistics when the tables are empty. (And since the tables are empty, the statistics are of no help in optimizing the DB.)
    Am I on the right track?
    And if so, is there a way to automatically trigger a statistics gather job when a table gets above a certain size?
    System details:
    Oracle: 11gR2 (64 bit) Standard version
    File System: ASM (GRID infrastructure)

    Usually these tables are empty, although when a user application runs they are populated, and queried against, and then at the end the data is deletedYou have three options (and depending on how the data changes, you might find that not all temporary tables work best with the same option) :
    1. Load representative data into the temporary table, collect statistics (including any histograms that you identify as necessary) and then lock the statistics
    2. Modify the job to re-gather statistics immediately after a temporary table is populated
    3. Delete statistics and then lock the statistics and check the results (execution plan and performance) when the optimizer uses dynamic sampling
    Note : It is perfectly reasonable to create indexes on temporary tables -- provided that you DO create the correct indexes. If jobs are querying the temporary tables for the full data set (all rows) indexes are a hindrance. If there are many separate queries against the temporary table, each query retrieiving a small set of rows, an index or two may be beneficiial. Also some designs do use unique indexes to enforce uniqueness when the tables are loaded.
    Hemant K Chitale

  • Oracle 11G Searching Issue : Statistics Corruption

    Hi,
    I guess their is some issue with oracle statistics for Text Indexing. Some times i got an issue regarding Text index searching, query throwing wrong results. and when i fire this command :-
    execute immediate 'analyze table ' ||' '||tablename ||' '||'delete statistics';
    for deleting statistics. the query returns the correct results.
    I guess this is the problem of "stale statistics" , Is their any way to sort out this problem ?
    Any help please ?

    Hi,
    I have Oracle Version - 11g Release 1 (11.1.0.6)
    Yes you are absolutely correct, Even i am not getting that why oracle is behaving like this. But i have shown this behaviour many times ( once in 2-3 months approximately )
    I know that we can provide hint in the queries but i cant give hints.
    Any Help please ?

  • When need to update statistics for a table

    In Sybase we use "delete statistics ", "update all statistics " and "sp_recompile ", does Oracle need to do such things in any case? Thank you!

    Modern versions have a default job to do this, which may or may not be appropriate in its settings.  Volumes have been written about it.  Version and app dependent.  Highly recommend studying Jonathan Lewis' books.
    Stored procedures automatically recompile on use, although there can be issues dependent on bad design or configuration.

  • Update statistics error in prod

    Dear Experts ,
    we are facing an error while updating statistics by using db13
    please check on log below
    18.05.2011     18:52:41     Job started
    18.05.2011     18:52:41     Step 001 started (program RSDBAJOB, variant &0000000000047, user ID BASIS)
    18.05.2011     18:52:42     No application server found on database host - rsh/gateway will be used
    18.05.2011     18:52:42     Execute logical command BRCONNECT On host PRDHOSR
    18.05.2011     18:52:42     Parameters: -u / -jid STATS20110518185240 -c -f stats -t ALL
    18.05.2011     18:53:34     BR0801I BRCONNECT 7.00 (40)
    18.05.2011     18:53:34     BR1304W Checking SAP license failed at location BrLicCheck-108
    18.05.2011     18:53:34     BR0602W No valid SAP license found - please contact SAP
    18.05.2011     18:53:34     BR0805I Start of BRCONNECT processing: cefxifuy.sta 2011-05-18 18.52.44
    18.05.2011     18:53:34     BR0484I BRCONNECT log file: /oracle/PRD/sapcheck/cefxifuy.sta
    18.05.2011     18:53:34     
    18.05.2011     18:53:34     BR0280I BRCONNECT time stamp: 2011-05-18 18.52.53
    18.05.2011     18:53:34     BR0813I Schema owners found in database PRD: SAPSR3*, SAPSR3DB%
    18.05.2011     18:53:34     
    18.05.2011     18:53:34     BR0280I BRCONNECT time stamp: 2011-05-18 18.53.05
    18.05.2011     18:53:34     BR0814I Number of tables/partitions in schema of owner SAPSR3: 32818/10
    18.05.2011     18:53:34     BR0836I Number of info cube tables found for owner SAPSR3: 143
    18.05.2011     18:53:34     BR0814I Number of tables in schema of owner SAPSR3DB: 722
    18.05.2011     18:53:34     
    18.05.2011     18:53:34     BR0280I BRCONNECT time stamp: 2011-05-18 18.53.24
    18.05.2011     18:53:34     BR0815I Number of indexes/partitions in schema ofowner SAPSR3: 43208/13
    18.05.2011     18:53:34     BR0815I Number of indexes in schema of owner SAPSR3DB: 1051
    18.05.2011     18:53:34     
    18.05.2011     18:53:34     BR0280I BRCONNECT time stamp: 2011-05-18 18.53.29
    18.05.2011     18:53:34     BR0818I Number of tables found in DBSTATC for owner SAPSR3: 814
    18.05.2011     18:53:34     
    18.05.2011     18:53:34     BR0280I BRCONNECT time stamp: 2011-05-18 18.53.29
    18.05.2011     18:53:34     BR0807I Name of database instance: PRD
    18.05.2011     18:53:34     BR0808I BRCONNECT action ID: cefxifuy
    18.05.2011     18:53:34     BR0809I BRCONNECT function ID: sta
    18.05.2011     18:53:34     BR0810I BRCONNECT function: stats
    18.05.2011     18:53:34     BR0812I Database objects for processing: ALL
    18.05.2011     18:53:34     BR0851I Number of tables with missing statistics:0
    18.05.2011     18:53:34     BR0852I Number of tables to delete statistics: 0
    18.05.2011     18:53:34     BR0854I Number of tables to collect statistics without checking: 0
    18.05.2011     18:53:34     BR0855I Number of indexes with missing statistics: 0
    18.05.2011     18:53:34     BR0856I Number of indexes to delete statistics: 0
    18.05.2011     18:53:34     BR0857I Number of indexes to collect statistics: 0
    18.05.2011     18:53:34     BR0853I Number of tables to check (and collect ifneeded) statistics: 33537
    18.05.2011     18:53:34     BR0126I Unattended mode active - no operator confirmation required
    18.05.2011     18:53:34     
    18.05.2011     18:53:34     BR0280I BRCONNECT time stamp: 2011-05-18 18.53.31
    18.05.2011     18:53:34     BR0817I Number of monitored/modified tables in schema of owner SAPSR3: 32818/1055
    18.05.2011     18:53:34     BR0817I Number of monitored/modified tables in schema of owner SAPSR3DB: 722/8
    18.05.2011     18:53:34     BR0280I BRCONNECT time stamp: 2011-05-18 18.53.33
    18.05.2011     18:53:34     BR0301E SQL error -2132 at location thr_db_connect-3, SQL statement:
    18.05.2011     18:53:34     'ENABLE THREADS'
    18.05.2011     18:53:34     SQL-02132: Message 2132 not found; No message file for product=precomp, facility
    18.05.2011     18:53:34     BR0310E Connect to database instance PRD failed
    18.05.2011     18:53:34     
    18.05.2011     18:53:34     BR0806I End of BRCONNECT processing: cefxifuy.sta2011-05-18 18.53.33
    18.05.2011     18:53:34     BR0280I BRCONNECT time stamp: 2011-05-18 18.53.34
    18.05.2011     18:53:34     BR0804I BRCONNECT terminated with errors
    18.05.2011     18:53:34     External program terminated with exit code 5
    18.05.2011     18:53:34     BRCONNECT returned error status E
    18.05.2011     18:53:34     Job finished
    please help to solve this error in production
    Regards

    Dear Experts ,
    now i got an error
    because of oracle client update statistics are failed now i required to upgrade oracle client
    please share your valiable knoledge how can i upgrade my oracle client 10.2.0.2 to 10.2.0.4, i checked note 819829 now i need your suggesitions on this activity
    and also pre - requsits to upgrade (steps)
    Regards

  • Update Database Statistics during System Export

    hi All,
    I am getting following error on step (Update Database Statistics ) during system export.
    WARNING 2011-06-17 15:13:35
    Execution of the command "E:\usr\sap\PRD\SYS\exe\uc\NTAMD64\
    brconnect.exe -u / -c -o summary -f stats -o SAPSR3 -t all -m +I -s
    P10 -f allsel,collect,method,precision,space,keep -p 4"
    finished with return code 5.
    Output: BR0801I BRCONNECT 7.00 (31)BR0805I Start of BRCONNECT processing:
    cegczbfe.sta 2011-06-17 15.12.02BR0484I BRCONNECT log file:
    G:\oracle\PRD\sapcheck\cegczbfe.sta
    ERROR 2011-06-17 15:13:35
    CJS-30023  Process call 'E:\usr\sap\PRD\SYS\exe\uc\NTAMD64\
    brconnect.exe -u / -c -o summary -f stats -o SAPSR3 -t all -m +I -s P10
    -f allsel,collect,method,precision,space,keep -p 4'
    exits with error code 5. For details see log file(s) brconnect.log.
    there is small part of brconnect.log is:
    BR0204I Percentage done: 27.88%, estimated end time: 15:16
    BR0001I **************____________________________________
    BR0280I BRCONNECT thread 2: time stamp: 2011-06-17 15.13.31
    BR0301E SQL error -20003 in thread 2 at location stats_tab_collect-20, SQL statement:
    'BEGIN DBMS_STATS.GATHER_TABLE_STATS (OWNNAME => '"SAPSR3"', TABNAME => '"/BEV3/CHCL_STAT"', ESTIMATE_PERCENT => NULL, METHOD_OPT => 'FOR ALL COLUMNS SIZE 1', DEGREE => NULL, CASCADE => TRUE, NO_INVALIDATE => FALSE); END;'
    ORA-20003: Specified bug number (5099019) does not exist
    ORA-06512: at "SYS.DBMS_STATS", line 14830
    ORA-06512: at "SYS.DBMS_STATS", line 14851
    ORA-06512: at line 1
    BR0886E Checking/collecting statistics failed for table SAPSR3./BEV3/CHCL_STAT
    BR0280I BRCONNECT thread 2: time stamp: 2011-06-17 15.13.31
    BR0301E SQL error -20003 in thread 2 at location stats_tab_collect-20, SQL statement:
    'BEGIN DBMS_STATS.GATHER_TABLE_STATS (OWNNAME => '"SAPSR3"', TABNAME => '"/BEV3/CHCL_STATT"', ESTIMATE_PERCENT => NULL, METHOD_OPT => 'FOR ALL COLUMNS SIZE 1', DEGREE => NULL, CASCADE => TRUE, NO_INVALIDATE => FALSE); END;'
    ORA-20003: Specified bug number (5099019) does not exist
    ORA-06512: at "SYS.DBMS_STATS", line 14830
    ORA-06512: at "SYS.DBMS_STATS", line 14851
    ORA-06512: at line 1
    BR0886E Checking/collecting statistics failed for table SAPSR3./BEV3/CHCL_STATT
    BR0280I BRCONNECT thread 2: time stamp: 2011-06-17 15.13.31
    BR0301E SQL error -20003 in thread 2 at location stats_tab_collect-20, SQL statement:
    'BEGIN DBMS_STATS.GATHER_TABLE_STATS (OWNNAME => '"SAPSR3"', TABNAME => '"/BEV3/CHCMVWOBJ"', ESTIMATE_PERCENT => NULL, METHOD_OPT => 'FOR ALL COLUMNS SIZE 1', DEGREE => NULL, CASCADE => TRUE, NO_INVALIDATE => FALSE); END;'
    ORA-20003: Specified bug number (5099019) does not exist
    ORA-06512: at "SYS.DBMS_STATS", line 14830
    ORA-06512: at "SYS.DBMS_STATS", line 14851
    ORA-06512: at line 1
    BR0886E Checking/collecting statistics failed for table SAPSR3./BEV3/CHCMVWOBJ
    BR0280I BRCONNECT thread 2: time stamp: 2011-06-17 15.13.31
    BR0301E SQL error -20003 in thread 2 at location stats_tab_collect-20, SQL statement:
    'BEGIN DBMS_STATS.GATHER_TABLE_STATS (OWNNAME => '"SAPSR3"', TABNAME => '"/BEV3/CHCMVWOBPR"', ESTIMATE_PERCENT => NULL, METHOD_OPT => 'FOR ALL COLUMNS SIZE 1', DEGREE => NULL, CASCADE => TRUE, NO_INVALIDATE => FALSE); END;'
    ORA-20003: Specified bug number (5099019) does not exist
    ORA-06512: at "SYS.DBMS_STATS", line 14830
    BEGIN DBMS_STATS.GATHER_TABLE_STATS (OWNNAME => '"SAPSR3"', TABNAME => '"/BEV3/CHCTLVAR"', ESTIMATE_PERCENT => NULL, METHOD_OPT => 'FOR ALL COLUMNS SIZE 1', DEGREE => NULL, CASCADE => TRUE, NO_INVALIDATE => FALSE); END;'
    ORA-20003: Specified bug number (5099019) does not exist
    ORA-06512: at "SYS.DBMS_STATS", line 14830
    ORA-06512: at "SYS.DBMS_STATS", line 14851
    ORA-06512: at line 1
    ORA-06512: at line 1
    BR0886E Checking/collecting statistics failed for table SAPSR3./BEV3/CHCTMSTFUB
    BR0280I BRCONNECT thread 2: time stamp: 2011-06-17 15.13.34
    BR0844E 100 errors occurred in thread 2 - terminating processing of the thread...
    BR0280I BRCONNECT time stamp: 2011-06-17 15.13.34
    BR0848I Thread 2 finished with return code -1
    BR0280I BRCONNECT time stamp: 2011-06-17 15.13.34
    BR0879I Statistics checked for 0 tables
    BR0878I Number of tables selected to collect statistics after check: 0
    BR0880I Statistics collected for 639/0 tables/indexes
    BR0889I Structure validated for 0/749/0 tables/indexes/clusters
    BR1308E Collection of statistics failed for 68292/0 tables/indexes
    BR0806I End of BRCONNECT processing: cegczbfe.sta 2011-06-17 15.13.34
    BR0280I BRCONNECT time stamp: 2011-06-17 15.13.35
    BR0804I BRCONNECT terminated with errors
    how can I resolve this issue?
    Regards,
    majamil

    hi SM,
    I have applied these patches with Opatch which successfully applied.
    is it ok or i had to use the MOpatch for these?
    one more thing for your information , when i execute Delete Harmful Statistics  under Database Statistics in brtools then i got following
    BR0280I BRCONNECT time stamp: 2011-06-30 08.10.53
    BR0818I Number of tables found in DBSTATC for owner SAPSR3: 390
    BR0280I BRCONNECT time stamp: 2011-06-30 08.10.53
    BR0807I Name of database instance: PRD
    BR0808I BRCONNECT action ID: cegfjniv
    BR0809I BRCONNECT function ID: dst
    BR0810I BRCONNECT function: stats
    BR0812I Database objects for processing: HARMFUL
    BR0852I Number of tables to delete statistics: 0
    BR0856I Number of indexes to delete statistics: 0
    BR0863W No tables/indexes found to update/delete statistics or validate structur
    e
    BR0806I End of BRCONNECT processing: cegfjniv.dst 2011-06-30 08.10.53
    BR0280I BRCONNECT time stamp: 2011-06-30 08.10.53
    BR0803I BRCONNECT completed successfully with warnings
    BR0292I Execution of BRCONNECT finished with return code 1
    BR0668I Warnings or errors occurred - you can continue to ignore them or go back
    to repeat the last action
    BR0280I BRTOOLS time stamp: 2011-06-30 08.10.53
    BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:
    c
    why i am getting this return code 1?
    Regards,
    Edited by: majamil on Jun 30, 2011 8:20 AM

  • BW Statistics setting.

    Dear All,
    I am having some doughts on BW Statistics Setting,
    In selection for BW Statistics settings ( AWB->Tools-> BW Statistics for infoprovider) all objects including Master data object/ODS/Cube is selected.
    My doughts is that is BW Statistics work for Master data objects/ODS ?
    or it only work for Cube.
    Do we need to deselect all check box in seting for Master Data object/ODS and only need to be checked for Cube.
    Thanks All in advance.

    Hi,
         With the new architecture for BI reporting, collection of statistics for query runtime analysis was enhanced or changed. The parallelization in the data manager area (during data read) that is being used more frequently has led to splitting the previous "OLAP" statistics data into "data manager" data (such as database access times, RFC times) and front-end and OLAP times. The statistics data is collected in separate tables, but it can be combined using the InfoProvider for the technical content.
        The information as to whether statistic data is collected for an object no longer depends on the InfoProvider. Instead it depends on those objects for which the data is collected, which means on a query, a workbook or a Web template. The associated settings are maintained in the RSDDSTAT transaction.
    Effects on Existing Data, Due to the changes in the OLAP and front-end architecture, the statistic data collected up to now can only partially be compared with the new data.
    Since the structure of the new tables differs greatly from that of the table RSDDSTAT, InfoProviders that are based on previous data (table RSDDSTAT) can no longer be supplied with data.
    Effects on Customizing
    The Collect Statistics setting is obsolete. Instead you have to determine whether and at which granularity you wish to display the statistics data for the individual objects (query, workbook, Web template). In the RSDDSTAT transaction, you can turn the statistics on and off for all queries for an InfoProvider. The maintenance of the settings (such as before) from the Data Warehousing Workbench can be reached using Tools  ® BW Statistics.
    You can use this BRCONNECT function to update the statistics on the Oracle database for the cost-based optimizer.
    By running update statistics regularly, you make sure that the database statistics are up-to-date, so improving database performance. The Oracle cost-based optimizer (CBO) uses the statistics to optimize access paths when retrieving data for queries. If the statistics are out-of-date, the CBO might generate inappropriate access paths (such as using the wrong index), resulting in poor performance.
    From Release 4.0, the CBO is a standard part of the SAP System. If statistics are available for a table, the database system uses the cost-based optimizer. Otherwise, it uses the rule-based optimizer.
            Partitioned tables, except where partitioned tables are explicitly excluded by setting the active flag in the DBSTATC table to I. For more information, see SAP
            InfoCube tables for the SAP Business Information Warehouse (SAP BW)
    You can update statistics using one of the following methods:
            DBA Planning Calendar in the Computing Center Management System (CCMS)
    For more information, see Update Statistics for the Cost-Based Optimizer in CCMS (Oracle). The DBA Planning Calendar uses the BRCONNECT commands.
    We recommend you to use this approach because you can easily schedule update statistics to run automatically at specified intervals (for example, weekly).
    To use the CBO, make sure that the parameter OPTIMIZER_MODE in the Oracle initialization profile init.ora is set to CHOOSE.
    BRCONNECT performs update statistics using a two-phase approach.
           1.      Checks each table to see if the statistics are out-of-date
           2.      If required, updates the statistics on the table immediately after the check
    For more information about how update statistics works, see Internal Rules for Update Statistics.
    You can influence how update statistics works by using the -force options. For more information, see -f stats.
    Unless you have special requirements, we recommend you to perform the standard update statistics, using one of the following tools to schedule it on a regular basis (for example, daily or weekly):
             DBA Planning Calendar, as described above in "Integration."
             A tool such as cron (UNIX) or at (Windows NT) to execute the following standard call:
    brconnect -u / -c -f stats -t all
    This is also adequate after an upgrade of the database or SAP System. It runs using the OPS$ user without operator intervention.
            Update statistics only for tables and indexes with missing statistics
    brconnect -u / -c -f stats -t missing
            Check and update statistics for all tables defined in the DBSTATC table
    brconnect -u / -c -f stats -t dbstatc_tab
    For examples of how you can override the internal rules for update statistics, see -force with Update Statistics.
    The InfoCube tables used in SAP Business Information Warehouse (SAP BW) and Advanced Planner and Optimizer (APO) need to be processed in a special way when the statistics are being updated. Usually, statistics should be created using histograms, Statistics for the InfoCube tables can be updated, together with other tables in a run. In this case, the statistics for the InfoCube tables are always created with histograms. You can specify which tables are to be handled as InfoCube tables using the init.sap parameters:
            stats_table       
            stats_exclude     
            stats_dbms_stats
    The function of this keyword is to ensure that only InfoCube tables are processed in accordance with the selected parameter settings.
    Statistics are only checked for InfoCube tables and updated, if required
            brconnect -u / -c -f stats -t all -e info_cubes
    Statistics are checked for all tables besides InfoCube tables and updated, if necessary.
            stats_dbms_stats = INFO_CUBES:R:4
    brconnect -u / -c -f stats -t all, Statistics are checked for all tables and updated, if necessary. New statistics for InfoCube tables are created with the DBMS_STATS package using row sampling and an internal parallel degree of 4.
    This is the default. Statistics are checked for all tables and updated, if necessary. If InfoCube tables are present and selected following the update check, statistics are generated for them using histograms.
    You can update statistics on the Oracle database using the Computing Center Management System (CCMS).
    By running update statistics regularly, you make sure that the database statistics are up-to-date, so improving database performance. The Oracle cost-based optimizer (CBO) uses the statistics to optimize access paths when retrieving data for queries. If the statistics are out-of-date, the CBO might generate inappropriate access paths (such as using the wrong index), resulting in poor performance.
    The CBO is a standard part of the SAP system. If statistics are available for a table, the database system uses the cost-based optimizer. Otherwise, it uses the rule-based optimizer.
    You can also run update statistics for your Oracle database using BRCONNECT. Refer to Update Statistics with BRCONNECT. This is the recommended way to update statistics.
    Update statistics after installations and upgrades
    You need to update statistics for all tables in the SAP system after an installation or an upgrade. This is described in the relevant installation or upgrade documentation.
           1.      You use the DBA Planning Calendar in CCMS to schedule regular execution of check statistics and, if necessary, update statistics. For more information.
           2.      If required, you run one-off checks on tables to see if the table’s statistics are out-of-date, and then run an update statistics for the table if required. This is useful, for example, if the data in a table has been significantly updated, but the next scheduled run of update statistics is not for a long time.
    You can check, create, update, or delete statistics for:
    ¡        Single tables
    ¡        Groups of tables
           3.      If required, you configure update statistics by amending the parameters in the control table DBSTATC . This control table contains a list of the database tables for which the default values for update statistics are not suitable. If you change this table, all runs of update statistics – in BRCONNECT, CCMS, or the DBA Planning Calendar – are affected. Configuring update statistics makes sense with large tables, for which the default parameters might not be appropriate.
    Do not add, delete, or change table entries unless you are aware of the consequences.
            Tables from the DBSTATC table with either of the following values:
             ACTIVE field U
             ACTIVE field R or N and USE field A(relevant for the application monitor)
          6.      BRCONNECT writes the results of update statistics to the DBSTATTORA table and also, for tables with the DBSTATC history flag or usage type A, to the DBSTATHORA table.
          7.      For tables with update statistics using methods EI, EX, CI, or CX, BRCONNECT validates the structure of all associated indexes and writes the results to the DBSTATIORA table and also, for tables with the DBSTATC history flag or usage type A, to the DBSTAIHORA table.
          8.      BRCONNECT immediately deletes the statistics that it created in this procedure for tables with the ACTIVE flag set to N or R in the DBSTATC table.

  • Statistics on tables

    Hi,
    Does the analyze table command actually delete statistics before regenrating new stats ?. If a query is issued during the analyze is running, will it have any stats available to it ?
    Thanks
    Vissu

    Vissu,
    That's an interesting question. I would hope that Oracle offers the same concurrency models to meta-data queries as it does for any other query, so a session that is reading statistics should see a consistent view of the data until the statement has finished. I'd be interested in hearing other opinions...
    Hi,
    Does the analyze table command actually delete statistics before regenrating new stats ?. If a query is issued during the analyze is running, will it have any stats available to it ?
    Thanks
    Vissu

  • Statistics data collection

    Statistics data is being loaded into 0TCT_C01 & 0TCT_C02 even though all infoproviders and queries in RSDDSTAT have been marked to not collect any statistics. Is there any other setting that has to be considered?
    Any help will be greatly appreciated!
    Mira

    Hi Mira,
    Make sure you have selected No Data (9). In this system does not record any data from the front end in the RSDDSTAT.
    You can manually delete statistics data with program RSDDSTAT_DATA_DELETE.
    Also please Check note 891740.
    Hope it helps.
    Regards,
    Mona

  • Harmful statistics???

    Harmful statistics detected error is frequntly occuring on  the system
    Well deleting them is a temporary solution
    Should i create new statistics
    Is there any other permanent solution for this???
    Help appreciated

    Hello,
    I partly disagree with Yoganand here.
    SAP's opinion about useful and harmful statistics depends on SAP release, on database release, and of course on the table.
    A permanent solution will begin by finding out whether these statistics really are harmful for your release.
    SAP note 122718 might give you are start.
    You may have to delete statistics, or you may have to adjust your DBCHECK, in order not to get further warnings.
    regards
    Edited by: Joe Bo. on Jan 16, 2009 10:49 AM:
    Or you may have to change the rules how statistics will be collected.

  • Need help writing script to have dbms_stats delete and collect schema

    I am working on a script to collect stats for Oracle 8i with dbms_stats.
    Since the bug in Oracle 8i requires me to first delete stats for all tables in the schema and
    then to re-run dbms_stats to collect the stats, how can I write a script to do the cleanup and collection stats process for Oracle 8i on Unix?
    Scott

    Something like this (Linux) :
    $ cat stats.sh
    . $HOME/.bash_profile
    ORACLE_SID=orcl; export ORACLE_SID
    echo "Deleting statistics..."
    sqlplus -s "/ as sysdba" << EOF
    exec dbms_stats.delete_schema_stats('SCOTT');
    exit
    EOF
    echo "Gathering statistics..."
    sqlplus -s "/ as sysdba" << EOF
    exec dbms_stats.gather_schema_stats('SCOTT',cascade=>true);
    exit
    EOF
    $ ./stats.sh
    Deleting statistics...
    PL/SQL procedure successfully completed.
    Gathering statistics...
    PL/SQL procedure successfully completed.
    $                                                    Change .bash_profile with .profile if you are using korn shell or bourne shell.

Maybe you are looking for