STATSPACK in 10G

Hi,
We are moving to 10g and I was wondering if STATSPACK is the tool (like in 9i) for performance monitoring in 10g or is there something else ? How would I install this tool?
Thanks
Vissu

Hello,
Yes, STATSPACK utility in Oracle10g is available and can be installed using $ORACLE_HOME/rdbms/admin/spcreate.sql script. Furthermore, Oracle10g introduced a new automated replacement for STATSPACK called Automatic Workload Repository AWR and Automatic Database Diagnostic Monitor ADDM.
You could review a tool "Statspack Viewer Enterprise" that supports both Oracle10g STATSPACK and AWR. Get it at http://www.statsviewer.narod.ru/
Cheers

Similar Messages

  • How to measure the performance of a SQL query?

    Hello,
    I want to measure the performance of a group of SQL queries to compare them, but i don't know how to do it.
    Is there any application to do it?
    Thanks.

    You can use STATSPACK (in 10g its called as AWR - Automatic Workload Repository)
    Statspack -> A set of SQL, PL/SQL, and SQL*Plus scripts that allow the collection, automation, storage, and viewing of performance data. This feature has been replaced by the Automatic Workload Repository.
    Automatic Workload Repository - Collects, processes, and maintains performance statistics for problem detection and self-tuning purposes
    Oracle Database Performance Tuning Guide - Automatic Workload Repository
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14211/autostat.htm#PFGRF02601
    or
    you can use EXPLAIN PLAN
    EXPLAIN PLAN -> A SQL statement that enables examination of the execution plan chosen by the optimizer for DML statements. EXPLAIN PLAN causes the optimizer to choose an execution plan and then to put data describing the plan into a database table.
    Oracle Database Performance Tuning Guide - Using EXPLAIN PLAN
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14211/ex_plan.htm#PFGRF009
    Oracle Database SQL Reference - EXPLAIN PLAN
    http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9010.htm#sthref8881

  • STATSPACK vs AWR - 10g DB

    Hi,
    I am trying to rewrite a custom Oracle DB Statistics report which used to run on PERFSTAT.statspack in 9i which is no longer running in our 10g RAC as we are using AWR. Apart from a lot of custom queries we used STATSPACK.STAT_CHANGES to get a long list of params and kept in our custom tables but in 10g AWR I don't see such procedure. I checked dbms_workload_repository pkg but doesn't help. Is there any replacement for that procedure in AWR to get those params.
    Also is there any doc which has the ER Model of AWR for better understanding and a comparative study of STATSPACK to help us rewrite existing programs.
    Appreciate any help
    cpa

    All queries from the AWR report comes from the DBA_HIST tables and these are pulled from the DBMS_SWRF_REPORT_INTERNAL package body.
    AWR is not really different from Statspack, the main difference is the data collection and repository architecture (AWR repository) and how this data is being utilized (advisors and metrics).
    But as for the AWR tables (DBA_HIST) there are counterpart tables in Statspack.. and possibly achieve similar results.
    dba_hist_snapshot = STATS$SNAPSHOT
    dba_hist_osstat = STATS$OSSTAT
    dba_hist_sys_time_model = STATS$SYS_TIME_MODEL
    dba_hist_sysstat = STATS$SYSSTAT
    Also another issue you may have when doing your porting of Statspack reports to AWR is the SNAP_TIME and END_INTERVAL_TIME data type differences
    SNAP_TIME = is for Statspack which is based on DATE data type
    END_INTERVAL_TIME = is for AWR which is based on TIMESTAMP data type
    So my simple query to get the SNAP duration in minutes in Statspack is this:
    (s1.snap_time-s0.snap_time)*24*60 dur
    While on AWR I have to do this:
    round(EXTRACT(DAY FROM s1.END_INTERVAL_TIME - s0.END_INTERVAL_TIME) * 1440
    + EXTRACT(HOUR FROM s1.END_INTERVAL_TIME - s0.END_INTERVAL_TIME) * 60
    + EXTRACT(MINUTE FROM s1.END_INTERVAL_TIME - s0.END_INTERVAL_TIME)
    + EXTRACT(SECOND FROM s1.END_INTERVAL_TIME - s0.END_INTERVAL_TIME) / 60, 2) dur
    You can see my example here http://karlarao.wordpress.com/2010/01/31/workload-characterization-using-dba_hist-tables-and-ksar/
    - Karl Arao
    karlarao.wordpress.com
    karlarao.tiddlyspot.com

  • Oracle 10g Statspack Report

    Hi....below is a snippet of statspack report
    Host CPU (CPUs: 4)
    ~~~~~~~~ Load Average
    Begin End User System Idle WIO WCPU
    5.61 7.04 54.95 32.01 13.04 0.00 106.09
    Instance CPU
    ~~~~~~~~~~~~
    % of total CPU for Instance: 44.84
    % of busy CPU for Instance: 51.56
    I want to understand what "% of total CPU for Instance" and "% of busy CPU for Instance". When I check for vmstat on this box it gives 100% utilization.
    I want to know which CPU Utilization should I refer. And whether this is good or bad? And what is the difference between vmstat and statspack report.
    Can someone help me with this?
    Thanks

    9:29pm up 81 day(s), 8:41, 5 users, load average: 3.62, 3.38, 3.31My rule of thumb is that no serious CPU bottleneck exists when load averages are at or lower than number of CPUs in system.
    Typically the load average is is decent surrogate for run queue depth reported by
    sar -q
    I suggest you enable sar data collection so you have decent system statistics available for review & analysis
    Which system resource (CPU, RAM, Disk I/O, or Network) is major contributor to slow response; which is the bottleneck?
    post formatted results from command below which takes 2 minutes to complete
    vmstat 6 20
    Edited by: sb92075 on Oct 27, 2010 7:14 PM

  • Oracle 10G New Feature........Part 1

    Dear all,
    from last couple of days i was very busy with my oracle 10g box,so i think this is right time to
    share some intresting feature on 10g and some internal stuff with all of you.
    Have a look :-
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Oracle 10g Memory and Storage Feature.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1.Automatic Memory Management.
    2.Online Segment Shrink
    3.Redolog Advisor, checkpointing
    4.Multiple Temporary tablespace.
    5.Automatic Workload Repository
    6.Active Session History
    7.Misc
    a)Rename Tablespace
    b)Bigfile tablespace
    c)flushing buffer cache
    8.ORACLE INTERNAL
    a)undocumented parameter (_log_blocks_during_backup)
    b)X$ view (x$messages view)
    c)Internal Structure of Controlfile
    1.Automatic memory management
    ================================
    This feature reduce the overhead of oracle DBA.previously mostly time we need to set diff oracle SGA parameter for
    better performance with the help of own experience,advice views and by monitoring the behaviour
    of oracle database.
    this was just time consuming activity.........
    Now this feature makes easy life for oracle DBA.
    Just set SGA_TARGET parameter and it automatically allocate memory to different SGA parameter.
    it focus on DB_CACHE_SIZE
    SHARED_POOL_SIZE
    LARGE_POOL
    JAVA_POOL
    and automatically set it as
    __db_cache_size
    __shared_pool_size
    __large_pool_size
    __java_pool_size
    check it in alert_log
    MMAN(memory manager) process is new in 10g and this is responsible for sga tuning task.
    it automatically increase and decrease the SGA parameters value as per the requirement.
    Benefit:- Maximum utlization of available SGA memory.
    2.Online Segment Shrink.
    ==========================
    hmmmmm again a new feature by oracle to reduce the downtime.Now oracle mainly focus on availablity
    thats why its always try to reduce the downtime by intrducing new feature.
    in previous version ,reducing High water mark of table was possible by
    Exp/imp
    or
    alter table move....cmd. but on these method tables was not available for normal use for long hrs if it has more data.
    but in 10g with just few command we can reduce the HWmark of table.
    this feature is available for ASSM tablespaces.
    1.alter table emp enable row movement.
    2.alter table emp shrink space.
    the second cmd have two phases
    first phase is to compact the segment and in this phase DML operations are allowed.
    second phase(shrink phase)oracle shrink the HWM of table, DML operation will be blocked at that time for short duration.
    So if want to shrink the HWM of table then we should use it with two diff command
    first compact the segment and then shrink it on non-peak hrs.
    alter table emp shrink space compact. (This cmd doesn't block the DML operation.)
    and alter table emp shrink space. (This cmd should be on non-peak hrs.)
    Benefit:- better full table scan.
    3.Redolog Advisor and checkpointing
    ================================================================
    now oracle will suggest the size of redo log file by V$INSTANCE_RECOVERY
    SELECT OPTIMAL_LOGFILE_SIZE
    FROM V$INSTANCE_RECOVERY
    this value is influence with the value of FAST_START_MTTR_TARGET .
    Checkpointing
    Automatic checkpointing will be enable after setting FAST_START_MTTR_TARGET to non-zero value.
    4.Multiple Temporary tablespace.
    ==================================
    Now we can manage multiple temp tablespace under one group.
    we can create a tablespace group implicitly when we include the TABLESPACE GROUP clause in the CREATE TEMPORARY TABLESPACE or ALTER TABLESPACE statement and the specified tablespace group does not currently exist.
    For example, if group1 is not exists,then the following statements create this groups with new tablespace
    CREATE TEMPORARY TABLESPACE temp1 TEMPFILE '/u02/oracle/data/temp01.dbf'
    SIZE 50M
    TABLESPACE GROUP group1;
    --Add Existing temp tablespace into group by
    alter tablespace temp2 tablespace group group1.
    --we can also assign the temp tablespace group on database level as default temp tablespace.
    ALTER DATABASE <db name> DEFAULT TEMPORARY TABLESPACE group1;
    benefit:- Better I/O
    One sql can use more then one temp tablespace
    5.AWR(Automatic Workload Repository):-
    ================================== AWR is built in Repository and Central point of Oracle 10g.Oracle self managing activities
    is fully dependent on AWR.by default after 1 hr, oracle capure all database uses information and store in AWR with the help of
    MMON process.we called it Memory monitor process.and all these information are kept upto 7 days(default) and after that it automatically purge.
    we can generate a AWR report by
    SQL> @?/rdbms/admin/awrrpt
    Just like statspack report but its a advance and diff version of statspack,it provide more information of Database as well as OS.
    it show report in Html and Text format.
    we can also take manually snapshot for AWR by
    BEGIN
    DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT ();
    END;
    **The STATISTICS_LEVEL initialization parameter must be set to the TYPICAL or ALL to enable the Automatic Workload Repository.
    [oracle@RMSORA1 oracle]$ sqlplus / as sysdba
    SQL*Plus: Release 10.1.0.2.0 - Production on Fri Mar 17 10:37:22 2006
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> @?/rdbms/admin/awrrpt
    Current Instance
    ~~~~~~~~~~~~~~~~
    DB Id DB Name Inst Num Instance
    4174002554 RMSORA 1 rmsora
    Specify the Report Type
    ~~~~~~~~~~~~~~~~~~~~~~~
    Would you like an HTML report, or a plain text report?
    Enter 'html' for an HTML report, or 'text' for plain text
    Defaults to 'html'
    Enter value for report_type: text
    Type Specified: text
    Instances in this Workload Repository schema
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    DB Id Inst Num DB Name Instance Host
    * 4174002554 1 RMSORA rmsora RMSORA1
    Using 4174002554 for database Id
    Using 1 for instance number
    Specify the number of days of snapshots to choose from
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Entering the number of days (n) will result in the most recent
    (n) days of snapshots being listed. Pressing <return> without
    specifying a number lists all completed snapshots.
    Listing the last 3 days of Completed Snapshots
    Snap
    Instance DB Name Snap Id Snap Started Level
    rmsora RMSORA 16186 16 Mar 2006 17:33 1
    16187 16 Mar 2006 18:00 1
    16206 17 Mar 2006 03:30 1
    16207 17 Mar 2006 04:00 1
    16208 17 Mar 2006 04:30 1
    16209 17 Mar 2006 05:00 1
    16210 17 Mar 2006 05:31 1
    16211 17 Mar 2006 06:00 1
    16212 17 Mar 2006 06:30 1
    16213 17 Mar 2006 07:00 1
    16214 17 Mar 2006 07:30 1
    16215 17 Mar 2006 08:01 1
    16216 17 Mar 2006 08:30 1
    16217 17 Mar 2006 09:00 1
    Specify the Begin and End Snapshot Ids
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Enter value for begin_snap: 16216
    Begin Snapshot Id specified: 16216
    Enter value for end_snap: 16217
    End Snapshot Id specified: 16217
    Specify the Report Name
    ~~~~~~~~~~~~~~~~~~~~~~~
    The default report file name is awrrpt_1_16216_16217.txt. To use this name,
    press <return> to continue, otherwise enter an alternative.
    Benefit:- Now DBA have more free time to play games.....................:-)
    Advance version of statspack
    more DB and OS information with self managing capabilty
    New Automatic alert and database advisor with the help of AWR.
    6.Active Session History:-
    ==========================
    V$active_session_history is view that contain the recent session history.
    the memory for ASH is comes from SGA and it can't more then 5% of Shared pool.
    So we can get latest and active session report from v$active_session_history view and also get histortical data of
    of session from DBA_HIST_ACTIVE_SESS_HISTORY.
    v$active_session_history include some imp column like:-
    ~SQL identifier of SQL statement
    ~Object number, file number, and block number
    ~Wait event identifier and parameters
    ~Session identifier and session serial number
    ~Module and action name
    ~Client identifier of the session
    7.Misc:-
    ========
    Rename Tablespace:-
    =================
    in 10g,we can even rename a tablespace by
    alter tablespace <tb_name> rename to <tb_name_new>;
    This command will update the controlfile,data dictionary and datafile header,but dbf filename will be same.
    **we can't rename system and sysaux tablespace.
    Bigfile tablespace:-
    ====================
    Bigfile tablespace contain only one datafile.
    A bigfile tablespace with 8K blocks can contain a 32 terabyte datafile.
    Bigfile tablespaces are supported only for locally managed tablespaces with automatic segment-space management.
    we can take the advantage of bigfile tablespace when we are using ASM or other logical volume with RAID.
    without ASM or RAID ,it gives poor response.
    syntax:-
    CREATE BIGFILE TABLESPACE bigtbs
    Flushing Buffer Cache:-
    ======================
    This option is same as flushing the shared pool,but only available with 10g.
    but i don't know, whats the use of this command in prod database......
    anyway we can check and try it on test server for tuning n testing some query etc....
    SQL> alter system flush buffer_cache;
    System altered.
    ++++++++++++++++++
    8.Oracle Internal
    ++++++++++++++++++
    Here is some stuff that is not related with 10g but have some intresting things.
    a)undocumented parameter "_log_blocks_during_backup"
    ++++++++++++++++++++++++
    as we know that oracle has generate more redo logs during hotbackup mode because
    oracle has to maintain the a complete copy of block into redolog due to split block.
    we can also change this behaviour by setting this parameter to False.
    If Oracle block size equals the operating system block size.thus reducing the amount of redo generated
    during a hot backup.
    WITHOUT ORACLE SUPPORT DON'T SET IT ON PROD DATABASE.THIS DOCUMENT IS JUST FOR INFORMATIONAL PURPOSE.
    b)some X$ views (X$messages)
    ++++++++++++++++
    if you are intresting in oracle internal architecture then x$ view is right place for getting some intresting things.
    X$messages :-it show all the actions that a background process do.
    select * from x$messages;
    like:-
    lock memory at startup MMAN
    Memory Management MMAN
    Handle sga_target resize MMAN
    Reset advisory pool when advisory turned ON MMAN
    Complete deferred initialization of components MMAN
    lock memory timeout action MMAN
    tune undo retention MMNL
    MMNL Periodic MQL Selector MMNL
    ASH Sampler (KEWA) MMNL
    MMON SWRF Raw Metrics Capture MMNL
    reload failed KSPD callbacks MMON
    SGA memory tuning MMON
    background recovery area alert action MMON
    Flashback Marker MMON
    tablespace alert monitor MMON
    Open/close flashback thread RVWR
    RVWR IO's RVWR
    kfcl instance recovery SMON
    c)Internal Structure of Controlfile
    ++++++++++++++++++++++++++++++++++++
    The contents of the current controlfile can be dumped in text form.
    Dump Level Dump Contains
    1 only the file header
    2 just the file header, the database info record, and checkpoint progress records
    3 all record types, but just the earliest and latest records for circular reuse record types
    4 as above, but includes the 4 most recent records for circular reuse record types
    5+ as above, but the number of circular reuse records included doubles with each level
    the session must be connected AS SYSDBA
    alter session set events 'immediate trace name controlf level 5';
    This dump show lots of intresting information.
    it also show rman recordes if we used this controlfile in rman backup.
    Thanks
    Kuljeet Pal Singh

    You can find each doc in html and pdf format on the Documentation Library<br>
    You can too download all the documentation in html format to have all on your own computer here (445.8MB)<br>
    <br>
    Nicolas.

  • Not able to install Statspack.

    DB 9.2.0.5.0
    OS WIn 2003 server
    I've gone through the following procedure to generate a statspack report. but, I am not able to insatall statspack, though the same procedure worked in 10g.
    1. create a perfstat tablespace
    2. run spcreate.sql
    SPCUSR complete. Please check spcusr.lis for any errors.
    SQL>
    SQL> --
    SQL> -- Build the tables and synonyms
    SQL> connect perfstat/&&perfstat_password
    ERROR:
    ORA-12560: TNS:protocol adapter error
    Warning: You are no longer connected to ORACLE.
    SQL> @@spctab
    SQL> Rem
    SQL> Rem $Header: spctab.sql 16-apr-2002.14:54:46 vbarrier Exp $
    SQL> Rem
    SQL> Rem spctab.sql
    SQL> Rem
    SQL> Rem Copyright (c) 1999, 2002, Oracle Corporation. All rights reserved.
    SQL> Rem
    SQL> Rem NAME
    SQL> Rem spctab.sql
    SQL> Rem
    SQL> Rem DESCRIPTION
    SQL> Rem SQL*PLUS command file to create tables to hold
    SQL> Rem start and end "snapshot" statistical information
    SQL> Rem
    SQL> Rem NOTES
    SQL> Rem Should be run as STATSPACK user, PERFSTAT
    SQL> Rem
    SQL> Rem MODIFIED (MM/DD/YY)
    SQL> Rem vbarrier 03/20/02 - 2143634
    SQL> Rem vbarrier 03/05/02 - Segment Statistics
    SQL> Rem cdialeri 02/07/02 - 2218573
    SQL> Rem cdialeri 01/30/02 - 2184717
    SQL> Rem cdialeri 01/11/02 - 9.2 - features 2
    SQL> Rem cdialeri 11/30/01 - 9.2 - features 1
    SQL> Rem cdialeri 04/22/01 - Undostat changes
    SQL> Rem cdialeri 03/02/01 - 9.0
    SQL> Rem cdialeri 09/12/00 - sp_1404195
    SQL> Rem cdialeri 04/07/00 - 1261813
    SQL> Rem cdialeri 03/20/00 - Support for purge
    SQL> Rem cdialeri 02/16/00 - 1191805
    SQL> Rem cdialeri 01/26/00 - 1169401
    SQL> Rem cdialeri 11/01/99 - Enhance, 1059172
    SQL> Rem cmlim 07/17/97 - Added STATS$SQLAREA to store top sql stmts
    SQL> Rem gwood 10/16/95 - Version to run as sys without using many vi
    SQL> Rem cellis.uk 11/15/89 - Created
    SQL> Rem
    SQL>
    SQL> set showmode off echo off;
    If this script is automatically called from spcreate (which is
    the supported method), all STATSPACK segments will be created in
    the PERFSTAT user's default tablespace.
    Using perfstat tablespace to store Statspack objects
    ... Creating STATS$SNAPSHOT_ID Sequence
    SP2-0640: Not connected
    SP2-0640: Not connected
    ... Creating STATS$... tables
    SP2-0640: Not connected
    SP2-0640: Not connected
    SP2-0640: Not connected
    SP2-0640: Not connected
    SP2-0640: Not connected
    SP2-0640: Not connected
    SP2-0640: Not connected
    SP2-0640: Not connected
    NOTE:
    SPCTAB complete. Please check spctab.lis for any errors.
    SQL> -- Create the statistics Package
    SQL> @@spcpkg
    SQL> Rem
    SQL> Rem $Header: spcpkg.sql 17-apr-2002.16:59:10 vbarrier Exp $
    SQL> Rem
    SQL> Rem spcpkg.sql
    SQL> Rem
    SQL> Rem Copyright (c) 1999, 2002, Oracle Corporation. All rights reserved.
    SQL> Rem
    SQL> Rem NAME
    SQL> Rem spcpkg.sql
    SQL> Rem
    SQL> Rem DESCRIPTION
    SQL> Rem SQL*PLUS command file to create statistics package
    SQL> Rem
    SQL> Rem NOTES
    SQL> Rem Must be run as the STATSPACK owner, PERFSTAT
    SQL> Rem
    SQL> Rem MODIFIED (MM/DD/YY)
    SQL> Rem vbarrier 03/20/02 - 2184504
    SQL> Rem spommere 03/19/02 - 2274095
    SQL> Rem vbarrier 03/05/02 - Segment Statistics
    SQL> Rem spommere 02/14/02 - cleanup RAC stats that are no longer needed
    SQL> Rem spommere 02/08/02 - 2212357
    SQL> Rem cdialeri 02/07/02 - 2218573
    SQL> Rem cdialeri 01/30/02 - 2184717
    SQL> Rem cdialeri 01/09/02 - 9.2 - features 2
    SQL> Rem cdialeri 11/30/01 - 9.2 - features 1
    SQL> Rem hbergh 08/23/01 - 1940915: use substrb on sql_text
    SQL> Rem cdialeri 04/26/01 - 9.0
    SQL> Rem cdialeri 09/12/00 - sp_1404195
    SQL> Rem cdialeri 04/07/00 - 1261813
    SQL> Rem cdialeri 03/28/00 - sp_purge
    SQL> Rem cdialeri 02/16/00 - 1191805
    SQL> Rem cdialeri 11/01/99 - Enhance, 1059172
    SQL> Rem cgervasi 06/16/98 - Remove references to wrqs
    SQL> Rem cmlim 07/30/97 - Modified system events
    SQL> Rem gwood.uk 02/30/94 - Modified
    SQL> Rem densor.uk 03/31/93 - Modified
    SQL> Rem cellis.uk 11/15/89 - Created
    SQL> Rem
    SQL>
    SQL> set echo off;
    Creating Package STATSPACK...
    SP2-0640: Not connected
    SP2-0640: Not connected
    SP2-0641: "SHOW ERRORS" requires connection to server
    Creating Package Body STATSPACK...
    SP2-0640: Not connected
    SP2-0640: Not connected
    SP2-0641: "SHOW ERRORS" requires connection to server
    NOTE:
    SPCPKG complete. Please check spcpkg.lis for any errors.
    hare krishna
    Alok

    Hi Alok
    I have encountered this before
    In the script there will be a comnnection link at the spcreate sql..
    Rem
    Rem $Header: spcreate.sql 16-apr-2002.11:22:55 vbarrier Exp $
    Rem
    Rem spcreate.sql
    Rem
    Rem Copyright (c) 1999, 2002, Oracle Corporation.  All rights reserved. 
    Rem
    Rem    NAME
    Rem      spcreate.sql - Statistics Create
    Rem
    Rem    DESCRIPTION
    Rem      SQL*PLUS command file which creates the STATSPACK user,
    Rem      tables and package for the performance diagnostic tool STATSPACK
    Rem
    Rem    NOTES
    Rem      Note the script connects INTERNAL and so must be run from
    Rem      an account which is able to connect internal.
    Rem
    Rem    MODIFIED   (MM/DD/YY)
    Rem    cdialeri    02/16/00 - 1191805
    Rem    cdialeri    12/06/99 - 1103031
    Rem    cdialeri    08/13/99 - Created
    Rem
    --  Create PERFSTAT user and required privileges
    @@spcusr
    --  Build the tables and synonyms
    connect perfstat/&&perfstat_password@MARAN
    @@spctab
    --  Create the statistics Package
    @@spcpkgadd the @servicename and run the script
    It will work
    Message was edited by:
    Maran Viswarayar

  • Error in creating perfstat user for statspack

    Hi Friends,
    DB: 11.2.0.2, SE and 64 bit
    OS: RHEL 5.7
    My DB is on SE and hence i cannot use the diagonistic pack so when i am trying to use Statspack for the same, i am facing the following error when i am trying to create Perfstat user.
    SQL> @?/rdbms/admin/spcreate
    Choose the PERFSTAT user's password
    Not specifying a password will result in the installation FAILING
    Enter value for perfstat_password: perfstat
    perfstat
    Choose the Default tablespace for the PERFSTAT user
    Below is the list of online tablespaces in this database which can
    store user data. Specifying the SYSTEM tablespace for the user's
    default tablespace will result in the installation FAILING, as
    using SYSTEM for performance data is not supported.
    Choose the PERFSTAT users's default tablespace. This is the tablespace
    in which the STATSPACK tables and indexes will be created.
    TABLESPACE_NAME CONTENTS STATSPACK DEFAULT TABLESPACE
    INDUS_SML_DATA PERMANENT
    INDUS_SML_INDEX PERMANENT
    PERFSTAT PERMANENT
    SYSAUX PERMANENT *
    USERS PERMANENT
    Pressing <return> will result in STATSPACK's recommended default
    tablespace (identified by *) being used.
    Enter value for default_tablespace: PERFSTAT
    Using tablespace PERFSTAT as PERFSTAT default tablespace.
    Choose the Temporary tablespace for the PERFSTAT user
    Below is the list of online tablespaces in this database which can
    store temporary data (e.g. for sort workareas). Specifying the SYSTEM
    tablespace for the user's temporary tablespace will result in the
    installation FAILING, as using SYSTEM for workareas is not supported.
    Choose the PERFSTAT user's Temporary tablespace.
    TABLESPACE_NAME CONTENTS DB DEFAULT TEMP TABLESPACE
    TEMP TEMPORARY *
    Pressing <return> will result in the database's default Temporary
    tablespace (identified by *) being used.
    Enter value for temporary_tablespace: TEMP
    Using tablespace TEMP as PERFSTAT temporary tablespace.
    ... Creating PERFSTAT user
    ... Installing required packages
    ... Creating views
    ... Granting privileges
    NOTE:
    SPCUSR complete. Please check spcusr.lis for any errors.
    SQL>
    SQL> --
    SQL> -- Build the tables and synonyms
    SQL> connect perfstat/&&perfstat_password
    Connected.
    SQL> @@spctab
    SQL> Rem
    SQL> Rem $Header: rdbms/admin/spctab.sql /st_rdbms_11.2.0/1 2010/08/13 10:06:01 kchou Exp $
    SQL> Rem
    SQL> Rem spctab.sql
    SQL> Rem
    SQL> Rem Copyright (c) 1999, 2010, Oracle and/or its affiliates.
    SQL> Rem All rights reserved.
    SQL> Rem
    SQL> Rem NAME
    SQL> Rem spctab.sql
    SQL> Rem
    SQL> Rem DESCRIPTION
    SQL> Rem SQL*PLUS command file to create tables to hold
    SQL> Rem start and end "snapshot" statistical information
    SQL> Rem
    SQL> Rem NOTES
    SQL> Rem Should be run as STATSPACK user, PERFSTAT
    SQL> Rem
    SQL> Rem MODIFIED (MM/DD/YY)
    SQL> Rem kchou 08/11/10 - Bug#9800868 - Add Missing Idle Events for
    SQL> Rem 11.2.0.2for Statspack & Standby Statspack
    SQL> Rem kchou 08/11/10 - Bug#9800868 - Add missing idle events to 11.2.0.2
    SQL> Rem cgervasi 05/13/09 - add idle event: cell worker idle
    SQL> Rem cgervasi 04/02/09 - bug8395154: missing idle events
    SQL> Rem rhlee 02/22/08 -
    Rem cdgreen 03/14/07 - 11 F2SQL> Rem shsong 06/14/07 - Add idle events
    SQL> Rem cdgreen 02/28/07 - 5908354
    SQL> Rem cdgreen 04/26/06 - 11 F1
    SQL> Rem cdgreen 06/26/06 - Increase column length
    SQL> Rem cdgreen 05/10/06 - 5215982
    SQL> Rem cdgreen 05/24/05 - 4246955
    SQL> Rem cdgreen 04/18/05 - 4228432
    SQL> Rem cdgreen 03/08/05 - 10gR2 misc
    SQL> Rem vbarrier 02/18/05 - 4081984
    SQL> Rem cdgreen 10/29/04 - 10gR2_sqlstats
    SQL> Rem cdgreen 07/16/04 - 10gR2
    SQL> Rem cdialeri 03/25/04 - 3516921
    SQL> Rem vbarrier 02/12/04 - 3412853
    SQL> Rem cdialeri 12/04/03 - 3290482
    SQL> Rem cdialeri 11/05/03 - 3202706
    SQL> Rem cdialeri 10/14/03 - 10g - streams - rvenkate
    SQL> Rem cdialeri 08/05/03 - 10g F3
    SQL> Rem cdialeri 02/27/03 - 10g F2: baseline, purge
    SQL> Rem vbarrier 02/25/03 - 10g RAC
    SQL> Rem cdialeri 11/15/02 - 10g F1
    SQL> Rem cdialeri 09/27/02 - sleep4
    SQL> Rem vbarrier 03/20/02 - 2143634
    SQL> Rem vbarrier 03/05/02 - Segment Statistics
    SQL> Rem cdialeri 02/07/02 - 2218573
    SQL> Rem cdialeri 01/30/02 - 2184717
    SQL> Rem cdialeri 01/11/02 - 9.2 - features 2
    SQL> Rem cdialeri 11/30/01 - 9.2 - features 1
    SQL> Rem cdialeri 04/22/01 - Undostat changes
    SQL> Rem cdialeri 03/02/01 - 9.0
    SQL> Rem cdialeri 09/12/00 - sp_1404195
    SQL> Rem cdialeri 04/07/00 - 1261813
    SQL> Rem cdialeri 03/20/00 - Support for purge
    SQL> Rem cdialeri 02/16/00 - 1191805
    SQL> Rem cdialeri 01/26/00 - 1169401
    SQL> Rem cdialeri 11/01/99 - Enhance, 1059172
    SQL> Rem cmlim 07/17/97 - Added STATS$SQLAREA to store top sql stmts
    SQL> Rem gwood 10/16/95 - Version to run as sys without using many view
    SQL> Rem cellis.uk 11/15/89 - Created
    SQL> Rem
    SQL>
    SQL> set showmode off echo off;
    If this script is automatically called from spcreate (which is
    the supported method), all STATSPACK segments will be created in
    the PERFSTAT user's default tablespace.
    Using PERFSTAT tablespace to store Statspack objects
    ... Creating STATS$SNAPSHOT_ID Sequence
    Sequence created.
    create public synonym STATS$SNAPSHOT_ID for STATS$SNAPSHOT_ID
    ERROR at line 1:
    ORA-00955: name is already used by an existing object
    Disconnected from Oracle Database 11g Release 11.2.0.2.0 - 64bit Production
    Kindly suggest on the same..
    BR

    @?/rdbms/admin/spdrop
    drop public synonym STATS$SNAPSHOT_ID;
    try again

  • Error While Running StatsPack

    Hi
    When i am running the Oracle stats pack report in Oracle ,I am getting the following error.Please find the error below.The OS version i am running is Solaris 9 and the Oracle version is 10.2.3.Request you to help me in understanding the root cause for the error.
    "Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> @spreport.sql
    Current Instance
    ~~~~~~~~~~~~~~~~
    DB Id DB Name Inst Num Instance
    1829660576 HRC88DEV 1 hrc88dev
    Instances in this Statspack schema
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    from stats$database_instance
    ERROR at line 7:
    ORA-00942: table or view does not exist
    Using 1829660576 for database Id
    Using 1 for instance number
    from stats$database_instance
    ERROR at line 5:
    ORA-06550: line 5, column 13:
    PL/SQL: ORA-00942: table or view does not exist
    ORA-06550: line 4, column 6:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 11, column 13:
    PL/SQL: ORA-00942: table or view does not exist
    ORA-06550: line 10, column 6:
    PL/SQL: SQL Statement ignored
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    Regards
    Pavan Pusuluri

    In Oracle 10g the utility AWR is available with more features.
    Ok.
    below link provides you the exact solution for your problem check out,
    http://www.dba-oracle.com/t_taking_statspack_awr_report.htm
    Thanks

  • Uniques constraint violation error while executing statspack.snap

    Hi,
    I have configured a job to run the statspack snap at a interval of 20 min from 6:00 PM to 3:00 AM . Do perform this task , I have crontab 2 scripts : one to execute the job at 6 PM and another to break the job at 3 AM. My Oracle version is 9.2.0.7 and OS env is AIX 5.3
    My execute scripts look like:
    sqlplus perfstat/perfstat <<EOF
    exec dbms_job.broken(341,FALSE);
    exec dbms_job.run(341);
    The problem is , that the job work fine for weekdays but on weekend get aborted with the error :
    ORA-12012: error on auto execute of job 341
    ORA-00001: unique constraint (PERFSTAT.STATS$SQL_SUMMARY_PK) violated
    ORA-06512: at "PERFSTAT.STATSPACK", line 1361
    ORA-06512: at "PERFSTAT.STATSPACK", line 2471
    ORA-06512: at "PERFSTAT.STATSPACK", line 91
    ORA-06512: at line 1
    After looking on to metalink , I came to know that this is one listed bug 2784796 which was fixed in 10g.
    My question is , why there is no issue on weekdays using the same script. There is no activity on the db on weekend and online backup start quite late at night.
    Thanks
    Anky

    The reasons for hitting this bug are explained in Metalink, "...cursors with same sql text (at least 31 first characters), same hash_value but a different parent cursor...", you can also find the workaround in Note:393300.1.
    Enrique

  • Statspack... error...

    hi.. I m tuning my database, i have created tools tablespce, when i was running spcreate.sql but it failed
    "Oracle SQL*PLUS has encountered a problem and needs to close."
    Can any body tell me where can i find statments/commands that are written in spcreate.sql script.
    Regards!!

    Hi,
    If your using 10g then just connect with DBA role priviliged user and run AWRRPT.sql scripts.
    Located: $ORACLE_HOME/rdbms/admin/awrrpt.sql
    If your not using 10g then use below procedure to generate statspack report.
    1. User must have SYSDBA privs
    set ORACLE_SID=orcl
    sqlplus sys/pwd as sysdba
    2.You should create SEPRATE TABLESPACE for statspack report.
    create tablespace PERFSTAT
    datafile 'c:\perf01.dbf' size 100m
    autoextend on
    segment management auto;
    We should generate STATSPACK report DURING PEAK TIME
    run SPCREATE.SQL script
    Located : $ORACLE_HOME\rdbms\admin\spcreate.sql
    conn sys as sysdba
    @$ORACLE_HOME\rdbms\admin\spcreate.sql
    4.connect with PERFSTAT user
    perfstat user create automatically when we run SPCREATE.SQL script
    conn perfstat/password
    5.run STATSPACK.SNAP procedure
    exec statspack.snap;
    Note: After 15 minutes run again STATSPACK.SNAP procedure
    6.run SPREPORT for generate statspack report in text format.
    @$ORACLE_HOME\rdbms\admin\spreport.sql
    7.connect with SYSDBA privs user ( sys user)
    and execute SPDROP.SQL script for drop PERFSTAT user and all related tables
    conn sys as sysdba
    @$ORACLE_HOME\rdbms\admin\spdrop.sql
    8.DROP TABLESPACE use for STATSPACK REPORT
    conn sys as sysdba
    drop tablespace [TABLESPACE NAME]
    including contents and datafileshttp://dbataj.blogspot.com/search/label/STATSPACK
    Regards
    Mohammed Taj
    http://dbataj.blogspot.com

  • Package STATSPACK

    Hello folks
    I have the invalid package PERFSTAT.STATSPACK because the error Compilation errors for PACKAGE BODY PERFSTAT.STATSPACK because the errorr: PL/SQL: ORA-00980: synonym translation is no longer valid stats$x$ksppsv sv
    Someone has an idea?
    Tks
    Spaulonci

    It sounds like you upgraded your database but did not upgrade the statspack package.
    Look to see if you have any recent sp data - look in stats$snapshot
    There are upgrade scripts provided in $ORACLE_HOME/rdbms/admin/spup*.sql
    If you are on 10g, try looking at AWR data - it's much like statspack and is enabled by default.
    I usually disable statspack collection after upgrading to 10g and just use AWR data (e.g. dba_hist_*)
    for a standard AWR report run $ORACLE_HOME/rdbms/admin/awrrpt.sql
    Cheers

  • Upgrade 9i to 10g Performance Issue

    Hi All,
    DBA team recently upgraded the database from 9i to 10g (Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bi).
    There is a process as follows
    Mainframe --> Flat file --> (Informatica) --> Oracle DB --> (processing through SPs) --> Report
    The whole process normally used to take 1.5 - 2 hrs which is now taking 4-5 hrs after 9i to 10g upgrade.
    I tried searching on Google but could not find any detailed procedure to root out the cause. Below is the link of such an instance-
    http://jonathanlewis.wordpress.com/2007/02/02/10g-upgrade/
    Can someone suggest where to start digging to find out the reason behind the slowdown (if possible, please tell the detailed procedure or reference)?
    It is to be noted that there was no other change besides Database upgrade. Also, for about 20 days after the upgrade the whole process took near 1 hr (which was a pleasnt gain) but afterward it shoot up to 4-5 hrs suddenly and since then its taking same time.
    Thanks.

    Without more information (Statspack reports, AWR reports, or at least query plans), it's going to be exceptionally hard to help you.
    There are dozens, more likely hundreds, of parameters which change between 9i and 10g. And one of which could cause an individual query to perform worse. Plus, obviously something changed after the process was running quickly for 20 days, so there is some change on your side that would need to be identified and accounted for. There is no way for anyone to guess which of the hundreds of parameter and behavioral changes might have contributed to the problem, nor for us to guess what might have changed after 20 days in your database.
    If you can at least provide Statspace/ AWR reports, we may be able to help you out with a general tuning exercise. If you can identify what changed between the time the process was running well to the time it stopped running well, we may be able to help there as well.
    Justin

  • Oracle 10g: How to reduce the select * time

    Hello,
    We have 10 million entries in our database (Oracle 10g in windows 32 bit machine.)
    The execution of 'select * ....' takes 3 to 4 hour. Is there any way to reduce this time.
    Is any tool available which can read the oracle export data and produce the output in text file format.
    or any idea ?
    Thanks
    With Regards
    Hemant.

    hem_kec wrote:
    Hello EdStevens
    Is that 3 to 4 hours scrolling data past your screen?Answer: The Oracle is taking 3-4 hr to produce the output.
    OK, let me try again. Where is the output being directed? To the screen? To a file?
    The reason I ask is that often people will say "It takes n minutes to run this query" when in fact Oracle is producing the result set in a few seconds and what is taking n minutes is to run the results past the screen.
    You should take a statspack report while the query is running and see where it is spending its time.
    >
    That's a different problem. I assume by "export data" you mean a .dmp file created by exp or expdp? If so what do you hope to achieve by outputting it in text format? What is the business problem to be solved?Answer: Since customer want to read all 10 milion entries. so we are think if we can dump (Oracle export) the data and using some tool (not Oracle) to read the data so there is no wait for the customer.As stated, a dmp file is oracle proprietary binary file that exists solely to transport data across platforms/versions. It is not suitable for your purpose. You are far better off finding where the current query is spending its time than looking for some kludge. 10 million rows of data is still 10 million rows of data. Do you think extracting it from the db, storeing it in some other format, and having some other tool read it off of disk in that format is going to be faster than simply selecting it from the db -- asking the db to do what it was designed to do?
    >
    >
    Thanks
    With Regards
    Hemant.

  • Queries slow after upgrade to 11g from 10g

    Hi experts,
    I've recently installed 11g and did a full import of my 10g db into it. We are currently testing our apps in 11g and we are finding that existing queries were running slower. For example, a complex query that used to run 4secs is now taking 60secs in 11g. We surely don't want to change existing queries because there's just too many of them.
    I have run statistics:
    EXEC dbms_stats.gather_system_stats();
    EXEC dbms_stats.gather_database_stats(estimate_percent=> 100);
    I'd appreciate your suggestions to resolve this issue.
    THanks
    Giovanni

    gvy wrote:
    Hi experts,
    I've recently installed 11g and did a full import of my 10g db into it. That means you've physically re-arranged all your data, and recreated (most of, but not necessarily all of) your indexes. Such changes can have an unlucky side effect.
    >
    I have run statistics:
    EXEC dbms_stats.gather_system_stats();
    EXEC dbms_stats.gather_database_stats(estimate_percent=> 100);
    How does this compare with the way you collected statistics in your 10g system. Changes in statistics collection method can have a very unlucky impact on performance. (You mention in a follow-up post that you don't have histograms in 10g; your call to gather database stats will collect histograms by default in 11g - to avoid them you need to use method_opt => 'for all columns size 1')
    There may be some particularly unlucky queries where the optimizer choose to do a new 11g transform that just does suit your data. One testing strategy is to set optimizer_features_enabled back to 10g (mores specifically the 10.x.x.x form it was on your previous release) to see if this bypasses the problems. If it does then you could use the optimizer_features_enable hint temporarily in just those queries that were misbehaving.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    There is a +"Preview"+ tab at the top of the text entry panel. Use this to check what your message will look like before you post the message. If it looks a complete mess you're unlikely to get a response. (Click on the +"Plain text"+ tab if you want to edit the text to tidy it up.)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Getting slowness issue with Oracle DB (10g) - specifically for one table

    We have a Oracle Database. When we are trying to access it through our Java application, it is working fine except for 2 menu option in the application.
    These 2 menu option are trying to fetch from the same table. It is taking 30-40 min to fetch some 500 records. It was not the case few days ago.
    I have checked at application end however didn't find any issues.
    Could you please suggest, what could be the possible reason and solution for this.

    There are many possible reasons and solutions for this. That is why you need to look at what the instrumentation is telling you is wrong.
    First: determine if there is something grotesquely wrong. Oracle has an alert log, see if there are any complaints in there. There are a number of ways of observing the database, dbconsole has a nice screen with performance, though you might need some special licensing. There are also scripts you can run and third party tools. You may also want to use statspack or AWR to tell you generally what is going on, sometimes the top sql just makes it obvious, but you have to know your own system to make that kind of judgment.
    Next, see if there is something obviously wrong, check for missing or otherwise unavailable indices. Tell us what your exact version is (10g is not a version: 10.2.0.4 is a version), as well as platform and your statistics gathering strategy.
    If it still isn't obvious, follow the [url https://forums.oracle.com/forums/thread.jspa?threadID=863295]Thread: HOW TO: Post a SQL statement tuning request thread. You should post a proper explain plan for times when it works good and times when it works bad. Most performance problems are bad sql, but you can have odd effects from things like bind peeking.
    And if all else fails, blame java.

Maybe you are looking for

  • Sql query taking too long to run

    I am not sure what to do. My app takes two long to run and the reason is right in front of me, but again, I don't know what to do or where to go. (VB.Net VS 2005) The main part of my query takes about 15 to 20 seconds to run. When I tack on this othe

  • How do i back up my itunes?

    i think im going to un install my itunes then re install it. soo what files should i copy and move and how should i go about it thank you.

  • Chapter buttons work fine in preview but not in build

    Hi, I am using video as a back ground and overlaying buttons that highlight when selected. The button routing is fine, default button set up, no overrides and it works fine in preview, however when I build it to disk no buttons are highlighted, canno

  • More than 1 customlog

    Hi all! I have an issue I'm trying to sort out with mac osX server 10.4.5 With older versions of mac os X I useed to be able to have more than 1 custom log. Because we process our clients web logs via more than 1 application I need this functionality

  • Can I remove ORACLE JRE/JDK?

    Hi all I already have Sun's JRE/JDK in /usr (SuSE). Can I safely remove Oracle JRE/JDK?