Need a dump on indexes for a table

RDBMS novice here asking what is probably an easy one.
How, in SQLPlus, can I get a spill on all the indexes of a specific table. In Oracle Rdb, the statement "show table (indexes) foo;" did the job. Looking for something similar in RDBMS. I need to see the components of the index (in their right order). It would also be great to see some of the other stuff you specify when you create the index.
Thanks in Advance

You can get the indexes for a table by querying
SELECT INDEX_NAME FROM USER_INDEXES WHERE TABLE_NAME='XXX'
You can get the columns within the index (in order) by
SELECT COLUMN_NAME FROM USER_IND_COLUMNS WHERE INDEX_NAME='XXX' ORDER BY COLUMN_POSITION

Similar Messages

  • When do I really need to create indexes for a table?

    Once I was talking to a dba in a conference.
    He told me that not always I have to create indexes for a single table, it depends of its size.
    He said that Oracle read registers in blocks, and for a small table Oracle can read it fully, in a single operation, so in those cases I don't need indexes and statistcs.
    So I would like to know how to calculate it.
    When do I really need to create indexes for a table?
    If someone know any documment that explain that, or have some tips, I'd aprecciate.
    Thanks.
    P.S.: The version that I'm using is Oracle 9.2.0.4.0.

    Hi Vin
    You mentioned so many mistakes here, I don't know where to begin ...
    vprabhu_2000 wrote:
    There are different kinds of Index. B-tree Index is by default. Bit map index, function based index,index organized table.
    B-tree index if the table is large This is incorrect. Small tables, even those consisting of rows within just one block, can benefit from an index. There is no table size too small in which an index might not be benefical. William Robertson in his post references links to my blog where I discuss this.
    and if you want to retrieve 10 % or less of data then B-tree index is good. This is all wrong as well. A FTS on a (say) million row table could very well be more efficient when retrieving (say) just 1% of data. An index could very well be more efficient when retrieving 100% of data. There's nothing special about 10% and there is no such magic number ...
    >
    Bit Map Index - On low cardinality columns like Sex for eg which could have values Male,Female create a bit map index. Completely and utterly wrong. A bitmap index might be the perfect type of index, better than a B-Tree, even if there are (say) 100,000 distinct values in the table. That a bitmap index is only suitable for low cardinality columns is just not true. And what if it's an OLTP application, with lot's of concurrent DML on the underlining table, do you really think a bitmap index would be a good idea ?
    >
    You can also create an Index organized table if there are less rows to be stored so data is stored only once in index and not in table. Not sure what you mean here but an IOT can potentially be useful if you have very large numbers of rows in the table. The number of rows has nothing to do with whether an IOT is suitable or not.
    >
    Hope this info helps. Considering most of it is wrong, I'm not sure it really helps at all :(
    Cheers
    Richard Foote
    http://richardfoote.wordpress.com/

  • Not able to figure out the table index for Edit table User Properties Dialo

    Studio Edition Version 11.1.1.0.0
    Build JDEVADF_MAIN.D5PRIME_GENERIC_080403.0915.4920
    I'm trying to automate the various features in Jdeveloper dialogs. At one point I got struck with table in Edit Table Dialog.
    Right Click on New -> Database Tier-> Select APPS: Import to offline database Objects. Step 1- Step5 dialogs comes up. Click on Next till finish button comes up. After that one table along with xdf file will be shown in the Jdeveloper Tree Menu. Right click on Table, Go to Properties. Then Select User Properties in the Left Pane. On Right Side table will be shown. I want to know what is the index for this table and also I need to input certain text and select some drop downs from this table.
    Automation Tool: JFCUnit
    Could you please tell how can I put values in some of the fields and select the values from the drop downs.
    Kindly let me know if you need any more Information for the same.

    Hi,
    if you are from Oracle, please use an internal forum. If not, the JDeveloper 11 forum is at: JDeveloper and OC4J 11g Technology Preview
    Frank

  • How much time it take to rebuild an index for a table with 20 millions rows

    Hi all,
    i need to rebuild the index of a table containing 20 000 000 row (i don't know why the other people working on this didn't think of rebuilding the index regularly, because i asked and apparently it has never been done :cry: :cry:) i am not a sql developper nor a DBA so i can't mesure how long it take to rebuild the index, does any one have an idea (aproximativly of course :aie:), the other question is there any formula to use in order to calculate how often to rebuild the indexes (i can for example retieve how much rows are delated or inserted daily ...)
    Thanks again
    Taha

    taha wrote:
    :aie: that's why i am asking because i don't know (and to be sure which solution is best)
    so the table is like this (the columns) :
    45 varchar2, 5 timestamp, 30 Number no LOB columns, (15 indexes : 5 unique indexes and that those indexes uses at a maximum 4 columns)15 indexes - 100,000 deletes: this could mean 1,500,000 block visits to maintain index leaf blocks as the table rows are deleted. If you're unlucky this could turn into 1,500,000 physical block read requests; if you're lucky, or the system is well engineered this could be virtually no physical I/O. The difference in time could be huge. At any rate it is likely to be 1,500,000 redo entries at 250 - 300 bytes per entry for a total of about 400MB of redo (so how large are your redo logs and how many log switches are you going to cause).
    yes the tables is used by an application so (update, insert ) can take place at any time
    for the deletion , there is the batch which does a mass delete on the table ( 4 or 5 time each day)
    You haven't answered the question - how long does it take to do a sample batch delete.
    If you can enable SQL tracing, or take a before/after snapshot of v$sesstat or v$session_event for the session as it does the delete then you can get some idea of where the time is going - for all you know it might be spending most of its time waiting for a lock to do away.
    >
    "How many leaf blocks are currently allocated to the index(es) ?" how can i answer to this question ? may be if i check the all_objects table ?
    If you keep your statistics up to date then dba_indexes is a good place, cross-checked with dba_segments, and you can use the dbms_space package for more detail. I have a code sample on my blog which allows you to compare the current size of your indexes with the size they would be if rebuilt at some specific percentage: http://jonathanlewis.wordpress.com/index-sizing/ (It's such good code that Oracle Corp. has copied it into MOS note 989186.1)
    Regards
    Jonathan Lewis

  • How to create index for particular table in R3

    Hi
    My load is taking too much time and it leads to process over due error. Does creating indexes on table in r3 side will solve this issue? If so how can we find out on which table does this particular data source depend. I went to maintain extract structure and findout only one table is supplying data for this data source.
    Is there any other factors depend to solve this.
    Thanks
    kk

    Hi,
    it will depend on the table.... Having an index created will speed up the loading but slow down the insert therefore slowing some process perhaps...
    May I ask which table it is? And which fields would you need to index?
    Are you sure that bottleneck is located in R/3? Analyze your loading time in the monitor and see if this is really the case.
    Otherwise you can create index for a table in Tx SE11; first check if an index is not already created...
    hope this helps,
    Olivier.

  • Module pool ---Problem in finding the line index for the table control

    Hi Friends,
    I am working in Module pool programming.
    My requirement is when i select any record on the lead selection I need to find out the index of the line on which  row i have selected.
    Could any one please suggest me the proper solution how to get the line index for the table control in module pool programming.
    Thanks
    Satish Raju

    Hi Raju,
    Follow the steps
    <li>U should take one variable in your internal table or in structure which is used for table control fields.
          DATA :BEGIN OF itab OCCURS 0 ,
                mark TYPE c ,
                matnr LIKE mara-matnr ,
                matkl LIKE mara-matkl,
                maktx LIKE makt-maktx,
            END OF itab .
       controls: tabc types tableview using screen 100.
    <li>This mark variable should be given in Table control properties. follow the path
    double click on the table control-->attributes .->select w/SelColumn and in that give itab-mark.
    <li>Flow logic of the screen
       process before output.
         MODULE status_0100.
         LOOP AT itab with control tabc
         endloop.
       process after input.
         module cancel at exit-command.
         LOOP AT itab.
           MODULE read_table_control.
         ENDLOOP.
         MODULE user_command_0100.
    <li>read_table_control module code
         MODULE read_table_control INPUT.
         MODIFY itab INDEX tabc-current_line."this will update the itab table
                                             "mark field with 'X ' whatever we
                                             "have selected on table control
         ENDMODULE.
    <li>If you want to Delete some of the records from Table control follow this code u2026Create one pushbutton and give Fucnction code to that and write below code
       CASE okcode.
         WHEN 'DELETE'.
           LOOP AT itab WHERE mark = 'X'.
             DELETE itab.
           ENDLOOP.
       ENDCASE.
    I hope that it helps you.
    Thanks
    Venkat.O

  • Index for a table

    I would like to ask when it makes sense to create an index for a table, e.g. ONRVB at the moment it takes 3.006.358 ms to select one enntry.

    Hi Witold
    It is always better to optimize your where clause rather creating index. Before creating any index you should first check what is the frequency of its usage. Moreover many a times creating index ends up in having side effects as some times database engine may choose ur new index instead which could be not be valuable. Hence before creating any index we need to think twice and try to optimize what we have.
    Cheers
    Vaibhav

  • DB statistic missing & Missing index for critical tables  after TDM refresh

    Hello SAP expert,
    We have completed our refresh using TDM, but after the refresh we encounter problem at the receiver system,
    Issue Encounter
    1. System too slow
    2. When running tcode it resulted to time_out dump
    3. Db statistics are missing
    4. missing index for critical tables
    Appreciate your help. How can we check tdm log if the data transfer really transferred or completed succesfuly.
    Thanks

    Thanks for your reply.
    We are looking the possible root cause of the issue, everything is fine in the target system before the refresh even the DB statistics update job is working fine before the refresh.
    is there a way we could find logs or report from tdms server if there something happen during the execution of the tdm jobs or data selection and transfer. as we only find logs of the latest run. let say we execute the data transfer 4 times where we could find a report or logs stating the error or execution logs from the 2nd or on 3rd run?
    thanks

  • Secondary Index for the table MSEG

    Hi folks,
             One of my report is comparetively very slow when it is executed in the production server. when i chked, a query related to the MSEG table is taking more time to execute. I want to create a secondary index for that table. Could any body tell  me the procedure of creating the seconday index for the table MSEG, as i am not aware of that.
    Thanks in advance,
    Shyam.

    Dear shyam,
    Search SDN before posting any thread their are 10k threads available for your question anyhow for your reference here is one link
    http://help.sap.com/search/highlightContent.jsp
    Cheers
    fareed

  • Problem while creating index for temporary table...

    Hi,
    i have created index for a temporary table and this script should used by multiusers.So when second user connecting to it is giving index i mean object already exists.
    So what i need is when the second user connected the script should create one more index on temporary table.Will sql server provide any random way of creating indexes if the index exists already with that name??
    Thank You,

    Nope..
    SQL Server is cleaver enough to handel this situation.
    When you create a index or constraint on the Temp Table, eventhough the index name is duplicate it will allow.
    But it only possible on temp tables (prefixed with single #).
    To Test this,
    Open Two window,
    Execute the below window on the opened 2 window..
    create table #test
                id int
    Insert Into #test values(1);
    Insert Into #test values(2);
    Create clustered index testindex on #test(id)
    Now you wont get any error on any of the window. Rite?
    To fetch the created index details, execute the below code on any one of the window..
    select * from sysindexes where name like '%test%'
    Now you can see the 2 rows with same indexname but refereing with different table. Yes. all the temp tables (#) will be suffixed with unique number to avoid the object already found error while multiple users connects.
     

  • A query related to creating Indexes for a table

    Hi ,
    I am in a J2EE Banking Project using Oracle 10g as our Database .
    We have created Indexes on some tables .
    But this this is not called by any of our Java class .
    Could anybody please let me know how these Indexes will actually improve the Performance .
    Waiting for your replies .
    Thanks in advance .

    But in our safety database (huge & ofcourse Oracle), we use indexes just because to avoid duplicates, improve data retrieval and so on.As you pointed out indexes can do 2 things for you: enforce uniqueness and (hopefully) improve data retrieval. Enforcing uniqueness is pretty basic, but indexes don't always improve performance. Under the wrong condtions indexes can hurt performance. The ideas below refer to B-TREE indexes; other kinds of indexes have other considerations
    Indexes add overhead to insert, delete, and (hopefully not - updating index columns is a Bad Idea), enough so that if you're inserting a lot of rows into a large table it is sometimes helpful to drop the indexes, load the data, and recreate the indexes when done to help performance. The more indexes a table has the more overhead DML statements need to maintain them.
    Indexes help query performance under a couple of conditions. When using them as join keys to retrieve a small percentage of rows in a table (< 20% maybe; there is no firm number) indexes can help. When a query can read its columns from an index only (such as counts against a primary key index) index access can be faster than table access.
    Indexes can hurt performance by adding overhead for maintenance if the index is never actually used or if used to read most of the rows in a table when a full table scan would be more efficient (why go through the extra effort to read the index and then table when you'll have to read most of the rows in the table anyway?).

  • CC&B 2.3.1 - Custom indexes for base tables

    Hi,
    We are seeing a couple of statements in the database that could improve its performance with new custom indexes on base tables. Questions are:
    - can we create new indexes on base tables ?
    - is there any recommendations about naming, characteristics and location for this indexes ?
    - is there any additional step to do in CC&B in order to use the index (define metadata or ...) ?
    Thanks.
    Regards.

    Hi,
    if it necessary You can crate custom index.
    In this situation You should follow naming convention from Database Design Standards:
    Indexes
    Index names are composed of the following parts:
    +[X][C/M/T]NNN[P/S]+
    +•     X – letter X is used as a leading character of all base index names prior to Version 2.0.0. Now the first character of product owner flag value should be used instead of letter X. For client specific implementation index in Oracle, use CM.+
    +•     C/M/T – The second character can be either C or M or T. C is used for control tables (Admin tables). M is for the master tables. T is reserved for the transaction tables.+
    +•     NNN – A three-digit number that uniquely identifies the table on which the index is defined.+
    +•     P/S/C – P indicates that this index is the primary key index. S is used for indexes other than primary keys. Use C to indicate a client specific implementation index in DB2 implementation.+
    Some examples are:
    +•     XC001P0+
    +•     XT206S1+
    +•     XT206C2+
    +•     CM206S2+
    Warning!  Do not use index names in the application as the names can change due to unforeseeable reasons
    There is no additional metadata information for indexes in CI_MD* tables - because change of indexes does not influence generated Java code.
    Hope that helps.
    Regards,
    Bartlomiej

  • Assigning primary key and index for a table

    I have a database consisting of only one table with 10 million rows which mostly looks like this:
    RECORDDATE                     ID     CLASS     VALUE
    24-JAN-12 10.52.47.000000 AM     96     3     0
    24-JAN-12 10.52.48.000000 AM     96     10     156
    24-JAN-12 10.52.48.000000 AM     96     3     0
    24-JAN-12 10.52.48.000000 AM     96     3     0
    24-JAN-12 10.52.48.000000 AM     96     3     0
    24-JAN-12 10.52.48.000000 AM     96     3     0
    24-JAN-12 10.52.48.000000 AM     96     10     156
    24-JAN-12 10.52.48.000000 AM     96     3     0
    24-JAN-12 10.52.48.000000 AM     96     3     0
    24-JAN-12 10.52.48.000000 AM     96     6     38
    24-JAN-12 10.53.05.000000 AM     253     16     197
    24-JAN-12 10.53.06.000000 AM     98     10     150
    24-JAN-12 10.53.06.000000 AM     98     0     0
    24-JAN-12 10.53.06.000000 AM     98     4     0
    24-JAN-12 10.53.06.000000 AM     98     11     33As you can see there are several entries that look exactly the same. Currently, I don't have primary key or index for any column and have a lot of performance issues. For example this query takes more than 10 seconds to run:
    select distinct      ID
    from      scdatabase4
    where ID < 253
    order by 1Since database is not my primary job and have no background of it, I'm really confused about what to do to fix my issues. Could someone please help me in assigning primary key and index if you agree that this is the problem?!

    Execute the query below to help decide what column to index:
    SELECT COLUMN_NAME, NUM_DISTINCT, NUM_NULLS, NUM_BUCKETS, DENSITY
    FROM DBA_TAB_COL_STATISTICS
    WHERE TABLE_NAME = 'your_table_name'
    ORDER BY COLUMN_NAME;
    The important columns are:
    1) NUM_DISTINCTS: Indicates the number of distinct values. If this number is very low for a column, it indicates that this column is not a very good candidate for a B-Tree index.
    2) NUM_NULL: Indicates the number of null values for each column. A column with few null values is a good candidate for a index
    But be aware, this is not a rule, it's just a method to help decide which column will have the most benefit of index creation.

  • Index for PS_TXN table

    Hi
    This is regarding the PS_TXN table which is created and maintained by ADF.
    We developed our application using JDev build 1811 and Oracle 10g as database.
    We recently migrated to JDev build 1929. We have the BC4J cleanup job in our database to clean the PS_TXN table.
    Since ADF is running a full table scan with each query, we have got a suggestion from our database administrator to create an index for the column COLLID in PS_TXN table.
    My question is:
    1) Since this is a JDeveloper table, is JDeveloper responsible for automatically providing indexes?
    2) If this is true, why was the index suggested by Robert (COLLID) not automatically added?
    4) If we manually add this index, is there a possibility that JDeveloper will override our change?
    Thanks in advance
    Shoba

    Hi
    Thanks for the immediate reply.
    We have not set the property. But as per my knowledge, if the value of this configuration parameter is not set by the developer (which is the default situation) then the framework will create the temporary tables using the credentials of the current application database connection. Thats what happens in our applicaiton. It created the table in our schema and the cleanup job is also working fine.
    But why an index is not created for the table PS_TXN by JDev?
    If JDev does not create any index, can we create one for performance.
    If we create, will it overriden by JDev.
    Thanks in Advance
    Shoba

  • Re: how to create a temporary index for a table in program

    Hi,
    I execute a report to access table EKBE. The field that is essential is the CPUDT - entry date.
    Now, the EKBE is not index with this field.
    I do not want to create a permanent index which might occupied space. The current read on EKBE is sequential.
    I thought of creating an index in the program and then releases it once the report is out.
    Is there a way to achieve that?

    Hi,
    You can dump the data into one internal table and create index of that internal table like this:
    tables: ekbe.
    data: begin of itab occurs 0,
           cpudt like ekbe-cpudt,
           indx type i,
           end of itab.
    select cpudt up to 10 rows
    from ekbe into table itab.
    loop at itab.
    itab-indx = sy-tabix.
    write:/ itab-cpudt, itab-indx.
    endloop.
    Regards,
    Bhaskar

Maybe you are looking for