Regarding prmary key & index

Hello,
We are having a very long runtime for transaction FBL3N, to access the archived data.
Regarding this, as per a SAP note 1135916, there should be an index on 'company code' & 'account number' in tables BSIS/BSAS.
Please let me know how to check whether there is an index on a certain field???
I am confused because when I checked in SE11, the 'primary key' collumn next to the above fields is checked.
But when I go to the menu 'Go to --> Indexes', the account number is not a part of that index.
Please let me know.
Thanks & Regards,
Kunal.

The best option is to trace the report / transaction / activity you are complaining about via transaction ST05. Then, switch off the trace and display the list (I usually select the 'Detainel Trace List' in the popup.
In the 2nd column you see the duration of each database request in µs (i.e. 1,000,000 = 1 second). You can cross check with the time stamp in the 1st column (only in detailed trace list). 'Long' running requests are marked red.
There may be numerous entries marked red. I would check the accesses to e.g. table BSIS (search for BSIS using Ctrl-F - the table name is also in one of the columns).
Once you have a suspicious database request, press the 'Explain' button. It will show you the access plan and the index being used.
Note that interpretation of an optimiser access plan requires some expertise.
Malte

Similar Messages

  • Usage of reverse key index

    Hi,
    Any body can explain the usage of reverse key index.
    Thanks and regards,

    It could be an option if you have lots of inserts simultaniously (and I mean lots not 2 a second - rather 1000'ds).
    If the index field comes like this 1000, 1001, 1002, 1003, 1004 etc etc then the very same index leaf blocks will be hit when using a "normal" index - if it is reverse, you will spread the IO load on many blocks - and might give a better performance. If reversed it will be 0001, 1001, 2001, 3001, 4001 instead (inserwise).
    BUT .... be aware when using ... between, GT og LT on those reversed indexed fields - index skip scans are not possible - so you may sacrifice performance in the selects.
    We have used it for audit records, where we had many many records being inserted from 20 simult. processes (java stuff), just reading off a jms queue and inserting. We had lots of waits - then we reversed index. And we do not have any appl. selecting the audit records.
    Mette

  • Reverse key index

    hi,
    I am reading Richard Foote's notes, and he talks how reverse key indexes can stop the contention in RAC environment on an index where the values are ascending and always being entered into the right most block. But, they still wont stop the contention on the tables data block, will they? so doesnt this make disappearing the contention on the index data block futile as we're still going to have it on the tables data block?
    also, when we enter an entry into the table, is a shared exclusive table lock taken on the index too?
    thanks

    OracleGuy777 wrote:
    hi,
    I am reading Richard Foote's notes, and he talks how reverse key indexes can stop the contention in RAC environment on an index where the values are ascending and always being entered into the right most block. But, they still wont stop the contention on the tables data block, will they? so doesnt this make disappearing the contention on the index data block futile as we're still going to have it on the tables data block?
    also, when we enter an entry into the table, is a shared exclusive table lock taken on the index too?
    See Re: reverse key index and contention in RAC
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    "Science is more than a body of knowledge; it is a way of thinking"
    Carl Sagan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to see wether the index is a primary key index or not

    hi,
    can anybody let me know how to get wether the index is made on the primary key (i.e primary key index)
    can we do by querying the user_constriants table.
    plz let me know..

    Maran.Viswarayar wrote:
    Vijay,
    Was that different from Anurag's reply?Yes it was. Anurag didn't include the index_name in his query.
    It is possible for the index name to be different from the constraint_name, so if you listed just the primary key constraint names you might decide that a given index was not a "primary key" index because you couldn't find a constraint with the matching name.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    "Science is more than a body of knowledge; it is a way of thinking"
    Carl Sagan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Problem with capturing Primary Key Index

    Hi
    I am capturing certain tables and in the mean process i observed that all the indexes are getting captured except the primary key index.
    Any Suggestions on this?
    Thanx,
    Suji

    Hi,
    I was unable to reproduce this behavior on OWM 10.1.0.8. It appears that you have a SR open for this issue, so I would suggest to continue with that process.
    Regards,
    Ben

  • Creating Primary Key Index

    Hi,
    Iam trying to create a Primary Index on Large table and Iam using the Parallelism to make it fast. I have used the following script to create a Primary key Index.
    CREATE UNIQUE INDEX FLX_ARCH.FUND_SEC_RESULT_STAT_ARCH_PK
    ON FLX_ARCH.FUND_SEC_RESULT_STAT_ARCH
    (FUND_SEC_RESULT_MAP_INST,RATES_RULE_ID,BASE_LOCAL_FLAG,EFFECTIVE_DATE)
    TABLESPACE FLX_PERF_I
    parallel;
    Index created.
    Elapsed: 01:43:37.37
    Index got created in 1 hour 43 minutes. But when Iam adding constarint to those columns, it is taking almost 12hours with or without parallelism.
    ALTER TABLE FLX_ARCH.FUND_SEC_RESULT_STAT_ARCH
    ADD CONSTRAINT FUND_SEC_RESULT_STAT_ARCH_PK
    PRIMARY KEY
    (FUND_SEC_RESULT_MAP_INST,RATES_RULE_ID,BASE_LOCAL_FLAG,EFFECTIVE_DATE)
    parallel
    Would you please let me know what could be the problem and how can we add the Primary constraint fast.
    Your early response is much appreciated.
    Thanks and Regards
    Suresh. D

    Would you please let me know what could be the problem and You have presented no details that indicate any problem exists.
    how can we add the Primary constraint fast. Fast is relative.
    If I asked you to make my snail fast, could you do so?
    ALTER SESSION SET SQL_TRACE=TRUE;
    ALTER TABLE FLX_ARCH.FUND_SEC_RESULT_STAT_ARCH
    ADD CONSTRAINT FUND_SEC_RESULT_STAT_ARCH_PK
    PRIMARY KEY
    (FUND_SEC_RESULT_MAP_INST,RATES_RULE_ID,BASE_LOCAL_FLAG,EFFECTIVE_DATE)
    parallel
    ALTER SESSION SET SQL_TRACE=FALSE;
    now find the trace file within ./udump folder
    tkprof <trace_file.trc> trace_results.txt explain=<username>/<password>
    By inspecting the trace file you will be able to see where time is being spent.
    With this knowledge, you may or may not be able to determine the bottleneck & therefore improve it

  • Primary key index not working in a select  statment

    Hi ,
    I'm doing a :
    select *
    from my_table
    where B = v1 and
    A = v2 ;
    where A and B are the primary key of the table, in that table the primary key index is there and the order of the primary key definition is A first and then B.
    While testing this statment in my database the Explain Plan shows that it is using the index ok but when
    runninng in client database it is not using it becasue of the order (i think), is this something configurable that I need to ask to my DBA ?
    The solution I found was to do the select with a hint wich fix the problem , but I'm curious about why is working in my dadabase and not in the client database
    thanks in advance .
    oracle version 11g

    This is the forum for SQL Developer (Not for general SQL/PLSQL questions). Your question would be better asked in the SQL and PL/SQL forum.
    Short answer: The execution plan used will depend on optimizer settings and table/index statistics. For example if the table has very few rows it may not bother using the index.

  • Dilemma regarding function based indexes

    Hello,
    I have a dilemma regarding function based indexes.
    I have read Note:66277.1 on the Metalink discussing thoroughly the subject of “Concepts and Usage of Function Based Indexes”.
    This doc was revised on 30-May-2006 so I was sure it referred to 9i and 10g.
    This doc as well as other docs on the web claim that in order to use FBI (function based indexes) one must set the following parameters (can be done also at session level)
    QUERY_REWRITE_ENABLED = TRUE
    QUERY_REWRITE_INTEGRITY = TRUSTED
    Also the schema that is owner of the FBI should be granted with QUERY REWRITE sys priv and statistics should be collected since FBI is usable only by CBO (cost based optimizer).
    I have tested it and it works, my problem was that it worked
    (1)     Without granting the QUERY REWRITE to the owning schema.
    (2)     QUERY_REWRITE_ENABLED was set to false.
    (3)     QUERY_REWRITE_INTEGRITY was set to enforced.
    I have conducted my tests on 9.2.0.6 and found no evidence in the docs (10g) saying the above is required or not.
    I found at http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1197786003246 the following:
    “Oracle9iR2 relaxed this so that the FBI on the builtin function may be used.”
    so I have tested it with my own function:
    create or replace function upper2( p_str in varchar2 ) return
    varchar2 DETERMINISTIC
    as
    begin
    return upper(p_str);
    end;
    =>
    Also (yes you guessed right), without any privilege granted nor parameter setting the optimizer picked my FBI.
    Can anyone refer me to a place documenting this behavior as a correct one?
    Other comments?
    Regards,
    Tal Olier ([email protected])

    Got an answer from Oracle support:
    19-DEC-06 18:04:31 GMT
    (Update for record id(s): 101017780,101017796)
    QUESTION
    ========
    Questions about the options required in 10g related to Function Based Indexes, and the correct
    behaviors associated with them.
    ANSWER
    ======
    For 10g:
    These requirements are no longer true in 10g. This has already clarified by
    development in the Bug 3999326 which is available on metalink.
    For 9I:
    For the creation of a function-based index in your own schema, you must be
    granted the QUERY REWRITE system privileges. To create the index in another
    schema or on another schema's tables, you must have the CREATE ANY INDEX
    and GLOBAL QUERY REWRITE privileges.
    You must have the following initialization parameters defined to create a
    function-based index:
    QUERY_REWRITE_INTEGRITY set to TRUSTED
    QUERY_REWRITE_ENABLED set to TRUE
    COMPATIBLE set to 8.1.0.0.0 or a greater value
    Additionally, to use a function-based index:
    The table must be analyzed after the index is created.
    The query must be guaranteed not to need any NULL values from the indexed
    expression, since NULL values are not stored in indexes.
    However, in 9.2.0.4 patchset, these prerequisites do not apply and one can
    create function-based indexes without any of the above to be true. This is not
    the case in 9.2.0.3, not in 8.1.7.
    Reference: Oracle 9i R2 Administrators Guide
    So as mentioned above that is why you didnt have any errors
    Please back to us if any further information is need, and we will be pleased to
    assist you further.
    Thank You,
    Best Regards,
    Mina Anes

  • Concept about Primary Key index

    I have a partitioned table as follow:
    CREATE TABLE TEST
    (TEST_KEY NUMBER(10,0) NOT NULL
    ,FOREIGN_KEY NUMBER(10,0) NOT NULL
    ,PARAM_ID NUMBER(10,0)
    ,PARAM_VALUE VARCHAR2(256)
    PARTITION BY HASH (operation_key) PARTITIONS 15
    STORE IN (TEST_R1_TS, TEST_R2_TS, TEST_R3_TS, TEST_R4_TS, TEST_R5_TS)
    CACHE
    I also created a partitioned index for the TEST_KEY to be used as primary key index.
    CREATE INDEX TEST_PK_IDX ON PARAMETER_1(TEST_KEY) LOCAL
    STORE IN (TEST_i1_ts, TEST_i2_ts, TEST_i3_ts, TEST_i4_ts, TEST_i5_ts);
    When I try to run alter table to add primary key, I got index not exist error?
    SQL> alter table TEST add (constraint test_pk primary key (test_key) using index test_pk_idx);
    alter table parameter_1 add (constraint pa1_pk primary key (parameter_key) using index pa_pk_idx)
    ERROR at line 1:
    ORA-01418: specified index does not exist
    BUT, I could find my index in the USER_INDEXES table...
    SQL> select index_name from user_indexes where index_name like '%TEST_PK%';
    INDEX_NAME
    TEST_PK_IDX
    Why? Help is very appreciated.
    Thank you in advanced.

    check the names of the tables in the script you give ... they are different for the table and the index. When you add the constraint the table name and column name mysteriously change in the error message, so I think that you aren't showing us what actually happened.

  • Key Index

    Hi,
    Is it possible to get the index of the key I inserted in berkeley? I need to know the arrangement of the keys I inserted. Are there methods in getting the index of the keys?
    Example: I put the following in the order given:
    Order Key Index
    1st key1 0
    2nd key2 1
    3rd key3 2
    If I will get the index of key2, it should return 2.
    Thank you in advance.

    Hi,
    I will clarify a few things about how JE's storing the records to make sure we are on the same page. Also, I don't know what API you use, I assume you use the base API.
    JE stores and retrieves data using key-data pairs. You store records in a Database by calling one of the put methods on a Database handle. JE automatically determines the record's proper placement in the database's internal B-Tree using whatever key and data comparison functions that are available to it. To iterate (which I think it's what you're looking for), just call getNext() until the last database record has been read. getFirst moves the cursor to the first key/data pair of the database, and returns that pair, but if If the cursor is not yet initialized, getNext moves the cursor to the first key/data pair of the database too. All cursor operations return an OperationStatus, so just read until you no longer see OperationStatus.SUCCESS. This will give you the order.
    Also, instead of scanning the database in the record's sort order, you can use cursors to retrieve records based on how they are stored on disk by using the DiskOrderedCursor class.
    Getting Records Using the Cursor: http://docs.oracle.com/cd/E17277_02/html/GettingStartedGuide/Positioning.html
    Cursor: http://docs.oracle.com/cd/E17277_02/html/java/com/sleepycat/je/Cursor.html
    DiskOrderedCursor: http://docs.oracle.com/cd/E17277_02/html/java/com/sleepycat/je/DiskOrderedCursor.html

  • Regarding access key

    hi
    I have a Question regarding Access key.actually I wanted to
    whenever we change different objects its asking different
    access key...say  frankly
    for Mara its asking different acess key then
    I observed Abap'rs are trying to insert a object PatternD
    so in this step its again asking Access key.so my doubt is
    do I need to request SAP portal for another acess ..plz do
    revert if any one knows the answer
    Thank you

    Hi
    Yes, access key is required for editing object, and for different objects it will ask different access keys. So , you need to apply for access key at marketplace, each time.
    Hope this helps you.
    Regards
    Rahul

  • What is Foreign Key Indexes?

    We have doubt in definition of "Foreign Key Indexe",
    Please give us a clear definition.
    Thanks in advance
    Soheil

    We have doubt in definition of "Foreign Key Indexe",
    Please give us a clear definition.
    Thanks in advance
    Soheil

  • Regarding Bank key and Bank account number

    Hi All,
    I have a query regarding Bank key and Bank account number.
    I want to set bank account number length as 9 digits. so I set it @ below path
    SPRO -> SAP NetWeaver-> General settings -> Set countries -> Set country specific checks.
    I tried to change the bank account number length to 9 digits from existing 10 digits using transaction FI12.
    But while changeing the bank account system throws an error like "Bank account number or bank number are not of valid length".
    Can any one suggest solution on this?
    Thanks in Advance!
    Regards,
    Nidhi

    Dear Nidhi,
    It seems that earlier bank account number contained 10 digits and then setting was changed to 9 digits that may be the cause of the error. Do one thing, go back to country setting and restore the bank account number digit to 10. Then make changes to bank account number to 9 digits. Make similar changes to all bank in your company code which has 10 digits.
    Then go to country settings and make account number digit to 9 digit which will prevent bank account number to be 10 digits created in future.
    Regards,
    Chintan Joshi.

  • Creating an unique index instaed of using primary key index

    Hi ,
    I heard in a debate sometimes it's better to create a unique index on a column and using it instaed of using primary key index in oracle.I couldn't understand what the reason propely.
    Can anyone please help me in thsi topic if it is a valid one .
    Thanks in advance

    Hi,
    They are exactly NOT identical.
    1. Unique key can have NULL values where primary keys can't.
    2. Primary key is fundamentally those keys which do not change. I mean updating a primary key is not a good idea.
    SQL> drop table test;
    Table dropped.
    SQL> create table test ( a number(2));
    Table created.
    SQL> ed
    Wrote file afiedt.buf
      1* create unique index test_idx on test(a)
    SQL> /
    Index created.
    SQL> ed
    Wrote file afiedt.buf
      1* insert into test values(NULL)
    SQL> /
    1 row created.
    SQL> drop table test;
    Table dropped.
    SQL>
    SQL> create table test ( a number(2) primary key);
    Table created.
    SQL> insert into test values(NULL);
    insert into test values(NULL)
    ERROR at line 1:
    ORA-01400: cannot insert NULL into ("HR"."TEST"."A")
    SQL>Cheers,
    Edited by: Avinash Tripathi on Nov 24, 2009 11:17 AM

  • Drop/recreate primary key index

    Any suggestions for dropping/recreating a primary key index? The index has to be dropped/recreated and not rebuilt due to ORA-600s.
    Do I simply disable/re-enable the primary key constraint? The database is 10g.
    Edited by: nickw2 on Apr 1, 2009 5:06 PM

    ORA-600 errors are a handful, I usually check metalink or ask ORacle support for help.
    Anyways, If you want to recreate the primary key index, have you tried dropping the primary key constraint and adding it back?
    ALTER TABLE tablename
    DROP CONSTRAINT pk_name;
    ALTER TABLE tablenames
    ADD CONSTRAINT pk_name PRIMARY KEY (column_name);

Maybe you are looking for