SQL tuning set for specific SQLID

Hi,
Is it possible to create SQL tuning set for specific SQLID's?
Advance thanks!

do you have any code or some package to do this?As long as those statements are in AWR or the cursor cache then you can use
DBMS_SQLTUNE.SELECT_CURSOR_CACHE or
DBMS_SQLTUNE.SELECT_WORKLOAD_REPOSITORY For example something like this:
begin
  DBMS_SQLTUNE.CREATE_SQLSET(
    sqlset_name => 'my_tuning_set',
    description  => 'my tuning set');
end;
DECLARE
baseline_cursor DBMS_SQLTUNE.SQLSET_CURSOR;
BEGIN
OPEN baseline_cursor FOR
      SELECT VALUE(p)
      FROM   TABLE(DBMS_SQLTUNE.SELECT_CURSOR_CACHE
             (basic_filter      => 'sql_id in (''1'',''2'',''3'')',
              attribute_list    => 'ALL'
              )) p;
    DBMS_SQLTUNE.LOAD_SQLSET(
             sqlset_name     => 'my_tuning_set',
             populate_cursor => baseline_cursor);
END;
/

Similar Messages

  • Permissions needed for Applying SQL Tuning Sets/SQL Plans 11g?

    What permission are needed for a user to apply/activate sql tuning sets (sql plans) in 11g? The user can capture and move the the sql tuning sets from a 10g database to an 11g database but is getting "ORA-01031: insufficient privileges" when trying to activate/apply the sqlplans in 11g.
    The user has:
    ADMINISTER SQL MANAGEMENT OBJECT and ADMINISTER SQL TUNING SET and EXECUTE on SYS.DBMS_SPM
    The user is an administrator for our Data Warehouse team but they do not have sysdba priviliges.
    Do you also know of a good white paper that covers the step by step instructions and permissions needed for aquiring and applying/activating sqlplans?
    If more information is needed in order to respond please advise.
    Thank you

    What permission are needed for a user to apply/activate sql tuning sets (sql plans) in 11g? The user can capture and move the the sql tuning sets from a 10g database to an 11g database but is getting "ORA-01031: insufficient privileges" when trying to activate/apply the sqlplans in 11g.
    The user has:
    ADMINISTER SQL MANAGEMENT OBJECT and ADMINISTER SQL TUNING SET and EXECUTE on SYS.DBMS_SPM
    The user is an administrator for our Data Warehouse team but they do not have sysdba priviliges.
    Do you also know of a good white paper that covers the step by step instructions and permissions needed for aquiring and applying/activating sqlplans?
    If more information is needed in order to respond please advise.
    Thank you

  • ORA-13754: "SQL Tuning Set" "" does not exist for user "SYS"

    While calling dbms_stats.seed_col_usage I got the following error. Can someone help me on how to resolve it
    sqlplus
    SQL*Plus: Release 11.2.0.1.0 Production on Thu Apr 14 14:37:38 2011
    Copyright (c) 1982, 2009, Oracle. All rights reserved.
    Enter user-name: / as sysdba
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE 11.2.0.1.0 Production
    TNS for IBM/AIX RISC System/6000: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL> show user
    USER is "SYS"
    SQL> begin
    2 dbms_stats.seed_col_usage(null,null,400);
    3 end;
    4 /
    begin
    ERROR at line 1:
    ORA-13754: "SQL Tuning Set" "" does not exist for user "SYS".
    ORA-06512: at "SYS.DBMS_SQLTUNE_INTERNAL", line 17379
    ORA-06512: at "SYS.DBMS_STATS", line 28451
    ORA-06512: at line 2
    Thank You
    Sarayu

    According to the documentation:
    SEED_COL_USAGE ProcedureThis procedure iterates over the SQL statements in the specified SQL tuning set, compiles them and seeds column usage information for the columns that appear in these statements.
    Syntax
    DBMS_STATS.SEED_COL_USAGE (
    sqlset_name IN VARCHAR2,
    owner_name IN VARCHAR2,
    time_limit IN POSITIVE DEFAULT NULL);>
    It looks like you need to provide a SQLSET_NAME and OWNER_NAME to use this procedure correctly, to which you've provided NULLs. I don't see any exceptions in the documentation that indicate special processing when NULLs are provided.

  • List Sql Tuning Sets

    I am hoping for a quick easy answer on this. grin
    We have been generating a number of Sql Tuning Sets via Grid Control and now we want to export them. Of course, they all have these awful, non-descriptive names. How do we list them? I was unable to find any help in the "automatic SQL tuning" guide (Chapter 12) of the Performance Guide, and browsing the DBA_* and other fixed views has not revealed anything, yet.

    Does this help?
    BANPROD_SQL > select id,name,owner,description,created from WRI$_SQLSET_DEFINITIONS order by 1 desc;
    ID NAME OWNER DESCRIPTION CREATED
    10 TUNING_SET_1141930799317 ORACLE Automatically generated by ADDM 09-MAR-06
    9 TUNING_SET_1141921159123 ORACLE Automatically generated by ADDM 09-MAR-06
    8 TUNING_SET_1141831053351 ORACLE Automatically generated by ADDM 08-MAR-06
    7 TUNING_SET_1141826801391 ORACLE Automatically generated by ADDM 08-MAR-06
    6 TOP_SQL_1141752418284 ORACLE Automatically generated by Top SQL 07-MAR-06
    5 TOP_SQL_1141749589578 ORACLE Automatically generated by Top SQL 07-MAR-06
    4 TOP_SQL_1141747575814 ORACLE Automatically generated by Top SQL 07-MAR-06
    2 TOP_SQL_1141746930242 ORACLE Automatically generated by Top SQL 07-MAR-06
    1 TUNING_SET_1141660362671 ORACLE Automatically generated by ADDM 06-MAR-06
    9 rows selected.

  • Loading SQL Tuning Sets

    On a 10.2.0.4 database, is it possible to load SQL Tuning sets with SQL from a text file? I can't find anything in the documentation mentioning this but I could have simply missed it and this facility would be very useful to us.
    Our reporting tool is MicroStrategy which operates by building lots of temporary tables: extracting the SQL via Top Activity EM page will put the CTAS statement into the tuning set which (I believe) is ignored by SQL Access Advisor - extracting the sql to a text file, editting to remove the "create table as" and executing in order to load the tuning set is very long winded for a set of queries - at least being able to load the tuning set directly with a set of SQL select statements directly from a text file would help significantly.
    Many thanks for any advice
    Pete

    I did not see a direct way to create the STS from a text file. From the docs:
    "The standard sources for populating an STS are the workload repository, another STS, or the cursor cache"
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/sql_tune.htm#i34915
    But you could try a couple of things:
    1) create one tuning task per statement, using DBMS_SQLTUNE.CREATE_TUNING_TASK, which can use plain text as input: http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/sql_tune.htm#CHDJDHGE
    2) create the STS with queries from cursor cache: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_sqltun.htm#i1010615
    Both approaches needs some PL/SQL programming, but it can be useful if you can identify your SQL statements some way.
    Regards.

  • Modify sql tuning set

    Hi Experts
    I have created a sql tuning set with all sqls from cursor cache referring table1. Now I have transported this sqlset to nonprod environment, now what I want to do is  make table1 partitioned and test the impact. Instead of altering table1 I want create copy of table1 as partitioned table2. Is there a way I cancl change the sqls in my sqlset to refer to table2 in place of table1. So I basically want to update the sqls with table2 instead of table1. Is this possible and if yes how? If no any other way of doing it, sqlset has ~200 sqls

    Why ever not!
    1. You create a new user with the appropriate privileges
    2. Logon as the new user and create private synonmys (if public ones do not exist) for the objects you need to use
    3. Either import a sql set or create a sqlset.
    4. Create and execute an analysis task - this will be your baseline
    5. Build test1 table as a partitioned table in the new schema - this will override the public synonym
    6. Execute an analysis task - this will be your post change run
    7. Compare results.

  • RAT - SQL Tuning Set from 9i trace in wrong order

    Hi together
    I want to test the impact of some staments on 9.2.0.8 in 11g with Real Application Testing, but the order in the tuning set seems to b wrong (not in the traced order). So i made a small Test Script who is creating a Table, insert Data with a loop and select all.
    Steps :
    * 9i enable trace level 4
    * 9i run the script
    * 9i stop the trace
    * transfer to 11g
    * make an sql tunnig set
    * running in the Performance Analyzer Workflow
    The first run Oracle makes performance datas from the trace files. In the second run I want to execute the statements from the tuning set in the 11g database. The traced Schema from 9i exists.
    In the report after the second run I see the failure that the insert and select statement is not allowed. When i take a look in the SQL Tuning Set i see that the select and insert will be played before the create table ! Also on the view DBA_SQLSET_STATEMENTS.
    Is there a way to get the correct order in the SQL Tuning Set like the statement order (create before insert,select) ? Or can Oracle not handle DDL-Statements in the trace ?
    Regards Martin

    Hi together
    I want to test the impact of some staments on 9.2.0.8 in 11g with Real Application Testing, but the order in the tuning set seems to b wrong (not in the traced order). So i made a small Test Script who is creating a Table, insert Data with a loop and select all.
    Steps :
    * 9i enable trace level 4
    * 9i run the script
    * 9i stop the trace
    * transfer to 11g
    * make an sql tunnig set
    * running in the Performance Analyzer Workflow
    The first run Oracle makes performance datas from the trace files. In the second run I want to execute the statements from the tuning set in the 11g database. The traced Schema from 9i exists.
    In the report after the second run I see the failure that the insert and select statement is not allowed. When i take a look in the SQL Tuning Set i see that the select and insert will be played before the create table ! Also on the view DBA_SQLSET_STATEMENTS.
    Is there a way to get the correct order in the SQL Tuning Set like the statement order (create before insert,select) ? Or can Oracle not handle DDL-Statements in the trace ?
    Regards Martin

  • Sql tuning advisor for concurrent requests

    Dear all,
    I am having one doubt in my mind from very long time.Can we use sql tuning advisor from 10G(EM) to tune concurrent requests and reports?
    Regards

    Hi Helios,
    I am just thinking wiht voice. If you have one code blog which is typed in sql-pl/sql for your concurrent request, its going and run on dbtier. So it has one SQL'ID and also can be check on AWR report. So i belive you can use sqltuning adviser for to can tune related sqlAFAIK, some Instances a single concurrent request may contain multiple SQLID's and in that scenario tuning approach is difficult. Any information how can we consolidate it. If tune one specific sql then the explain plan for other sql become more worst. I came across this situation so many time.
    Any information or inputs on this is really appreciated.
    thanks,
    X A H E E R

  • Sql tuning set explain plan

    A hypothetical question came up between dbas in the office.   We regularly take tuning sets before making significant changes on the DB.  Populate from cache.  Great little way of checking to see if anything changed.  Someone asked if a table T1 was accessed during a given day where we had a tuning set being populated from the cache (no reason for auditing to be on at the time).  Well first thing to do is search the sql_statements
    select * from DBA_SQLSET_STATEMENTS
    where sqlset_name = 'my_sts'
    and sql_text like '%select * from t1%'
    but no rows returned, so next idea is to query the plan in case a synonym was used
    select * from DBA_SQLSET_PLANS
    where sqlset_name = 'my_sts'
    and object_name = 'T1'
    And yes, its there we had a select against the table, the main sql_text in the dba_sqlset_statments view was using a synonym.  great, so now we might be able to use this as a alternative audit method (mmv depending on whether you have the diag pack). 
    Heres the question, can we always be guaranteed an object will be in a plan?

    Dom Brooks wrote:
    Also, the presence of a SQL statement in the shared pool does not indicate it was run today - you'd need to check the relevant column, something like last_active_time.
    More importantly, the absence of a SQL statement from the shared pool does not indicate that it was not run today.
    Just that it's no longer in the shared pool.
    I'm concious of that when running the populate,  even in a busy period our pools last over an hour,  with that in mind when Im populating my tuning set, I set the frequency to 10 minutes to poll the cache where distinct IDs and HASHes are overloaded in the tuning set if theyre already there. 
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_sqltun.htm#CACJHDDC
    Note that in production systems the time limit and repeat interval would be set much higher. You should tune the time_limit and repeat_interval parameters based on the workload time and cursor cache turnover properties of your system.

  • SQL Tuning Pack for 10G R2 database

    Hi,
    I am looking for a SQL tuning pack plug in with SQL Developer 2.1 release for Oracle 10g R2 database.
    Any information this would be appreciated.
    Thanks,
    Patchava

    There is no 'tuning pack' plugin for SQL Developer, We can process trace files, monitor sessions etc.
    If you are looking for specifics on things like SQL Advisor, SQL Profiles and things, we do not have specific features for them yet, but we have planned them in the future.
    Barry

  • SQL tuning Advisor for old statements

    Hi all,
    i've identified SQL ID (through snapshots AWR) that make me performance problem. This is a old select statement (Mar 10, 2008) and when i try to run sql tuning advisor, it shows me this error:
    "There was a problem creating a SQL tuning task. ORA-13780: SQL statement does not exist. ORA-06512"
    I've set AWR for retain 60 days of Snapshot Retention, why i can't run tuning advisor for this statement??
    thanks very much for answers.
    Andrea

    Hi
    The problem is that the information of AWR is based on Historical information that Oracle retrieve of historical tables . AWR means Automatic Workload Repository.
    But when you execute the SQL tuning advisor task, Oracle needs retrieve the information of sql statement from SHARED POOL.
    The Library Cache is a part of Shared pool and contains an area named SQLAREA that stored information of execution plan for sql statements. This memory area is managed by LRU alghoritm.(last recently used) and the error is produced because this sql statement not is stored in this memory area.
    When the sql stament not reside in memory Oracle can't build the execution plan and then the error appear
    Regards

  • Layout for packing list cannot be set for specific customers

    It is not possible to set an standard layout for the packing list for specific customers. So, if you have layouts in different languages, you have to check the standard layout every time before you print and to set the right one. In other documents it is possible to set an standard layout for specific customers/suppliers for example depending on the language.
    kind regards,
    Markus Niebergall

    Hi Engin,
    Have you followed the ios tutorial which sybase provides :
    http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc01213.0200/doc/html/title.html
    if you get "login success" at console it seems everything fine there may be something missing.
    Regards
    Tahir

  • Function to change character set for specific text

    Hi all,
    there is any function that i can use to change specific character from AL16UTF16 character set to UTF8 character set,
    there is any such a function in oracle doing this ..
    Thanks in advance
    Ahmed,

    HI Elic,
    The things is my CharacterSet is AR8MSWIN1256
    and i want to convert it to unicode character set that supported arabic
    can you please tell me ,
    ahmed

  • Set for specific nodes in JTree specific rowheight

    Hi,
    I got a JTree with different components for the nodes userobject.
    some nodes got JTextAreas as userobject. Those nodes got the same height as all other nodes. This is the problem ... the nodes who contains JTextAreas should have a larger rowheight - to paint their content well. But there is only a method to specify the of the height of all rows in a JTree, anyone knows a good solution?
    thx
    null
    Message was edited by:
    Olek

    From the JTree.setRowHeight documentation:
    "Sets the height of each cell, in pixels. If the specified value is less than or equal to zero the current cell renderer is queried for each row's height."
    So try tree.setRowHeight(0);

  • ACS Service set for specific SSIDs

    I have a wireless service set that I have configured on ACS 5.2.  It basically handles radius requests comming from wireless controllers.  I have a special SSID that I only want specific users to log into.  In my service set, how can I add the SSID as a condition?

    You need to create a SSID set under the policy elements by going to end-station filter >> create >> CLI/DNIS > DNIS=*SSID
    Save changes.
    Go to access-policy >> network access service >> authorization >> customize >> move the end-station filter on the right end side >> ok
    Now if you have users on the AD then from the customize tab you need to select and move one more attribute AD1:Externals-groups >> ok
    Edit the policy and fetch the end-station filter and external groups you created before.
    Rgds, Jatin
    Do rate helpful posts~

