DBMS_SQLTUNE.ALTER_SQL_PROFILE

Hi,
I'm trying to alter an SQL Profile to use force matching. But am getting an error saying the attribute name is not valid.
BEGIN
DBMS_SQLTUNE.ALTER_SQL_PROFILE(
name => 'SYS_SQLPROF_0149d3932ac34000',
attribute_name => 'FORCE_MATCH',
value => 'TRUE');
END;
ORA-13835: invalid attribute name specified.
But the documentation says 'FORCE_MATCH' is an attribute. Any ideas what I could be doing wrong? Thanks.
12.4.2 Altering a SQL Profile
You can alter the STATUS, NAME, DESCRIPTION, CATEGORY and FORCE_MATCH attributes of an existing SQL Profile with the ALTER_SQL_PROFILE procedure. For example:
BEGIN
DBMS_SQLTUNE.ALTER_SQL_PROFILE(
name => 'my_sql_profile',
attribute_name => 'STATUS',
value => 'DISABLED');
END;
/

DECLARE
  my_sqlprofile_name VARCHAR2(30);
BEGIN
  my_sqlprofile_name := DBMS_SQLTUNE.ACCEPT_SQL_PROFILE (
    task_name    => 'my_sql_tuning_task',
    name         => 'my_sql_profile',
    profile_type => DBMS_SQLTUNE.PX_PROFILE,
    force_match  => TRUE );
END;
/

