Clarification on the collection of statistics

Hello

My very slow query performns and it contains the tables of partitions and uses parallel and index.

Last_analysed columns shows that he is 11 - July (2 weeks)

What statistics to be gathered every day?

What will be the timeduration?

S

Also check the STALE_STATS column in the views of the statistical dictionary (ALL_TAB_STATISTICS, ALL_IND_STATISTICS).

The optimizer statistics management

This indicates when there was enough DML operations on the subject to warrant an update of statistics. The auto night stats collection work should give priority to update statistics on these objects.

Tags: Database

Similar Questions

  • performance degrades after the collection of statistics

    Oracle 11 g 2 OEL 5

    We have several very large tables (40 million lines and more) and recently we gathered stats on tables and it degraded our performance. He began to do table scans complete rather than use the index. The same queries are very well in other environments. Only difference is the collection stats. Logically, the performance should be better after the collection of statistics. But it is rather poor.

    I ran track 10053 on request and I see that the cardinality and the cost is medium high in the inefficient environment. A test, I have restored the old stats in the environment and it put everything back to normal - the query runs quickly again. Note that the restored stats were collected for more than a year. Should not collect us statistics regularly on very large tables?

    Thank you.

    Hello

    the stats of the default collection behavior is to determine the number of cells (i.e. a histogram is necessary or not and if yes, how accurately must be) automatically, depending on distribution and usage of the column of data in different types of predicates. This means that, in many cases collection histogram is almost a random process - once you get a histogram, the next time that you don't have, even if there is almost no change. This is (unfortunately) the normal behavior.

    I could quite at the bottom of your question - the optimizer esteem seem to be all correct in the second case, it is not clear to me why the plan that is so bad (there are also some other problems, as lines of 40G supposed to be returned by one of the nested loops, or estimation of cardinality missing for another nested loop). But in any case, histograms and bind variables do not mix, so you can just solve your problem by specifying method_opt => "for columns size 1' to disable the histograms for this table.

    Best regards
    Nikolai

  • Specifying the user name for the collection of statistics of servers windows performance monitor?

    When using load OATS tests collect statistics of servers Windows (perfmon stats), the load test server runs under the user Id must be a member of the monitoring group of the Performance on all Windows servers, I'm watching. I have a user ID standard I use for this type of surveillance. It is automatically configured on all servers in our company. Where can I specify this user ID and password in OATS load tests?

    The only reference I can find in the documentation says to change the user ID and un_mot_de_passe in the Oracle Load Test Agent Serivce. I don't think that's what I want. And there is no installed service named 'Oracle Load Testing Service Agent' on my server in any case.

    Thanks for the help!

    Hello Bob
    You should have a service called Service Oracle Application Testing Suite Agent on each server running a load test agent. If this is not the case, there is a problem it somethere and you can't run a load test.
    This is the service you need to run as the specific user (go to control panel-> service-> change the service to log on under your username).

    And tell us the resultl
    See you soon
    JB

  • Estimated cardinality changed after the collection of statistics

    Hello

    Grateful if anyone can help answer why there is an extra line in the DRB estimated after gather his stats.
    Windows Oracle 10.2.0.4.0

    SQL > select * from t
    2 where id between 6000 and 7000;

    Execution plan
    ----------------------------------------------------------
    Hash value of plan: 1601196873

    --------------------------------------------------------------------------
    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
    --------------------------------------------------------------------------
    | 0 | SELECT STATEMENT | 1001 | 13013. 6 (0). 00:00:01 |
    |* 1 | TABLE ACCESS FULL | T | 1001 | 13013. 6 (0). 00:00:01 |
    --------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):
    ---------------------------------------------------

    1 - filter("ID">=6000 AND "ID"<=7000)

    Note
    -----
    -dynamic sampling used for this statement

    SQL > exec dbms_stats.gather_table_stats (user, 't');

    PL/SQL procedure successfully completed.

    SQL > select * from t
    2 where id between 6000 and 7000;

    Execution plan
    ----------------------------------------------------------
    Hash value of plan: 1601196873

    --------------------------------------------------------------------------
    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
    --------------------------------------------------------------------------
    | 0 | SELECT STATEMENT | 1002 | 3006 | 6 (0). 00:00:01 |
    |* 1 | TABLE ACCESS FULL | T | 1002 | 3006 | 6 (0). 00:00:01 |
    --------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):
    ---------------------------------------------------

    1 - filter("ID">=6000 AND "ID"<=7000)

    SQL >

    Hi Hemant

    I don't think that the dynamic sampling would be launched for the first time.

    If you carefully check the first post to the OP, you will notice the "dynamics of sampling used for this statement" text in the output of the first run. Therefore, dynamic sampling is used.

    Best regards
    Chris Antognini

    Troubleshooting Oracle, Apress 2008 performance
    http://top.Antognini.ch

  • With respect to the analysis and collection of statistics

    Hello

    Why the collection of statistics is necessary in the DB?

    Thank you

    Hello Balmo-Oracle

    You can start reading this document for example: Managing optimizer statistics

    or this: http://www.oracle.com/technetwork/database/bi-datawarehousing/twp-optimizer-stats-concepts-110711-1354477.pdf

    The best way if you check yourself in google.

    Best regards, David

  • Collection of statistics with the cascade option is slow

    Hi all.

    The database is 11.2.0.3 on a linux machine.

    I published the following command, but the session was a bit slow.

    The size of the table is about 50 GB and has 3 clues.

    I said 'degree = 8' for parallel processing.

    When collecting statistics on the table, parallel slaves have been invoked and gather statistics on the table ended pretty quickly.

    However, when he goes to the collection of statistics on indexes, only an active session was invocked and so "level = 8" option is ignored.

    My question is:

    Do I need to use dbms_stats.gahter_index_stats instead of the option "cascade" in order to gather statistics on indexes with parallelism?

    exec dbms_stats.gather_table_stats(ownname=>'SDPSTGOUT',tabname=>'OUT_SDP_CONTACT_HIS',estimate_percent=>10, degree=>8 , method_opt=>'FOR ALL COLUMNS SIZE 1',Granularity=>'ALL',cascade=>TRUE);
    Thanks in advance.

    Best regards.

    Hello

    This could happen due to the index being created as NOPARALLEL. Try to redefine with DOP = 8 and see if that helps (running a quick test to verify this before making any expensive DDLS).

    Best regards
    Nikolai

  • Collection of statistics online

    Hi all

    Is it possible to collect statistics for a schema that use sound. When I try to analyse the tables to a diagram, it shows that the statistics for this table are locked. So is it possible that rather than analyze a table, one by one, I can go for gathering statistics for schema objects of this scheme while is still in use (such as DML or select statements issued on these schema objects).

    DB version: 10.2.0.4
    Version of the OS: RHEL 5.8

    DB type: CARS


    Kind regards
    Imran Khan

    Imran khan says:
    Hi Mark,

    Why is there a question about the inability to update statistics? Someone has locked the collection of statistics.

    How can we check if statistics collection has been locked? Are you talking about on the level of the db, or for a particular schema or its purpose? As far as I know in oracle 10g statistics are collected automatically (if I have a lot of m).

    Kind regards
    Imran Khan

    Published by: imran khan on December 24, 2012 07:33

    Well, as SB said, just look at the relevant information in the documentation for your version.

    If you don't have local copies of the documentation for your version, you can find copies for recent versions here:

    http://www.Oracle.com/technetwork/indexes/documentation/index.html

    (or docs.oracle.com or tahiti.oracle.com)

    I recommend you watch DBMS_STATS package and the [USER |] ALL THE | S/n] _TAB_STATISTICS view (s).

    Those who should have what you need.

  • Collect table statistics take longer for large tables

    Version: 11.2

    I noticed brings his stats (via dbms_stats.gather_table_stats) takes more time for the large tables.

    As number of rows must be calculated, collection of statistics on the table a big would naturally be a little longer (running COUNT (*) SELECT internal).
    But for a table not partitioned with 3 million lines, it took 12 minutes to retrieve the stats? Outside the County info and the row index what other information is collected for the table stats gather?

    Size of the Table is actually important for the collection of statistics?

    USER_TABLES DESC

    and also

    USER_IND_STATISTICS
    USER_PART_COL_STATISTICS
    USER_SUBPART_COL_STATISTICS
    USER_TAB_COL_STATISTICS
    USER_TAB_STATISTICS
    USER_TAB_STATS_HISTORY
    USER_USTATS
    USER_TAB_HISTOGRAMS
    USER_PART_HISTOGRAMS
    USER_SUBPART_HISTOGRAMS

  • Collection of statistics on partitioned and non-partitioned tables

    Hi all
    My DB is 11.1

    I find that the collection of statistics on partitioned tables are really slow.
    TABLE_NAME                       NUM_ROWS     BLOCKS SAMPLE_SIZE LAST_ANALYZED PARTITIONED COMPRESSION
    ------------------------------ ---------- ---------- ----------- ------------- ----------- -----------
    O_FCT_BP1                        112123170     843140    11212317 8/30/2011 3:5            NO                    DISABLED
    LEON_123456                      112096060     521984    11209606 8/30/2011 4:2           NO                   ENABLED
    O_FCT                           115170000     486556      115170 8/29/2011 6:3            YES         
    
    SQL> SELECT COUNT(*)  FROM user_tab_subpartitions
      2  WHERE table_name =O_FCT'
      3  ;
    
      COUNT(*)
    ----------
           112
    I used the following script:
    BEGIN
      DBMS_STATS.GATHER_TABLE_STATS(ownname          => user,
                                    tabname          => O_FCT',
                                    method_opt       => 'for all columns size auto',
                                    degree           => 4,
                                    estimate_percent =>10,
                                    granularity      => 'ALL',
                                    cascade          => false);
    END;
    /
    It costs 2 minutes for the first two tables to gather statistics respectively, but more than 10 minutes for the partitioned table.
    Time of collection of statistics represents a large part of the time of the whole lot.
    Most of the work of the lot are at full load, which case all partitions and subpartitions will be affected and we cannot collect just specified partitions.

    Does anyone have experiences on this subject? Thank you very much.

    Best regards
    Leon

    Published by: user12064076 on August 30, 2011 01:45

    Hi Leon

    Why don't collect you statistics to the partition level? If your data partitions will not change after a day (score range date for ex), you can simply do to the partition level

    GRANULARITY-online 'SCORE' for partition level and
    GRANULARITY-online 'SUBPARTITION' for subpartition level

    You collect global stats whenever you can not require.

    Published by: user12035575 on August 30, 2011 01:50

  • How to view the monthly/annual statistics in terms of time past/calories burned, broken down by each individual activity such as run elliptical/outside etc. Y at - it a third party application that can help me to collect and display these data?

    How to view the monthly/annual statistics in terms of time past/calories burned, broken down by each individual activity such as run elliptical/outside etc. Y at - it a third party application that can help me to collect and display these data?

    Hello

    It is not currently possible to review the data the application integrated in activity or training on this basis. If you want Apple to consider adding this feature, you can suggest here:

    https://www.Apple.com/feedback/watch.html

    However, health and fitness data from other sources, iPhone, and Apple Watch are registered and grouped within the health on iPhone app. These data can be exported, which you may find useful to track the cumulative progress and/or analyze your activity more in detail.

    IPhone app activity also has a button for sharing (top right of the screen) that allows to share data - including social media, Messages, Mail, Notes, and a printer.

    Include third-party applications that can be useful, for example:

    Access to QS

    -"Access your HealthKit data in a table so you can Explorer using numbers, Excel, R, or any other tool compatible CSV."

    - https://itunes.apple.com/gb/app/qs-access/id920297614?mt=8

    SpectaRun workouts

    -"View from the workouts of your Apple Watch on your iPhone and to export these workouts so you can download them to your favorite online running community."

    - https://itunes.apple.com/gb/app/spectarun-workouts/id991723862?mt=8

    Data can also be exported directly from the application of the health (Health Data > All - Share at the top button on the right).

    Check the descriptions and support resources for third party applications for supported details of import and data analysis features.

    More information:

    Use the activity on your Apple Watch - Apple Support

    Use of the workout on your Apple Watch - Apple Support

    http://www.Apple.com/watch/health-and-fitness/

  • XLS2COLLECTION in the collection date format

    Recently, I noticed the Date format imported into the collection as part of the XLS2COLLECTION is to come across as DD/MM/YYYY even if the XLS format is DD/MM/YYYY.  I can't seem to find a setting anywhere where it would change someone knows all the parameters that affect this format?

    XLS2COLLECTION

    I actually reached out to my contact at Oracle to get some clarification on this and he was kind enough to return after scanning through the code that is actually a HARD-CODED in the earphone date format.  He recommended to post something in the forum of listener to try and address the potential for improvement, but for now it looks like it's like that and in my case, I need to code exception to reformat the date in my application.

    Thanks for your comments to Mike!

  • Collection of statistics takes forever after adding new index - why?

    Hello everyone,

    I'm on Oracle 11.2.0.2. Collection of statistics for one of my paintings takes extremely long (several hours), and I don't know why.

    I'm inserting about 11,000 new records in a table with 5.3 million existing records using a INSERT INTO... SELECT...

    This insert takes a little more than 3 minutes

    Then I collect stats using:

    DBMS_STATS.gather_table_stats ('SCOTT', 'S_RMP_EVALUATION_CSC_MESSAGE', estimate_percent = > DBMS_STATS.) AUTO_SAMPLE_SIZE);

    It takes 2 hours.

    If the number of records increases, the time it takes for the stats increases (8 hours after 70,000 newly inserted records)

    I don't have this problem until recently, I created the I_S_RMP_EVAL_CSC_MSG_ACTIONSindex, but I do not understand why it would cause a radical change like that. Especially since the insertion of records to update the index takes only a few minutes.

    I'm writing the create for the table and the index statements in the table below.

    There are about 5.3 million records in the table. The table uses about 7.8 GB of space for the 'regular' table data and 37.6 GB for the LOB. Use the index:

    Index Space used

    I_S_EVALUATION_CSC_MSG_LMID:

    152 MB

    I_S_EVALUATION_CSC_MSG_IDLM:

    144 MB

    PK_S_RMP_EVALUATION_CSC_MESSAG:

    118 MB
    I_S_RMP_EVAL_CSC_MSG_ACTIONS:5 MB

    CREATE TABLE "QQRCSBI0"."S_RMP_EVALUATION_CSC_MESSAGE" 
    ( "ID" NUMBER(22,0) NOT NULL ENABLE, 
      "XML_MESSAGE_TEXT" CLOB, 
      "CREATION_TIME" TIMESTAMP (6), 
      "LAST_UPDATE_TIME" TIMESTAMP (6), 
      "NEXT_UPDATE_SYNC_TS" TIMESTAMP (6), 
      "SW_VERSION_XML" VARCHAR2(100 BYTE), 
      "DWH_LM_TS_UTC" DATE DEFAULT NULL NOT NULL ENABLE, 
      CONSTRAINT "PK_S_RMP_EVALUATION_CSC_MESSAG" PRIMARY KEY ("ID")
      USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "STAGING"  ENABLE
    ) SEGMENT CREATION IMMEDIATE 
    PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
    STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    TABLESPACE "STAGING" 
    LOB ("XML_MESSAGE_TEXT") STORE AS BASICFILE (
      TABLESPACE "STAGING" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION 
      NOCACHE LOGGING 
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
    ) ;
    
    
    CREATE INDEX "QQRCSBI0"."I_S_EVALUATION_CSC_MSG_IDLM" ON "QQRCSBI0"."S_RMP_EVALUATION_CSC_MESSAGE" ("ID", "DWH_LM_TS_UTC") 
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "STAGING" ;
    
    
    CREATE INDEX "QQRCSBI0"."I_S_EVALUATION_CSC_MSG_LMID" ON "QQRCSBI0"."S_RMP_EVALUATION_CSC_MESSAGE" ("DWH_LM_TS_UTC", "ID") 
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS NOLOGGING 
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "STAGING" ;
    
    
    CREATE BITMAP INDEX "QQRCSBI0"."I_S_RMP_EVAL_CSC_MSG_ACTIONS" ON "QQRCSBI0"."S_RMP_EVALUATION_CSC_MESSAGE" (DECODE(INSTR("XML_MESSAGE_TEXT",'<actions>'),0,0,1)) 
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
      STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
      TABLESPACE "STAGING" ;
    

    What causes this extreme long to collect statistics, and what I can do to fix that (apart from the removal of the index again)? Why collect stats lasts much longer than the update data and indexes?

    Thank you...

    It's a VIRTUAL column - Oracle does not store the value of the function in the table for each line, it simply records the description of the decisive function in the column definition in the data dictionary.  The index takes the calculated actual value (with the identifier of the line from each value), but Oracle does not have a mechanism to watch the index when collecting column statistics.  (In fact, such a mechanism could only be created for a single column still index).

    Concerning

    Jonathan Lewis

  • Harvest collection of statistics vs automatic statistics

    We intend to move statistical manual automatic statistics collection our oracle databases.

    Please share your opinion?

    also do you have any script tested for even where we can implement statistical manual collection our oracle databases.

    Help, please?

    Thank you

    Please share your opinion?

    Unless you have a specific situation, such as the coordination of statistics collection with the ETL batch process, create your own manual stats gathering scripts (which you will want to soon schedule/automate) lose your time and money to rebuild the features that you have already paid for as part of your Oracle license.

    If there is an advantage to writing your own scripts, these scripts will be specific to your environment and data. A script someone else that is generic enough to work in your environment will be little different than what the auto jobs.

    My recommendation:
    1 enter your manual stats gathering scripts (and ask questions here when you need help with questions specific). You will learn a lot about the statistics collection process and your own environment.
    2 compare the performance of the database and to explain the plans as part of your scripts to the performance and plans as part of integrated automatic employment.
    3. If after all that you measure the best performance with your scripts, then decide to spend; you will have the evidence to back up your decision and a set of scripts tested in support.

  • Collection of statistics

    It is said that, in order to allow the CBO work correctly, I need first "collection of statistics. Is this true? If so, no ORACLE "collection of statistics" automatically? or I have to run a package to "gathering statistics?



    Thank you


    Scott

    scottjhn wrote:
    It is said that, in order to allow the CBO work correctly, I need first "collection of statistics.
    Is this true?

    Yes

    If so, no ORACLE "collection of statistics" automatically? or,

    With V10 + statistics are collected once every 24 hours.

    I have to run a package to "gathering statistics?

    DBMS_STATS can be used manually to collect statistics

  • collection of statistics on a remote table

    Hello

    Is it possible and how to collect statistics on remote tables of non-Oracle?
    In my set up an Oracle Server (11g r2) is connected to an Oracle Server remote gateway to Oracle and DB2 server through ODBC gateway. All queries are distributed and heterogeneous, that is, the access data of the two remote servers. The query optimizer uses the real on remote tables from Oracle statistics, while for DB2 tables some default values are used. The difference between the default values and actual statistics is huge.
    I found in a user's guide this column selectivity cannot be collected for tables non-Oracle. Is it possible to collect general statistics such as number of rows from the tables? It would be different if I use DRDA gateway to access DB2?

    Concerning

    Ruslan,
    The HS_FDS_SUPPORT_STATISTICS = TRUE parameter is supported using DG4ODBC, even if it is not documented. However, as already said it depends on the ODBC driver and the database non-Oracle to what is returned when set.
    To see if it is used by the pilot, then check track of debug gateway. With the parameter set to true, then you should see explicit SQLStatistics ODBC calls. If these are not present then the parameter is to have no effect. You can also view an ODBC trace for these calls.

    Kind regards
    Mike

Maybe you are looking for

  • The upgrade to Vista seems impossible on Satellite U300

    I have a Satellite U300 psu30a, I come from it.He had the professional vista on and I wanted to put a partition on it... Make the partitions, formatted it. And when I used the recovery CD, it just now came back to XP instead of vista. Tried all the d

  • Satellite A205 - screwdriver-DVD Player problems

    I have a Toshiba Satellite A205My operating system is: Windows Vista: Home Premium, 32-bit operating system I have a RUG * A DVD-RAM UJ-850 s ATA DEVICE I haven't installed any strange software or had any new hardware installed, but the DVD player de

  • Windows not can find updates

    Error code: 80072EFE Windows update encountered an unknown error.

  • Windows Update and System Restore does not work after that the virus

    I recently had a virus on my computer, when I finally had removed my windows update does not work, my system restore will restore to any previous point and my computer seems to generally work more slowly.  Also groovemonitor seems still exists but is

  • Open an Adobe Reader attachment that is sent to me.

    The attachment shows a xls.x file, but when I try to open it after he drops the charges, it says that adobe Reader cannot open this file. It may be damaged. I can't open it in any other format either.