Analyzing schema in 9i

Dear Guru's,
DB_VERSION=9.2.0.8
OS_VERSION=Windows
I have rebuilded the Indexes of a schema say "ORACLE" User.
Now i need to Analyze the schema
SQL> exec dbms_stats.gather_schema_stats(ownname=>'ORACLE',estimate_percent=>dbms_stats.auto_sample_size,cascade=>true);
BEGIN dbms_stats.gather_schema_stats(ownname=>'ORACLE',estimate_percent=>dbms_stats.auto_sample_size,cascade=>true); END;
ERROR at line 1:
ORA-01476: divisor is equal to zero
ORA-06512: at "SYS.DBMS_STATS", line 10502
ORA-06512: at "SYS.DBMS_STATS", line 10996
ORA-06512: at "SYS.DBMS_STATS", line 11183
ORA-06512: at "SYS.DBMS_STATS", line 11237
ORA-06512: at "SYS.DBMS_STATS", line 11214
ORA-06512: at line 1I think this is not working since the database is not on 10g and it's in 9i.
QWhich command shall i use for Analyzing  Schema when it comes to 9.2.0.8 database user ? Thanks in advance
Edited by: user12000301 on Sep 21, 2012 8:22 AM
Edited by: user12000301 on Sep 21, 2012 8:23 AM

Possibly a known bug
Bug 5645718 - ORA-1476 gathering statistics with DBMS_STATS [ID 5645718.8]
HTH
Srini

