Automatic statistics generation in 11.2

Dear experts!
I've initialized the automatic statistics collector in my 11.2 db as follows:
BEGIN
DBMS_AUTO_TASK_ADMIN.ENABLE(
client_name => 'auto optimizer stats collection',
operation => NULL,
window_name => NULL);
DBMS_SCHEDULER.SET_ATTRIBUTE('SYS.MONDAY_WINDOW', 'repeat_interval', 'freq=daily;byday=MON;byhour=11;byminute=0;bysecond=0');
DBMS_SCHEDULER.SET_ATTRIBUTE('SYS.WEDNESDAY_WINDOW', 'repeat_interval', 'freq=daily;byday=WED;byhour=11;byminute=0;bysecond=0');
DBMS_SCHEDULER.SET_ATTRIBUTE('SYS.FRIDAY_WINDOW', 'repeat_interval', 'freq=daily;byday=FRI;byhour=11;byminute=0;bysecond=0');
DBMS_SCHEDULER.SET_ATTRIBUTE('SYS.THURSDAY_WINDOW', 'repeat_interval', 'freq=daily;byday=THU;byhour=11;byminute=0;bysecond=0');
DBMS_SCHEDULER.SET_ATTRIBUTE('SYS.TUESDAY_WINDOW', 'repeat_interval', 'freq=daily;byday=TUE;byhour=11;byminute=0;bysecond=0');
DBMS_STATS.GATHER_SCHEMA_STATS(ownname => 'DBUSER',
options => 'GATHER AUTO',
estimate_percent => dbms_stats.auto_sample_size
END;
After this initial procedure the automatic maintenance task checks from monday to friday at 11 am if the statistics of the database objects are still ok. For objects with old statistics they are newly generated.
The first question is with which parameters the automatic maintenance task executes the dbms_stats.gather_... for the objects with old statistics. In my opinion it'll take the same options as specified in the initial procedure (options=GATHER AUTO and estimate_percent=dbms_stats.auto_sample_size). Am I right?
The second question belongs also to the parameter of the dmbs_stats procedure - but in another context:
Some used tools generate statistics too after intensive workload, they execute the following:
execute DBMS_STATS.GATHER_SCHEMA_STATS(ownname => 'DBUSER',
options => 'GATHER EMPTY',
estimate_percent => 70
execute DBMS_STATS.GATHER_SCHEMA_STATS(ownname => 'DBUSER',
options => 'GATHER STALE',
estimate_percent => 70
So what happens to my automatic maintenance task after these two procedure calls? Do these two procedures overwrite the inital provided option (GATHER AUTO) which is required for automatic statistics collection? If yes does it mean that the automatic statistics collector doesn't maintain the database objects any more?
Thanks for your help!
Best regards!
Markus

1. There is a database and table option called MONITORING. By default this is turned on from 10g. So database is watching for changes and will collect statistics on tables/objects where needed in GATHER AUTO option.
2. No GATHER AUTO options wont be touched but you recollect stats on objects you specified in function/procedure call. And if those objects wont change in the future AUTO GATHER may wont touch these stats anymore....
This is a doc reference list I created when I was working on similar issue. :)
Best Practices for automatic statistics collection on Oracle 10g [ID 377152.1]
https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=BULLETIN&id=377152.1
How to check what automatic statistics collection is scheduled on 10g [ID 377143.1]
https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=377143.1
How To Extend Maintenance Windows For GATHER_STATS_JOB for More Than 8 Hours? [ID 368475.1]
https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=368475.1
Oracle 10g PL/SQL Packages and Types Reference - DBMS_SCHEDULER documentation
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_sched.htm#CIHHBGGI
Oracle 10g PL/SQL Packages and Types Reference - DBMS_STATS documentation
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_stats.htm#CIHBIEII
Oracle® Database Performance Tuning Guide 10g Release 2 (10.2) 14 Managing Optimizer Statistics 14.2 Automatic Statistics Gathering
http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/stats.htm#i41282
Statistics Best Practices: How to Backup and Restore Statistics [ID 464939.1]
https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=464939.1
Managing CBO Stats during an upgrade to 10g or 11g [ID 465787.1]
https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=HOWTO&id=465787.1

Similar Messages

  • Automatic PO generation while doing MIGO

    Hi,
    Please guide me the details configuration and data maintain steps to enable automatic po generation at the time of doing MIGO with the movement type .
    Thanks in Advance,
    Regards,
    Soumen

    Settins
    a) Define and asing standard purchasing Organization at the Enterprice structure configuration
    Note: You can use the same normal purchasing organization you use for procurement as a standard.
    b) Activate automatic PO indicator for movement type 101 in coustomizig
    materials management - inventory management - goods receipt - create purchase order automatically
    c) Define purchasig document type
    materiales management - purchasing - define default values for puchasing document type
    d) Infor record for the standard purchasing organization and the vendor mater record.
    Note: You can use the same normal purchasing organization you use for procurement as a standard.
    e)The material has to be valuated
    And when you use de MIGO use movement type 101 as an non ordered item.
    regards,
    MC

  • Problem in Automatic mail generation after shipment creation in vt01

    Hi All,
    In VT01 Automatic mail generation to  customer  whenver a new shipment is created & in from address user mail adderess is mentioned but in my requirements i have  to mention different mail id in user mail address.
    how can i do this?
    please give me ur suggestions.
    Thanx

    Hi...
    When user close the shipment ,then he gets a mail on his id automatically generated from sap system.
    he want this mail should come to the mail id of his colleague.
    Pls reply asap.
    Thanx
    Vj

  • How to automate the generation of SCB Indicator while raising Invoices?

    Hi Team,
    According to our client requirements we are using different SCB Indicators(for Foreign vendors) in order to segregate the payments for diff. services. Can we automate this SCB Indicator while raising the invoices ? Else is there any other way to achieve this requirement.
    We are using different sources to raise the invoices automatically like self billing process, other middleware i.e. from Non-SAP system etc.,
    If we are raising invoices manually via MIRO / FB60 then we are giving the suitable SCB indicator according to the relevant service. Can we automate the generation of SCB Indicator while raising the invoices automatically ?
    Please provide your valuable suggestions!
    Thanks & Regards,
    Lakshmi S

    Hi Vinod,
    Thanks alot for your help in this regard
    Requesting you to please clarify here which BADI is the relevant one.PFB the screenshot for your easy reference.Because we found nearly 4 BADIs related to this scenario.Please through some light here once.
    Thanks in Advance!
    Regards,
    Lakshmi S

  • How stop the automatic statistics collection job after the maintenance wind

    Hi,
    we are for a solution to stop the automatic statistics collection job after the maintenance window finished.
    we disable all jobs except the automatic statistics collection, because this is the only one we want to run. Then we define specific values for the interval and duration parameters of the maintenance window to customize this task.
    But for their systems it is very important that this job/task will immediately stop when the window is closed!!!
    So, how could we ensure this behavior.
    For Oracle 10g it is easy because the statistic job always exists and it is possible to set its duration and create an addtional event based job which kills all jobs that are running over duration.
    In Oracle 11g the statistic job is created by the system during the maintenance window is open.
    We are not able to modify parameters of this system job. After the maintenance window closed the job is already running - only with another resource priority - but it is running.
    Please help me in this scenario
    Thanks&Regards
    Prem

    ?So basically you are saying is if none of the tables are changed then GATHER_STATS_JOB will not run, but i see tables are updated still the job is not running. I did >query dba_scheduler_jobs and the state of the job is true and scheduled. Please see my previous post on the output
    Am i missing anything here, do i look for some parameters settings
    So basically you are saying is if none of the tables are changed then GATHER_STATS_JOB will not run,GATHER_STATS_JOB will run and if there are any table in which there's a 10 percent change in data, it will gather statistics on that table. If no table data have changes less than 10 percent, it will not gather statistics.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/stats.htm#i41282
    Hope this helps.
    -Anantha

  • How to disable automatic statistics collections on tables

    Hi
    I am using Oracle 10g and we have few tables which are frequently truncated and news rows added to it. Oracle automatically analyzes the table by some means which collects statistics of the table but at the wrong time(when the table is empty). This makes my query to do a full table scan rather using indexes since the statistics was collected when the table was empty.Could any one please let me know how to disable the automatic statistics collection feature of Oracle?
    Cheers
    Anantha PV

    Hi
    I am using Oracle 10g and we have few tables which
    are frequently truncated and news rows added to it.
    Oracle automatically analyzes the table by some means
    which collects statistics of the table but at the
    wrong time(when the table is empty). This makes my
    query to do a full table scan rather using indexes
    since the statistics was collected when the table was
    empty.Could any one please let me know how to disable
    the automatic statistics collection feature of
    Oracle?
    First of all I think it's important that you understand why Oracle collects statistics on these tables: Because it considers the statistics of the object to be missing or stale. So if you just disable the statistics gathering on these tables then you won't have statistics at all or outdated statistics.
    So as said by the previous posts you should gather the statistics manually yourself anyway. If you do so right after loading the data into the truncated table, you don't need to disable the automatic statistics gathering as it only processes objects that are stale or don't have statistics at all.
    If you still think that you need to disable it there are several ways to accomplish it:
    As already mentioned, for particular objects you can lock the statistics using DBMS_STATS.LOCK_TABLE_STATS, or for a complete schema using DBMS_STATS.LOCK_SCHEMA_STATS. Then these statistics won't be touched by the automatic gathering job. You still can gather statistics using the FORCE=>true option of the GATHER__STATS procedures.
    If you want to change the automatic gathering job that it only gathers statistics on objects owned by Oracle (data dictionary, AWR etc.), then you can do so by calling DBMS_STATS.SET_PARAM('AUTOSTATS_TARGET', 'ORACLE'). This is the recommended method.
    If you disable the schedule job as mentioned in the documentation by calling DBMS_SCHEDULER.DISABLE('GATHER_STATS_JOB') then no statistics at all will be gathered automatically, causing your data dictionary statistics to be become stale over time, which could lead to suboptimal performance of queries on the data dictionary.
    All this applies to Oracle 10.2, some of the features mentioned might not be available in Oracle 10.1 (as you haven't mentioned your version of 10g).
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle:
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Automatic invoice generation for service contract

    Hello,
    I want to create the  automatic invoicce generation for service contract based on the order.
    whenever i raise service contract order system should create the invoice automatically.
    could please let me know the settings?

    Hi JP Reddy
    You can schedule VF04/VF06 for your requirement, such that VF06 will run every 15/30 minutes and will generate billing document for your contracts automatically.
    Else go for Z extension development which will assign as output type to your contract and once triggered it will create invoice.
    try and revert

  • Automatic number generation using the function module

    Hai Everyone,
    I have the doubt in automatic number generation.
    i find the function module. the function module is
    report 123.
    *DATA: RC         LIKE INRI-RETURNCODE,
         NUMBER(10) TYPE C.
       CALL FUNCTION 'NUMBER_GET_NEXT'
            EXPORTING OBJECT          = 'HUGO'
                        NR_RANGE_NR     = '01'
            IMPORTING RETURNCODE      = RC
                        NUMBER          = NUMBER.
      CASE RC.
        WHEN ' '.
         everything o.k.
        WHEN '1'.
         the assigned number lies in the critical area.
        WHEN '2'.
         this was the last number, next time the first number
          will be assigned
      ENDCASE.
      write:/ number.
      in that function module what i want to give the  Exporting Object  'HOGO'. where i want to define the number range. what is meant by 'HOGO'.
    If any one faced the same problem plz help me.
    Thanks and regards,
    P.Naganjana Reddy

    Hai Chandrasekhar,
    in that what i have to give. Plz help me in this.
    Subobject data element
    To-year flag
    Number length domain
    No interval rolling
    Number range transaction
    Warning %
    Main memory buffering
    Group table
    Subobject field in group table
    Fld  NoRangeElement
    Fields int./ext. no.range no.
    Fld. NoRangeNo
    Display element text
    Thasnks and regards,
    P.Naganjana reddy

  • Automatic PR generation during third party sales order

    When I am create third party Sales order , systems automatically tries to creates the PR . Ok its fine and as expected . But system asks for Account assignment. Where I can give that account assignment during the auto PR at Sales order

    Hi,
    In Automatic PR generation during 3rd party sales order,the account category determination depends on following configuration:
    Step 1:
    Sales & Distribution-->Sales->Sales Documents->Sales Document Item->Define Item Categories--
    Check this configuration
    Step 2:
    Sales & Distribution-->Sales->Sales Documents->Sales Document Item->Define Schedule line CategoriesUnder this configuration ,for your scheduline item category ,check following entries ,Order type-NB ,Item Category---5 & Acct.Assingment category (3rd Party).
    Step3:
    Sales & Distribution-->Sales->Sales Documents->Sales Document Item--->Assign Schedule line Categories
    Then Assign the schedule line category to 3rd Party Item category defined .
    From this when PR get generated then acct.assingment category get populated automatically .
    Thanks,
    AMIT

  • Third Party Sales-Automatic PO generation

    Hi
    I am using Item cat.TAS & Automatic PO Generation is ticked in TAS.
    Schedule line cat. CS.but automatic PR is  getting generated & PO is not getting generated...
    Pls help...
    Amol

    Hi,
    As far as my knowledge goes, we will be getting only PR and Not PO. You need to create PO in ME21N, with reference to this PR.
    The Automatic PO Generation field in Item Category is used for creating PO for ALE Process (you can get in F1 Help)
    Regards
    Vamsi Javaji.

  • Automatic playlist generation error

    I have the 8320 curve.
    My problem is with "Automatic Playlist" generation.
    When creating an auto playlist I get the error message:
    "Your automatic playlist criteria generated no songs to play"
    I go to music > playlists > new playlist > Automatic Playlist
    Then click the plus sign on the right side of select artist.
    Then next to FIND: I enter my selection criteria.
    Let's say U2 for example.
    A list comes up wih U2, UB40,...  and I select U2
    This enters U2 as the criteria under "Songs by these artist"
    I then name the playlist on that same screen and press the ball to start the selection process.
    That is when the error messages comes up:
    "Your automatic playlist criteria generated no songs to play"
    I did notice I'm not the only goober with this problem:
    http://forums.crackberry.com/f2/auto-playlist-generation-145014/
    Any advice would be greatly appreciated.
    SDinSD

    Any ideas? I'm convinced there must a script that can do this somewhere...

  • DPR_ATTRIBUTES - Automatic number generation of Project ID

    Dear All,
    I am using the method 'SET_DEFAULTS_UPON_CREATION' in  BAdi 'DPR_ATTRIBUTES'  for automatic number generation of Project ID in cProjects.
    I am able to change the project ID with my new number in CS_ATTRIBUTES. But the same is not getting populated to cprojects screen.
    My code --
      FIELD-SYMBOLS:
        <ls_attributes> TYPE dpr_ts_project_int.
      CASE flt_val.
        WHEN cl_dpr_co=>sc_ot_project.
         ASSIGN cs_attributes TO <ls_attributes>.
          CALL FUNCTION 'NUMBER_GET_NEXT'
            EXPORTING
              nr_range_nr = '01'
              object      = 'ZXX'
            IMPORTING
              number      = g_pid.
          CONCATENATE g_ptype g_pid INTO g_newpid SEPARATED BY '-' .
            MOVE g_newpid TO <ls_attributes>-project_id.
    ENDCASE.
    While debugging the new project ID can be viewed in CS_ATTRIBUTES.
    Can you please let me know what might be the issue for not populating on cprojects.

    Hi Matthias,
    Thanks for the reply.
    Can you please help me where exactly the external_id attributes needs to be changed.
    Your help is greatly appreciated.
    Matthias

  • Urgent: automatic key generation and java.lang.Long

    Hi,
    I keep getting the following error:
    In RDBMS CMP bean 'UserEntity', when Automatic Key Generation is enabled, the
    Primary Key class must be java.lang.Integer.
    I need to have Long as primary key, how do I solve it?
    Thanks,
    A.

    Use WebLogic Server 8.1
    java.lang.Long is supported in WLS 8.1
    thanks,
    Deepak
    "iggy" <[email protected]> wrote:
    >
    Hi,
    I keep getting the following error:
    In RDBMS CMP bean 'UserEntity', when Automatic Key Generation is enabled,
    the
    Primary Key class must be java.lang.Integer.
    I need to have Long as primary key, how do I solve it?
    Thanks,
    A.

  • Doubt regarding automatic statistics collection in Oracle 10g

    I am using Oracle 10g in Linux
    Does statistic collection for tables throughout the database happen automatically or should we manually analyze the tables using
    Analyze command or DBMS_STATS package ?
    AWR collects statistics(snapshots) every 1 hr but does it mean it collects only session and database related statistics and not the table related statistics?

    I am using Oracle 10g in Linux Version and os name and version?
    AWR collects statistics(snapshots) every 1 hr butIt's performance related statistics. Read about data gathering and AWR.
    Note that AWR is an extra licensable feature thru Management packs.

  • Dbms_stats or automatic statistics.

    Hi members,
    We are using 10g database. I am aware that 10g collects statistics automatically using its job scheduling process. Do we still need to schedule statistics collection using dbms_stats or analyze on our 10gR2 database? Is it redundant? In what situations is it required?

    You either want statistics to be gathered by the Oracle background job (which is calling dbms_stats) or you want to control statistics gathering via a job you control. Having both would be, at best, redundant, and would likely eventually cause problems.
    There is probably an 80/20 rule here. 80% of organizations with 80% of the databases probably want to keep the default settings. For the remaining 20%, you may want to change the DBMS_STATS default settings (i.e. you may need to gather fewer histograms). You may want to gather stats as part of your nightly loads (i.e. a data warehouse). You may have a preferred scheduling tool that is not the database that you want to control statistics gathering for operational reasons.
    As an aside, you should not be using ANALYZE to gather object statistics. That has been depricated for quite some time.
    Justin

Maybe you are looking for