IMPORT_SYSTEM_STATS

Hi,
on 11gR2,
what should this mean, from the docs it seems it
this should be done after gathering system stats
http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_stats.htm#ARPLS68493
VARIABLE   jobno   number;
BEGIN
   DBMS_JOB.SUBMIT (:jobno, 'DBMS_STATS.IMPORT_SYSTEM_STATS
   (''mystats'',''OLTP'');'
   sysdate, 'sysdate + 1');
   COMMIT;
END;but is this really necesary, can I just collect the stats without using dbms_job.submit after ?

The link you posted shows the system statistics are gathered in a separate table, so they won't be used, unless you import them to the default table.
It is also preferred you don't use capitals in the subject line as that constitutes SHOUTING
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • Gather system statistics

    Hi Friends,
    I want to gather system statistics in my Oracle 9.2.07 (windows) environment...
    created one statistics table...
    execute DBMS_STATS.CREATE_STAT_TABLE ('SYS','MY_STATS');
    (2) Gathering SYSTEM Statistics Script during office hours ( 8 hours) (8am to 4pm)
    begin
    execute dbms_stats.gather_system_stats(
    gathering_mode=> 'interval',
    interval => 480,
    stattab=> 'MY_STATS',
    STATID=> 'OLTP');
    END;
    REM
    REM
    REM END of Script
    REM===================================================
    (3) Import the Collected System Statistics
    Import the statistics daily around 8AM...because..users starts entering the transactions....
    variable jobno number;
    begin
    dbms_job.submit(:jobno,'dbms_stats.import_system_stats(''IMAL_STATS'',''OLTP'');',
    SYSDATE,'SYSDATE+1');
    COMMIT;
    END;
    ========================================================
    OLAP..also i will collect during night time....
    gathering system statiscs will end after 4pm....so..it takes system statistics during 8 hours interval time...and i am going to import them next day 8am..
    is this the correct method????.please sched some light on this...

    Hi,
    Oracle recommends to gather system statistics from oracle 9i onwards....this the line from Oracle 9i R2 document...
    Oracle9i Database Performance Tuning Guide and Reference
    Release 2 (9.2)
    Gathering System Statistics
    System statistics enable the optimizer to consider a system's I/O and CPU performance and utilization. For each plan candidate, the optimizer computes estimates for I/O and CPU costs. It is important to know the system characteristics to pick the most efficient plan with optimal proportion between I/O and CPU cost.
    System I/O characteristics depend on many factors and do not stay constant all the time. Using system statistics management routines, database administrators can capture statistics in the interval of time when the system has the most common workload. For example, database applications can process OLTP transactions during the day and run OLAP reports at night. Administrators can gather statistics for both states and activate appropriate OLTP or OLAP statistics when needed. This enables the optimizer to generate relevant costs with respect to available system resource plans.
    When Oracle generates system statistics, it analyzes system activity in a specified period of time. Unlike table, index, or column statistics, Oracle does not invalidate already parsed SQL statements when system statistics get updated. All new SQL statements are parsed using new statistics. Oracle Corporation highly recommends that you gather system statistics.The DBMS_STATS.GATHER_SYSTEM_STATS routine collects system statistics in a user-defined timeframe. You can also set system statistics values explicitly using DBMS_STATS.SET_SYSTEM_STATS. Use DBMS_STATS.GET_SYSTEM_STATS to verify system statistics.
    So better performanace, as per above document, we need system statistics.
    if not needed.why it is not need...can u please describe this...
    Message was edited by:
    bsubbu

  • Windows 2000에서 9.2.0.1에서 9.2.0.7로 패치(patch) 후 문제..

    windows 2000에서 9.2.0.1에서 9.2.0.7로 패치(patch)후에 DB에 작성되어 있던 대부분의 Query문(procedure)들이 query 속도가 엄청 늦어졌습니다.
    2초 걸리던 것이 10분이 넘게 걸리고요
    패치 전과 패치 후에 변경 시스템 혹은 DB 설정이 변경 된 것은 없습니다.
    패치 작업은 정상적으로 완료가 되었습니다.
    패치 작업 이후에 특별히 해주어야 하는 것이 있는 것인지...
    제가 보아도 질문이 너무 막연하네요.
    많은 답변 부탁드립니다.

    이건 많이 이슈가 되는 사항인데요..
    9.2.0.1과 9.2.0.7은 optimizer가 다릅니다.
    버그도 잡고 기존 정책이 바뀌기도 하니까요...
    하지만 9.2.0.7에서의 optimizer관련 버그로 인한 문제가
    아니라면 통계정보를 재생성하면 문제가 대부분 해결됩니다.
    패치후 업그레이드 이후에 모든 segment에 대한 통계정보 생성은
    필수입니다.
    9.2.0.7 이라고 하셨으니.. 아래로 하면 한번 명령에 application 유저의
    모든 segment를 통계정보 생성해줍니다.
    원래는 stats table을 만들어서 현재의 통계정보를 백업해두고..
    통계정보 생성후에 추이를 지켜보지요... 만약에 통계정보 생성 이후에
    문제가 생겼을 경우에는.. stats table의 백업 통계정보를 DB에 부어버리고,
    DB를 재기동하면 이전 통계정보로 옵니다.
    이 경우는 이미 문제가 생긴 상태이니 백업은 필요없을 것 같구요..
    그렇다면 아래처럼 하면 통계정보가 생성됩니다.
    아래는 hr유저의 모든 테이블과 인덱스에 대해서
    10 퍼센트의 샘플링을 해서, parallel 4로 인덱스까지
    수행합니다. 9i이후에 새로 나온? block sampling기법까지
    사용하구요.
    exec dbms_stats.gather_schema_stats( -
    OWNNAME=>'HR', -
    ESTIMATE_PERCENT=>10, -
    BLOCK_SAMPLE=>TRUE, -
    DEGREE=>4, -
    CASCADE=>TRUE -
    1. 특정 테이블(emp)에서 5 percent sample만 통계정보를 만들고
    parallel 2로 수행하고, block sampling기법을 사용하면서
    인덱스까지 하려고 한다면.. 아래처럼 하면 됩니다.
    exec dbms_stats.gather_table_stats( -
    ownname=>'USER01',-
    tabname=>'emp',-
    estimate_percent=>5, -
    degree=>2,-
    block_sample=>true ,-
    cascade=>true);
    2. 통계정보 생성후 plan이 바뀌고 업무에 영향이 갈 수 있으니
    지금 현재의 통계정보를 백업하고 통계정보를 생성하면 좋겠죠.
    sys유저에 mystats 통계정보 테이블을 data01 테이블스페이스에
    만들고 STAT060616 이라는 아이디로 MYSTATS 통계정보 테이블에
    지금 상태의 HR유저의 통계정보를 백업합니다.
    exec dbms_stats.create_stat_table('SYS','MYSTATS','DATA01');
    exec dbms_stats.EXPORT_SCHEMA_STATS ('HR','MYSTATS','STAT060616','SYS');
    - 이제 통계정보를 생성합니다.
    hr유저의 10 percent 통계정보를 parallel 4로 인덱스까지 수행합니다.
    exec dbms_stats.gather_schema_stats( -
    OWNNAME=>'HR', -
    ESTIMATE_PERCENT=>10, -
    BLOCK_SAMPLE=>TRUE, -
    DEGREE=>4,-
    CASCADE=>TRUE -
    - 이런 통계정보를 생성했더니 오히려 어떤 쿼리성능이 느려졌다고 합니다.
    지금 바로 서비스를 해야 하는 상황인데 난감하겠죠?
    이 때에는 이전에 백업한 통계정보를 DB에 import합니다.
    위에서 export해서 백업했던 STATID=STAT060616 을 DB에 부으면 되겠죠.
    exec dbms_stats.IMPORT_SCHEMA_STATS ('HR','MYSTATS','STAT060616','SYS');
    3. 통계정보를 시스템에서 사용하는 것만 캡쳐해서 통계정보 테이블에
    저장한 다음에 이것을 한꺼번에 DB에 적용할 수도 있습니다.
    통계정보 캡쳐를 START시키고 시스템을 운영시킨 후에...
    STOP을 시키고.. STATS 테이블에 캡쳐된 통계정보를 DB에 붓는 방법이죠.
    exec dbms_stats.create_stat_table('SYS','MYSTATS','DATA01');
    exec dbms_stats.gather_system_stats( -
    gathering_mode=>'START',-
    STATTAB=>'MYSTATS',-
    STATID=>'OLTP', -
    statown=>'SYS')
    --> START후에 들어오는 쿼리들에 대해서 통계정보를 자동으로 gathering
    합니다.
    시간이 지난 후에 통계정보 수집을 STOP합니다.
    exec dbms_stats.gather_system_stats( -
    gathering_mode=>'STOP',-
    stattab=>'MYSTATS',-
    statid=>'OLTP');
    - 캡쳐된 통계정보를 DB에 적용합니다.
    exec dbms_stats.import_system_stats( -
    stattab=>'MYSTATS',-
    statid=>'OLTP',-
    STATOWN=>'sys');
    그리고 마지막으로 sql> desc dbms_stats 를 하게 되면 describe되니
    쉽게 어떤 컬럼값들이 있는지 체크할 수 있지요.
    analyze 명령도 있긴 하지만.. dbms_stats는 parallel이 가능해서
    많이 사용하죠. CPU가 32장있는 DB는.. 데이터가 많아도 SAMPLE 10
    percent하고 parallel 32로 야밤에 돌리면 금방 수행되지요.
    단.. 만약에.. 파티션을 하고 싶다면 어떻게 할까요?
    주의해야 할 것이.. 아래에서 보면.. GRANULARITY=>'PARTITION'이라고
    주지 않으면 특정 파티션을 지정했어도 전체 파티션을 찾더군요.
    당연히 시간도 오래 걸리구요.
    exec dbms_stats.gather_table_stats(OWNNAME=>'HR',TABNAME=>'TEST',-
    PARTNAME=>'PT_200606',-
    ESTIMATE_PERCENT=>10,-
    GRANULARITY=>'PARTITION', -
    DEGREE=>2, -
    CASCADE=>TRUE);
    자세한 사항은 아래를 참고하세요.
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_stats.htm
    http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/d_stats2.htm

Maybe you are looking for

  • Reading records from excel

    hi all, i am using Forms [32 Bit] Version 6.0.8.24.1 (Production). i am uploading data from excel to form(record wise)and saving. now i am reading the data from 2nd row by assuming that 1st row followed with columns titles.But, my question is we cann

  • I can't access Itunes Store from my computer (windows 7) - Itunes 11.1

    I always get the same error message: Itunes Store is temporally unavailable. Try again later. I've tried ALL "troubleshoot issues in Windows" from apple support, but I still can't access Itunes Store on Itunes 11.1.

  • Internet won't open

    We have one of the hp all in one computers. It has been working perfectly fine until we moved houses. Now we start the computer and everything says it is connected to the internet but every time we click the internet icon it pops up like it will open

  • MDS directory structure - Standard guidelines

    Hi, I am trying to setup MDS repository for my SOA projects and looking for a standard directory structure which complies with AIA standards too. In most of the company's we use structure like */apps */apps/xsd */apps/wsdl or for AIA, we put like /ap

  • LIRE UN TABLEAU à 2 DIMENSIONS DEPUIS UN FICHIER EXCEL SOUS LABVIEW

    SVP, je suis débutante en labview et je cherche à importer des données (real et string) d'un tableau sous un fichier excel vers labview, je souhaite afficher ce tableau dans labview (le nombre des colonnes est 7 par contre le nombre des lignes est va