How to Gather Statistics of Tables and Indexes

Hi all,
Plz help me in Gathering Statistics of Tables and Indexes.
Thanks

for tables
exec dbms_stats.gather_table_stats('SCOTT', 'EMPLOYEES');
for indexes
exec dbms_stats.gather_index_stats('SCOTT', 'EMPLOYEES_PK');
check this link for detail
http://nimishgarg.blogspot.com/2010/04/oracle-dbmsstats-gather-statistics-of.html

Similar Messages

  • How Find space Used by Tables and Indexes

    Dear All(s)
    How i check space used (and number of rows) by each table and index in schema. ( can i check current space utilization and sysdate-date past in time)
    How i can check used, and free space for each database and tablespace.
    Thanks

    You can always use the search feature
    anyway
    how to calculate the percentage of free space for a table in Oracle
    Re: incorrect free space in dba_free_space
    These links could give you all the necessary info

  • How to identify frequently accessed tables and indexes

    Hi,
    Could some one give me the exact queries to identify the frequently accessed Tabels and Indexes
    Regards
    Naveen

    Hi,
    depends from your definition of "frequently accessed" but i this you can use a query like this:
    select owner,object_name, sum( value)
    from V$SEGMENT_STATISTICS
    where OBJECT_TYPE='TABLE'
    and owner='NAVEEN_4_EX'
    and STATISTIC_NAME in ('logical writes','logical reads')
    group by owner,object_name
    h.h.
    Sam

  • Display statistics history of tables and indexes

    hi,
    in display statistics history of tables and indexes i can see only one year old table history, how we can check the table history for more than one year?
    Thanks,
    Nithin

    Welcome to SDN,
    Please search on help.sap.com or SDN before you post your query to avoid duplicate thread.
    I think below link will clear your doubt. help.sap.com/saphelp_nw70ehp1/helpdata/en/a6/8c933bf687e85de10000000a11402f/frameset.htm

  • How to partition tables and indexes in this scenario?

    So our situation is pretty simple. We have 3 tables.
    A, B and C
    the model is A->>B->>C
    Currently A, B and C are range partitioned on a key created_date however it's typical that only C is every qualfied with created date. There is a foreign key from B -> A and C -> B
    we have many queries where the data is identified by state that is indexed currently non partitioned on columns in A ... there are also indexes on the foreign keys that get from C -> B -> A. Again these are non partitioned indexes at this time.
    It is typical that we qualify A on either account or user or both. There are indexes (non partitioned) on these
    We have a problem now because many of the queries use leading wildcards ie. account like '%ACCOUNT' etc. This often results in large full table scans. Our solution has been to remove the leading wildcard but this isn't always possible.
    We are wondering how we can benefit from partitioning and or sub partitioning table A. since it's partitioned on created_date but rarely qualify by that.
    We are also wondering where and how we can benefit from either global partitioned index or local partitioned indexes on tables A. We suspect that the index on the foreign key from C to B could be a local partitioned index.
    I am also wondering what impact pushing the state from A that's used to qualify A down to C would have any advantage.
    C is the table that currently we qualify with the partition key so I figure if you also pushed down the state from A that's used to qualify the set of C's we want based on the set of B's we want based on the set of A thru qualfying on columns within A.
    If we push down some of those values to C and simply use C when filtering I'm wondering what the plans will look like compared to having to work all the way up from the bottom to the top before it begins qualifying A.
    Edited by: steffi on Jan 14, 2011 11:36 PM

    We are wondering how we can benefit from partitioning and or sub partitioning table A. since it's partitioned on >created_date but rarely qualify by that. Very good question. Why did you partition on it? You will never have INSERTS on these partitions, but maybe deletes and updates? The only advantage (I can think of) would be to set these partitions in a read only tablespace to ease backup... but that's a weired reason.
    we have many queries where the data is identified by state that is indexed currently non partitioned on columns in >A ... there are also indexes on the foreign keys that get from C -> B -> A. Again these are non partitioned indexes at >this time.Of course. Why should they be partitioned by Create_date?
    It is typical that we qualify A on either account or user or both. There are indexes (non partitioned) on these
    We have a problem now because many of the queries use leading wildcards ie. account like '%ACCOUNT' etc. This >often results in large full table scans. Our solution has been to remove the leading wildcard but this isn't always possible.I would suspect full index scan. Isn't it?
    We are also wondering where and how we can benefit from either global partitioned index or local partitioned >indexes on tables A. We suspect that the index on the foreign key from C to B could be a local partitioned index.As A is not accessed by any partition, why should C and B profit? You should look to partition by the key you are using to access. But, you are looking to tune your SQLs where the access is like '%ACCOUNT' on A. Then when there is a match. ORACLE joins via your index and nested loop (right?) to B and C.
    I am also wondering what impact pushing the state from A that's used to qualify A down to C would have any >advantage.Why should it. It just makes the table and indexes larger => more IO.
    C is the table that currently we qualify with the partition key so I figure if you also pushed down the state from A >that's used to qualify the set of C's we want based on the set of B's we want based on the set of A thru qualfying >on columns within A.If the access from A to C would be .. AND A.CREATE_DATE =C.CREATE_DATE and c.key like '%what I want%' which does not qualifify for a FK ;-) then, as that could be resulting in a partition scan, you could "profit". But, I'm sure that's not your model.
    If we push down some of those values to C and simply use C when filtering I'm wondering what the plans will look >like compared to having to work all the way up from the bottom to the top before it begins qualifying A.So you want to denormalize A,B,C and into one table? With the same access is like '%ACCOUNT' you would get a full scan on an index as before, just the objects would be larger due to redundance and harder to maintain. In the end you would have a bad and slower design.
    Maybe you explain what the problem is.
    Full index scan can not be avoided, but that can be made faster by e.g. parallel query, and then the join to B and C should be a "snip" if you just identify a small subset of rows in these tables.

  • Missing Tables and Indexes

    Hi all,
    we have checked "missing table and indexs" status with DBACOCKPIT and there it show 362 Indexes are not created.
    all are the standard table indexes.
    we have updated the indexes and statistics with BRCONNECT also.and its complited successfully.after this also "it show 362 Indexes are not created". we are using SOLARIS OS and oracle database.
    Can anybody help me out how to rebuilt the missing indexes .....plz mention the steps.
    Thanks,
    Rableen   khurana

    Hi,
    Refer to the note and lins on how to fix it
    Note 1320008 - DBA Cockpit: Selection in "Missing Tables and Indexes"
    http://wiki.sdn.sap.com/wiki/display/TechTSG/(DB)IndexReportedasMissing
    http://help.sap.com/saphelp_nwpi711/helpdata/en/33/5b277b8b0745b8b60e67ca04c77ebb/content.htm
    Thanks,
    Arjun

  • DB02 view is empty on Table and Index analyses  DB2 9.7 after system copy

    Dear All,
                 I did the Quality refresh by System copy export/import method. ECC6 on HP-UX DB29.7.
    After Import Runstats status n Db02 for Table and Index analysis was empty and all value showing '-1'. Eventhough
    a) all standard backgrnd job scheduled in sm36
    b) Automatic runstats are enabled in db2 parameters
    c) Reorgchk all scheduled periodically from db13 and already ran twice.
    4) 'reorgchk update statistics on table all' was also ran on db2 level.
    but Run stats staus in db02 was not getting updated. Its empty.
    Please suggest.
    Regards
    Vinay

    Hi Deepak,
    Yes, that is possible (but only offline backup). But for the new features like reclaimable tablespace (to lower the high watermark)
    it's better to export/import with systemcopy.
    Also with systemcopy you can use index compression.
    After backup and restore you can have also reclaimable tablespace, but you have to create new tablespaces
    and then work with db6conv and online table move to move one tablespace online to the new one.
    Best regards,
    Joachim

  • Report to find all table and index sizes

    Hi all,
    Good day..
    Is there any report.sql or so to find out the sizes of all the tables and indexes in a database.
    thanks,
    baskar.l

    1.To get table size
    What will be the table size if?
    <or>
    break on report
    set line 200
    COMPUTE SUM LABEL "Total Reclaimable Space" OF "KB Free Space" ON REPORT
    column "Table Size" Format a20
    column "Actual Data Size" Format a20
    column "KB Free Space" Format "9,99,999.99"
    select table_name,
    round((blocks*8),2)||'kb' "Table size",
    round((num_rows*avg_row_len/1024),2)||'kb' "Actual Data size",
    pct_free,
    round((blocks*8),2) - (round((blocks*8),2)*pct_free/100) - (round((num_rows*avg_row_len/1024),2)) "KB Free Space"
    from user_tables
    where round((blocks*8),2) - (round((blocks*8),2)*pct_free/100) - (round((num_rows*avg_row_len/1024),2)) > 0
    order by round((blocks*8),2) - (round((blocks*8),2)*pct_free/100) - (round((num_rows*avg_row_len/1024),2)) desc
    2.To get index size
    How to size the Index
    Hth
    Girish Sharma

  • Missing Tables and Indexes in 3.5

    Hi,
    when i am executing Tcode DB02 then under Missing Tables and Indexes i find 35 Indexes as not created.
    can anybody tell me what does that signify. is this a issue if so how to fix it.
    Indexes not created
    ADCP-I04
    ADCP-I03
    ADCP-I02
    ADCP-I01
    ADCPS-I01
    ADCPS-I02
    ADCPS-I03
    ADCPS-I04
    ADRC-I14
    ADRC-I11
    ADRC-I05
    ADRC-I02
    ADRC-G
    ADRP-I01
    ADRP-I02
    ADRP-I03
    ADRP-I04
    ADRP-I07
    ADRP-I08
    ADRP-I09
    ADRV-I01
    BUT000-PER
    CDHDR-001
    CDHDR-002
    CRMD_ORDERADM_I-PKI
    CRMD_ORDERADM_I-DES
    ISSUE_RELATION-001
    NAST-ADQ
    RMPS_T_RESUB-RAG
    RMPS_T_RESUB-RCU
    SSPICSPRHD-S02
    SSPICSTRHEAD-S01
    SSPICSTRPL-FLD
    STXH-TDN
    SWBRULECOM-RSY
    Rakesh

    Hi Rakesh,
    First thing this is not an issue but an information that says that these indexes are not be created in the System.
    This option Indexes not created is an SAP table maintained from Dev to Prod just to indicate that these indexes cannot be created.
    That's the reason why u have a green mark beside them and this will make clear for you that this is not an issue.
    Hope it helps!!!!
    Thanks & Regards,
    Neelesh Jain.

  • DB02 = Missing Tables and Indexes = Unknown objects in ABAP Dictionary = DB views

    Hi SAP Gurus,
    on our SAP NetWeaver 7.x BW (based on AIX/Oracle) I find via transaction DB02 (path = Diagnostics => Missing Tables and Indexes) under "Unknown objects in ABAP Dictionary" under DB views a BW object /BI0/.....
    When I make a double click on the object, I am getting the popup window "Display not possible for this object":
    How can I identify the object and clarify with the BW application expert, if needed, how to resolve this object?
    I searched already via RSA1 for the object, but I wasn't able to find anything so far ...
    Thanks for your help and ideas.
    Best regards
    Carlos

    Hello Carlos
    The database view in question is a temporary database object created during a query execution.
    Please read this SAP note 449891 - Temporary database objects in BW 3.x to understand what that view is all about and impact if those views are removed.
    The SAP notes 449891 and 1139396 suggests to run the report SAP_DROP_TMPTABLES to drop these temporary objects. Whether the objects are still required or not is a question to be put across to the BW team. If the temporary objects are removed when they are used by a query, then the query will fail.
    Have a nice day
    RB

  • Import dumpfile with seperate tablespaces for table and index

    Hi,
    We have a schema for which the its tables are stored in seperate tablespace and indexes are stored in different tablespace. Now we have take full schema export. Now we want to import it on another schema. Now I want to know if the we have difference in the tablespace name we use REMAP_TABLESPACE clause of the impdp command but what about the seperate tablespace for table and indexes. How would Oracle handle this.
    Regards,
    Abbasi

    Hi,
    I hope you created the same tablespace structure on the target side if not so remap_tablespace option you have to use for specifying different tablespaces.Oracle will take care of putting data and index.Any how if a index is moved from one tablespace to other you have to rebuild them,once you rebuild them than only stattistics are gathered otherwise you
    might face some performance issue.
    Better option is to keep same tablespace structures in source and target environment.
    Best regards,
    Rafi.
    http://rafioracledba.blogspot.com
    Edited by: Rafi (Oracle DBA) on May 9, 2011 7:07 AM

  • Transaction DB02 = Missing Tables and Indexes shows under Secondary indexes from package $tmp

    Hi SAP Gurus,
    I noticed on our SAP business warehouse (BW) system (NetWeaver 7.0 based on AIX/Oracle 11g) in transaction DB02 => Diagnostics => Missing Tables and Indexes under Secondary indexes, 26 indexes, in package $tmp:
    The indexes are defined, but they don't have been created on the database.
    When I try to create them via the database tool, I am getting the warning:
    Does the warning raise up, because they where defined in the $tmp package?
    I was looking in SAP notes for a solution for this "warning" concerning the /BIC/F-Indexes but I didn't found yet anything helpful ...
    Thanks for your help and ideas ...
    Best regards
    Carlos

    Hi Carlos,
    These are secondary indexes created during process chains in BI to improvise performance.
    You may refer below SCN blogs on creation of these indices in BI.
    Secondary Index - Improving DSO insert/read performance
    How to Create Secondary Index on DSO in SAP BW
    Hope this helps.
    Regards,
    Deepak Kori

  • Reorganization of tablespaces, tables and indexes.

    Hello Experts,
    What is the concept of tablespaces, statistics , tables and indexes in SAP/Oracle ? Where are they used and what are they meant for ?
    Wt is the concept and procedure of performing Reorganization of tablespaces, tables and indexes ? why do we need it for ?
    Requested to revertb at earliest as its urgent . points guaranteed .
    Regards,
    Somya

    Hello Somya,
    Probably difficult to explain entire information in this thread. But you definately get good information in the following link
    http://help.sap.com/saphelp_47x200/helpdata/en/0d/d2fafd4a0c11d182b80000e829fbfe/frameset.htm
    Please drill down through menus, and you will be able to get good information.
    Also you can check the following SAP notes
    666061     FAQ: Database objects, segments and extents
    912620     FAQ: Oracle indexes
    588668     FAQ: Database statistics
    592393     FAQ: Oracle
    541538     FAQ: Reorganizations
    Regards,
    Madhukar

  • Generate the tablespace clause for tables and indexes

    How can I make Designer generate the tablespace clause for the create table and create index statements?
    I assigned tables and indexes to Tablespaces objects in designer but they don't seem to have any effect on the generator.
    I am using the latest version of Oracle Designer.
    Thanks
    Message was edited by:
    bikerc

    Guess I am not real clear what you want.
    In the DB admin tab you will need to create the tablespace with the data file.
    Then you need to assign the table space to the table.
    You will need to generate from the DB Admin tab.
    Hope this helps.
    Michael

  • After move tables and index another tablespace, indexes got unusable?

    Hi,
    I moved table and indexes another tablespace. After move many indexes got unusable state. I couldn't understand thiis?
    How can I make them again usable?
    regards and thanks?

    hi,
    check this query below
    create table test (id number(10));
    create table succeeded.
    insert into test values (10);
    1 rows inserted
    commit;
    create index test_indx on test(id);
    select index_name, status from user_indexes
    where table_name = 'TEST';
    INDEX_NAME STATUS
    TEST_INDX VALID
    alter table test move tablespace users;
    select index_name, status from dba_indexes
    where table_name = 'TEST';
    INDEX_NAME STATUS
    TEST_INDX UNUSABLE
    rebuliding index
    alter index test_indx rebuild
    alter index test_indx succeeded.
    then check
    select index_name, status from user_indexes
    where table_name = 'TEST';
    INDEX_NAME STATUS
    TEST_INDX VALID

