How and when the table will go STALE ?

Hi,
I want to check how and when a table will be marked as STALE.
I have done following steps
---- Created a table --------------------
SQL> create table t1 (id number, name varchar2(100)) ;
Table created.
---- Inserted decent amount of data --------------
SQL> declare v1 number; begin for i in 1..25 loop
2 insert into t1 select object_id, object_name from all_objects ; commit; end loop;
3 end;
4 /
PL/SQL procedure successfully completed.
SQL> select table_name, status, num_rows, last_analyzed, monitoring from user_tables where table_name='T1';
TABLE_NAME STATUS NUM_ROWS LAST_ANAL MON
T1 VALID YES
---- Gather stats -----------------
SQL> exec dbms_stats.gather_table_stats( user, 'T1', METHOD_OPT => 'FOR ALL COLUMNS SIZE 1');
PL/SQL procedure successfully completed.
SQL> select table_name, status, num_rows, last_analyzed, monitoring from user_tables where table_name='T1';
TABLE_NAME STATUS NUM_ROWS LAST_ANAL MON
T1 VALID 115544 18-JAN-08 YES
---- Insert more data ---------------------------
SQL> declare v1 number; begin for i in 1..25 loop
2 insert into t1 select object_id, object_name from all_objects ; commit; end loop;
3 end;
4 /
PL/SQL procedure successfully completed.
Now, after I have analyzed the table and get the stats in, I loaded good amount of data. So, in theory, this table should be marked as STALE.
Where can I check if this table has been marked STALE? when ?
Please guide.
Thanks

You need to read that manual with more caution. It has all info you need.
1. Table modification info stays in shared pool and flushed into dictionary by Oracle automatically. You can explicity do it by calling dbms_stats.flush_database_monitoring_info.
2. dba_tab_modifications view = How many DML are applied to target table?
dba_tab_statistics.stale_stats = Is statistics stale?
3. When you call dbms_stats.gather... familiy, Oracle flushed the stale info to disk. You gnerally don't need to care about that.
4. Statistics is considered to be stale, when the change is over 10% of current rows.
(As of 11g, this value can be customized per objects. Cool feature)
create table t_stat(id int);
insert into t_stat select rownum from all_objects where rownum <= 100;
commit;
exec dbms_stats.gather_table_stats(user, 'T_STAT');
select * from sys.dba_tab_modifications where table_name = 'T_STAT';
No row selected
select stale_stats from sys.dba_tab_statistics where table_name = 'T_STAT';
NO
insert into t_stat select rownum from all_objects where rownum <= 20;
select * from sys.dba_tab_modifications where table_name = 'T_STAT';
No rows selected <-- Oops
select stale_stats from sys.dba_tab_statistics where table_name = 'T_STAT';
NO  <-- Oops
exec dbms_stats.flush_database_monitoring_info;
select * from sys.dba_tab_modifications where table_name = 'T_STAT';
TABLE_OWNER     TABLE_NAME     PARTITION_NAME     SUBPARTITION_NAME     INSERTS     UPDATES     DELETES     TIMESTAMP     TRUNCATED     DROP_SEGMENTS
UKJA     T_STAT               20     0     0     2008-01-18 PM 11:30:19     NO     0
select stale_stats from sys.dba_tab_statistics where table_name = 'T_STAT';
YES

