Analyze table in oracle 8.1.6

Hi,
I am working in oracle 8.1.6 on unix.the optimizer used here is RBO. I need to analyze a table using the command "analyze table <tablename> compute statistics; but my team mate said that the using anlyze table will degrade the performance.
how can i analyze a table without affecting the performance?...
give me an example..
rgds..

user537350 wrote:
hi,
i did defrag table using the command alter table move tablespace then rebuild the indexes and then analyze the table.
while doing the analyze of table my teammate said it will degrade the performance?..how can i proceed ..First, I wouldn't just blindly assume I have a problem to be fixed just because "my teammate" said that what I did would degrade performance. Did he have a valid theory to back up his assertion? Why not actually measure performance and see if it degraded?
BTW, I assume you realize that your vesion of oracle is totally unsupported in this millenium .... which means your organization doesn't value the data in the database.
Edited by: EdStevens on Aug 12, 2009 10:46 AM

Similar Messages

  • Analyze Table required on a Global Temp. Table

    Hi,
    This is the background. We have a Windows reporting Oracle Server where we write stored procedures to access data mainly based off a warehouse residing on a unix box. DBLinks have been setup and synonym's created .
    We create Global Temp. Tables to store temp. data used by our report stored procedures. I have one query that accesses 5 remote tables and one local table
    The query was taking hours to run...after some research i found out that when I did an "Analyze Table" on my Global temp. table, the query came back in a few minutes.
    My confusion is that this table being a GTT.. it will always be empty when we run "Analyze Table" on it. What information is oracle? Do we need to run "analyze table" on all our GTT's created for different reports?
    Second question on show query plan
    Also if I do a query plan on this query ORacle dooes not provide a plan on the remote tables. If i change the query by removing the reference to the local table and hardcoing some vlaues, oralce returns a query plan for the query which now only uses the remote tables. Is this correct?

    Hi,
    you can fake the statistics of the temporary table.
    First create a real table (with indexes) that looks like the temporary table. Load the table with representative data.
    Then
    dbms_stats.gather_table_stats(ownname=>'schemauser',tabname=>'TEMPCOPY');
    dbms_stats.create_stat_table(ownname=>'schemauser',stattab=>'TEMPSTATS');
    dbms_stats.export_table_stats(ownname=>'schemauser',tabname=>'TEMPCOPY',stattab=>'TEMPSTATS'); --do that for every index
    dbms_stats.export_index_stats(ownname=>'schemauser',indname=>'INDEXNAME',stattab=>'TEMPSTATS');Now we import the generated statistics:
    dbms_stats.import_table_stats(ownname=>'schemauser',tabname=>'TEMPTABLE',stattab=>'TEMPSTATS');
    dbms_stats.import_index_stats(ownname=>'schemauser',tabname=>'TEMPTABLE',stattab=>'TEMPSTATS'); --for every indexOf course you can create a set of statistics and load them as needed.
    Dim
    dbms_stats.

  • How to find out when data was deleted from table in oracle and Who deleted that

    HI Experts,
    Help me for below query:
    how to find out when data was deleted from table in oracle and Who deleted that ?
    I did that to fidn out some data from dba_tab_modifications, but I m not sure that what timestamp shows, wether it shows for update,insert or delete time ?
    SQL> select TABLE_OWNER,TABLE_NAME,INSERTS,UPDATES,DELETES,TIMESTAMP,DROP_SEGMENTS,TRUNCATED from dba_tab_modifications where TABLE_NAME='F9001';
    TABLE_OWNER                    TABLE_NAME                        INSERTS    UPDATES    DELETES     TIMESTAMP         DROP_SEGMENTS TRU
    PRODCTL                        F9001                                                     1683         46       2171            11-12-13 18:23:39             0                   NO
    Audit is enable in my enviroment?
    customer is facing the issue and data missing in the table and I told him that yes there is a delete at 11-12-13 18:23:39 in table after seeing the DELETS column and timestamp in dba_tab_modifications, but not sure I am right or not
    SQL> show parameter audit
    NAME                                 TYPE        VALUE
    audit_file_dest                      string      /oracle/admin/pbowe/adump
    audit_sys_operations                 boolean     TRUE
    audit_syslog_level                   string
    audit_trail                          string      DB, EXTENDED
    please help
    Thanks
    Sam

    LOGMiner --> Using LogMiner to Analyze Redo Log Files
    AUDIT --> Configuring and Administering Auditing

  • How to calculate the percentage of free space for a table in Oracle

    okay, I am a little confused here. I have been searching the web and looking at a lot of documents. What I basically want to find out is this, how do I calculate the difference between the number of bytes a table is using and the total bytes allocated to a table space (going that way to get percent free for a particular table). So I need a byte count of a table and total table space and the percentage difference. I have been looking at the DBA_TABLES DBA_TABLESPACES and DBA_SEGMENTS views. I have tried to calculated the space as num_rows * avg_row_len (if I am wrong, let me know). I have been trying to compare that calculation to the number in DBA_TABLESPACES and DBA_SEGMENTS. I am just looking for the total space allocated to the table space that the table sits in (seem logical right now) to make the percentage value work. Thus I want to be able to track the table as it grows as compated to the table space it sits in to see a value as it changes over time (days, weeks, etc.) each time I run this script I am working on.
    Can someone get me straight and help me to find out if I am looking in the right places. Any advice would help.
    Edward

    You can use a little modified version of dbms_space from Tom, show_space. Have a look,
    SQL> create table test222 as select * from all_objects;
    Table created.
    SQL> delete from test22 where rownum<=100;
    delete from test22 where rownum<=100
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> delete from test222 where rownum<=100;
    100 rows deleted.
    SQL> analyze table test222 compute statistics;
    Table analyzed.
    SQL>  create or replace procedure show_space
      2  ( p_segname in varchar2,
      3    p_owner   in varchar2 default user,
      4    p_type    in varchar2 default 'TABLE',
      5    p_partition in varchar2 default NULL )
      6  -- this procedure uses authid current user so it can query DBA_*
      7  -- views using privileges from a ROLE and so it can be installed
      8  -- once per database, instead of once per user that wanted to use it
      9  authid current_user
    10  as
    11      l_free_blks                 number;
    12      l_total_blocks              number;
    13      l_total_bytes               number;
    14      l_unused_blocks             number;
    15      l_unused_bytes              number;
    16      l_LastUsedExtFileId         number;
    17      l_LastUsedExtBlockId        number;
    18      l_LAST_USED_BLOCK           number;
    19      l_segment_space_mgmt        varchar2(255);
    20      l_unformatted_blocks number;
    21      l_unformatted_bytes number;
    22      l_fs1_blocks number; l_fs1_bytes number;
    23      l_fs2_blocks number; l_fs2_bytes number;
    24      l_fs3_blocks number; l_fs3_bytes number;
    25      l_fs4_blocks number; l_fs4_bytes number;
    26      l_full_blocks number; l_full_bytes number;
    27
    28      -- inline procedure to print out numbers nicely formatted
    29      -- with a simple label
    30      procedure p( p_label in varchar2, p_num in number )
    31      is
    32      begin
    33          dbms_output.put_line( rpad(p_label,40,'.') ||
    34                                to_char(p_num,'999,999,999,999') );
    35      end;
    36  begin
    37     -- this query is executed dynamically in order to allow this procedure
    38     -- to be created by a user who has access to DBA_SEGMENTS/TABLESPACES
    39     -- via a role as is customary.
    40     -- NOTE: at runtime, the invoker MUST have access to these two
    41     -- views!
    42     -- this query determines if the object is a ASSM object or not
    43     begin
    44        execute immediate
    45            'select ts.segment_space_management
    46               from dba_segments seg, dba_tablespaces ts
    47              where seg.segment_name      = :p_segname
    48                and (:p_partition is null or
    49                    seg.partition_name = :p_partition)
    50                and seg.owner = :p_owner
    51                and seg.tablespace_name = ts.tablespace_name'
    52               into l_segment_space_mgmt
    53              using p_segname, p_partition, p_partition, p_owner;
    54     exception
    55         when too_many_rows then
    56            dbms_output.put_line
    57            ( 'This must be a partitioned table, use p_partition => ');
    58            return;
    59     end;
    60
    61
    62     -- if the object is in an ASSM tablespace, we must use this API
    63     -- call to get space information, else we use the FREE_BLOCKS
    64     -- API for the user managed segments
    65     if l_segment_space_mgmt = 'AUTO'
    66     then
    67       dbms_space.space_usage
    68       ( p_owner, p_segname, p_type, l_unformatted_blocks,
    69         l_unformatted_bytes, l_fs1_blocks, l_fs1_bytes,
    70         l_fs2_blocks, l_fs2_bytes, l_fs3_blocks, l_fs3_bytes,
    71         l_fs4_blocks, l_fs4_bytes, l_full_blocks, l_full_bytes, p_partition);
    72
    73       p( 'Unformatted Blocks ', l_unformatted_blocks );
    74       p( 'FS1 Blocks (0-25)  ', l_fs1_blocks );
    75       p( 'FS2 Blocks (25-50) ', l_fs2_blocks );
    76       p( 'FS3 Blocks (50-75) ', l_fs3_blocks );
    77       p( 'FS4 Blocks (75-100)', l_fs4_blocks );
    78       p( 'Full Blocks        ', l_full_blocks );
    79    else
    80       dbms_space.free_blocks(
    81         segment_owner     => p_owner,
    82         segment_name      => p_segname,
    83         segment_type      => p_type,
    84         freelist_group_id => 0,
    85         free_blks         => l_free_blks);
    86
    87       p( 'Free Blocks', l_free_blks );
    88    end if;
    89
    90    -- and then the unused space API call to get the rest of the
    91    -- information
    92    dbms_space.unused_space
    93    ( segment_owner     => p_owner,
    94      segment_name      => p_segname,
    95      segment_type      => p_type,
    96      partition_name    => p_partition,
    97      total_blocks      => l_total_blocks,
    98      total_bytes       => l_total_bytes,
    99      unused_blocks     => l_unused_blocks,
    100      unused_bytes      => l_unused_bytes,
    101      LAST_USED_EXTENT_FILE_ID => l_LastUsedExtFileId,
    102      LAST_USED_EXTENT_BLOCK_ID => l_LastUsedExtBlockId,
    103      LAST_USED_BLOCK => l_LAST_USED_BLOCK );
    104
    105      p( 'Total Blocks', l_total_blocks );
    106      p( 'Total Bytes', l_total_bytes );
    107      p( 'Total MBytes', trunc(l_total_bytes/1024/1024) );
    108      p( 'Unused Blocks', l_unused_blocks );
    109      p( 'Unused Bytes', l_unused_bytes );
    110      p( 'Last Used Ext FileId', l_LastUsedExtFileId );
    111      p( 'Last Used Ext BlockId', l_LastUsedExtBlockId );
    112      p( 'Last Used Block', l_LAST_USED_BLOCK );
    113  end;
    114
    115  /
    Procedure created.
    SQL> desc show_space
    PROCEDURE show_space
    Argument Name                  Type                    In/Out Default?
    P_SEGNAME                      VARCHAR2                IN
    P_OWNER                        VARCHAR2                IN     DEFAULT
    P_TYPE                         VARCHAR2                IN     DEFAULT
    P_PARTITION                    VARCHAR2                IN     DEFAULT
    SQL> set serveroutput on
    SQL> exec show_space('TEST222','SCOTT');
    BEGIN show_space('TEST222','SCOTT'); END;
    ERROR at line 1:
    ORA-00942: table or view does not exist
    ORA-06512: at "SCOTT.SHOW_SPACE", line 44
    ORA-06512: at line 1
    SQL> conn / as sysdba
    Connected.
    SQL> grant sysdba to scott;
    Grant succeeded.
    SQL> conn scott/tiger as sysdba
    Connected.
    SQL> exec show_space('TEST222','SCOTT');
    BEGIN show_space('TEST222','SCOTT'); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00201: identifier 'SHOW_SPACE' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    SQL> exec scott.show_space('TEST222','SCOTT');
    PL/SQL procedure successfully completed.
    SQL> set serveroutput on
    SQL> exec scott.show_space('TEST222','SCOTT');
    Unformatted Blocks .....................               0
    FS1 Blocks (0-25)  .....................               0
    FS2 Blocks (25-50) .....................               1
    FS3 Blocks (50-75) .....................               0
    FS4 Blocks (75-100).....................               1
    Full Blocks        .....................             807
    Total Blocks............................             896
    Total Bytes.............................       7,340,032
    Total MBytes............................               7
    Unused Blocks...........................              65
    Unused Bytes............................         532,480
    Last Used Ext FileId....................               4
    Last Used Ext BlockId...................           1,289
    Last Used Block.........................              63
    PL/SQL procedure successfully completed.
    SQL>http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5350053031470
    I use this to find the space allocations.
    Just read your post again,this is not going to show you the percentage of the free/used space. This is going to be the number of blocks which are free/used. For the growth trend, you can look at (in 10g) Oracle EM. It has added now,Segment Growth Trend report which can show you for each object,comparing to the allocated space to the object,how much space is being used by it.
    HTH
    Aman....

  • Discoverer Tables in Oracle Apps

    Hello All,
    We have implemented Oracle Financials 11i (11.5.9) and Discoverer 4i. We have around 300 discoveror reports.Out of these we think we can amalgmate few and can make them more generic .To do that I need to go through every single report to check parameters, columns and list them.
    Now my question :-
    Iinstead of opening every single report manualy and list parameter/columns I am thinking to extract parameters/columns through SQL, does anyone have idea which oracle schema/table hold oracle discoverer columns/parameters etc ?
    Note : I am able to track table name for discoverer table and that is
    EUL4_US.EUL4_DOCUMENTS
    Any suggestion/help is highly appreciated.
    Thanks
    Dinesh

    Hi Dinesh
    I have some bad news for you I'm afraid. Discoverer workbooks are not stored as SQL definitions, they are stored as BLOBs within the database. It is therefore not possibly to write any sort of query to interrogate the inner workings of a workbook. The only way to do this is to open each workbook in turn and analyze it.
    Sorry to be the bringer of bad news
    Best wishes
    Michael

  • Analyze table

    Dear all,
    What are the advantages if we do
    analyze table <table name> compute statisticsWhen ever i run this it is computing huge CPU utilization and taking long time........
    if we do this as far as i know
    1)it will analyze the table and count number of rows in a table properly.......
    Is there any advantage for INDEX if we do this operation.
    Regards,
    Vamsi

    Hey,
    Actually this command is old. I think it is 9i and below; It is still there for backwards compatibility.
    Since you are computing the statitics, oracle is going over all the records to get the stats. You can do estimate statics instead.
    OR, even better, you can use the new DBMS_Stats Package:
    EXEC DBMS_STATS.GATHER_TABLE_STATS (ownname=>'SCHEMA_NAME', tabname => 'TABLE_NAME', estimate_percent=>dbms_stats.auto_sample_size, degree=>2);
    This uses DBMS stats package, to estimate the statistics via a sample size automatically set through oracle.
    You can also use a similar command to estimate the stats of the whole schema
    EXEC DBMS_STATS.GATHER_SCHEMA_STATS (ownname=> 'SCHEMA_NAME', estimate_percent=>dbms_stats.auto_sample_size, degree=>2);
    From previous experience, creating an index is not enough, you have to gather the stats on the related table, so that the execution plan gets optimized.
    This command get table stats, histogram, uniqueness.. etc

  • Where is the output of analyze table name validate structure cascade

    Hi,
    database version:8.1.7.0.0
    os :solaris 5.9
    since i used to get ORA-00600: INTERNAL ERROR CODE, ARGUMENTS: [25012], [7], [39] and i need to validate the table and this table is very huge(200 gb) where will be the output generated if any error is there in table including indexes.
    sql>analyze table event_t validate structure cascade;
    Regards
    Prakash

    Hello Helios
    sorry ,
    I am using 10.2 and reviewing
    http://docs.oracle.com/cd/B14117_01/server.101/b10759/statements_4005.htm#sthref4205
    my quote is from this document. My question of an ideal case, when there is no block corruption
    regards ,
    Pavel
    Edited by: Pavel on Oct 17, 2012 3:55 AM

  • ORA-20000: Unable to analyze TABLE "ECI"."COUNTRY"

    Oracle9i 9.2.0.7 on Windows Server 2003 32bit
    Using the "ANALYZE" in the Enterrpise Manager Console
    begin
    dbms_stats.gather_table_stats(ownname=>'ECI',tabname=>'COUNTRY',partname=>NULL);
    end;
    ORA-20000: Unable to analyze TABLE "ECI"."COUNTRY", insufficient priviledges or does not exist
    ORA-06512: at "SYS.DBMS_STATS", line 10292
    ORA-06512: at "SYS.DBMS_STATS", line 10315
    ORA-06512: at line 2
    Using SQLPLUS
    SQL>begin
    2>dbms_stats.gather_table_stats(ownname=>'ECI',tabname=>'country',partname=>NULL);
    3>end;
    4>/
    ORA-20000: Unable to analyze TABLE "ECI"."COUNTRY", insufficient priviledges or does not exist
    ORA-06512: at "SYS.DBMS_STATS", line 10292
    ORA-06512: at "SYS.DBMS_STATS", line 10315
    ORA-06512: at line 2
    COMMENT:I noticed here that eventhough I specifically used (tabname=>'country') it still used "ECI"."COUNTRY"(ALL CAPS) in executing my statement
    I also tested on other procedure.
    Using SQLPLUS
    SQL>begin
    2>dbms_redefinition.can_redef_table('ECI','country',dbms_redefinition.cons_use_pk);
    3>end;
    4>/
    BEGIN
    ERROR at line 1:
    ORA-00942: table or view does not exist
    ORA-06512: at "SYS.DBMS_REDEFINITION", line 8
    ORA-06512: at "SYS.DBMS_REDEFINITION", line 247
    ORA-06512: at line 2
    I don't understand why this error happens because
    a) the schema and table exist (I double checked)
    b) the error only happens on a single schema for only the old tables, when I create new tables I could "ANALYZE" it. I also can "ANALYZE" the indexes.
    c)I have used both the sys and system user logging in as SYSDBA
    In the ff exercise, I noticed that "ECI"."productrange" will work but "ECI"."PRODUCTRANGE" won't:
    SQL>select count(*) from "ECI"."productrange";
    COUNT(*)
    8
    SQL>select count(*) from "ECI"."PRODUCTRANGE";
    select count(*) from "ECI"."PRODUCTRANGE"
    ERROR at line 1:
    ora-00942: TABLE OR VIEW DOES NOT EXIST
    Can anyone kindly help me?

    You should not be creating tables in Oracle with names enclosed in double quotes. In that case Oracle preserves the case, making it difficult for others to identify the table.
    Create the table without using double quotes (may be CTAS) and everything should work fine.

  • Analyze table after insert a large number of records?

    For performance purpose, is it a good practice to execute an 'analyze table' command after inserting a large number of a records into a table in Oracle 10g, if there is a complex query following the insert?
    For example:
    Insert into foo ...... //Insert one million records to table foo.
    analyze table foo COMPUTE STATISTICS; //analyze table foo
    select * from foo, bar, car...... //Execute a complex query whithout hints
    //after 1 million records inserted into foo
    Does this strategy help to improve the overall performance?
    Thanks.

    Different execution plans will most frequently occur when the ratio of the number of records in various tables involved in the select has changed tremendously. This happens above all if 'fact' tables are growing and 'lookup' tables stayed constant.
    This is why you shouldn't test an application with a small number of 'fact' records.
    This can happen both with analyze table and dbms_stats.
    The advantage of dbms_stats is, it will export the current statistics to a stats to table, so you can always revert to them using dbms_stats.import_stats.
    You can even overrule individual table and column statistics by artificial values.
    Hth
    Sybrand Bakker
    Senior Oracle DBA

  • ORA-04092 trying to analyze table

    Hi,
    I was trying to analyze some tables issuing:
    analyze table owner.table_name compute statistics;
    Immediately raises the ora-04092, as far as I seen, read, and googled, this ORA error occurs only when someone try to commit inside a trigger, but clearly this is not the case.
    And even in some web applications this error appears.
    This error started to occur after session limit exceeded, doesn't sound related to me, but maybe it can be interesting information.
    Any suggestions please, I'm comfused.
    Regards

    Here more information:
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    TNS for Linux: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SO: RHELAS 5
    And according recomendation, I tryed to use DBMS_STAT, with same results:
    SQL> conn system/*******@siin
    Connected.
    SQL> conn mailedu/*******@siin
    ERROR:
    ORA-04092: cannot COMMIT in a trigger
    ERROR:
    ORA-24315: illegal attribute type
    Warning: You are no longer connected to ORACLE.
    SQL> conn mailedu/********@siin
    ERROR:
    ORA-24315: illegal attribute type
    SQL> conn system/********@siin
    ERROR:
    ORA-24315: illegal attribute type
    Once I restart sqlplusw, and I could connect (just the first connect is successfull) I tryed with dbms_stats:
    SQL> exec dbms_stats.gather_schema_stats ( -
    ownname => 'MAILEDU', -
    options => 'GATHER' );BEGIN dbms_stats.gather_schema_stats ( ownname => 'MAILEDU', options => 'GATHER' ); END;
    ERROR at line 1:
    ORA-04092: cannot COMMIT in a trigger
    ORA-06512: at "SYS.DBMS_STATS", line 14002
    ORA-06512: at "SYS.DBMS_STATS", line 13974
    ORA-06512: at line 1
    Looking further inside the forum I found this thread:
    stupid ora-04092 error message
    In the conversation it is mentioned that according document Link:[7886990|https://metalink.oracle.com/CSP/ui/flash.html#tab=KBHome(page=KBHome&id=()),(page=KBNavigator&id=(bmDocDsrc=Bug&bmDocTitle=AFTER%20OCCURRING%20ORA-18,%20ORACLE%20THROWS%20ORA-4092%20CONTINOUSLY&bmDocID=7886990&viewingMode=1143&from=BOOKMARK&bmDocType=BUG))]
    it can occur after ORA-00018 maximum number of sessions exceeded
    this one is my scenario,
    And...
    Bug No: 6977167
    Filed 16-APR-2008 Updated 19-AUG-2009
    Product Oracle Server - Enterprise Edition Product Version 10.2.0.2
    Platform Linux x86-64 Platform Version rel4
    Database Version 10.2.0.2 Affects Platforms Generic
    Severity Severe Loss of Service Status Development to Q/A
    Base Bug N/A Fixed in Product Version 11.2
    So I would like to mark this as a known bug, but I don't know how to proeced.
    Regards

  • Sql slow afterweekly STATS-JOB,then run analyze table it is fast again

    Oracle R11.2.0.2 :
    I hade some slow sql / reports and found the effect,
    that the sql is slow obvious after the weekend ,
    when STATS - JOB BSLN_MAINTAIN_STATS_JOB and other Jobs were running weekly on SYS.
    I did run dbms_stats.GATHER_TABLE_STATS on schema
    it doesn't help.
    But when
    run ANALYZE TABLE afterwards on only one or two tables of the schema
    the sql / reports performance is well and fast.
    in the dba_tables I can see the last_analyze - date
    and in GLOBAL_STATS = NO ( when Table runs with ANALYZE ),
    GLOBAL_STATS = YES( when Table runs with STATS )
    what does the ANALYZE TABLE command doing good and let my sql run well and fast,
    while dbms_stats.GATHER_TABLE_STATS
    seems not work well in this situation ?
    regards

    astramare wrote:
    Oracle R11.2.0.2 :
    I hade some slow sql / reports and found the effect,
    that the sql is slow obvious after the weekend ,
    when STATS - JOB BSLN_MAINTAIN_STATS_JOB and other Jobs were running weekly on SYS.
    I did run dbms_stats.GATHER_TABLE_STATS on schema
    it doesn't help.
    What options do you use for the gather_stats command ?
    Do you also have collected system stats?
    But when
    run ANALYZE TABLE afterwards on only one or two tables of the schema
    the sql / reports performance is well and fast.Analyze table is deprecated, but still does its work for some part. It is not as complete as dbms_stats
    >
    in the dba_tables I can see the last_analyze - date
    and in GLOBAL_STATS = NO ( when Table runs with ANALYZE ),
    GLOBAL_STATS = YES( when Table runs with STATS )
    It must have to do something with the way you use it..
    HTH
    FJFranken

  • Question about Analyze Table

    Hi Guys,
    I am creating an Oracle Job that performs two tasks:
    1.) Delete record from a Table A older than 30 days.
    2.) Perform Analyze Table to the Table A after deleting records.
    The thing that makes me think is that aside from the job I'm creating, there are other jobs/processes that accesses Table A.
    Will there be any problem that may occur once my job performs the Analyze Table to Table A and other jobs/process are also accessing Table A concurrently (e.g. inserting, querying)?
    I'll surely appreciate any idea from you guys!
    Thanks,
    Jay

    Other than the IO load that it causes, the ANALYZE statement has no effect on other sessions while it is running+.
    However, on completion, it will invalidate all SQLs referencing that table. All new invocations of SQLs will need re-parsing and may generate a new Execution Plan, different from those for the same statements before the ANALYZE. Rrunning SQLs already begun will continue running until they complete.
    If you have a job / session / application that frequently queries the table, you might suddenly see a change in execution plan for those queries after the ANALYZE completes.

  • ANALYZE TABLE ... VALIDATE STRUCTURE

    I did ANALYZE TABLE ... VALIDATE STRUCTURE CASCADE. MetaLink says output
    is in trace file in udump location. Well it is not. Does anyone
    know where Oracle does hide this info?

    Oracle is not hiding anything.
    There will be only info when there is something wrong.
    Rather than discussing irrelevant issues like defragmenting tablespaces, rebuilding indices etc,etc why don't you start reading the documentation?
    You seem to have too much time on your hands.
    Sybrand Bakker
    Senior Oracle DBA

  • What analyze table command will do exactly?

    Hi,
    Can any one tell me what this analyze table command will do when we execute it??? Please help me out.
    Cheers,
    Senthil

    Which database version?
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_4005.htm#i2086320
    See the NOTE on that link.
    Basically, unless there is a bug in DBMS_STATS where the recommended workaround is to use ANALYZE use DBMS_STATS instead.

  • Analyze table command

    what is Analyze table command,please clear with example,using this command how to find how many rows in table

    Manual pages for Analyze command.
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_4005.htm#i2086320
    Pay special attention to the part where it says Oracle strongly recommends using dbms_stats package from now on instead of analyze.
    You can find out the number of rows in the table by doing a select count(*) from the table. Or, if the most recent statistics are good enough, you can look at user_tables (in the num_rows column).

Maybe you are looking for