Use of SQL Profiles where each schema has very different data distribution and volumes

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE    11.2.0.3.0      Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
Our architecture has multiple client schemas in the same database. Each schema has the same code base (tables, procedures etc) but each client's data is very different in terms of volumes and skew/distribution per table. This architecture was done based on cost - I know it's not ideal but it can't change.....
I am fairly seasoned with performance management and so know the usual tricks of when to eat up the table using parallel full table scans etc. I couldn't further optimise a given stmt for our largest table. I'll call it TSPCI and it has monthly partitions (2 years) and totals about 35Gb in the largest client schema.
Anyway, I was surprised when ADDM suggested that I could achieve 98% improvement if I were to use a given SQL Profile. Great?
So, here's my issue - I've found that the same SQL_ID is shared across all those different client schemas: I can't see how to get it to pick/use the SQL Profile in only a particular client schema - let's call it NEX - and not in another (lets call it COL).
If I generate a SQL Profile as NEX, has it analysed and built the SQL Profile based on the NEX schema and is it therefore invalid/undesirable to have that SQL Profile used in the COL schema??
I suppose that I could add a small change (say /*+ NEX */) to the SQL in the NEX schema to make the given sql unique there and then generate a SQL Profile for that..........
What am I missing here?

Well, I can confirm the behaviour: accept a SQL Profile for a given SQL in one schema and verified that it is used in another schema (where the data volume and distribution is very different).
I can also confirm the workaround - simply add a hint to the SQL to make it unique such that I could use different sql profiles for the otherwise exact same sql in different schemas.
I'm happy enough with this workaround but I'll leave this thread unanswered in case someone can suggest a better approach.