Similar Messages

  • Sql profiles in 11.1.0.7

    We just upgraded from 10.1.0.3 to 11.1.0.7 and some very complex queries are running slower. When I check the plans in a non-production 11g database, the join orders are slightly different. I also have traces from my 10g production database and that I loaded into a sql tuning set in production. I am running the sql tuning advisor. When I get a recommendation to use the old plan, I implement it in the 10.2.0.5 Oracle Enterprise manager grid control.
    How do I tell the sql_id of the sql profile? Is it part of the name? So if I look in dba_sql_profiles and see
    SYS_SQLPROF_012a8f339c4b0001
    Is the last part the sql_id? When I search on that value, I do not see it in v$sql. It does not appear that my queries are using the sql profile. So there might a slight difference from these queries (space maybe) than the ones I have. How do I confirm that my queries are using a sql profile as well?

    Dear user11990507,
    I do think that the value "012a8f339c4b0001" is nothing to do with the SQL_ID in the v$sql fixed view. It can be generated based on an algorithm like generating SQL_IDs. That is an internal information and i really don't know much about it.
    You can also accept, alter or drop an SQL profile with the below commands;
    DECLARE my_sqlprofile_name VARCHAR2(30);
    BEGIN my_sqlprofile_name := DBMS_SQLTUNE.ACCEPT_SQL_PROFILE (task_name => 'my_sql_tuning_task', name => 'my_sql_profile', force_match => TRUE);
    END;
    BEGIN
    DBMS_SQLTUNE.ALTER_SQL_PROFILE(name => 'my_sql_profile', attribute_name => 'STATUS', value => 'DISABLED');
    END;
    BEGIN
    DBMS_SQLTUNE.DROP_SQL_PROFILE(name => 'my_sql_profile');
    END;
    DBA_SQL_PROFILES;
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28320/statviews_4256.htm#REFRN23477
    Check the SQL_TEXT column for you particular SQLs.
    Hope That Helps.
    Ogan

  • Advice regarding how best to collect stats on 10G RAC Production system

    Friends,
    I have read quite a lot of blogs and docs and need some help with the best way forward. I am a DBA new to RAC who has limited experience with busy 24@7 10g systems on the scale of my current employer.
    Historically stats are gathered here as follows :-
    exec dbms_stats.unlock_schema_stats('BP');
    exec dbms_stats.gather_schema_stats(ownname => 'BP', cascade => true, estimate_percent => dbms_stats.auto_sample_size);
    exec dbms_stats.lock_schema_stats('BP');
    Then Flush shared pool ok ????
    Because of previous issues with this - alll tables are currently locked and this process is recommended for every 1-2 months rather than daily.
    EM Grid Control is used when performance is poor and the sql tuning advisor is run to generate recommendations from which a sql profile could be selected and enabled for the selected code.
    My plan is to bring back gathering of stats every 1 to 2 months, my goal is make sure I can fix things quickly if it all goes to custard !!!!
    From research it looks like sql_profile is like a hint and independent of gathering stats - it tells optimiser what hints to use when executing sql.
    This thread is for advice from professional dba's in my shoes - how do you approach this so that any issues are quickly rectified ???
    My thinking is to query dba_profiles and get list of profiles and statuses ... for all tables with sql profiles ..
    This is so profiles can be disabled and then quickly enabled if there is a problem aftewr the tables are analyzed.
    To revert all the schema stats :-
    exec dbms_stats.unlock_schema_stats('BP');
    exec dbms_stats.restore_schema_stats(ownname=>'BP',as_of_timestamp=>sysdate-1);
    exec dbms_stats.lock_schema_stats('BP');
    To revert a table's stats (this looks more finicky so not sure the way to go ...):-
    Pre gather stats :-
    select stats_update_time from user_tab_stats_history where table_name = ‘<EnterTabName>’;
    exec dbms_stats.create_stat_table ( -‘SCOTT’, -‘stattab_new’);
    exec dbms_stats.export_table_stats ( -‘SCOTT’, -‘DEPT’, -null, -‘stattab_new’, -null, -true, -‘SCOTT’);
    Then later after gather stats :-
    exec dbms_stats.restore_table_stats ( -‘SCOTT’, -‘DEPT’, -’21-JAN-09 11.00.00.000000 AM -05:00′);
    Enable/Disable Profile
    exec dbms_sqltune.alter_sql_profile('<Profile name>', 'STATUS', 'DISABLED');
    exec dbms_sqltune.alter_sql_profile('<Profile name>', 'STATUS', 'ENABLED');
    I will do the plan below on a test system first however load may not really identify problems until for real on the Prod system.
    My plan is to :-
    1 analyze all tables as per outline at start above (existing practice)
    2 Disable the sql profiles that are in use on the analyzed tables
    3 See what code is affected and what tables
    If Profile exists for these sql statements then either apply existing profile (as disabled) or use tuning adviser to create another profile
    (Advice welcome here - what do you do on big systems ????)
    4 If its a catastrophe - I can restore the schema stats using (exec dbms_stats.restore_schema_stats(ownname=>'BP',as_of_timestamp=>sysdate-1);)
    and then possibly re-enabling the sql_profiles that were in place before ....
    I welcome any advice based on similar experiences that can help me get this right.
    Many thanks,
    cheers, Rob
    Edited by: Diesel on Jun 27, 2012 10:51 PM

    Useful Link:
    http://www.oradev.com/create_statistics.jsp
    ## Gather schema stats
    begin
    dbms_stats.gather_schema_stats(ownname=>'SYSLOG');
    end;
    ## Gather a particular table stats of a schema
    begin
    DBMS_STATS.gather_table_stats(ownname=>'syslog',tabname=>'logs');
    end;
    Regards
    Asif Kabir
    --mark the answer as correct/helpful                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • SQL Profiles

    Hi
    DB:         10.2.0.4
    Platform:  Redhat Linux
    Summary:
    When I unpack SQL profiles from a staging table, even if they had a status of DISABLED in the staging table, they will all be set to ENABLED when querying DBA_SQL_PROFILES. That seems wrong - am I missing something here?
    Details:
    Current SQL profiles (select * from dba_sql_profiles):
    NAME                           STATUS
    SYS_SQLPROF_0145a03131fdc001   ENABLED
    SYS_SQLPROF_01445c4c7d068003   DISABLED...then I take a backup of the SQL Profiles to a staging table:
    exec DBMS_SQLTUNE.PACK_STGTAB_SQLPROF(profile_category => '%', staging_table_name => 'PRF_SQL_PROFILES_STAGING'); Data in the staging table (select * from PRF_SQL_PROFILES_STAGING):
    PROFILE_NAME                   STATUS
    SYS_SQLPROF_0145a03131fdc001   ENABLED
    SYS_SQLPROF_01445c4c7d068003   DISABLED...so looks right in the staging table. The status is the same as the actual SQL profiles.
    Now I load (unpack) the SQL Profiles from the staging table back into the DB:
    exec DBMS_SQLTUNE.UNPACK_STGTAB_SQLPROF(replace => TRUE, staging_table_name => 'PRF_SQL_PROFILES_STAGING');Now I would expect the statuses to be the same as in the staging table - but (select * from dba_sql_profiles):
    NAME                           STATUS
    SYS_SQLPROF_0145a03131fdc001   ENABLED
    SYS_SQLPROF_01445c4c7d068003   ENABLED   <-- ???Now the previously DISABLED SQL profille is ENABLED.
    Any thoughts? Is this the expected behavior?
    Thanks,
    Andreas
    Upate -
    As a workaround I did the following as part of the unpack script:
    declare
    cursor c1 is
    select profile_name
    from PRF_SQL_PROFILES_STAGING
    where status = 'DISABLED';
    begin
    for rec in c1 loop
    DBMS_SQLTUNE.ALTER_SQL_PROFILE (name => rec.profile_name, attribute_name => 'STATUS', value => 'DISABLED');
    end loop;
    end;
    /So basically I just disable any 'live' SQL Profiles that have a status of DISABLED in the staging table...
    Works fine, but still curious whether all profiles enabled by default is expected behavior.
    Edited by: Andreas Hess on Mar 18, 2010 5:18 PM

    Hi,
    You can get the details from the DBA_SQL_PROFILES. there are futher sys tables which can give some details
    SQL Profiles hints from SQLPROF$ATTR,SQLPROF$ and SQLPROF$DESC
    - Pavan Kumar N
    Oracle 9i/10g - OCP
    http://oracleinternals.blogspot.com/

  • Unable to get the execution plan when using dbms_sqltune (11gR2)

    Hi,
    Database version: 11gR2
    I have a user A that is granted privileges to execute dbms_sqltune.
    I can create a task, excute it and run the report.
    But, when I run the report I get the following error:
    SQL> show user
    USER is "A"
    SQL> set long 10000 longchunksize 10000 linesize 200 pagesize 000
    select dbms_sqltune.report_tuning_task(task_name => 'MYTEST') from dual;SQL>
    GENERAL INFORMATION SECTION
    Tuning Task Name : MYTEST
    Tuning Task Owner : A
    Workload Type : Single SQL Statement
    Scope : COMPREHENSIVE
    Time Limit(seconds): 1800
    Completion Status : COMPLETED
    Started at : 05/15/2013 11:53:22
    Completed at : 05/15/2013 11:53:23
    Schema Name: SYSMAN
    SQL ID : gjm43un5cy843
    SQL Text : SELECT SUM(USED), SUM(TOTAL) FROM (SELECT /*+ ORDERED */
    SUM(D.BYTES)/(1024*1024)-MAX(S.BYTES) USED,
    SUM(D.BYTES)/(1024*1024) TOTAL FROM (SELECT TABLESPACE_NAME,
    SUM(BYTES)/(1024*1024) BYTES FROM (SELECT /*+ ORDERED USE_NL(obj
    tab) */ DISTINCT TS.NAME FROM SYS.OBJ$ OBJ, SYS.TAB$ TAB,
    SYS.TS$ TS WHERE OBJ.OWNER# = USERENV('SCHEMAID') AND OBJ.OBJ# =
    TAB.OBJ# AND TAB.TS# = TS.TS# AND BITAND(TAB.PROPERTY,1) = 0 AND
    BITAND(TAB.PROPERTY,4194400) = 0) TN, DBA_FREE_SPACE SP WHERE
    SP.TABLESPACE_NAME = TN.NAME GROUP BY SP.TABLESPACE_NAME) S,
    DBA_DATA_FILES D WHERE D.TABLESPACE_NAME = S.TABLESPACE_NAME
    GROUP BY D.TABLESPACE_NAME)
    ERRORS SECTION
    - ORA-00942: table or view does not exist
    SQL>
    It seems there a missing privileg for dislaying the execution plan.
    As a workaround, this is solved by granting select any dictionay (which I don't want) to the user A.
    Does someone have an idea about what privilege is missing?
    Kind Regards.

    Hi,
    SELECT ANY DICTIONARY system privilege provides access to SYS schema objects only => which you are using as workaround
    SELECT_CATALOG_ROLE provides access to all SYS views only.==> Safe option
    SQL> grant SELECT ANY DICTIONARY to test;
    Grant succeeded.
    SQL> conn test/test
    Connected.
    SQL> select count(*) from  sys.obj$;
      COUNT(*)
         13284
    SQL> conn /as sysdba
    Connected.
    SQL> revoke SELECT ANY DICTIONARY from test;
    Revoke succeeded.
    SQL> grant SELECT_CATALOG_ROLE to test;
    Grant succeeded.
    SQL> conn test/test
    Connected.
    SQL> select count(*) from  sys.obj$;
    select count(*) from  sys.obj$
    ERROR at line 1:
    ORA-00942: table or view does not existHTH

  • Using DBMS_SQLTUNE package...

    Hi ,
    I use Oracle10g v.2 database and i have a sql statement....
    I want this to be tuned... so i use the DBMS_SQL_TUNE package to accomplish this task.
    I use the following commands:
    DECLARE
    task_name_var VARCHAR2(30);
    sqltext_var CLOB;
    BEGIN
    sqltext_var :=<select statement> ;
    task_name_var := DBMS_SQLTUNE.CREATE_TUNING_TASK(
    sql_text => sqltext_var,
    user_name => 'HIS',
    scope => 'COMPREHENSIVE',
    task_name => 'sql_tuning_task_test4',
    description => 'This is a tuning task on .... table');
    END;
    Execute dbms_sqltune.Execute_tuning_task (task_name => 'sql_tuning_task_test4')
    SELECT DBMS_SQLTUNE.SCRIPT_TUNING_TASK('sql_tuning_task_test4') FROM DUAL
    The last above select statement (in bold) points out some indexes to create....
    I create them , analyze all new indexes and indexed columns , but when i execute again the above commands the optimizer again - advise me to create the same indexes as above - which i have created them.....
    Why may be the cause of this...?????
    thanks ,
    Simon

    Hi ,
    I use Oracle10g v.2 database and i have a sql statement....
    I want this to be tuned... so i use the DBMS_SQL_TUNE package to accomplish this task.
    I use the following commands:
    DECLARE
    task_name_var VARCHAR2(30);
    sqltext_var CLOB;
    BEGIN
    sqltext_var :=<select statement> ;
    task_name_var := DBMS_SQLTUNE.CREATE_TUNING_TASK(
    sql_text => sqltext_var,
    user_name => 'HIS',
    scope => 'COMPREHENSIVE',
    task_name => 'sql_tuning_task_test4',
    description => 'This is a tuning task on .... table');
    END;
    Execute dbms_sqltune.Execute_tuning_task (task_name => 'sql_tuning_task_test4')
    SELECT DBMS_SQLTUNE.SCRIPT_TUNING_TASK('sql_tuning_task_test4') FROM DUAL
    The last above select statement (in bold) points out some indexes to create....
    I create them , analyze all new indexes and indexed columns , but when i execute again the above commands the optimizer again - advise me to create the same indexes as above - which i have created them.....
    Why may be the cause of this...?????
    thanks ,
    Simon

  • Invalid DBMS_SQLTUNE

    Guys,
    I need your help, I cannot run the sql tuning advisor in Oracle 10g since the package DBMS_SQLTUNE is invalid. I tried to recompile but found errors.
    SQL> alter PACKAGE DBMS_SQLTUNE compile;
    Warning: Package altered with compilation errors.
    SQL> show error
    Errors for PACKAGE DBMS_SQLTUNE:
    LINE/COL ERROR
    1707/3 PL/SQL: Declaration ignored
    1709/37 PLS-00201: identifier 'SQLPROF_ATTR' must be declared
    1959/3 PL/SQL: Declaration ignored
    1961/40 PLS-00201: identifier 'SQL_BIND' must be declared
    1982/3 PL/SQL: Declaration ignored
    1984/10 PLS-00201: identifier 'SQL_BIND_SET' must be declared
    1994/3 PL/SQL: Declaration ignored
    1994/51 PLS-00201: identifier 'SQL_BIND_SET' must be declared
    1998/3 PL/SQL: Declaration ignored
    1999/10 PLS-00201: identifier 'SQL_BIND_SET' must be declared
    SQL>
    Regards

    Hi,
    Those nonexistent attributes are synonyms. Somehow you lost them or you never created them. The script is in %ORACLE_HOME%\RDBMS\ADMIN\catsqlt.sql. Copy-paste the CREATE SYNONYM and GRANT fragments into sqlplus and execute them as SYS. In case of error, you'd probably need to execute whole script.
    Bartek

  • Errors using DBMS_SQLTUNE Advisors for Oracle 10g

    I get errors trying to tune the below query for Oracle 10g using the DBMS_SQLTUNE advisors.
    It happens when I wrap either a large block of PL/SQL code that uses bind variables or multiple nested subqueries with multiple JOIN conditions in a SELECT query statement that I wish to tune using the 10g SQLTUNE advisors.
    Message was edited by:
    benprusinski

    Hi, I was trying to use the DBMS_SQLTUNE package to tune my sql statements used in the huge procedure. I can successfully create a task and execute it. But when I run report tuning task, I'm always getting error like the one in below example. Two questions I have now.
    1) Is this becuase I'm using bind, but not passing any values?
    2) Can I able to use to this package to tune a procedures instead of sql statement?
    Example output...
    SQL&gt; SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK( 'my_sql_tuning_task3')
    2 FROM DUAL;
    DBMS_SQLTUNE.REPORT_TUNING_TASK('MY_SQL_TUNING_TASK3')
    GENERAL INFORMATION SECTION
    Tuning Task Name : my_sql_tuning_task3
    Tuning Task Owner : SCOTT
    Scope : COMPREHENSIVE
    Time Limit(seconds) : 3000
    Completion Status : COMPLETED
    Started at : 02/26/2009 21:44:41
    Completed at : 02/26/2009 21:44:41
    Number of Errors : 1
    DBMS_SQLTUNE.REPORT_TUNING_TASK('MY_SQL_TUNING_TASK3')
    Schema Name: KPRAVEEN
    SQL ID : 479831s42xj1n
    SQL Text : SELECT a.pdrorn, a.pdrcto, a.pdrlln FROM f4311 a
    WHERE a.pddoco = receiptsrcrec.prdoco AND a.pddcto = :2 AND
    a.pdkcoo = :3 AND a.pdsfxo = :4 AND a.pdlnid = :5
    ERRORS SECTION
    SQL&gt;

  • Generate HTML format report using  DBMS_SQLTUNE.REPORT_TUNING_TASK function

    How could i generate HTML format report using DBMS_SQLTUNE.REPORT_TUNING_TASK function in oracle 11g

    See [url http://download.oracle.com/docs/cd/E11882_01/appdev.112/e16760/d_sqltun.htm#CHDGEIHJ]documentation for DBMS_SQLTUNE.
    The TYPE parameter suggests that it would determine the format and whilst the nline documentation in the code (desc DBMS_SQLTUNE) suggests that valid values are TEXT, HTML and XML, it seems that this is not yet implemented. Whilst valid values of TEXT, HTML and XML are validated, only a TEXT report is produced.

  • Awr dbms_sqltune  package

    Hi,
    Our company doesn't currently have oem installed on production. This will be done in March. Right now I am working with the sqltune package to access the database on the dev server before I run it on production. I was running the following procedure below and requested the GOLDUSER schema.
    Down in the load_sqlset procdure I think I have the load_option and update_option set to the correct values. I could be wrong though. By setting these all I want is to extract the old sql statements and performace tune them.
    I get those sql statements listed out and also I get a different named schema under "tables with new potential indices" (LEADUSERS).
    Should I be concerned with this? Would someone just look this procedure over to see if it is correct?
    I would appreciate your help in this matter.
    Thanks in advance.
    al
    declare
    cursor_1 dbms_sqltune.sqlset_cursor;
    begin
    open cursor_1 for
    select value(p)
    from table(dbms_sqltune.select_workload_repository)
    750,
    1501,
    'parsing_schema_name= ''GOLDUSER'' AND executions > 25',
    null,
    null,
    null,
    null,
    null,
    10)) p;
    dbms_sqltune.load_sqlset(
    sqlset_name => 'prod_awr',
    populate_cursor => cursor_1,
    load_option => 'MERGE',
    update_option => 'ACCUMULATE');
    end;
    /

    Check this one:
    http://www.oracle-base.com/articles/10g/AutomaticSQLTuning10g.php
    OR
    DECLARE
    ret_val VARCHAR2(4000);
    BEGIN
    ret_val := dbms_sqltune.create_tuning_task(
    task_name=>'t1',
    sql_id=>' '); Execute the sql prior to this and get the sql_id in place it here
    dbms_sqltune.execute_tuning_task('t1');
    END;
    check the status by,
    SELECT status FROM DBA_ADVISOR_LOG WHERE task_name ='t1';
    Upon completion of the above,
    SET LONG 100000
    SET LONGCHUNKSIZE 99999
    SET LINESIZE 20000
    SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK( 't1') FROM DUAL;

  • Dbms_sqltune

    Hi,
    I am using dbms_sqltune package for sql tuning in 10g. In DBMS_SQLTUNE.CREATE_TUNING_TASK one paramter is bind_list.i want to pass the parameter for sql.suppose two dates.Pls tell me how can i do.
    Thanks
    Reena

    Hi, this is what I found in teh documantation:
    Table 101-14 CREATE_TUNING_TASK Function Parameters
    Parameter      Description
    sql_text      The text of a SQL statement
    begin_snap      Begin snapshot identifier
    end_snap      End snapshot identifier
    sql_id      The identifier of a SQL statement
    bind_list      An ordered list of bind values in ANYDATA type
    plan_hash_value      The hash value of the SQL execution plan
    sqlset_name      The SQL tuning set name
    basic_filter      The SQL predicate to filter the SQL from the SQL tuning set
    object_filter      The object filter
    rank(i)      An order-by clause on the selected SQL
    result_percentage      A percentage on the sum of a ranking measure
    result_limit      The top L(imit) SQL from the (filtered/ranked) SQL
    user_name      The username for whom the statement is to be tuned
    scope      Tuning scope (limited/comprehensive)
    time_limit      The maximum duration in seconds for the tuning session
    task_name      An optional tuning task name
    description      A task of the SQL tuning session to a maximum of 256 characters
    plan_filter      Plan filter. It is applicable in case there are multiple plans (plan_hash_value) associated with the same statement. This filter allows for selecting one plan (plan_hash_value) only. Possible values are:
    LAST_GENERATED: plan with the most recent timestamp
    FIRST_GENERATED: plan with the earliest timestamp, the opposite to LAST_GENERATED
    LAST_LOADED: plan with the most recent first_load_time statistics information
    FIRST_LOADED: plan with the earliest first_load_time statistics information, the opposite to LAST_LOADED
    MAX_ELAPSED_TIME: plan with the maximum elapsed time
    MAX_BUFFER_GETS: plan with the maximum buffer gets
    MAX_DISK_READS: plan with the maximum disk reads
    MAX_DIRECT_WRITES: plan with the maximum direct writes
    MAX_OPTIMIZER_COST: plan with the maximum optimizer cost
    sqlset_owner      The owner of the SQL tuning set, or NULL for the current schema owner
    Hope it helps,
    Lutz

  • ORA-06532: ORACLE 10.2.0.4: TUNING: dbms_sqltune accept_sql_profile

    Hi all,
    i have a big problem with oracle tuning set. I'm using this script for tune some query when the EM is unusable, but for the first time i have this error: ORA-06532: Subscript outside of limit.
    I have not found any solutions from google to metalink... can you help me? you need others informations?
    these are the steps:
    1) login with system
    2) launching the script sqltune.sql
    spool M:\tuning\sql_tune_TSQ.log
    set long 100000
    SET LONGCHUNKSIZE 100000
    SET LINESIZE 200
    execute DBMS_SQLTUNE.DROP_TUNING_TASK('sqltuning_request_fromuser');
    DECLARE my_task_name VARCHAR2(100);
    tune_sqltext CLOB;
    BEGIN
    tune_sqltext := q'#Select row_ticket from abc.ticket_kasdeww_export#';
    my_task_name := dbms_sqltune.create_tuning_task(user_name=>'abc',sql_text=>tune_sqltext, task_name=>'sqltuning_request_fromuser', time_limit=>1800);
    dbms_sqltune.execute_tuning_task(task_name=>'sqltuning_request_fromuser');
    END;
    SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK( 'sqltuning_request_fromuser') FROM DUAL;
    spool off
    3) when trying accept new sql profile:
    execute dbms_sqltune.accept_sql_profile(task_name => 'sqltuning_request_fromuser', replace => TRUE);
    ERROR at line 1:
    ORA-06532: Subscript outside of limit
    ORA-06512: at "SYS.DBMS_SQLTUNE_INTERNAL", line 7087
    ORA-06512: at "SYS.DBMS_SQLTUNE", line 5559
    ORA-06512: at "SYS.DBMS_SQLTUNE", line 5586
    ORA-06512: at line 1
    N.b. A Generic error from EM is returned when trying accept sql profile, this is the reason for using the command line method
    N.b.2 This query return approximately 40.000 rows and is a select from a view that is created from the union of two type of select

    user9523366 wrote:
    thanks!
    no one for this unusual problem please?I think I had some time ago a similar issue. You can try to check if the SQL profile generated contains an unusual large number of hints, by querying for your tuning task here:
    USER_TUNING_TASKS
    And then query an underlying table called SYS.WRI$_ADV_RATIONALE like that:
    select
    from
              sys.WRI$_ADV_RATIONALE
    where
              task_id = <your_task_id from USER_TUNING_TASKS>;If this query shows hundreds of rows with hints in the ATTR1 column then this might be the reason for the error. You might want to open an SR with Oracle then, because I can't remember if I found a way back then to make the "ACCEPT_SQL_PROFILE" work and I think I remember I solved the issue otherwise.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • DBMS_SQLTUNE question

    Hi All,
    Oracle v11.2.0.2 on RedHat.
    I ran following query
    SQL> set pagesize 0 echo off timing off linesize 1000 trimspool on trim on long 2000000 longchunksize 2000000
    SQL> select dbms_sqltune.report_sql_monitor( report_level=>'ALL', type=>'text', session_id=> 1373 ) from dual ;
    SQL Monitoring Report
    SQL Text
    BEGIN app_owner.UPDATE_LOT(:p1, :p2, :p3, :p4, :p5, :p6); END;
    Global Information
    Status                                 :  DONE
    Instance ID                            :  1
    Session                                :  APP_USER (1373:41491)
    SQL ID                                 :  fvffk1aqrb55n
    SQL Execution ID                       :  16802863
    Execution Started                      :  06/15/2012 12:49:16
    First Refresh Time                     :  06/15/2012 12:49:20
    Last Refresh Time                      :  06/15/2012 12:49:20
    Duration                               :  4s
    Module/Action                          :  updateLot.pl/-
    Service                                :  PROD01
    Program                                :  perl.exe
    PLSQL Entry Ids (Object/Subprogram)    :  61727,1
    PLSQL Current Ids (Object/Subprogram)  :  61727,1
    Global Stats
    ==================================================================
    | Elapsed |   Cpu   |    IO    | PL/SQL  | Buffer | Read | Read  |
    | Time(s) | Time(s) | Waits(s) | Time(s) |  Gets  | Reqs | Bytes |
    ==================================================================
    |    4.28 |    1.90 |     2.38 |    0.24 |   160K |  944 |   7MB |
    ==================================================================
    1 row selected.In this session, SID 1373, the above procedure call keeps running whole day (24X7). Almost every call does different amount of work depending on the parameters passed and hence takes different time.
    I am running 100s of calls to UPDATE_LOT in one session and running above (dbms_sqltune.report_sql_monitor) call in another session repeatedly.
    For a duration of 10-15 minutes, when several UPDATE_LOT calls has done very different amount of work and taken very different time (coz I know the inputs were different) in one session, my SQL (dbms_sqltune.report_sql_monitor) keep giving me same output in other session.
    Why is that?
    Is there something I need to reset between successive calls to dbms_sqltune.report_sql_monitor ?
    Thanks in advance

    Real time sql monitoring will report on a particular execution of a sql statement.
    I use it a lot to find and it is well suited to:
    - finding the current execution plan of a long-running sql statment and it's execution statistics so far
    - reporting on parallel execution plan and actual execution statements
    With your particular inputs, you should get the report for the last execution of this statement for that particular session, the duration for which was 4 seconds - either because it lasted 4 seconds or that was the one executing when you ran the report.
    You can get the report for a specific execution by specifying the sql_exec_start or sql_exec_id.
    But your statement is a plsql block so you're not going to get any execution plan and sampled wait activity for a sql statement.
    From your description of what you want / what you're doing, I'm not convinced that real time sql monitoring is the tool you want.
    Depending on what exactly you want, you might be better doing one of a sql trace, an extended sql trace using event 10046, an ASH report, or looking at/analysing the raw ash data in V$ACTIVE_SESSION_HISTORY.

  • DBMS_SQLTUNE.REPORT_TUNING_TASK

    Hi,
    In 10g R2 i receive the following :
    SQL> SET LONG 1000
    SQL> SET LONGCHUNKSIZE 1000
    SQL> SET LINESIZE 100
    SQL> SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK( 'my_sql_tuning_task')
      2    FROM DUAL;
    DBMS_SQLTUNE.REPORT_TUNING_TASK('MY_SQL_TUNING_TASK')
    GENERAL INFORMATION SECTION
    Tuning Task Name                  : my_sql_tuning_task
    Tuning Task Owner                 : SCOTT
    Scope                             : COMPREHENSIVE
    Time Limit(seconds)               : 60
    Completion Status                 : COMPLETED
    Started at                        : 07/05/2010 17:21:36
    Completed at                      : 07/05/2010 17:21:37
    Number of Statistic Findings      : 2
    DBMS_SQLTUNE.REPORT_TUNING_TASK('MY_SQL_TUNING_TASK')
    Schema Name: SCOTT
    SQL ID     : 6trybwr380un5
    SQL Text   : SELECT /*+ ORDERED */ * FROM emp e, dept d WHERE e.deptno =
                 d.deptno AND e.empno < :bnd
    FINDINGS SECTION (2 findings)
    1- Statistics Finding
    DBMS_SQLTUNE.REPORT_TUNING_TASK('MY_SQL_TUNING_TASK')
      Table "SCOTT"."DEPT" and its inMy questions are :
    1-What are the findings ? It says two but displays (If no mistake from me) only one.
    2-What does mean : Table "SCOTT"."DEPT" and its in ?
    Thank you.

    My glogin.sql file contains the following:
    set pagesize 25
    set linesize 121
    set long 1000000   <-------------------
    col name format a30
    col value format a30
    col column_name format a30
    col object_name format a30
    col segment_name format a30
    col file_name format a60
    col data_type format a20
    SET DEFINE OFF
    ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS';
    ALTER SESSION SET PLSQL_WARNINGS='ENABLE:ALL';you might find it useful so you don't bump into these problems in the future.

  • DBMS_SQLTUNE.REPORT

    Hi,
    on 11g R2 on Win I run in SQLPLUS:
    variable stmt_task VARCHAR2(64);
    EXEC :stmt_task := DBMS_SQLTUNE.CREATE_TUNING_TASK(sql_id => ‘4rc7d8c0mvfm8');
    EXEC DBMS_SQLTUNE.EXECUTE_TUNING_TASK(:stmt_task);
    SET LINESIZE 140
    SELECT DBMS_SQLTUNE.REPORT_TUNING_TASK(:stmt_task) from dual;
    DBMS_SQLTUNE.REPORT_TUNING_TASK(:STMT_TASK)
    GENERAL INFORMATION SECTION
    SQL>Is the report empty ? Nothing in it ? Why ?
    Thank you.

    Is this not just the display being too small?
    Try something like:
    set long 10000then rerun.

Maybe you are looking for

  • What's the best format for a movie to be in a site and be viewed by a PC?

    I created a temporary web site using GoLive. I imported a short movie in 2 different versions (1 medium for DSL/Cable and 1 small for Dial-up). When I tested the site either in Explorer or Safari on different Mac computers at home, they both loaded a

  • How can I use FRF function after i have collected the raw data?

    I have collected a set of raw data from a vibrational test. I didn't save the FRF results. I was wondering if i can do a FRF post data analysis. Maby by using a modified verison of the FRF (SVXMPL_Baseband FRF (Simulated).vi found in the NI example f

  • Reg: Test Configuration with Default variant

    Hi Guru's   I am new here.. Guide me to achieve this.   I do created the Test script ,Test data and also the Test Configuration   Whats my problem is  I do run the TC with external variant (File that i have mapped) .    its works fine but Default var

  • PS Connected Query:How 2 Check Child Query Result

    Hi Gurus, I am trying to Create a BI Report using PS Connected Query. Its a simple PS Connected Query where Child Query are sub total of various coloumn of Parent Query. I have observed that if a child query doesn't return value then XML file doesn't

  • Availability of 10g database for windows

    Hi. Did anyone know when the Oracle Database 10g for windows will be available ?? Thanks