Maybe you are looking for

  • How can i sync my iphone to a different user account on my laptop?

    i have my iphone synced to our familys shared user account, and i finally made my own user on the computer and i put all the music on the new itunes library, but when i plug it in it doesnt show up on the new user account, only on the old one. can yo

  • How to remove "Read Only" attribute on folders

    Hi I am logged in with my User account which has full control over my folders.<o:p></o:p> I have a folder that I tried to add modifications to, however i could not do so because the folder was classified as read only. I have full permissions to this

  • PO creation from POR: quantity rounded. Why?

    Hi, when I create a PO from a Purchase Order Requisition (with transaction ME21N) the system round the quantity. Why? Example: in the POR the quantity is 1000,345. When I create the PO the quantity become 1000. Where do I have to check the parameters

  • Problem sending the data into XI through webservice

    Dear All, I am getting an error while sending the data into XI after hitting my webservice. SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP:Header> </SOAP:Header> <SOAP:Body> <SOAP:Fault xmlns:SOAP="http://schemas.xmlsoap.

  • Self-registration and the WWSSO_API_USER_ADMIN package

    I am using the wwsso_api_user_admin package to build a self registration JPDK portlet for my client to be run on the Portal Welcome page and I have a few questions. Just so you know, I am using Oracle 8.1.7.1.1 and Oracle Portal 3.0.9.8.2 all running