Similar Messages

  • How and when the database release a row lock?

    Dear experts,
    We are using the following statement to obtain a row lock in a table in the database(ORACLE of course),
    SELECT * FROM {TABLE_NAME} WHERE ID = 1 for update
    and if we succeed grabbing the row lock we will continue to issue a update statement every 30 seconds to preserve the lock as far as possible.
    here is the update statement to preserve the lock,
    UPDATE {TABLE_NAME} SET time = ? WHERE ID = 1.
    As you see more longer we keep holding the row lock , more update statements are submitted in the pending transaction.
    In normal case our application can grab the exclusive row lock and works for a long time,however sometimes a connection reset exception is thrown
    and our application will close the connection(I assume the pending transaction will be rolled back by the database) and exit the JVM.
    Since other applications will keep trying to grab the same row lock to become the master role,
    we expect one of them can succeed but they are all failed because the database has not released the row lock as expected.
    Can someone explain more details about how and when the row lock can get released in our use case?
    Thanks,
    SuoNayi
    Edited by: SuoNayi on 2013-5-30 上午8:12

    Hm. Is this part of an XA transaction by any chance? I know that Oracle maintains separate bookkeeping for such transactions which can cause rows to stay 'locked' even when the regular DBA views will indicate there is no user currently locking the record at all. I have no idea about the actual details and what you need to do to clean up such a situation, that is something a DBA should know and do.
    If not... well this is more of a question for people who know the DBMS, which makes it a target for the Oracle DBMS forums. Java developers don't tend to have DBA-level knowledge of the database, you should ask the question where you have more chance of people with expertise answering stuff:
    General Database Discussions

  • How and when the realDelete method gets called for a custom adapter?

    Hi,
    I am a newbie in sun identity manager and is in the process of writing a custom adapter for documentum resource.
    While I am successful in creating the resource,then provisioning the resource to an user(i.e creating an account of the user on documentum ) updating the user through idm I am not being able to deprovision the resource.
    Actually in the trace I am not seeing the realDelete method getting called anywhere,but I am sure if it gets called it would do its designated job bcos as a standalone code it's working.
    Does this mean I am not properly doing deprovisioning in sun-idm?
    What method I am employing is in the assignment list of the user,i am putting the resource from assigned to unassigned side(i.e right to left side) just as in case of provisioning I have put it from left to right.
    Is it the standard way of deprovisioning or am I missing something here?
    Any sort of help would be highly appreciated.
    Thanks
    anjan

    You need to read that manual with more caution. It has all info you need.
    1. Table modification info stays in shared pool and flushed into dictionary by Oracle automatically. You can explicity do it by calling dbms_stats.flush_database_monitoring_info.
    2. dba_tab_modifications view = How many DML are applied to target table?
    dba_tab_statistics.stale_stats = Is statistics stale?
    3. When you call dbms_stats.gather... familiy, Oracle flushed the stale info to disk. You gnerally don't need to care about that.
    4. Statistics is considered to be stale, when the change is over 10% of current rows.
    (As of 11g, this value can be customized per objects. Cool feature)
    create table t_stat(id int);
    insert into t_stat select rownum from all_objects where rownum <= 100;
    commit;
    exec dbms_stats.gather_table_stats(user, 'T_STAT');
    select * from sys.dba_tab_modifications where table_name = 'T_STAT';
    No row selected
    select stale_stats from sys.dba_tab_statistics where table_name = 'T_STAT';
    NO
    insert into t_stat select rownum from all_objects where rownum <= 20;
    select * from sys.dba_tab_modifications where table_name = 'T_STAT';
    No rows selected <-- Oops
    select stale_stats from sys.dba_tab_statistics where table_name = 'T_STAT';
    NO  <-- Oops
    exec dbms_stats.flush_database_monitoring_info;
    select * from sys.dba_tab_modifications where table_name = 'T_STAT';
    TABLE_OWNER     TABLE_NAME     PARTITION_NAME     SUBPARTITION_NAME     INSERTS     UPDATES     DELETES     TIMESTAMP     TRUNCATED     DROP_SEGMENTS
    UKJA     T_STAT               20     0     0     2008-01-18 PM 11:30:19     NO     0
    select stale_stats from sys.dba_tab_statistics where table_name = 'T_STAT';
    YES

  • How and when does table SWIWIOBJCT being updated / populated with workitem

    Hi Experts,
    I am currently debugging an issue wherein a Invoice Workflow is being displayed in the Purchase Order Workflow Overview. I debugged this and found out that this is because there are entries being selected from table SWIWIOBJCT and this will be also displayed in the workflow overview.
    So what I am trying to look into is how does this table being populated. Like, what are the criteria and requirements that this table will be updated / populated.
    Any help is highly appreciated.
    Thanks so much in advance,
    Larissa
    Edited by: Larissa Taguiamon on Apr 14, 2010 7:48 PM

    Abdullah
    The EKBE table will have items related to PO history - so if you go to a PO line item and look at the PO history you will see an invoice but you will NOT see a payment.   Payments are not directly related to a PO and therefore no payment information would appear in your PO history and therefore it wouldn't be on the EKBE table either 
    Sandra

  • How and when to create a fact table

    hi every1,
    I am new to oracle and specially to Data Warehousing. I am using OWB 11g on windows XP.
    I have created the dimensional for a database, now i am in the implementation phase.
    i have the following questions.
    1. I don't know how and when to create a fact table. I have already created the dimensions (ROLAP).
    2. Do i need to create a mapping for a Cube. if yes, then how to load them from 4 different dimensions. how will be the join condition, they don't match?
    3. I will also try for aggregation, do i need to use MOLAP for the dimensions or ROLAP works?
    Please, give a quick reply.
    regards
    RF

    You should ask your question here:
    Warehouse Builder
    where it is on topic.

  • How to add a field to the selection screen and when the user enters ...

    hi all,
    can any one plesase send the code of how to add a field to seletiion screen and when the user enters in the field , it should be store in the database table , the table is MKPF and the field is BKTXT.  Thanks.

    Hi Kripa,
       If u r using PNP ldb then the screen u will get is the screen for that ldb and if u want to add some more fields then u define using selection-screen..as follows
    SELECTION-SCREEN BEGIN OF BLOCK mysel WITH FRAME TITLE text-111.
    PARAMETERS: n_in_en  RADIOBUTTON GROUP g1,
                q_ev  RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK mysel.
    SELECTION-SCREEN BEGIN OF BLOCK mysel1 WITH FRAME TITLE text-222.
    PARAMETERS: r_date TYPE sy-datum DEFAULT sy-datum.
    SELECTION-SCREEN END OF BLOCK mysel1.
    SELECTION-SCREEN BEGIN OF BLOCK mysel2 WITH FRAME TITLE text-333.
    PARAMETERS:f_ver(3) TYPE c DEFAULT 1,
               c_no(10) TYPE c DEFAULT '9D0161',
               u_id(15) TYPE c,
               password(15) TYPE c,
               r_email(30) TYPE c DEFAULT PARAMETERS: s_not TYPE c AS CHECKBOX.
    PARAMETERS:t_run TYPE c  AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK mysel2.
    SELECTION-SCREEN BEGIN OF BLOCK mysel3 WITH FRAME TITLE text-444.
    SELECTION-SCREEN BEGIN OF BLOCK mysel4 WITH FRAME TITLE text-555.
    PARAMETERS: p_ser  RADIOBUTTON GROUP g2,
    a_ser  RADIOBUTTON GROUP g2.
    SELECTION-SCREEN END OF BLOCK mysel4.
    SELECTION-SCREEN BEGIN OF BLOCK mysel5 WITH FRAME TITLE text-666.
    PARAMETERS:p_path TYPE string.
    SELECTION-SCREEN END OF BLOCK mysel5.
    SELECTION-SCREEN END OF BLOCK mysel3.
    u will get this additional screen after the screen of ldb.
    I hope this will help u..
    Thanks & Regards
    Ashu Singh.

  • How and When Sub-Ledger Data is populated into XLA_DISTRIBUTION_LINKS Table

    Hello Gurus
    I have been working on a Sub-Ledger Accounting and I could get a fair idea of how data is being transferred from XLA_DISTRIBUTION_LINKS to XLA_AE_LINES and XLA_AE_HEADERS. As per my understanding, During "Create Accounting" process, data from XLA_DISTRIBUTION_LINKS will be summed up based on JOUNRAL_LINE_TYPES rules and conditions to load into XLA_AE_LINES and XLA_AE_HEADERS. Then during "Transfer to GL" process, data from XLA_AE_LINES and XLA_AE_HEADERS is transferred to GL Tables. What I didn't understand is how and When data gets loaded into XLA_DISTRIBUTION_LINKS. What are the rules and conditions and during which step data will be loaded to XLA_DISTRIBUTION_LINKS table? Can somebody please explain me how data is transferred from Sub-Ledger Distribution Tables to SLA Distribution Table?
    Thanks,
    Sunny.

    Above Notes are good.
    But I just wanted to add a staight point.
    xla_distribution_links and xla_ae_lines will get populated at the same time.
    Both goes on JLTs and their conditions. One is detailed and the other is summarized / merged.
    xla_ae_lines will have extra balancing lines and xla_distirbution_links will have extra gain / loss lines, which end up with zero amount.
    Also check the links for the setup of distribution identifiers.
    http://docs.oracle.com/cd/E18727_01/doc.121/e13420/T193592sdextchap.htm#sdextacattg
    http://docs.oracle.com/cd/E18727_01/doc.121/e13420/T193592sdextchap.htm#sdextdisidg
    By
    Vamsi

  • How to update the table when change list item in classic report

    hi ,
    i worked with apex 4.2 and i create normal classic report with one select list(named loved)Column ,now i want to update table when user change the list with new value ,i can't create dynamic action to do this,i create check box with primary key and loop for check item to update the table but i can't get the value of list item. and for more speed the user want to do this when change the list value.
    my question
    1- how to do this by javascript and get the value from list item and update the table with new value
    2- is i must use API to create list item so i can get the value of item in report or what.
    Thanks
    Ahmed

    I coded the following to give you direction:
    1. In the "Element Attributes" section of the DEPTNO column, I call a javascript function as:
    onchange = "javascript:updateTable(this);"2. I wrote a simple javascript function that shows an alert when the user changes the select list as:
    <script language="JavaScript" type="text/javascript">
    function updateTable(pThis)
        var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
        alert('Row# - '+ vRow + ' has the value - ' + pThis.value);
    </script>Now, you can call a AJAX on-demand process inside the javascript function to update the database value.

  • Synonyms cant be recompiled when the tables are dropped and recreated?

    hi
    i have a synonym pointing to a table .
    1)when i drop and recreate a table.............
    isnt it enough to recompile the synonym? do i need to drop the synonym as well and recreate again?
    2) when i add new columns to a table will the synonym also show up the new column?
    thanks in advance
    raj

    Recompiled is probably not quite the correct word. Re-validated is more like it.
    Notice that the synonym goes invalid when the table is dropped, but does NOT become valid when the table is recreated.
    That happens the first time it's used (similar to invalid stored procedures).
    SQL> drop table t;
    Table dropped.
    SQL> select object_name, status
      2  from user_objects
      3  where object_name = 'T_SYN';
    OBJECT_NAME                    STATUS
    T_SYN                          INVALID
    SQL> create table t(c number);
    Table created.
    SQL> select object_name, status
      2  from user_objects
      3  where object_name = 'T_SYN';
    OBJECT_NAME                    STATUS
    T_SYN                          INVALID
    SQL> select * from t_syn;
    no rows selected
    SQL> select object_name, status
      2  from user_objects
      3  where object_name = 'T_SYN';
    OBJECT_NAME                    STATUS
    T_SYN                          VALID

  • My iPhone 4 is 3 years old, and recently the Flash will only work WHEN it wants to... Anyone got any ideas what I need to do?

    My iPhone 4 is 3 years old, and recently the Flash will only work WHEN it wants to... Anyone got any ideas what I need to do? Does it need to be repaird in an Apple store? if so does anyone know roughly how much it would be? Or would a simple Restore work?
    Thank you in advance for replies

    Take it to an Apple store. Most likely you will have to get a replacement for which you will be charged the replacement fee.
    Rice only absorbs water. But it cannot prevent damage to the device.

  • How to get the table of value field? and can we expand the technical limits

    Dear
    I have created value field in COPA with KEA6. And now, I need the table which the value fields are saved. Yet, I have tried a lot to find it and get failure? Can any guy help me? Please tell me how to get the table of a value field.
    And another question is that, can we extend the technical limits for the number of value field for ECC6.0?
    We have a note for R.4.x Please see below:
    OSS note 160892
    You can display the length of a data record using Transaction KEA0 ('Maintain Operating Concern'). After you have navigated to the 'Characteristics Screen' or to the 'Value field Screen' choose menu path 'Extras -> Technical Limits'.
    The maximum displayed here under 'Length in bytes on the DB' is the maximum length permitted by the Dictionary. The reserve required for the release upgrade must be subtracted from this value.
    To increase the allowed number of the value fields, increase the value that is assigned to field ikcge-bas_max_cnt (FORM init_ikcge_ke USING fm_subrc, approx. line 165) in Include FKCGNF20. It specifies the number of the possible value fields. The corresponding part of the source code is attached to the note as a correction.
    David Sun
    Regards!

    how to extend the limit of value numbers? please see the original question.

  • I got the iPhone 4S and I use google calendar and when the Sprint salesperson set up my phone only 2 months of my calendar went on my phone. How do I get my whole calendar to sync on my phone?

    I got the iPhone 4s and i use google calendar and when the Sprint sales person set up my phone, only 2 months showed up on my iPhone. How do I sync all of google calendar to my iPhone!

    Settings/Mail,Contacts,Calendar - there's a setting for how far back to sync calendars.

  • Ask your question.please help itunes will not launch on my computer the icon on desktop has changed to a white folder no error message appears and it appears but then disappears in task manager when the programme will not open quick time is working

    please help i need to fix my itunes it will not launch on my computer . no error message appears it simply will not run. the icon on desktop has changed to a white folder and it still appears in programmes in start menu but will not open. it appears in task manager but disappears when the programme will not open

    You music etc should not be affected by problems with the iTunes program, nevertheless it is always a good idea to backup your data.
    You haven't said if there was any error message when you tried to start iTunes. If  there was one please give it in full.
    Also check to see if QuickTime works, iTunes can not work without it. If QuickTime doesn't work, it has to be fixed before worrying about iTunes.
    Then restart your PC and open your Task manger and select the Processes tab.
    Try to start iTunes, does iTunes.exe appear on the processes tab? If so does it disappear again or remain although the programs does not open?

  • In MS Word, it is possible to prevent tables from breaking at page breaks.  So, if a table, when populated with data gets too big for the spae allotted on one page, the table will move in its entirety, to the next page. Can this be done in "Pages"?

    I am trying to figure out ow to prevent tables from breaking along a row when there is a page break in "Pages".  This is done in MS Word by going under Table properties under "Rows".   I have a document with small three row tables and I want to keep the tables together and move to the next page in its entirety when there is a page break.  Help!

    The table that I don't want to break between rows looks like this, except it fits the width of the page:
    quilt name
    picture of quilt      
    source
    Size: XX; Difficulty Level: 3
    I inserted a Inline Text box into the document, copied the table inside the text box, then pasted it through the document (which lists quilting projects).  When the table spans a page break, even when in an inline text box, the picture which is in the right hand column splits, as well as the information pertaining to the particular quilt.
    Jerry - thank you for your help.  I tried to give you a "solved my problem" rating, but I am adjusting to the Mac slowly after 20+ years on a PC.

  • I am running Windows 7 Professional.  When I try to install Flashplayer, I get to step 3, and then the installation will not proceed any further.  A blank dialog box appears, with Adobe Flash Player Installer in the upper left corner.  I have tried to ins

    I am running Windows 7 Professional.  When I try to install Flashplayer, I get to step 3, and then the installaion will not proceed any further.  A blank dialog box appears, with Adobe Flash Player Installer in the upper left corner.  I have tried to install on Explorer, Firefox, and Chrome.  Nothing works. Please help.
    Thanks/ Scott

    1. Restart your computer to stop any Adobe process that is running.
    2. Click on the following Adobe  link. Go to the bottom where it says "Still having problems?". Click on the version of Flash Player for your browser.
    Installation problems | Flash Player | Windows

Maybe you are looking for