Disable the automatic optimizer statistics

Hello

I wanted to request user_tab_modifications track, the number of rows updated in a week. Because this view is updated automatically when the automatic optimizer statistics collects statistics, I have disabled the automatic optimizer statistics. Now, I will carry out run dbms_stats. FLUSH_DATABASE_MONITORING_INFO(); manually to get the full view with the number of rows updated.

My concern here is, I get the exact number of rows updated per week of user_tab_modifications in doing this? Also, is there anything that is also updated from this point of view outside of optimizer statistics that are collected on a table.

Thank you

You might try to write a few PLSQL yourself.

What:

SQL> create table count_X_updates (update_count number);

Table created.

SQL> insert into count_X_updates values (0);

1 row created.

SQL> commit;

Commit complete.

SQL>
SQL> create table X (col_1 varchar2(5), col_2 varchar2(5), col_3 number);

Table created.

SQL> insert into X values ('a','first',1);

1 row created.

SQL> commit;

Commit complete.

SQL>

SQL> create or replace trigger count_x_updates_trg
  2  after update of col_1,col_2,col_3
  3  on X
  4  for each row
  5  declare prev_cnt number;
  6  begin
  7  update count_X_updates set update_count = update_count+1;
  8* end;
SQL> /

Trigger created.

SQL>  update x set col_1 = 'b', col_2='secnd',col_3=2;

1 row updated.

SQL> commit;

Commit complete.

SQL> select * from count_X_updates;

UPDATE_COUNT
------------
           1

SQL>  update x set col_1 = 'c' where col_3=2;

1 row updated.

SQL> commit;

Commit complete.

SQL> select * from count_X_updates;

UPDATE_COUNT
------------
           2

SQL> select * from x;

COL_1 COL_2      COL_3
----- ----- ----------
c     secnd          2

SQL>

Note: This trigger code must be improved because
a. several sessions could obtain the same value
b. it introduced a serialization - several session waiting on a lock on the count_X_updates of the table line - effectively, which means that all other sessions to try to update X will wait (even if they are to be updated lines X) until each previous emits a COMMIT.

Thus, this demo code is only to show you the PLSQL triggers. But may not be used in Production.

Practice some PLSQL. Learn about the autonomous operations.

Hemant K Collette

Tags: Database

