Tables with locked stats

Hi: I am on 10.2.0.3.
Anybody know a view which shows thw tables with locked stats?
Thanks,
Greg

You can find table lock details from dba_tables / all_tables check table_lock column
http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_2.htm#i1592091

Similar Messages

  • Left outer join 3 tables with where-statement

    Hi folks,
    I hope you can understand (and maybe solve) my problem.
    Generally I try to left outer join three tables. The third table is used for a WHERE-statement.
    The three table structures are the following:
    table 1 (user)   
    user1 | key
    table 2 (detail)  
    key | ID
    table 3 (header)
    ID | user2                 
    ...and I want to achieve the following structure (as example filled with data):
    user | key | ID
    |-----|----
    xy    | a    | 001
    xy    | b    | #
    z     | b     | #
    The clue ist the usage of the third table. I need the table to set user1 and user2 equal (WHERE) but there are two problems:
    1) Obviously I can't left outer join two tables with each other. In this case I already used the 'key' of table 1 to join it with the 'key' of table 2. So I can't left outer join the 'ID' of table 2 with the 'ID' of table 3. Error message that I can only left outer join a table once. Any proposals?
    2) I have to include a WHERE to equal user1 with user2. But I am not allowed to use the user2 from table 3 because of the left outer join.
    I tried this coding:
    SELECT auser1 akey b~id INTO TABLE itab FROM ( table1 AS a
      LEFT OUTER JOIN table2 AS b ON akey = bkey )
      LEFT OUTER JOIN table3 AS c ON bID = cID )
      WHERE auser1 = cuser2.
    I would really appreciate your help.
    Regards
    MrclSpdl

    IF you want to join a DB table with an internal table, you need to use the 'FOR ALL ENTRIES' statement.
    select dbfields
    into table itab2
    from dbtab
    for all entries in itab
    where dbfield1 = itab-field1.
    This will get you a second internal table with all the corresponding data for the first selection.  You can then join them with a loop through the first table and a read table on the second table (for 1 - 1 relation) or a nested loop statement on both tables (for 1 - N relation).  Make itab a hashed table when using read table with key, use a sorted table if you need to loop without key access.
    Regards,
    Freek

  • How to insert a table with ref statement?

    the script:
    CREATE OR REPLACE TYPE B_T AS OBJECT (
    type varchar(6),
    value number(2));
    create table Bo of B_T;
    insert into Bo values('a',0);
    insert into Bo values('b',1);
    create or replace type try_T AS OBJECT(
    iii number(10),
    aaa ref B_T);
    create table try of try_T
    (scope for (aaa) is Bo);
    how to insert into the "try" table?
    the statement:
    insert into try values(4,B_T('a'))
    or :
    insert into try values(4, ref(t) from bo t where bo.type='a');
    both are erro.
    help me please.

    Hi,
    Right click the mouse->create->table
    If you want 5 columns, you need to declare 5 cells in one line type of the table
    Click on Table -> Details, then do the following
    Line Type 1 2 3 4 5
    L1 2mm 3mm etc
    Here specify the width of the columns as many as you want..
    then in the header/main area of the table, click create Table Line, Rowtype is L1, automatically 5 cells will come,In each cell create a text element, display the variable to be printed there.

  • Passing tables with PERFORM statement

    Hi all,
    There is a table returned by a function module ZCDAPO_MATNR_CHECK_FOR_QUOTA .
    I want to use the table returned by this FM  in a subroutine.
    So i pass this table thru FORM statement.
    within  PERFORM  and ENDFORM i want to use the data in this table
    and do some manipulation.
    but i am getting an error saying for typing TABLES parameter only table types should be used
    can anyone tell me where i am going wrong or please tell me how use tables in this PERFORM statement.for reference i will paste the code below,
    TYPES  : BEGIN OF x_quota     ,
                   trpid type ztrpid    ,
                   quota TYPE decv1_3   , 
                   END OF x_quota       .
    DATA :  it_qheader TYPE TABLE OF zapo_trqtah,
                 wa_it_qheader LIKE LINE OF it_qheader.
    DATA:    it_qitem TYPE TABLE OF zapo_trqtap,
                 wa_it_qitem LIKE LINE OF it_qitem.
    DATA   : it_quotavalue      TYPE TABLE OF x_quota                    ,
                  wa_it_quotavalue   LIKE LINE  OF it_quotavalue              .
    CALL FUNCTION 'ZCDAPO_MATNR_CHECK_FOR_QUOTA'
          EXPORTING
            i_matnr            = 'AATESTQUOTA2'
            i_werks            = '5034'
          IMPORTING
            e_quota_exist_flag = lv_flag
          TABLES
            t_zapo_trqtap      = it_qitem
            t_zapo_trqtah      = it_qheader
          EXCEPTIONS
            invalid_input      = 1
            OTHERS             = 2.
    perform f_loadquota_apo TABLES it_qitem.
    form f_loadquota_apo tables it_qitem type zapo_trqtap.
                     LOOP AT it_qitem INTO wa_it_qitem.
                     wa_it_quotavalue-trpid = wa_it_qitem-ztrpid.
                     wa_it_quotavalue-quota = wa_it_qitem-zquota / lv_sum.
                     append wa_it_quotavalue to it_quotavalue.
                     endloop.
    endform.

    Hi..
    Using TABLES is like obselete.
    So change your code like this:
    Call the Subroutine like this:
    <b>perform f_loadquota_apo using it_qitem[].</b>
    You can change the Definition of Form like this:
    <b>form f_loadquota_apo USING  it_qitem LIKE zapo_trqtap[].</b>
    LOOP AT it_qitem INTO wa_it_qitem.
    wa_it_quotavalue-trpid = wa_it_qitem-ztrpid.
    wa_it_quotavalue-quota = wa_it_qitem-zquota / lv_sum.
    append wa_it_quotavalue to it_quotavalue.
    endloop.
    endform.
    <b>Reward if Helpful</b>

  • Check the range of values of an internal table with the statement IN

    Hi,
    I'd like to know how to check if the current contents of a field are in the set described by an internal table.
    I know I have to use the statement <b>IN</b>, but I don't know exactly how to define the internal table. In my case, I have a single field (<i>tipo_doc</i>) in my internal table which stores 4 different values: C, I, K, L.
    I want to use the statement <b>IN</b> as shown next:
    SELECT * FROM VBFA APPENDING CORRESPONDING FIELDS OF TABLE it_flujo_docs WHERE ( VBELN = it_total_fact-vbeln )
                          AND ( VBTYP_V <b>IN</b> itab).
    Then I'd like to know how the internal table <i>itab</i> should be defined. It should be something like this I think, but it doesn't work:
    DATA: BEGIN OF itab OCCURS 0,
            tipo_doc LIKE zpedidos-tipo_doc,
            tipo_doc-sign = 'I',
            tipo_doc-option = 'EQ',
            tipo_doc-low = C,
            tipo_doc-high = L,
        END OF it_tipo_doc_ped.
    I'd appreciate if someone could tell me the proper way to define it.
    Thanks in advance,
    Gerard

    Hi,
    Please follow this.
    RANGES R_VBTYP FOR VBFA-VBTYP_V.
    R_VBTYP-SIGN = 'I'.
    R_VBTYP-OPTION = 'EQ'.
    R_VBTYP-LOW = 'C'.
    CLEAR R_VBTYP-HIGH.
    APPEND R_VBTYP.
    Do the same for value 'I', 'K' and 'L'.
    Now in the SELECT statement replace the following
    VBTYP_V IN itab
    with
    VBTYP_V IN R_VBTYP.
    Thanks
    Vinod

  • Join table with additional state

    I have two entities:
    A: @Id String acronym;
    B: @Id String name;
    and I need to create a relationship between these tables adding a new attribute:
    @Entity
    @SecondaryTables( {
              @SecondaryTable(name = "A", pkJoinColumns = @PrimaryKeyJoinColumn(name = "A_ACRONYM", referencedColumnName = "acronym")),
              @SecondaryTable(name = "B", pkJoinColumns = @PrimaryKeyJoinColumn(name = "B_NAME", referencedColumnName = "name")) })
    public class C implements Serializable {
         private static final long serialVersionUID = PujAbstractEntity.serialVersionUID;
         @Id
         @Column(name="acronym")
         private String acronym;
         @Id
         @Column(name="name")
         private String name;
    ERROR:
    [exec] Exception Description: An incomplete @PrimaryKeyJoinColumns was specified on the annotated element [class com.kenai.puj.arena.model.entity.PujInstitutionRoles]. When specifying @PrimaryKeyJoinColumns for an entity that has a composite primary key, a @PrimaryKeyJoinColumn must be specified for each primary key join column using the @PrimaryKeyJoinColumns. Both the name and the referencedColumnName elements must be specified in each such @PrimaryKeyJoinColumn.
    ????? any tip ?

    Thanks but I am still facing problems...
    --------- PujInstitutionEntity:
    @Entity
    public class PujInstitutionEntity extends PujAbstractRootEntity {
         @Id
         @Column(length = 20)
         private String acronym;
    --------- PujCompetitionEntity:
    @Entity
    public class PujCompetitionEntity extends PujAbstractRootEntity {
         @Id
         @Column(length = 12)
         private String name;
    --------- PujInstitutionRoles (the mapping):
    @Entity
    @IdClass(PujInstitution_Roles_ID.class)
    public class PujInstitutionRoles extends PujAbstractEntity {
         @ManyToOne
         @PrimaryKeyJoinColumn(name = "INSTITUTION_ACRONYM", referencedColumnName = "acronym")
         private PujInstitutionEntity institution;
         @ManyToOne
         @PrimaryKeyJoinColumn(name = "COMPETITION_NAME", referencedColumnName = "name")
         private PujCompetitionEntity competition;
    ---------- The deployment failure:
    [exec] Exception Description: Predeployment of PersistenceUnit [arenapuj] failed.
    [exec] Internal Exception: Exception [EclipseLink-7150] (Eclipse Persistence Services - 2.0.0.v20091009-r5515): org.eclipse.persistence.exceptions.ValidationException
    [exec] Exception Description: Invalid composite primary key specification. The names of the primary key fields or properties in the primary key class [com.kenai.puj.arena.model.entity.PujInstitution_Roles_ID] and those of the entity bean class [class com.kenai.puj.arena.model.entity.PujInstitutionRoles] must correspond and their types must be the same. Also, ensure that you have specified ID elements for the corresponding attributes in XML and/or an @Id on the corresponding fields or properties of the entity class.

  • Question about reading generic tables with keys

    Hello
    I'm wondering if it's possible to read a generic table with key statement:
    FIELD-SYMBOLS:
        <lv_key>         TYPE zconf_key,
        <lt_data_bi>     TYPE INDEX TABLE,
        <lt_data_ai>     TYPE INDEX TABLE,
        <ls_data_bi>     TYPE any,
        <ls_data_ai>     TYPE any.
    * create data types
      CREATE DATA lt_data_bi TYPE (ls_node-data_table_type).
      ASSIGN lt_data_bi->* TO <lt_data_bi>.
      CREATE DATA lt_data_ai TYPE (ls_node-data_table_type).
      ASSIGN lt_data_ai->* TO <lt_data_ai>.
    * do check
      LOOP AT <lt_data_ai> ASSIGNING <ls_data_ai>.
        ASSIGN COMPONENT 'KEY' OF STRUCTURE <ls_data_ai> TO <lv_key>.
        READ TABLE <lt_data_bi> WITH KEY key = <lv_key>
        ASSIGNING <ls_data_bi> BINARY SEARCH.
    I receive the message: "The specified type has no structure and therefore no component called KEY" in the read statement above.
    Does anyone has an idea what I can do here?
    Regards,
      Mathias

    Mathias Glockner wrote:
    >     READ TABLE <lt_data_bi> WITH KEY key = <lv_key>
    In your structure ls_data_bi there is no field called KEY . please check whether you have field KEY in structure
    a®s

  • Lock escalation on table with no key/index

    Hi,
    I've got the table with single column only (int) and no indexes nor pk/uq, just auto-created statistics.
    now, in transaction, there is a command: SELECT <COL> FROM <TABLE> WITH (ROWLOCK UPDLOCK) WHERE <COL>=100
    Table has variable num of records but it doesn't go over 200k, usually below 60k. Column values are mostly unique but can be duplicated in minor portion.
    Question 1: when this select executes, what will be locked - row, page or entire table?
    Question 2: if I have PK/UQ/index and execute same SELECT as above, what will locked then?

    Hi,
    1. Please note that every lock taken by sql server has some memory associated with it so more the number of locks more memory it will use. To avoid this unnecessary usage sql server uses Lock escalation when it deems necessary that it would be better to
    lock whole table instead of locking whole row.
    There is no use here using UPDLOCK with select statement, it would just change locking behavior and would force U lock lets see example
    I have a table having structure as
    CREATE TABLE [dbo].[Logging](
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [c1] [char](50) NOT NULL DEFAULT ('SOME MORE DATA')
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO
    it ha some 20 K records now lets concentrate on query which you asked
    begin transaction
    select @@SPID,ID,C1 from dbo.Logging with (ROWLOCK,UPDLOCK) where id=12
    --commit
    To see locks taken by this query we would run below query in other SSMS window
    Select
    resource_type,
    request_mode,
    request_status,
    request_session_id
    from sys.dm_tran_locks
    where resource_database_id=11--databse ID
    below is result
    You can see update lock bein taken on row and IX intent exclusive lock on object that is table and shared lock on database.
    Now if we change the query to scan whole table like below
    Now you can see Only exclusive lock is taken on whole table instead of taking on every row. If you see the query every row has predicate 'some more data' so ultimately a table scan would be required .
    Above is assuming default Isolation level
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • RFC calls with SAP table insert - lock tables

    Hi,
    I have an external server program, which is calling a rfc function many times the same time with different transaction types. There are transaction types, which are downloading information from SAP (only send data back to the caller), and there are transaction types which are uploading data to SAP (inserting/updating data on SAP).
    The function calls are synchronous as the server needs to get feedback directly. The parallel work processes for RFC calls are limited, so a system overload can´t happen.
    The problem now is, if the server is down for while and going to be restarted, it´s opening parallel threads and calls the function in SAP at nearly the same time. That means, it will call the function with upload requests (table must be locked), and download requests the same time.
    In the upload requests, the table has to be locked, that it can´t occur that we get wrong entries...
    I can only enqueue the table with just two fields... I know, that is almost like locking the whole table, but it´s not possible to lock it in a different way.
    I tried to use the enqueue function with the parameter WAIT, but it didn´t help, as there where too many parallel calls and after some seconds, they were ending up with an error (Because the table has been locked by another call).
    It seems that it´s trying to lock the table again for all parallel calls at exactly the same time....
    The calls has to be synchronous, as the server needs to get the feedback directly. Any ideas how top solve this, that it handles all incoming calls parallel and waits for the table is unlocked again?
    Thank you for your help!

    Hi,
    thank you for your answer!
    I have investigated something new yesterday:
    I thought at the beginning, that the problem just occurs, when the system work processes are reached. The system has for example set up 15 dialog processes and the external server is calling the function 20 times in parallel. Then we normally need 5 dialog processes more. The system is taking then all 15 dialog processes and the locks got stucked.
    That means, that I´ll maybe only get 4 or 5 uploads, which have really been updated the tables. All the others couldn´t get the table locked for their process.
    But if I now let the server call the function just about 13 times in parallel, nearly all uploads have been updated the table!
    From my point of view, the lock from SAP gets stucked, when the limit of dialog processes is reached. It´s not working in the right way anymore...
    The same is happening, when you set up in the system, that only 10 work proecesses can be used by RFC. If I have more than 10, it´s going to be critical with the locks....
    WEIRD!
    Can anybody help me out of trouble?
    Thank you!

  • Table with FK with no Index created will LOCK TABLE during DML ?

    Hi all,
    Know that always create index for FK on table as FK's value will 99.9% be use in Where query on table.
    Had seen info with regards to the above and had not been successfull trying to simulate the  above using:
      DROP TABLE "TABLE2";
      CREATE TABLE "TABLE2"
       (     "A2" VARCHAR2(10 BYTE),
          CONSTRAINT "PK_A2" PRIMARY KEY ("A2") ENABLE
    Insert into TABLE2 (A2) values ('AAA');
    Insert into TABLE2 (A2) values ('BBB');
    Insert into TABLE2 (A2) values ('CCC');
    DROP TABLE "TABLE1";
      CREATE TABLE "TABLE1"
       (     "A1" VARCHAR2(10 BYTE),
         "A2" VARCHAR2(10 BYTE),
         "A3" VARCHAR2(10 BYTE),
          CONSTRAINT "PK_A1" PRIMARY KEY ("A1"),
            CONSTRAINT "FK_A1_A2" FOREIGN KEY ("A2")
           REFERENCES "LSD"."TABLE2" ("A2") ENABLE
    Insert into TABLE1 (A1,A2,A3) values ('111','AAA','yyy');
    Insert into TABLE1 (A1,A2,A3) values ('222','BBB','ZZZ');
      When i UPDATE A3 in TABLE1 using '111' record in SQLPlus without COMMIT,
    I was able to UPDATE A3 using '222' in another SQLPlus session, so it does not seems like table is LOCK.
    Questions.
    1. Am using 10GR2, is the above not applicable to 10G ?
    2. Or had understand the above concept wrongly  ?
    Thanks In Advance
    Zack

    Hi Legatti,
    I was able to UPDATE A3 using '222' in another SQLPlus session, so it does not seems like table is LOCK.   Thought that when updating more than 1 record in TABLE1 will caused TABLE1 to be LOCK.
    Now, try to perform an update on the TABLE1 like below:    SQL>update table1 set A3='aaa' where A1=111;
    And open an another session and perform this SQL below    SQL>delete from table2 where A2='BBB'; -- now it's hangs
      Yes !!! Very interesting, it hangs until i do a COMMIT on the UPDATE
    and DELETE session shows ORA-02292 Integrity Constraint violated as child record found.
      Now, when i create a index for A2 on TABLE1, it DOES NOT HANG and shows ORA-2292 immediately.
      So, is this the result of having no index for FK column (A2) on TABLE1 and when doing DML ,
    before COMMIT, will result in TABLE2 to be hang upon doing DML on TABLE2 ?
    Thanks for the valuable lesson learned.
    Zack                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Dynamic table with header locked and vertical scrollbar problem.

    Hi,
    I have created a dynamic table with header locked.The sample code is as below.
    <div style="width:910px ; overflow-x : scroll">
    <h:panelgrid ...for header populated by binding to pagecode/>
    <div style="width:910px ; height:200px ; overflow-y : scroll">
    <h:panelgrid ...for data populated by binding to pagecode/>
    </div>
    </div>
    The above piece of code serves the purpose.
    There is an overflow in both x as well as y directions and scrollbars appear.But the y scrollbar can be seen only when the x-scrollbar is moved to the extreme right.
    Does anyone have a solution so that both the scrollbars can be seen as soon as the table loads without the need to move x to the extreme right to see y?

    wa_layout-grid_title = text-039.
        wa_layout-sel_mode = 'A'.
        APPEND wa_layout TO gs_layout.
        wa_layout-grid_title = text-039.
        wa_layout-sel_mode = 'A'.
        APPEND wa_layout TO gs_layout.
        wa_layout-grid_title = text-039.
        wa_layout-sel_mode = 'A'.
        APPEND wa_layout TO gs_layout.
      CALL METHOD gr_alvgrid1->set_table_for_first_display
          EXPORTING
            is_layout       = gs_layout
          CHANGING
            it_fieldcatalog = it_fieldcatalog1[]
            it_outtab       = <l_table>.
    i am using like but its not accepting more than one line header in is_layout, is there any possibility to take like this.
    Regards,
    Mallikarjuna.

  • Gather Schema Stats concurrent program error with lock

    We are running Gather Schema Statistics from Oracle E-Business Suite 11.5.10 against a 10..2 database. When run against individual schema it completes with no error, but when run against ALL schemas it completes with the following error.
    “ERROR: While GATHER_TABLE_STATS: object_name=XDP.XDP_ORDER_PROCESSOR_QTAB***ORA-20005: object statistics are locked (stattype = ALL)***”
    I understand why the tables are locked and I know how to unlock the table (exec dbms_stats.unlock_schema_stats('schema_owner'); exec dbms_stats.unlock_table_stats('table_owner','table_name');
    My query is this: Metalink Note [ID 433240.1] advises If the table is a queue table then the statistics should remain empty and locked so that dynamic sampling is used due to the volatility of queue tables.
    If I follow the advise in the note above, and leave the tables as locked then gather Schema Statistics will continue to complete with an Error (its annoying).
    I found metalink note (375351.1) which seems to say that all tables can be unlocked including queue tables.
    Has anyone encountered this problem, do you recommended that I unlock this tables even though they are queue tables.

    Hi;
    Please follow doc ORA-20005 WHEN GATHERING STATISTICS FOR APPS 11i / R12 IN 10G or 11G [ID 375351.1],i belive you can run command wihtout issue. If its prod than you can also rise SR and confirm wiht oracle support
    Regard
    Helios

  • INSERT Statement behind a FORM on a TABLE with REPORT

    When I create a form on a table with report, I'm sure an INSERT STATEMENT is genereated in the background somewhere. How can I see this insert statement or how can I get to this INSERT statement? If I can see it, would I be able to modify this INSERT statement?
    Please use simple terms.
    Thanks.

    Roel
    At first, i was just curious to see where that insert statement is and how it looks like.
    Later, I really wanted to see it because I wanted to know how it looks like whne I try to insert a one to many relationship record. Don't know if I'm being too clear on this.
    Lets say table A and B have a 1-to-many relationship. When I want to insert records into both A and B, how does the insert work? Maybe if I get an answer to this question, I may understand how the inserts are done on a 1 to many relationship data insert.
    Thanks.

  • Lock a table with toplink

    Hello
    I would like to lock a table with a toplink instruction (ie select for update).
    How to lock the data ?
    Thank in advance.

    You can think of using pessimistic locking if you are wanting SELECT for UPDATE.
    Following documentation will help you in this regard -
    - http://oraclesvca2.oracle.com/docs/cd/B14099_19/web.1012/b15901/dataaccs008.htm
    There is a section on pessimistic locking in that URL.

  • Db_associate fails with : Lock table is out of available lock entries

    Hi
    Occasionally on startup my app needs to rebuild its secondary database, so I call db_associate with DB_CREATE set. If the primary db is large the associate fails with "Lock table is out of available lock entries". Both databases are hashes, so I have not configured any special lock sizes as I didn't think I needed to.
    What lock configuration does db_associate need to succeed?
    I am using version 4.7.25
    Thanks
    Ashley

    Hi Ashley,
    You should be sizing the locking subsystem with high enough values so the secondary database rebuilds successfully, then run the "db_stat -C" utility and see how many locks, lock objects and lockers did you need to perform the operation and reconfigure the locking subsystem with values slightly bigger than what you needed, so you make sure that you'll have enough resources for the next time you'll rebuild the secondary.
    "Lock table is out of available lock entries" means that the Berkeley DB locking subsystem has not been configured for enough locks. For more information, see the "Configuring locking: sizing the system" section of the Berkeley DB Reference Guide, included in your download package and also available at:
    http://download.oracle.com/docs/cd/E17076_01/html/programmer_reference/lock_max.html
    To see what locks are held in the database environment at any time, you can dump the lock table using the -Cl options:
    % db_stat -h [database environment directory] -Cl -N
    Additional documentation:
    db_stat: http://download.oracle.com/docs/cd/E17076_02/html/api_reference/C/db_stat.html
    set_lk_max_locks: http://download.oracle.com/docs/cd/E17076_01/html/api_reference/C/envset_lk_max_locks.html
    Bogdan Coman

Maybe you are looking for