Maybe you are looking for

  • Vista Ultimate: Local Network Access Only (Wired and Wireless)

    Alright, I am not very experienced working with Windows Vista, and I'm having serious trouble solving this problem. I've been searching for solutions for two days and not found anything that works. The computer is a Compaq Presario A900 running Windo

  • Aspect ratio in itunes

    Hi How can I make itunes play my 5:4 aspect video (720*576) in 16:9? Right now I convert them to 720*404 to get the correct aspect ratio but that seems like a bad idea. Cheers

  • No details for medium PRN im vendor master record

    Hello all, I hope you can help me with following issue in SRM extended classic. When I'm trying to create a purchase order in SRM I'm getting the message"No details for medium PRN im vendor master record" Has anyone seen this error message before? Ki

  • WD ABAP: Reset Table To Show the First Record.

    Hi WebDynpro ABAP Experts, Settings of tables allow me to display set of 10 records at a time. If i want to select , say 18th record I use paginator to select & use it. i navigate to next view , do some processing here. When I come back to the previo

  • Admin.war: App Server not starting (Error 500, then 404)

    Hi, I am trying to install CS4 in a Linux Fedora Core 12 (kernel 2.6.32.10) I have Tomcat 6 running fine (I would say, I have downloaded sample WAR files from other servers and tried installing through the manager web interface, and they installed an