Similar Questions

  • Automatic optimizer statistics collection

    Hello

    on 11.2.0.4 standard edition, Win 2008

    How to check if the automatic optimizer statistics collection is enabled?

    Thank you.

    select * from dba_autotask_client where client_name = "auto optimizer stats collection"
    
  • I have disabled the automatic update, but it will however update! How to disable?

    I use version 34 and I don't want to update becase the plugins work correctly with the newer versions. I disabled the automatic updates check in preferences, but updates of firefox sometimes! It makes me very angry, I'm tired to restore my backups. What should I do to prevent the automatic update forever! I'll be able to update the program if I need!

    Mozilla Maintenance Service can be updated Firefox for you. Disabling updates of Firefox does not stop this 'service' to make updates.
    https://support.Mozilla.org/en-us/KB/what-Mozilla-maintenance-service

  • How can I disable the automatic renewal of an app?

    How can I disable the automatic renewal of an application I bought?

    Applications on the MAc App Store are a time purchase only. There is no renewal.

    The app offers a renewable subscription to certain services with inside, if that is managed through the application Web site if the subscription has been activated it, or can be managed inside your Apple if that was used to activate the subscription ID.

    View, change or cancel your subscription - Apple Support

  • How can I disable the automatic connection on Ubuntu OS Netbook

    During initialization of the machine AUTO LOGIN has been already highlighted.
    Unfortunately I only noticed that I hit the next key.

    How can I disable the automatic connection?

    I think I change the etc/gdm/gdm.conf, but would like confirmation that there is a slightly different version of Linux.

    malcolli

    Decided to give the full answer on this point Ubuntu system and it works fine.
    In a terminal, run the command: sudo/usr/sbin/gdmsetup

    This will bring up the gdm gui and there you can disable auto login and the login timed.

    malcolli

  • Disable the automatic reactivation after opening of the screen

    Hello

    is it possible to disable the automatic reactivation after the idle state by opening the screen? If so, how?

    Greetings
    Mr. Auer

    Hi, Matthias

    When the laptop is in sleep or Hibernate mode after the opening of the screen for laptop wakes up automatically and display will be automatically ON.

  • Disable the automatic backup in Apple applications

    How can I disable the automatic backup in the Script Editor and other Apple applications?

    I love how the captain tells us what is good for us and allows us no easy way to change things.

    AutoSave/Versions has been part of Mac OS X Lion. See these instructions. Save As will be in its normal position in all applications, and when you close the documents, you will be asked if you want to return (same result as the old do not save).

    Versions and AutoSave will always run in background for the applications that use it. You can't really turn off without disrupting some application menus, but it's been at least OS X behave more like Snow Leopard or earlier version.

  • You can disable the automatically load a random number of Freecell game first starts?

    FreeCell startup in Windows 7, it automatically loads a game of chance.  I don't want it.  I ALWAYS want to choose the number of game I want to play.  Yes, I can choose the game - after - the cards are dealt, but then I have to accept defeat on the hand held before that I don't want to play.

    I want to choose the game is because I'm going sequentially through the list, game 1 to...

    Yes, is it when even disable the automatic selection, or revert to the behavior where you will be asked to each selection random or # first game? (As in previous versions)

    Duh_ug,
    Well, I'm just a casual player of Freecell, so I've never really paid attention to the stats.  However what I found is that if after the cards are dealt, if you 'Select Game' before to make some moves on in the game, it does not count as a game played or a loss.  As soon as make you any kind of move on the game, then becomes an active game and will be considered a loss\game played if you select a new game.  Try it and make sure it works correctly for you. Mike - Engineer Support Microsoft Answers
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • I disabled the automatic updates and it starts to turn itself on, W H Y?

    "WINDOWS XP HOME SP2 '!

    I have disabled the automatic update and it starts itself to spin, WHY?

    HOW DO I KILL IT?

    I want all the crud that microsoft that will come to me.

    Hi Gail,

     

    You run the computer as an administrator?

    Method 1: You can run the fixit available in the article below from the off-ramp of Windows Update and then check if it makes a difference

    How to configure and use automatic updates in Windows

    http://support.Microsoft.com/kb/306525

    Method 2: You can see the steps outlined in the article below

     

    How do I turn off the Windows Update feature in Windows XP

    http://support.Microsoft.com/kb/892894

    Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base.
    How to back up and restore the registry in Windows

    Note: It is not recommended to disable Windows Update, automatic update, you do not have to search for updates online or worry that critical fixes for Windows might be missing from your computer. Windows automatically checks for updates for your computer.

  • How to disable the automatic updates of windows and to update on demand

    At the same time, I had disabled the automatic updates of windows and updated on demand by opening windows update.  Where is the place to activate and deactivate the automatic updates of windows.

    It worked.  Thank you!

    I wasn't able to get automatic updates to download a microsoft windows update.  The fix for microsoft in default mode indicated that he needed to be repaired and that fixed it.  When windows update was used again the update has failed once again.  The fix even that it was then run in aggressive mode and with a recheck has failed to correct the problem.  At each restart, automatic updates took the time to start producing a yellow shield and then pop-up reminders.  So thank you to help us with these questions to disable the automatic updates of windows.

    Thanks for posting the results of your efforts, I don't know they will be read and appreciated.

    UTC/GMT is 15:27 on Thursday, October 6, 2011

  • I cannont turn on automatic updating. I have is gray. Disable the automatic update is selected but also gray and selected.

    I cannont turn on automatic updating.  I have is gray.  Disable the automatic update is selected but also gray and selected.

    you have the service disabled?

    Click Start > run > type in services.msc box and Microsoft Management Console will be open.

    Search for automatic updates. Right-click the line, and then click Properties. In the dialog that opens, make sure Startup Type is automatic. Click on apply. Wait for it. Then click Start under Service status. You will see another pop-up window but it is a progress bar. If the service does not start, you will get an error. Otherwise, you will see wuauserv in the Task Manager. You should also see the yellow shield which shows you download updates. Also check your Windows Firewall and third-party firewall installed on the machine. Another place is the router/modem. You may need your ISP to help with the party.

  • How to disable the automatic locking of the screen of the computer with windows XP

    How to disable the automatic locking of the screen of the computer with windows XP? so many people responded on windows 7, but NOT a SINGLE spoke of XP.  I have this problem.  screen goes into sleep mode and I have to wake up even if NO PASSWORD is selected.  I changed the POWER SETTINGS. Nothing helps.  NEED HELP. Thank you

    Well since it is already assigned, and a mod has not moved this somehow already in the XP section:

    On your desktop, right-click right properties, under the screen saver are of course "on Resume, display logon screen" is NOT checked. You can also disable screen saver.

  • Disable the automatic generation of folder.jpg

    I have a couple of music files that already have incorporated album covers, but that do not contain the album cover itself in this same folder where the music file. Whenever I try to add music for collections such as the Zune software, it automatically generates a folder.jpg file. However, when I try to integrate album art on a music file using freeware like Mp3Tag and add it to my collection in the Zune collection, no folder.jpg file is generated automatically in the file where is the music file. Is it possible to disable the automatic generation of folder.jpg?

    Any help is appreciated.

    I have a couple of music files that already have incorporated album covers, but that do not contain the album cover itself in this same folder where the music file. Whenever I try to add music for collections such as the Zune software, it automatically generates a folder.jpg file. However, when I try to integrate album art on a music file using freeware like Mp3Tag and add it to my collection in the Zune collection, no folder.jpg file is generated automatically in the file where is the music file. Is it possible to disable the automatic generation of folder.jpg?

    Any help is appreciated.

    ==================================
    I am not sure that it is, but you can place
    all .jpg image in any folder and rename it Folder.jpg
    and it will be displayed on the folder when thumbnails
    display is selected...
    John Inzer - MS - MVP - digital media experience

  • How to disable the automatic creation of folders of documents under Vista?

    How can I disable the automatic creation of folders on my desktop windows wista SP2 documents?

    Hi ZucOrc,

    (1) since when are you facing this problem?

    (2) remember to make changes?

    Method 1: Run the fixit available in the links below and check if that makes a difference-Worth to try
    Diagnose and repair Windows files and folders problems automatically
    Difficulty of broken desktop shortcuts and common system maintenance tasks

    Note: FixIt would attempt to recover bad sectors on the hard disk, in the course of this process there are chances of DATA loss from that particular area.

    Method 2: Run Microsoft Security scanner (MSS) to any threat and try to correct

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    Note: Infected files can be deleted from your computer; There is a chance of data loss.

  • How can I disable the automatic backup in Photo Viewer?

    I did a clean install of Windows 7 Home Premium. As I looked through some of my pictures, one of them was displayed on the side and I used the 'spin' button to see her standing. As I clicked on the button 'Next', the picture has been saved without any confirmation. I don't want to save changes in the viewer of photos at all, and I have not found any setting for this. How can I disable the automatic backup in Photo Viewer?

    Hello

    Please note the last changes you make on your computer will be automatically saved on your computer and which will be unchanged, unless you change it again on your computer.

    As it is a design, there is nothing we can do from our end.

    If you want to suggest changes in the design here is the link you can make reference to: Microsoft Connect - back products and bug reports. Microsoft...

    https://connect.Microsoft.com/dashboard/Info/

    Thank you, and in what concerns:
    Suresh Kumar-Microsoft Support.
    Visit our Microsoft answers feedback Forum and let us know what you think.

Maybe you are looking for