Best Way to gather statistics in 10g

Hi All,
What is the best way to gather optimizer statistics in 10g databases? We are currently following the default automatic statistics gathering feature of 10g. But we feel it has got some shortcomings. For many of the tables the stats are not up to date. Also we have hit one bug in 10g which can cause "cursor: pin S wait on X " during stats gathering (As given in metalink note).
So what do you experts feel about the issue. What would be the best way to gather stats=> manual or auto?
Regards
Satish

The right reply to your question is "it depends". It depends on your application systems,
the amount of change that your data suffers during time and your queries. You can choose what statistics to gather and when. You have to know your data and your application, though. There is no simple answer, right for everyone, which could be dispensed and set as a "golden
rule". The great site with many useful articles about statistics is Wolfgang Breitling's site:
www.centrexcc.com. That is for starters. Your question is far from trivial and is not easily answered. The best reply you can get is "it depends".

Similar Messages

  • Best practices for gathering statistics in 10g

    I would like to get some opinions on what is considered best practice for gathering statistics in 10g. I know that 10g has auto statistics gathering, but that doesn't seem to be very effective as I see some table stats are way out of date.
    I have recommended that we have at least a weekly job that generates stats for our schema using DBMS_STATS (DBMS_STATS.gather_schema_stats). Is this the right approach to generate object stats for a schema and keep it up to date? Are index stats included in that using CASCADE?
    Is it also necessary to gather system stats? I welcome any thoughts anyone might have. Thanks.

    Hi,
    Is this the right approach to generate object stats for a schema and keep it up to date? The choices of executions plans made by the CBO are only as good as the statistics available to it. The old-fashioned analyze table and dbms_utility methods for generating CBO statistics are obsolete and somewhat dangerous to SQL performance. As we may know, the CBO uses object statistics to choose the best execution plan for all SQL statements.
    I spoke with Andrew Holsworth of Oracle Corp SQL Tuning group, and he says that Oracle recommends taking a single, deep sample and keep it, only re-analyzing when there is a chance that would make a difference in execution plans (not the default 20% re-analyze threshold).
    I have my detailed notes here:
    http://www.dba-oracle.com/art_otn_cbo.htm
    As to system stats, oh yes!
    By measuring the relative costs of sequential vs. scattered I/O, the CBO can make better decisons. Here are the data items collected by dbms_stats.gather_system_stats:
    No Workload (NW) stats:
    CPUSPEEDNW - CPU speed
    IOSEEKTIM - The I/O seek time in milliseconds
    IOTFRSPEED - I/O transfer speed in milliseconds
    I have my notes here:
    http://www.dba-oracle.com/t_dbms_stats_gather_system_stats.htm
    Hope this helps. . . .
    Don Burleson
    Oracle Press author
    Author of “Oracle Tuning: The Definitive Reference”
    http://www.dba-oracle.com/bp/s_oracle_tuning_book.htm

  • Best way to manage 8i and 9i databases?

    Hi,
    I'm looking for the best way to manage 8i, 9i, 10g and 11g databases with EM (of course, upgrading the 8i databases is not an option). I successfully installed OMS 12c, but the 12.1 agent will not connect to the 8i databases. What are the alternatives?
    -The 10g agent can manage 8i, but will it be able to connect to 12.1 OMS?
    -If this doesn't work, I guess I would need a 12.1 OMS for 9i, 10g and 11g databases, and a 10g OMS for the 8i databases. Is this a viable solution? Can 10g and 12.1 OMS coexist within the same environment?
    I'm looking for the best scenario that actually works, I understand that anything that connects to 8i will not be supported.
    Thanks.

    Hi.
    I'm afraid you got it right.
    Let's distinguish between MONITORING- which is done by the agent and MANAGEMENT (administration, maintenance, performance management etc) - which is done directly from the OMS.
    According to my experience:
    OEM 10G is the last version that can fully MANAGE 8i databases.
    OEM 11G can MONITOR 8i databases (via a 10G agent) but cannot MANAGE them (or in other words ,the 11G OMS cannot connect to 8i databases).
    OEM 12C cannot MONITOR nor MANAGE 8i databases.
    If you use OEM to fully manage your 8i databases (and plan to continue doing so) I suggest you keep a dedicated OEM 10G installation for those databases.
    There's no problem using 2 different OMS installations and many organizations choose to do so for various reasons.
    The downsides are that you'll need to duplicate your OEM configurations (monitoring templates, rules etc) and of course- you won't be able to manage all databases in a single console...
    If you use OEM to only monitor the 8i databases, you can create a set of user defined metrics that will run against a 9i database and will connect to the 8i databases via DB Link.
    This solution is far from ideal but it might eliminate the need for maintaining another OMS installation if all you need is monitoring the 8i databases.
    Erez.

  • Best way to transfer a 10g database from HP9000 to Linux Redhat?

    What is the best way to transfer a 10g databasse from HP9000 to Linux Redhat?

    Hi Bill,
    What is the best way to transfer a 10g databasse from HP9000 to Linux Redhat?Define "best"? There are many choices, each with their own benefits . . .
    Fastest?
    If you are on an SMP server, parallel CTAS over a databaee link can move large amnunts of tables, fast:
    http://www.dba-oracle.com/t_create_table_select_ctas.htm
    I've done 100 gig per hours . . .
    Easiest?
    If you are a beginner, data pump is good, and I have siome tips on doing it quickly:
    http://www.dba-oracle.com/oracle_tips_load_speed.htm
    Also,, make sure to check the Linux kernel settings. I query http://www.tpc.org and search for the server type . . .
    The full disclosure reports show optimal kernel settings.
    Finally, don't forget to set direct I/O in Linux:
    http://www.dba-oracle.com/t_linux_disk_i_o.htm
    Hope this helps . . .
    Donald K. Burleson
    Oracle Press author
    Author of "Oracle Tuning: The Definitive Reference" http://www.rampant-books.com/book_2005_1_awr_proactive_tuning.htm

  • Best Way to Drop a 10g Database

    hi experts,
    This is 10g on Windows.
    I have 3 10g databases on this server and I need to drop and recreate 1 of the databases.
    What is the best way to get the cleanest, most thorough deletion?
    I'm thinking of doing:
    shutdown immediate;
    startup mount exclusive restrict;
    drop database;
    is there a better option?
    Thanks, John

    No.
    Though the "EXCLUSIVE" keyword is no longer required ... at least in 11gR1 and perhaps not in your version either.

  • Best way to upgrade 10g RAC

    Hello
    What is the best practice to upgrade Oracle 10g (10.2.0.4 )RAC with two physical nodes and one physical Data Guard to Oracle 11(12) RAC with Data Guard?
    Two RAC nodes are already quiet old, they have to replace probably. Maybe is the best way to build new parallel Oracle 12 RAC and then import data to them?
    What is your experiences, how should I act in order to upgrade my Oracle RAC to newest supported version?
    Thank you

    Hi,
    Please go through the following note:
    RACcheck Upgrade Readiness Assessment (see Note:  1457357.1)
    all the required steps/procedures available in this note.
    Regards,
    Imran Khan

  • Migrated new MBPro = slow . Best way to start again without same problem

    Hi
    I bought a Macbook Pro and on bootup I put my old powerbook with all my data into firewire mode and just migrated things across.
    I have been very disappointed with the MBPro speed and have tried to clean it up a bit as I am assuming that Migrating things across has caused this slowness.
    I am wanting to do a fresh install but need to get the critical things across
    these include my Photo Library in iPhoto and My emails and my iTunes library and my address book. and bookmarks.
    I will start from scratch with all the extra applications I have
    So when I reinstall what is the best way to achieve this ?
    I dont have .Mac accounts but I do have an external firewire hard drive.
    To explain where the system is slow it is mainly on boot up and loading for the first time. I checked what was running and everything loaded is a UB so PPC stuff using Rossetta. The spec on the MBPro is standard with the 160gb drive. The powerbook is a 1.5ghz with and upgraded 7200 rpm drive. So I also assume that the PBook drive is a fraction faster but as everything else is way faster in the MBPro I would of though that this would still make the MBPro at least as fast to boot and load things.
    It is not alot slower just a fraction but it is noticable. Once loaded the system seems fine and any cpu intensive stuff is way way faster
    Thanks

    slow startup could be a sign of directory damage, as normal part of the boot process is doing a directory check. booting up on the intel should be much faster, not the other way around. have you tried booting to the install disk and running disk repair?? http://docs.info.apple.com/article.html?artnum=106214 that may be all that is needed to get the boot faster. as well, do you have anything hooked up to the mbpro during startup?? that could also be a factor. as well, if you have not done firmware updates for the mbpro, you should do that as well. this article http://docs.info.apple.com/article.html?artnum=303880 gives up-to-date firmware versions and how to locate them on your mac. from what i gather there are limits in sharing one fw drive between a power pc and intel mac. see this thread. http://discussions.apple.com/thread.jspa?messageID=2950422&#2950422 here is the macosx hints discussion on creating a volume bootable by both types of computers. http://www.macosxhints.com/article.php?story=20060322054212363&query=firewire%2B drive%2Bintel however, you would have to have the space available on the drive, and the inclination to put two different versions (one power pc, one intel!) of the os on one drive, so both volumes are bootable, one with each computer.

  • Advice on best way to setup Disaster Recovery for SOA Suite 10.1.3.4

    Hi Everyone,
    I need some advice on the best way to setup Disaster Recovery for a SOA Suite 10.1.3.4 install deploying JSF/ADF OC4J applications.
    The way we are trying to do it at the moment is manually copy the "applications" and "applications-deployments" folders for the OC4J application on the production server, then compress and ship the files across to the DR application server nightly. (We don't require high availability).
    In the event of a disaster we then extract the files and copy to the OC4J instance (pre-created and configured) on the DR server. Unfortunately to date we haven't been able to reliably setup a DR application (seem to mostly get 404 errors etc), even though the OC4J application has its connection pool resolved to the DR database and is showing as "up" in the ASConsole.
    My question is, is there a more "native" way to do what we are trying to do. We do not have Enterprise version of SOA Suite or 11g database so any advanced recovery features are not an option. The setup is also stand alone, i.e. we are not using clustering or RAC etc.
    Any ideas would be really helpful.
    Thanks,
    Leigh.
    PS we are also running the production apps server with Oracle Application server 10g 10.1.2.3.0 as the HTTP apache server (with Forms, Reports and Discoverer deployed) and the SOA Suite 10.1.3 applications use the 10.1.2 HTTP server via the HTTP to AJP bridge. So the 10.1.3 OC4J instance is configured to use AJP on port range 12501 - 12600.

    For enterprise solutions, AS Guard would work.
    http://download.oracle.com/docs/cd/B25221_04/core.1013/b15977/disasrecov.htm#sthref303
    However, since advanced recovery options are not available (as you said), then what you are doing should not be too bad.
    AMN

  • Best way to handle text files in OD10g

    We have a requirement to store reports in text format into a database field, to be able to view the reports, and to print them if desired using Forms 10g. What is the best way to handle this?
    - define the field in the database as clob or blob?
    - if CLOB is the choice, what tools to use to upload CLOBs to the database (since webutil transfer is for blob only)?
    - in Forms 10g, can one use the Forms data type LONG for CLOB?
    - can you do Forms search on clob and blob fields?
    - how can reports that are stored in fields be viewed without first downloading to the client workstation?
    - in Forms 10g, what is the best way to view text files residing in local PCs: "host notepad myFile"?
    Thanks much for your reply!
    gk

    Take a deep breath. Relax. All is fine.
    iDVD does not look at the size of your video file, it looks at the length. iDVD can accomodate up to 2 hours of movie
    iDVD gives you different options depending on the length of your movie. Although I won't agree with your friend about reducing the length of your movie to 15 minutes, if you could trim out a few minutes to get it under an hour that setting in iDVD (Best Performance though the new version may have renamed it) gives you the best quality. Still, any iDVD setting will give you good quality even at 64 minutes
    In FCE export as Quicktime Movie NOT any flavour of Quicktime Conversion. Select chapter markers if you have them. If everything is on one system unchecked the Make Movie Self Contained button. Drop the QT file into iDVD

  • Best way to back out data changes after a release

    Hi,
    I'm trying to decide on the best way to backup some production data in case a release fails and we need to roll back the changes. This would be for data updates only, not schema changes. We have extremely limited access to production, and another team handles all the RMAN backups. The people who actually implement our releases are also pretty prone to mistakes.
    I have thought of two options. The tables we want to backup are about 9 MB total in size (it's about 10 codes tables).
    1. Create a bu table for each of the tables before the release. So for JENNSTABLE, we would create a JENNSTABLE_BU using CTAS. If we need to revert, we can drop JENNSTABLE and rename the JENNSTABLE_BU accordingly. The bu table would remain in production until the next release, where it would be reused again. This would be really easy to script and therefore avoid any mistakes by the production support team who implements our instructions. We would also be able to determine what values changed by querying the bu table at any time (currently old values are not retained anywhere).
    2. Use datapump to export the 10 tables, then truncate the tables and import the previously created files to restore the original data. I'm hesitant to use this method because I've never used datapump before, and as we don't have access to the servers, creating file system files makes me a little nervous. If I used a bu table, I can logon to the database and at least tell if it exists.
    Are there any preferred methods for doing this (besides restoring a table w/ RMAN)? Is there a best practice? Any advice is appreciated!
    -Jenn
    Oracle 10g
    UNIX Solaris

    Hi sb92075,
    That's a good suggestion. FLASHBACK_ON is set to no on my database, but if I understand correctly, I can still do a FLASHBACK TABLE and the undo data would be used. Is that correct?
    My concerns w/ using Flashback are ..
    1) The client might decide to rollback the changes a week after they've been executed. The undo data might not be available and the flashback would fail.
    2) If any of the following processes are part of the release, the flashback wouldn't work:
    "The following DDL operations change the structure of a table, so that you cannot subsequently use the TO SCN or TO TIMESTAMP clause to flash the table back to a time preceding the operation: upgrading, moving, or truncating a table; adding a constraint to a table, adding a table to a cluster; modifying or dropping a column; adding, dropping, merging, splitting, coalescing, or truncating a partition or subpartition (with the exception of adding a range partition)."
    Can you address those two issues? Thanks so much for taking the time to respond! This forum has helped me immensely with my work.
    -Jenn

  • What is the best way to migrate from Forms to ADF?

    We are in a big quagmire. Our company has been into Oracle Forms development for over 15 years. We have applications developed in Forms 6i and 10g. We have about 5 products and these 5 products have about 25 to 30 different versions. i.e. we maintain about 30 different versions of our applications. Each version of the application has about 100 forms and 100 reports.
    Now, since Forms has come to the End of life from 11g we want to move to ADF. We tried Forms to ADF migration tools but failed. So now we have decided to manually rewrite the applications in ADF.
    Our Forms / PL/SQL developers, designers and analysts (total about 40) are all Oracle Forms people. They have no experience in Java.
    What I want to know is:
    (1.) What is the BEST way to achieve this?
    (2.) Do we have to learn Java, JSF and ADF?? (i.e. All 3)?
    (3.) Is it mandatory to learn JSF??
    (4.) Assuming, comprehensive training can be given, how long will it take for Forms people to learn ADF?
    (5.) What type of training will be required?? (Java, JSF, ADF, JDeveloper etc.)
    (6.) How LONG will this take? i.e. to train all 40 and then get rewrite an application of 100+ forms and 100+ reports? (Ballpark is OK).
    (7.) Any other technologies we should learn??
    Edited by: user12240205 on Jul 18, 2012 5:48 AM

    Obvoiusly the longer you have for training the better but I think the minimum would be
    1) Java skills - I think to start off, 1 or two days reading something like Head First Java http://www.amazon.com/Head-First-Java-Kathy-Sierra/dp/0596009208
    2) I'd then get "The Quick Start Guide to Fusion Development" http://www.amazon.com/Quick-Start-Oracle-Fusion-Development/dp/0071744282/ref=sr_1_1?s=books&ie=UTF8&qid=1343201618&sr=1-1&keywords=jdeveloper+quick (declaration: I'm the author so have a vested interest, but I still think its a good place to start. - this should be about 2-3 days to read and also to try things out.
    3) In parallel I'd be watching these ADF Insider Basics http://www.oracle.com/technetwork/developer-tools/adf/learnmore/adfinsider-093342.html#a1 - a couple of hours
    4) I'd then try this tutorial http://www.oracle.com/webfolder/technetwork/tutorials/obe/jdev/obe11jdev/ps1/ria_application/developriaapplication_long.htm - 3 hours.
    5) Optionally, if you are coming from a Forms background I would also read http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/SummitADF/SummitADF_Redevelopment.pdf and watch http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/Forms_Redevelopment_ADF/Forms_Redevelopment_ADF.html - which is about 2 hours of work.
    I think this would be the absolute MINIMUM to at least be able to build some basic applications and to start feeling your way - everything else outlined in the "ADF COLLATERAL TOUR" http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/ADFTour/ADFTour.html could be learned as you start building some proof of concept. However, I'd wouldn't suggest you try building a real application with only one weeks exposure (in the same way I wouldn't expect you to design a product database with only one week training). I would probably expect your developers to have at least the above training and then spend about a month or so (minimum) building proof of concepts (or testing themselves with the ADF Insider Essentials Tasks). Furthermore, I'd probably expect you to have at least on senior developer/architect, with much more experience who can be making decisions on things like reuse, partitioning, architecture etc.
    Of course, this is all subjective but I hope it helps.
    regards
    Grant
    ps
    Of course, we also have formal Oracle University Training courses which you could attend (or they can be purchased to watch on line).

  • Whats the best way to get a copy of a clients DB onto an internal test DB?

    Hi there
    We have a client who hosts an Oracle 9i DB in house and we need to get a copy of this DB onto our own servers for testing purposes. What is the best way to go about doing this?
    I was reading about the data pump for exporting and importing [http://www.exforsys.com/tutorials/oracle-10g/oracle-10g-using-data-pump-export.html]
    Would this meet my requirements and how easy is it to do? Also what type of export would I need to do (there a 5+ schemas using different tablespaces)
    Sorry if this is all a bit vague, but i am not a DBA and have been tasked with doing this :(
    Thanks in advance,
    Toby
    edit: sorry i meant a 9i DB
    Edited by: redeye on Nov 5, 2009 11:21 AM

    If you want to export schemas/objects from 9i db you wouldn't be able to use datapump for exporting them,although you can import the dump file that will be created using the datapump.
    Determine what schemas you need at the test(destination) database, and then export them from the source(clients db) database.
    Also make sure that on the target database server, os paths where the oracle related files will be created(redo logs,datafiles...) are the same as the ones that are on the source database.

  • What is the best way to call a report from within a report

    What is the best way to call a report from within a report(master / Detail concept)
    A type of drill down report
    Oracle Database 10g
    Forms 10.1.2.0.2
    Report Builder 10.1.2.0.2

    Hi
    Have a look in this link, certainly you will get fix, if not just post a comment on blog, will get reply soon
    http://windows7bugs.wordpress.com/?s=oracle+10g+bug

  • Best way to insert in a table througth a database link

    Hi all,
    i have two databases (oracle 10g, windows 2003 server)
    Database A and Database B
    i need to insert data in a table (Table_A) that lives in database A
    The data i have to insert is in a table that lives a database B
    I have a database link from database B to database A
    so, connected to database B, i'm trying the following :
    insert into table_a@database_link_to_A
    select col1
    from table_b
    where col1 is not null
    This query is taking forever, and i have to cancel it.
    I'd like to hear from your experience. Wich is the best way to accomplish this task ?
    Best Regards
    Rui Madaleno
    NOTE: I forgot to mencion that Table_A does not have any trigger or indexes.
    Edited by: ruival on Jan 20, 2010 3:51 PM

    Try this:
    insert /*+ append */ into table_a@database_link_to_A select col1 from table_b where col1 is not nullOr
    Sqlplus COPY another option.
    [http://www.praetoriate.com/oracle_tips_dm_sqlplus_copy.htm]
    HTH
    -Anantha

  • How to gather statistics

    Hi folks!
    I gathered statistcs in one schema with folowing options:
    exec dbms_stats.gather_schema_stats(user,method_opt=>'FOR ALL COLUMNS SIZE 1',estimate_percent=>null,gather_temp=>false,cascade=>true,degree=>dbms_stats.auto_degree);Then:
    exec dbms_stats.gather_schema_stats(user,method_opt=>'FOR ALL COLUMNS SIZE SKEWONLY',estimate_percent=>null,gather_temp=>false,cascade=>true,degree=>dbms_stats.auto_degree);Now, I turn on table monitoring and suggest to gather statistics (per day) with that parameters:
    dbms_stats.gather_schema_stats(ownname =>user, options=>'GATHER STALE', gather_temp => false, cascade => true, estimate_percent => 100, degree => dbms_stats.auto_degree);Default method_opt is FOR ALL COLUMNS SIZE AUTO.
    Now I got better perfomance. How often I need to gather statstics?
    Thanks in advance.
    Best regards, Pavel.

    Thanks, I also think so.
    Little test-case:
    SQL>exec dbms_stats.gather_table_stats(user,'TABLE1',estimate_percent=>null);
    Elapsed: 00:00:01.03
    SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE1;
    COLUMN_NAME                                                                                NUM_DISTINCT  SAMPLE_SIZE
    DISGRP                                                                                             7944        33204
    DISMBR                                                                                            18948        33204
    TYPE                                                                                                  4        33204
    Elapsed: 00:00:00.03
    SQL> exec dbms_stats.gather_table_stats(user,'TABLE1',estimate_percent=>10);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:01.78
    SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE1';
    COLUMN_NAME                                                                                NUM_DISTINCT  SAMPLE_SIZE
    DISGRP                                                                                             3836         3269
    DISMBR                                                                                            13686         3269
    TYPE                                                                                                  4         3269
    Elapsed: 00:00:00.00
    SQL> exec dbms_stats.gather_table_stats(user,'TABLE1',estimate_percent=>100);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.52
    SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE1';
    COLUMN_NAME                                                                                NUM_DISTINCT  SAMPLE_SIZE
    DISGRP                                                                                             7944        33204
    DISMBR                                                                                            18948        33204
    TYPE                                                                                                  4        33204
    Elapsed: 00:00:00.01
    SQL> exec dbms_stats.gather_table_stats(user,'TABLE1',estimate_percent=>dbms_stats.auto_sample_size);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.53
    SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE1';
    COLUMN_NAME                                                                                NUM_DISTINCT  SAMPLE_SIZE
    DISGRP                                                                                             8448         5568
    DISMBR                                                                                            18948        33204
    TYPE                                                                                                  4         5568
    Elapsed: 00:00:00.00
    SQL> select count(distinct disgrp) from TABLE1;
    COUNT(DISTINCTDISGRP)
                     7944
    Elapsed: 00:00:00.02
    SQL> select count(distinct dismbr) from TABLE1;
    COUNT(DISTINCTDISMBR)
                    18948
    Elapsed: 00:00:00.03
    SQL> select count(distinct type) from TABLE1;
    COUNT(DISTINCTTYPE)
                      4
    Elapsed: 00:00:00.01
    SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE2';
    COLUMN_NAME                                                                                NUM_DISTINCT  SAMPLE_SIZE
    ID                                                                                               219120       219120
    UNIT                                                                                             114762       219120
    LOC                                                                                                  61       219120
    TIS                                                                                                1230       219120
    RTYP                                                                                                  3       219120
    Elapsed: 00:00:00.02
    SQL> exec dbms_stats.gather_table_stats(user,'TABLE2',estimate_percent=>null);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:07.61
    SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE2';
    COLUMN_NAME                                                                                NUM_DISTINCT  SAMPLE_SIZE
    ID                                                                                               219120       219120
    UNIT                                                                                             114762       219120
    LOC                                                                                                  61       219120
    TIS                                                                                                1230       219120
    RTYP                                                                                                  3       219120
    Elapsed: 00:00:00.00
    SQL> exec dbms_stats.gather_table_stats(user,'TABLE2',estimate_percent=>10);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:02.90
    SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE2';
    COLUMN_NAME                                                                                NUM_DISTINCT  SAMPLE_SIZE
    ID                                                                                               219950        21995
    UNIT                                                                                              70812        21995
    LOC                                                                                                  43        21995
    TIS                                                                                                 496        21995
    RTYP                                                                                                  3        21995
    Elapsed: 00:00:00.00
    SQL> exec dbms_stats.gather_table_stats(user,'TABLE2',estimate_percent=>50);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:03.70
    SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE2';
    COLUMN_NAME                                                                                NUM_DISTINCT  SAMPLE_SIZE
    ID                                                                                               218716       109358
    UNIT                                                                                              92338       109426
    LOC                                                                                                  61       109455
    TIS                                                                                                 994       109567
    RTYP                                                                                                  3       109422
    Elapsed: 00:00:00.00
    SQL> exec dbms_stats.gather_table_stats(user,'COMPS',estimate_percent=>100);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:04.37
    SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE2';
    COLUMN_NAME                                                                                NUM_DISTINCT  SAMPLE_SIZE
    ID                                                                                               219120       219120
    UNIT                                                                                             114762       219120
    LOC                                                                                                  61       219120
    TIS                                                                                                1230       219120
    RTYP                                                                                                  3       219120
    Elapsed: 00:00:00.00
    SQL> exec dbms_stats.gather_table_stats(user,'COMPS',estimate_percent=>dbms_stats.auto_sample_size);
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:03.81
    SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE2';
    COLUMN_NAME                                                                                NUM_DISTINCT  SAMPLE_SIZE
    ID                                                                                               217968        54492
    UNIT                                                                                             122237        54492
    LOC                                                                                                  31         5495
    TIS                                                                                                 240         5495
    RTYP                                                                                                  3         5495
    Elapsed: 00:00:00.01
    SQL> select count(distinct id) from TABLE2;
    COUNT(DISTINCTID)
               219120
    Elapsed: 00:00:00.27
    SQL> select count(distinct unit) from TABLE2;
    COUNT(DISTINCTUNIT)
                 114762
    Elapsed: 00:00:00.30
    SQL> select count(distinct loc) from TABLE2;
    COUNT(DISTINCTLOC)
                    61
    Elapsed: 00:00:00.06
    SQL> select count(distinct tis) from TABLE2;
    COUNT(DISTINCTTIS)
                  1230
    Elapsed: 00:00:00.09In that situation, auto_sample_size not bad? But estimate_percent=>100 - exact.
    Best regards, Pavel.

Maybe you are looking for

  • Compressor 3.5.1 crashing on Snow Leopard 10.6.2?

    I have problems with Compressor 3.5.1 crashing on Snow Leopard 10.6.2. It crashes on application launch. I have tried uninstalling Final Cut Studio completely using Jon Chappell's FCS Remover. After that I rebooted and then reinstalled completely fro

  • Comparing the "line" results of two Cubesets- is it possible?

    Hi all- I had asked this previously- I'm going to try again and hopefully be clearer about what I'm hoping to accomplish. I'm open to any way to accomplish this, although in the best possible world I'd be able to keep it inside one or more cubeformul

  • How to use ugm:getGroupNamesForUser tag in jsp

    when I use the tag in jsp ,run in server,the console write"weblogic.servlet cannot be resolved or is not a field <p><ugm:getGroupNamesForUser username="weblogic" id="weblogic"/>" I don't how to use it,please tell me,thank you!

  • Mail  Keeps  Sending  Me  To  The  Search  Page

    As the header says, everytime I try to access my MacMail, it keeps sending me to the Search Page. I have to go through the System Preferences to get my MacMail, Any Help Will Be Greatly Appreciated M.I. G5   Mac OS X (10.4.9)  

  • Lightroom 5 failing to install

    I am using a Mac OS x and when I try to download Lightroom 5 from creative cloud the installation always fails with this error message: Exit Code: 7 Please see specific errors below for troubleshooting. For example,  ERROR: DW006 ... ----------------