Similar Messages

  • How to run analyze schema

    Hi Guys .
    Please how do you RUN analyze schema or database or table?
    I have ran gather all schema statistics and now my told to run analyze schema by my boss .. How do you do this please?
    Platform is 11.5.9
    OS: solarais
    Thanks in advance

    Look at the SQL Area report for your database. If you see more than maybe 1 SYS query in the top ten, you need to gather stats for SYS as well (9i and above).
    SQLAREAT.SQL - SQL Area, Plan and Statistics for Top DML (expensive SQL in terms of logical or physical reads)
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=238684.1
    Collecting Statistics with Oracle Apps 11i
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=368252.1

  • Analyze schema portal30?

    What is the prevailing wind concerning creating DB statistics for the portal30 schema in an effort to improve performance?
    This is a 3.0.7 installation and performance seems to be degrading the longer it is in existence. I am having the users go through their modules and deleting older versions, can this help? The create index scripts that are floating around for the 3.0.8 installation will not work in 3.0.7. The database indicates that the majority of rows are returned via full-table-scans rather than index-lookups, hence my desire to analyze the portal30 schema. Any ideas or thoughts? Thanks you.

    Dont do it! Portal will break, I belive it is rule based. I did it with the same idea at heart and I was not able to edit any components until I deleted the statistics for the portal schema.
    null

  • Relation analyze schema and chaining?

    Hi there,
    I have some SQL's that I use daily to get some basic information about my database's health. One of them warns me about chaining or row migration.
    - at first no warnings about chaining/row migr.
    - then execute of analyze_schema utility
    - now chaining/row migr.warnings for some tables.
    Is there a relation? Can execution of dbms_utility.analyze_schema cause chaining/row migration?
    Regards,
    Georges

    Can execution of dbms_utility.analyze_schema cause chaining/row migration?No. The problmes were there prior running analyze, statistics just weren't up to date.
    AFAIK one should nonetheless use dbms_stats.gather_schema_stats instead of dbms_utility.analyze_schema.
    -Antti

  • Analyze schema

    Hi,
    I am running " exec sys.dbms_utility.analyze_schema ('SIEB','COMPUTE'); " It has been running now for over 5hrs.. Should it take this long, is there any way to find out what it is actually doing and to make sure it has not hung. I want to check the analyze is actually running..?
    Any Help / advice will be much appreciated.
    Regards,
    H

    Refer to this:
    http://www.psoug.org/reference/dbms_stats.html
    Sample:
    =======
    exec dbms_stats.gather_schema_stats( -
    ownname => 'SCOTT', -
    options => 'GATHER AUTO', -
    estimate_percent => dbms_stats.auto_sample_size, -
    method_opt => 'for all columns size repeat', -
    cascade => true, -
    degree => 15 -
    i would suggest you to go through the documentation.

  • Analyze table to flush cache

    Hi
    In the Oracle 8i Concepts book it states that
    "when the ANALYZE statement is used to update or delete the statistics of a table, cluster, or index, all shared SQL areas that contain statements referencing the analyzed schema object are flushed from the shared pool".
    I ANALYZEd a table on my server but when I subsequently looked in V$SQLAREA statements referencing the table were still there.
    Any ideas ?
    Richard Hennessy

    Hi
    In the Oracle 8i Concepts book it states that
    "when the ANALYZE statement is used to update or delete the statistics of a table, cluster, or index, all shared SQL areas that contain statements referencing the analyzed schema object are flushed from the shared pool".
    I ANALYZEd a table on my server but when I subsequently looked in V$SQLAREA statements referencing the table were still there.
    Any ideas ?
    Richard Hennessy

  • Analyze commad

    Hi,
    Is there anyone who can give me information about Analyze command.
    I would like to know what is the use of analyze command. why we Analyze schemas or tables. Please give me some Info. if you can. tell me where I can find the info about this in Oracle documentation.
    Thanks

    If you do a search on "analyze" or "CBO" (Cost Based Optimizer) on http://tahiti.oracle.com, you'll get plenty of hits.
    Justin

  • TOP 10 things you should AVOID in a OLTP DB

    So, what do you think?
    Who wants to give a contribuition?
    I vote on flooding the server with very cold water, but what the hell do i know?
    This post is serious, please give you're expert opinion.
    Cheers! And enjoy.

    This post is serious, please give you're expert opinion.OK, here are mine:
    http://www.dba-oracle.com/t_worst_practices.htm
    Inadequate Indexing - One of the top causes of excessive I/O during SQL execution is missing indexes, especially function-based indexes, and failure to tune the instance according to the SQL load is a major worst practice. It's no coincidence that the Oracle 10g SQLAccess advisor recommends missing indexes.
    Poor optimization of initialization parameters - The worst Oracle practice of all is undertaking to tune your SQL before these global parameters have been optimized to the workload.
    Poor Schema Statistics Management - The Oracle worst practice (before 10g automatic statistics collection) was to re-analyze the schema on a schedule, forgetting that the purpose of re-analyzing schema statistics is to change your production execution plans. This worst practice has become so commonplace that it has been dubbed the "Monday Morning Suprise". Shops with strict production change control procedures forget that analyzing the production schema can effect the execution of thousands of SQL statements.
    Poor change control testing - This is the worst of the worst practices, where an Oracle shop relies on a "test case proof" to preview how a database change will effect production behavior.
    No performance tracking - With STATSPACK (free) and AWR in Oracle10g, there is no excuse for not tracking your database performance. STATSPACK and AWR provide a great historical performance record and set the foundation for DBA predictive modeling.
    HTH . . . .
    Donald K. Burleson
    Oracle Press author

  • Oracle 10.2.0.3 performance issue

    Hi all,
    I have a performance issue in the database I currently maintain.
    Here's the specifications:
    - Windows 2003 Server 64bit
    - Oracle 10g 10.2.0.3 patch 31
    - Application Server 10gR2 OC4J (Forms and Report Services)
    The server was re-installed about 3 weeks ago after it got viruses.
    I believe my setup on the memory parameters were fine because for two weeks the system ran fine and the end of day process is also increasing in terms of time.
    However, starting 2 days ago in the middle of no where, the end of day process started to get really slow (from 11 minutes became 1 hour).
    The IT standby in my client will normally do an analyze schema and after that every thing will be back to normal again.
    I turned off the GATHER_STATS_JOB 2 weeks ago and replaced it with DBMS_STATS.GATHER_DATABASE_STATS which I scheduled to execute every Friday.
    This problem occurred even before the server was re-installed and as usual, analyze schema (GATHER_SCHEMA_STATS) will fix it.
    I don't have much options currently, and analyzing the schema seems to be the only solution which normally we never do for other clients (at not everyday analyzing schema).
    I hope any of you could help me out with any solution on how to trace the exact problem on this.
    Thank you,
    Adhika

    Hi Satish,
    This end of day process basically will insert some values to certain tables and also generating reports afterward.
    I managed to get the AWR report within the time of the end of day process.
    sql execute elapsed time is on the top of Time Model Statistics.
    What I don't understand here is why is this issue happened only after 2 weeks?
    I suspected that this might be because Oracle pick the wrong execution plan, and normally a wrong execution plan caused by outdated statistics on the indexes and tables, but what I cannot understand is why this is happening on Monday morning where in Friday night GATHER_DATABASE_STATS ran successfully.
    Yesterday when the analyze schema was executed again, this morning I got another email saying that the performance issue occurred again.
    The top most wait events are: db file sequential read, db file scattered read, log file parallel write, LNS Wait on SENDREQ, and log file sequential read.
    Thank you,
    Adhika

  • Query does not uses indices

    I am using 10.2.0.1 database instance and wrote a SQL query which involves several tables but I had made sure all columns in where clause has got proper indexes. The query is fairly simple does not use any function etc. in where clause but inner joins.
    I have analyzed schema statistics using dbms_stats.gather_schema_stats... procedure and also added new required indexes to support this query.
    Now when I see explain plain for this query it still does full table scan? I do not understand why it is not using indices and does full table scan.
    Any comments?

    Pgoel,
    The plan that you posted with the proper tags to help when reading the plan:
    | Id  | Operation                     | Name               | Rows  | Bytes | Cost  | Time      |
    | 0   | SELECT STATEMENT              |                    |       |       |   279 |           |
    | 1   |  HASH UNIQUE                  |                    |   692 |  130K |   279 |  00:00:04 |
    | 2   |   NESTED LOOPS                |                    |   692 |  130K |   247 |  00:00:03 |
    | 3   |    HASH JOIN                  |                    |    12 |  2184 |   223 |  00:00:03 |
    | 4   |     HASH JOIN                 |                    |    12 |  2028 |   212 |  00:00:03 |
    | 5   |      HASH JOIN                |                    |    12 |  1608 |   203 |  00:00:03 |
    | 6   |       HASH JOIN               |                    |  3855 |  248K |    45 |  00:00:01 |
    | 7   |        HASH JOIN              |                    |  3855 |  132K |    20 |  00:00:01 |
    | 8   |         TABLE ACCESS FULL     | COD_SCHED_ITEMS    |  3970 |   39K |     6 |  00:00:01 |
    | 9   |         HASH JOIN             |                    |  3064 |   75K |    13 |  00:00:01 |
    | 10  |          INDEX FAST FULL SCAN | COD_SCHED_POLICY_PK|  3064 |   24K |     3 |  00:00:01 |
    | 11  |          TABLE ACCESS FULL    | COD_SCHEDULE       |  3155 |   52K |     9 |  00:00:01 |
    | 12  |        TABLE ACCESS FULL      | COD_ASSET          |  4982 |  151K |    25 |  00:00:01 |
    | 13  |       TABLE ACCESS FULL       | COR_ACL            |   46K | 3124K |   157 |  00:00:02 |
    | 14  |      TABLE ACCESS FULL        | COR_POLGROUP       |  3236 |  111K |     8 |  00:00:01 |
    | 15  |     TABLE ACCESS FULL         | COR_BASE_PRICE     |  3247 |   41K |    11 |  00:00:01 |
    | 16  |    INDEX RANGE SCAN           | QAM_LOG_URI_IX     |    58 |   580 |     2 |  00:00:01 |
    ----------------------------------------------------------------------------------------------Obtaining the plan from the 10053 trace was likely a minor goal of Sybrand when he suggested activating the trace. The plan implies that the cost based optimizer determined that Oracle would require 0.04 seconds to execute the plan and return the data. Does it take much longer than 0.04 seconds for the query to execute?
    As Sybrand pointed out, the 10053 trace shows the decisions made by the cost based optimizer when trying to determine the most efficient plan. If a potential step in the plan is determined to be more expensive (costly, assumed to require more time to execute) than a previously found method, the potential plan step is aborted. This process continues until one of:
    * All join order possibilities have been tried (8! = 40,320 possible)
    * 2,000 join order possibities have been tried
    * The continued examination of join combinations will require more time than Oracle predicts for the execution of the query.
    * And probably something else.
    The process and decisions made by the cost based optimizer are included in the 10053 trace. For some reason, possibily bad statistics, inappropriate initialization parameters, cardiality calcuation problems, or something else, Oracle calculated that retrieving the data from the tables using a full tablescan is less costly than an index access path. The 10053 trace will show why that happened.
    Charles Hooper
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

  • Overview, which Jobs are scheduled and which haven't finished successfully

    We are using GridControl jobs to administrate several databases (e.g. execute exports, analyze schemas, etc.). All of these jobs are scheduled...
    The "Home" tab of the GridControl GUI has the information "All target jobs" with "Problem executions" and "Suspended executions" - but what we would
    like to have is a view, which contains the job-names and their status.
    I've looked through the data-dictionary of the GridControl repository and found several tables and views which contain all kind of informations about the
    jobs.
    Does anybody already know, how to setup a view with the needed informations?
    We can't use the tab "Job activity" since the result of the view should be mailed to the developers...
    Any help will be appreciated...
    Rgds
    JH

    we are rather new to GridControl and not very experienced with the reports. I thought that just the already defined report-categories could be used.
    I went through the reports but couldn't find any report which is related to jobs.
    But thansks for your suggestion - we will try to create a report...

  • Lot of reads on datafile

    Hi,
    Oracle Version : 10.2.0.3
    Operating system : Linux
    We are facing histogram for wait event: db file sequential read and one of the data file is having lot of reads here is the out put regarding read and writes on datafiles.
    FILE_NAME|TABLESPACE_NAME|PHYRDS|PHYWRTS|PHYBLKRD|PHYBLKWRT|READTIM|WRITETIM
    /u02/oradata/PAVS/DATAFILE/o1_mf_sysaux_3009nc4t_.dbf|SYSAUX|126465922|21801339|149411701|33512014|18207957|1573788
    /u02/oradata/PAVS/DATAFILE/o1_mf_system_3009mxdj_.dbf|SYSTEM|80814600|2633018|134311002|3523532|13040158|405217
    /u03/QFUNDVS_DATA.dbf|QFUNDVS_DATA|42815767|71238703|204079399374|83018465|1561712841|4379779
    /u03/oradata/perfstat01.dbf|PERFSTAT|35332882|4436734|135997567|5776784|64242597|455643
    /u02/oradata/PAVS/DATAFILE/o1_mf_undotbs1_3009n8bm_.dbf|UNDOTBS1|27385552|14470664|27385548|34694423|18204635|2208441
    /u03/QFUNDVSPROD.dbf|QFUNDVSPROD|26787064|4866641|108496253|5941012|7551293|267220
    /u02/QFUNDVS_INDX.dbf|QFUNDVS_INDX|6806994|3281736|9679295|4160141|19754970|380101
    /u02/oradata/PAVS/DATAFILE/o1_mf_users_3009njwd_.dbf|USERS|49365|21973|49365|21973|53688|805
    /u03/oradata/QFUNDVS_INDX2_02.dbf|QFUNDVS_INDX2|9620|1398|15765|5186|2392|117
    /u03/oradata/QFUNDVS_DATA_02.dbf|QFUNDVS_DATA|2559|1430|4405|1775|925|79
    /u02/oradata/PERFSTAT_02.dbf|PERFSTAT|369|659|369|1198|549|45
    /u02/QFUNDVS_INDX2.dbf|QFUNDVS_INDX2|-1411725084|157349624|4063145153|174397410|420478849|8722442in the above output the datafile /u03/QFUNDVS_DATA.dbfis having lot of I/o
    Please help me how to solve this problem.
    Thanks & Regards,
    Pooran Prasad.S

    Hi sybrand_b ,
    I am not good at performance tuning and need help.
    Here my problem is two day back we face some performance problem while fetching data and i get a call from onsite regarding the problem .Yesterday what i did is i analyze all the schema object and after analyzing schema objects yesterday it went fine with out any performance problem but again today we get the same problem .
    because of one query we are getting lot's of i/o problem and in explain plan for that query there is no full table scan alos and it using index only .
    In OEM ADDM report shows the below recommendations
    Recommendations
    Show All Details | Hide All Details     
    Details     Category     Benefit (%) [Sorted in descending order]
    [Select to hide information] Hide     Segment Tuning     31.5
    Action     Investigate application logic involving I/O on TABLE "QFUNDVSPROD.ST_LO_MASTER" with object id 47453.
         Database ObjectQFUNDVSPROD.ST_LO_MASTER
    Rationale     The I/O usage statistics for the object are: 0 full object scans, 2483123 physical reads, 277 physical writes and 0 direct reads.
    Rationale     The SQL statement with SQL_ID "fa6mx2hx4fy02" spent significant time waiting for User I/O on the hot object.
    SQL TextSELECT DS.LOAN_CODE,C.SSN,C.LAST_NAME,C.FIRST_NAME,CI.NEXT_PAY_DATE, DS.BO_CHECK...
    SQL IDfa6mx2hx4fy02
    Rationale     The SQL statement with SQL_ID "19pd4gfx07c1z" spent significant time waiting for User I/O on the hot object.
    SQL TextSELECT DS.LOAN_CODE, DS.BO_CODE, CASE WHEN DS.LOAN_CODE IN (SELECT CS.LOAN_CODE ...
    SQL ID19pd4gfx07c1z
    Rationale     The SQL statement with SQL_ID "d8n7z2d3hhc5f" spent significant time waiting for User I/O on the hot object.
    SQL TextSELECT F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14 FROM (SELECT...
    SQL IDd8n7z2d3hhc5f
    Rationale     The SQL statement with SQL_ID "c51yw06mhpp0s" spent significant time waiting for User I/O on the hot object.
    SQL TextSELECT BO_CODE, CUSTNM, CUSTADDRESS, PHONE_NUM, IS_DONT_CONTACT, NVL(TO_CHAR(MAX...
    SQL IDc51yw06mhpp0s
    Rationale     The SQL statement with SQL_ID "1frqrk7sd1zhb" spent significant time waiting for User I/O on the hot object.
    SQL TextSELECT F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,F13,F14,F15,F16,F17,F18,F19 FROM (...
    SQL ID1frqrk7sd1zhbCan you please guide me how to proceed .
    Thanks & Regards,
    Pooran Prasad.S

  • Schema analyzing is taking too much time.

    Hi All,
    A schema analyze in our database that should take max 2hours.It has been running for last 18 hours.
    So, what i need to check for that.
    Ranjan

    Handle:      788442
    Status Level:      Newbie
    Registered:      Aug 14, 2010
    Total Posts:      87
    Total Questions:      25 (18 unresolved)
    so many questions & so few answers.
    A schema analyze in our database that should take max 2hours.based upon what evidence do you make this claim?
    It has been running for last 18 hours.post SQL & results that provides proof above is true
    You can NOT necessarily depend upon LAST_ANALYZED to determine if/when statistics were last run.
    ANALYZE has been obsoleted & replaced by DBMS_STATS
    do as below so we can know complete Oracle version & OS name.
    Post via COPY & PASTE complete results of
    SELECT * from v$version;

  • Analyze Table Or Schema

    when we want to query the dba_tables or user_tables to find the no of rows in a particular table or no of rows of all the tables then why do we need to analyze that particual table or schema to get the num_rows columns values??

    "RTFM" is the best teacher always"
    When you analyze the table:
    Oracle collects the following statistics for a table. Statistics marked with an
    asterisk are always computed exactly. Table statistics, including the status of
    domain indexes, appear in the data dictionary views USER_TABLES,
    ALL_TABLES, and DBA_TABLES in the columns shown in parentheses.
    ->"Number of rows (NUM_ROWS) "
    -> * Number of data blocks below the high water mark (that is, the number of data
    blocks that have been formatted to receive data, regardless whether they currently
    contain data or are empty) (BLOCKS)
    -> * Number of data blocks allocated to the table that have never been used (EMPTY_BLOCKS)
    -> Average available free space in each data block in bytes (AVG_SPACE)
    -> Number of chained rows (CHAIN_COUNT)
    -> Average row length, including the row's overhead, in bytes (AVG_ROW_LEN) Jameel

  • Script to Analyze multiple schemas at same time

    Hi Guys,
    I'm looking for a script by which I can analyze (estimate 25%) multiple schemas (In Oracle 9i Database) at same time. I know we can use dbms_utility but do not know, how to use for multiple schemas (around 60 schemas). I appreciate your cooperation.
    Thanks in advance.
    Regards,
    Sanjeev

    Hi Syed,
    Thanks for response,
    can u tell me how I can analyze multiple schema by using dbms_stats at same time. I would appriciate if you can send any script for me for same.
    Thanks,
    Sanjeev
    [email protected]

Maybe you are looking for