Similar Messages

  • Is it possible to sort a 2CD compilation album where each CD has a different "album artist" together as one album in iTunes?

    I have an album which I am trying to sort correctly in iTunes.
    It has 2CDs of tracks by various artists, it is set up as a 'compilation' and I have 'album artist' set up. 
    As far as I can see all the settings are correct, however CD1 is a compilation of tracks remixed by "artist A" and CD2 is a compilation of tracks remixed by "artist B" therefore  becasue each disc has a different album artist, the album is split into two seperate albums on album view.
    Is there any way to get this to display as one album?
    The album is released as "Artist A" so for now I have set that name as the 'album artist' for CD2 as well to get round it but would ideally like to have the second CD labelled correctly with the second artist's information.
    I suppose I could also use "Arist A / Artist B" for both CDs but would prefer not to do this as well so that it would be grouped with other (solo) albums from these artists.
    Cheers for any help!

    Your options are to treat this as one collective album by the joint Album Artists, or as two separate albums by them as individuals, or I suppose you could duplicate the entire album and do both.
    tt2

  • How can i make a slideshow to use in muse where each slide has its own hyperlink

    I want to make a slideshow to use in muse where each slide has its own hyperlink to another page in the site.
    example here: Genesis Bicycles - Easton PA
    I see how slideshows can be made in muse, but haven't seen where you can assign a hyperlink to each image. 
    I would like it to be html5 compatible.
    Thanks ,
    mark

    Hey Mac, thanks for the feedback. I did some research on composition widget, still not finding how I can use that to make a slide show like the one on www.Genesisbicycles.com home page , could you elaborate on how to or maybe link a tutorial for me.  It would be a big help.
    mark

  • I need to back up and sync multiple iPhones to a single iMac.  Each iPhone has a separate Apple ID and the data from each iPhone needs to be backed up separately from the others.  How can I do this without getting all of the contacts, etc. mixed? Tnx

    I need to back up and sync multiple iPhones to a single iMac.  Each iPhone has a separate Apple ID and the data from each iPhone needs to be backed up separately from the others.  How can I do this without getting all of the contacts, etc. mixed? Tnx

    This might help: http://support.apple.com/kb/HT1495.

  • HT202213 can i use home sharing with my wife who has a different apple id

    Can I use home sharing with my wife who has a different apple id so we dont buy the same songs twice

    Wow, great question mhaney73.  There's got to be a way.  I have that problem as well, double songs all over the place. 

  • HT201269 I am using my daughters old laptop (which already has her iTunes on it) and need to add my iPhone and iTunes acct info but can't figure out how...   HELP!!

    I am using my daughters old laptop (which already has her iTunes on it) and need to add my iPhone and iTunes acct info but can't figure out how...   PLEASE HELP!!

    Sign her out of the iTunes copy that's on the machine, then you can sign in with your account credentials.

  • I want to use the SQL query IF EXIST to update or insert data in a ms access table, but it doesn´t work

    Hi,
    I want to use the SQL query IF EXIST to update or insert data in a ms access table, but it doesn´t work
    (fault number -2147217900)
    I want to search for a value in a ms access table , if it exist i want to update it, if not i want to insert a new row.
    Working with LabView 7.1, database con. toolset.
    Who can HELP?
    Thanks a lot
    Marco

    Hello,
    I think that If exist is not a standar SQL command (I know it exists I think in Oracle and SQL server), MS access doesn't support it, so I think the best way to do it is first make a Select and then either an Update or an insert, sorry...
    Paulo

  • For the ipod on my phone, each song has a different volume. How do you set it so all the songs have the same volume?

    For the ipod on my phone, each song has a different volume. How do you set it so all the songs have the same volume?

    Copy everything from your old computer, or your backup copy of your old computer, to your new one.

  • Using pl/sql function for each day between two dates.

    Hi,
    create TABLE EMP(
    ID_EMP NUMBER,
    DT_FROM DATE,
    DT_TO DATE,
    CREATE_DATE DATE);
    into EMP(ID_EMP, DT_FROM, DT_TO, CREATE_DATE)
    Values(100, TO_DATE('07/01/2008 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('04/30/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),TO_DATE('05/08/2009 14:11:21', 'MM/DD/YYYY HH24:MI:SS'));
    I have a function called  elig_pay_dates(date p_date), which returns the code for  person payment eligibility for a particular date. For paid dates it's 'P' and for unpaid dates it's 'N'.
    How can I check this function between two dates for each day. Example : 07/01/2008 to 04/30/2010.
    By using this function with select I needs to display the dates when there is a change in status.
    I am expecting data in following manner from above logic(this is example):
    07/01/2008 --- 07/01/2009 ---'P'
    07/02/2009 -- 07/25/2009 ----'N'
    07/26/2009 -- 01/01/2010 ---'P'
    01/02/2010 -- 01/13/2010 --'N'
    01/14/2010 -- 01/18/2010 --'P'
    01/19/2010 -- 04/30/2010 -- 'N'
    I thought of looping for each day date but that seems to be expensive for online application. Is there any way that I can achieve this requirement with sql query ?
    Thanks for your help,

    Certainly not the best way to code the requirement, but it does achieve the result you are looking for in a fairly quick time
    create or replace
    function test_ret_paid_unpaid (p_date in date)
    return varchar2
    is
      v_ret     varchar2(1);
    begin
      if ( (p_date between to_date('07/02/2009', 'MM/DD/YYYY') and to_date('07/25/2009', 'MM/DD/YYYY') ) or
           (p_date between to_date('01/02/2010', 'MM/DD/YYYY') and to_date('01/13/2010', 'MM/DD/YYYY') ) or
           (p_date between to_date('01/19/2010', 'MM/DD/YYYY') and to_date('04/30/2010', 'MM/DD/YYYY') )
        then v_ret := 'N';
      else
        v_ret := 'Y';
      end if;
      return v_ret;
    end;
    Wrote file afiedt.buf
      1  with get_paid_unpaid as
      2  (
      3    select dt_from start_date, dt_to end_date, dt_from + level - 1 curr_date, test_ret_paid_unpaid(dt_from + level - 1) paid_unpaid,
      4           row_number() over (order by dt_from + level - 1) rn_start,
      5           row_number() over (order by dt_from + level - 1 desc) rn_end
      6      from test_emp
      7    connect by level <= dt_to - dt_from + 1
      8  ),
      9  get_stop_date as
    10  (
    11  select start_date init_date, end_date, curr_date, paid_unpaid,
    12         case when paid_unpaid != lag(paid_unpaid) over (order by curr_date) or rn_start = 1 or rn_end = 1
    13          then curr_date
    14          else null
    15         end start_date,
    16         case when paid_unpaid != lead(paid_unpaid) over (order by curr_date) or rn_start = 1 or rn_end = 1
    17          then curr_date
    18          else null
    19         end stop_date
    20    from get_paid_unpaid
    21  )
    22  select period, paid_unpaid
    23    from (
    24  select init_date, curr_date, start_date, end_date, stop_date,
    25         case when paid_unpaid = lead(paid_unpaid) over (order by curr_date)
    26                then nvl(start_date, init_date) || ' - ' || lead(stop_date, 1, end_date) over (order by curr_date)
    27              else null
    28         end period,
    29         paid_unpaid
    30    from get_stop_date
    31   where stop_date is not null or start_date is not null
    32         )
    33*  where period is not null
    12:06:10 SQL> /
    PERIOD                                             PAID_UNPAID
    01-JUL-08 - 01-JUL-09                              Y
    02-JUL-09 - 25-JUL-09                              N
    26-JUL-09 - 01-JAN-10                              Y
    02-JAN-10 - 13-JAN-10                              N
    14-JAN-10 - 18-JAN-10                              Y
    19-JAN-10 - 30-APR-10                              N
    6 rows selected.
    Elapsed: 00:00:00.35

  • Replacement iPhone 4 has very different screen - faulty?

    I had to swap my launch day 16gb device (Vodafone UK locked) at the Glasgow Apple store on Saturday as the sleep button had stopped working. Having now viewed my replacement phone against some friends and colleagues ones it's clear that my screen is washed out looking, and even has some faint horizontal lines on it. Is it faulty, and am I entitled to take this back and have it swapped out again?

    The yellow spots that people talk about aren't the issue as it's an all over screen problem with regards to it looking "washed out". The temperature of the colours is certainly a lot warmer than the devices of other iPhone 4 owners I know. Although even between them there are obvious differences even with brightness set the same. On mine the white has a yellow/brown tinge to it, whereas the others have a more blue tinge to theirs.
    Also on mine there are very visible light spots at the top of the screen too, like the back light isn't uniform across the top edge.
    Obviously as I've now been using the phone since Saturday I'm perhaps slightly more used to the colour temperature, but the light spots are a concern and were definitely not present on my first device. The slight noticeable horizontal lines (that are more apparent if you move the device) are a concern too.

  • Can you use 2 apple tvs on the same network with different apple ids and how would your devices know which apple tv to stream to?

    Hi,
    I was looking into purchasing 2 apple tvs and was wondering if they can be setup with different apple ids. I need to have mine setup with my id and be able to hook my devices to it , but have the one in a bedroom hooked to a different apple id and have my friend's devices stream to that one and not mine.  Is this possible?

    Welcome to the Apple Community.
    In order that your Apple TV only streamed from your iTunes Library and your friends to your friends, you would both have to have different homesharing ID's.
    So far as devices go, any device on a network can stream over AirPlay to an Apple TV, to ensure each of you couldn't stream to the others device you can enable a password via the Apple TV which would then need entering when you used a device for AirPlay.
    Shouldn't be a problem to do what you want to do.

  • Blackberry Link for Q10 with Outlook Sync has very poor performanc​e and not good Functional​ity

    I am wondering if anyone has tested this software. Blackberry Sync software for my previous phones were wonderful. I can sync my contacts and calender in a very short time. With this new Blackberry Link it takes about 1 1/2 hours Plus to complete. And when it does complete - it duplicates entries which I did not want.
    Plus what is missing is the following:
        1. I am not able to say Update both Device and Outlook any longer. This functionality is gone.
    My question: How does it do a two way sync if I only have a choice to use what I have on my phone or on outlook only
    I want to be able to update my Outlook contacts with changes and addition I made on my Q10 phone and update my device with changes I made to Outlook.
    Why did Blackberry remove this very flexible choice? Plus Blackberry Link has very poor performance.
    I work for a large company and I do Enterpirse Software testing daily. Performance is the number one complaint for customers on top of the UI and functionality.

    Thanks for the reply.
    OS: Windows 8.1 Pro 6.3.9600 Build 9600
    Link: 1.2.3.23
    BB Desktop: 7.1.0.41
    Anti Virus: Avast 140312-0
    Firewall: None
    A thing I noticed when I opened Descktop Software for the first time since the new Z30 is that the old application thinks it is looking for a Z30.  I havent even opened the application since before I got the new device.  The only way it could think I have a Z30 is if it is using a lot of the same files as Blackberry Link.   That is some pretty terrible software development practices in my opinion.  I'm going to take your suggestion and uninstall both apps, run a registry cleaner and reinstall BB Link and I bet it works a lot better afterwards.  
    EDIT 12 March 2014 7PM EST
    Still all of the same errors with regard to syncing outlook contacts and Schedules.  I will post all of the error messages I recieve here as I see them.  Application is always started by connecting device with USB cable.
    "Sync was unseccessful
    Caught _com_error exception. Description(): Error in MAPILogonEx: MAPI_E_CALL_FAILED; Error(): -2147467259 (0x80004005); ErrorMessage(): Unspecified error; Source(): XCPCRdmptn.RdRDOSession"
    REBOOT
    Change to sync contacts only, 1-way sync to computer, always use device data
    "Sync was unsuccessful
    CPreferencesManager: Configuration Value for /Preferences/Account_1_65537/DevicePin not set in TransConfig.xml for translator RimBB"
    REBOOT
    Application went through the whole process and hung for about 15 minutes and then completed successfuly syncing contacts only.
    Change to callendar only.  Sync completed successfuly.  No hang or errors. very quick.
    A new recurring appointment on the device was not transferred to the computer.  
    Sync callendar again, completed successfuly.
    Appointment is still not transferred to computer.
    So far I've spent an hour tonight trying to sync my contacts and appointment changes from just one day.  I'm not thrilled.

  • SQL Developer 1.1.0.21: Issues with Data Grid and SQL syntax checking

    In this new release of SQL Dev, when I execute a SQL in the SQL Worksheet and click in the Data Grid in the Results tab and try to navigate within a record using arrow keys, the grid cell enters into edit mode by default and so I cannot use the Left or Right arrow keys to navigate the grid. I am forced to use tab key to navigate. This is counter intuitive in my opinion.
    Is there any option to change this behavior?
    Another issue that I have come across is with SQL syntax checking. In some cases, when I press F9 to execute a SQL, it shows the SQL as executed i.e. shows something like 0.0134 seconds in the toolbar and no results displayed. In reality, the SQL had some syntax error which were NOT reported. This can be frustrating since now I have to fall back to SQL*Plus or TOAD just for syntax check.
    I like the fact that SQLDev highlights the current SQL but it would be more useful if it just indicated the first line of the current sql instead of highlighting the whole sql.
    Manish

    "In this new release of SQL Dev, when I execute a SQL in the SQL Worksheet and click in the Data Grid in the Results tab and try to navigate within a record using arrow keys, the grid cell enters into edit mode by default and so I cannot use the Left or Right arrow keys to navigate the grid. I am forced to use tab key to navigate. This is counter intuitive in my opinion."
    In the "Results" tab, Click Ctrl & Tab keys (at the same time) or with mouse click on any cell other than the first column (a sequence or rownum), you will be able to navigate using the arrow keys.
    "Another issue that I have come across is with SQL syntax checking. In some cases, when I press F9 to execute a SQL, it shows the SQL as executed i.e. shows something like 0.0134 seconds in the toolbar and no results displayed. In reality, the SQL had some syntax error which were NOT reported. This can be frustrating since now I have to fall back to SQL*Plus or TOAD just for syntax check."
    The 0.0134 seconds could be the result of the most recently executed successful statement. Check the Script Output tab for errors. Use F5 (Run Script option) instead of F9.
    "I like the fact that SQLDev highlights the current SQL but it would be more useful if it just indicated the first line of the current sql instead of highlighting the whole sql."
    On the SQL statement (or code), Right Click -> Format SQL (or press Ctrl & B), proper formatting would help.
    I use version 1.0.0.15.57 and seems to be working allright.
    - Babu Rangasamy

  • Multicam where each camera has a set of 4GB clips.

    Hi,  I have 2 cameras and shot a 1.3 houre talk.  Eatch camera has generated a set of 4GB files that whne played one after another give a uninterupted shot (i.e. eatch camera has 3 files).  How should I do mulicam this.  Do I create a sequence for eatch camera then multical the sequence?

    Best practice with the multi-part clips is this - copy entire contents of memory card to hard drive, then in Premiere, use the Media Browser to import your clips. Premiere will treat the multiple parts as one long clip then when imported. This should make it easier to use Multicam and also has the benefit of avoiding glitches between the shorter segments.
    Thanks
    Jeff Pulera
    Safe Harbor Computers

  • Create Test data using T-SQl script for each row

    Hi team,
    I am looking for a sql code snippet which read data from below table
    UserId username contact
     1      Anil    111
     2      Sunil   222
    and insert data to below table with some test data appending sequence number 1,2,3 for only City and Email. Both are different tables
    and does not have any referencial integrity
    No of records inserted for user is configurable for example count = 3
    Username  City  Email
    Anil      city1 email1
    Anil      city2 email2
    Anil      city3 email3
    Sunil      city1 email1
    Sunil      city2 email2
    Sunil      city3 email3

    DECLARE @cnt INT=3
    DECLARE @Users TABLE(UserId INT, UserName VARCHAR(99),Contact INT)
    INSERT INTO @Users VALUES
    (1,'Anil',111),
    (2,'Sunil',222)
    SELECT UserName,'city'+CAST(num AS varchar(10)) city FROM @Users
    CROSS APPLY
    SELECT TOP(@cnt) number +1 AS num
                    FROM master..spt_values
                    WHERE type = 'P') AS Der
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

Maybe you are looking for