Pininig frquently used sql statements in SGA

Hi
Can you pls let me know the procedure to pin Oracle sql or pl/sql statements into SGA
Thanks in anticipation.
Hariharan.T

William Robertson wrote:
Perhaps it is used frequently but other code is used even more frequently.Yep, and of course pinning the less frequently used code will cause the more frequently used code to be aged out which will require pinning that code which in turn will age out code that is run even more frequently to be aged out which will require pinning that until everything but the most frequently used code will be pinned and the most frequently used code will be aged out.

Similar Messages

  • Add sql statements in SGA

    select a.address address,
    s.hash_value hash_value,
    s.piece piece,
    s.sql_text sql_text,
    u.username parsing_user_id,
    c.username parsing_schema_id
    from v$sqlarea a,
    v$sqltext_with_newlines s,
    dba_users u,
    dba_users c
    where a.address=s.address
    and a.hash_value=s.hash_value
    and a.parsing_user_id=u.user_id
    and a.parsing_schema_id=c.user_id
    and exists (select 'x'
    from v$sqltext_with_newlines x
    where x.address=a.address
    and x.hash_value=a.hash_value
    and upper(x.sql_text) like '%UNION%')
    order by 1,2,3
    On executing the above statement the server display list of sqltext present in sga. We know that the server first search for the record in sga and if it is not
    present in SGA it searches in data files.
    My question is ,adding all the sql statements in sga manually is advisable? will that improve the performance?

    Vinodh2 wrote:
    In production the users uses some sql statement frequently. So those statements should be in the sga for better performance. The dbms package said by you takes object as input. What is object here?
    Did you check the last line I pasted from document?
    The value for this identifier is the concatenation of the address and hash_value columns from the v$sqlarea view.Each SQL in SQL AREA has a hash_value to identify it. You can use this hash value to decide which SQL want to keep in shared pool.
    Having Dynamic sql statements(records fetched based on varying filter condtion) called from interfaces will not help.
    But having static sql statements helps.
    In that case how to include those sql.Like said, you are introducing some more problems instead of any real gain by trying to micro manage how shared pool work. You should let Oracle take care it with it's own algorithm. Unless some rare cases, that you have limited shared pool and super busy system you want to pin some SQL in the shared pool with provide package.

  • Assigning values to 2 fields using sql statement

    db11g , apex 4.0 and firefox 24 ,
    hi all ,
    i am trying to follow this tutorial to assign values to 2 items on a page using sql statement ,
    and i am using the same sql statement the tutorial uses
    select d.loc location, count(e.empno) num_employees from dept d, emp e where d.deptno = e.deptno(+) and d.deptno = :P3_DEPTNO group by d.loc -- btw , what does the "+" sign mean?
    after the e.deptno in the where condition .
    but i am facing this error
    1 error has occurred
    Wrong number of columns selected in the SQL query. See Help of attribute for details.
    and it does not work with two columns in the select statement under any conditions , i tried to remove the group function and the group clause ,
    it does not work unless i use only one column in the select statement ??
    thanks

    Pars
    And how exactly is this rewrite of the sql statement resolving the OP's issue.
    You are still using more than 1 column which will still result in the error message:
    Wrong number of columns selected in the SQL query.
    As mentioned in my earlier post APEX 4.0 (the version the OP is using) does not handle a sql statement with multiple columns for the dynamic action Set Value.
    Which means the fastest  and simplest solution is splitting up the dynamic action in multiple Set Value actions.
    Using this plugin or upgrade to a newer apex version would also be a possibility.
    Nicolette

  • Using SQL Statements in Error Exceptions

    Is there any way to include SQL statements within my catch routines (i.e.
    catch (java.io.IOException ex) {
    System.out.println("An error occurred whilst writing to the message buffer: " + ex);
    #sql { INSERT INTO DEBUG_TBL(CURRENT_DT,PROGRAM_ID,DEBUG__MESG) VALUES (SYSDATE,'TEST',:ex) };
    #sql { COMMIT };
    As it stands I get the following error upon compile:
    Error: Unsupported Java type for host item (at position#1): java.io.IOException
    Any help would be greatly appreciated.
    Thx,
    Boybles
    null

    You can use SQL statements in your catch blocks, just not SQL statements that use Java types which do not map to SQL.
    You cannot pass exceptions from Java to SQL. You can catch a SQL exceptions as a SQLException in Java. However, any exception that is thrown by a Java Stored Procedure (including SQLException) is rendered as an "Uncaught Java exception" in SQL.
    When you receive a SQLException there is information about the originator, the error message, etc. in the exception object. See:
    http://technet.oracle.com/docs/products/oracle8i/doc_library/817_doc/java.817/a83723/keyprog5.htm#1004462
    While you cannot insert a Java exception per se into a table, you can extract the message string(s)/code and insert that in a table.

  • Issue Related to limit the result in prompt by using SQL statement.

    Hello Gurus,
    I am facing one issue rite now with our testing environment in some Dashboard Prompt. it seems like they are working fine in our Development environment.
    basically I am using SQL statement in prompt to limit the values for current + last 2 years in drop down.
    Here is the SQL that I am using SELECT Time."Fiscal Year" FROM "Financials - AP Overview" where Time."Fiscal Year" <= VALUEOF(NQ_SESSION.CURRENT_FSCL_YEAR) AND Time."Fiscal Year" >= (VALUEOF(NQ_SESSION.CURRENT_FSCL_YEAR)-2) ORDER BY TIme."Fiscal Year" desc
    Now it's working fine in our Dev but geeting failed in Test environment.
    it's giving below error.
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred.
    [nQSError: 43113] Message returned from OBIS.
    [nQSError: 43119] Query Failed:
    [nQSError: 22023] An arithmetic operation is being carried out on a non-numeric type. (HY000)
    SQL Issued: SELECT Time."Fiscal Year" FROM "Financials - AP Overview" where Time."Fiscal Year" <= VALUEOF(NQ_SESSION.CURRENT_FSCL_YEAR) AND Time."Fiscal Year" >= (VALUEOF(NQ_SESSION.CURRENT_FSCL_YEAR)-2) ORDER BY TIme."Fiscal Year" desc
    Please let me know your output.
    Thanking You..

    Couple of possibilities..
    1. environments may be at different patch sets, may be causing the issue.
    2. data in working environment is fine but in other environment.
    to further debug use the same logical sql in both environments and compare the results..
    hope this helps..

  • Update record using SQL statement

    I have VB6.0 and Oracle 10G Express Edition in Windows 2000 Server. My procedure in VB 6.0 can't update record in the table using SQL statement, and the Error Message is " Missing SET keyword ".
    The SQL statement in VB6.0 look like this :
    General Declaration
    Dim conn as New ADODB.Connection
    Dim rs as New ADODB.Recordset
    Private Sub Command1_Click()
    dim sql as string
    sql = " UPDATE my_table " & _
    " SET Name = ' " & Text3.Text & " ' " & _
    " AND Unit = ' " & Text2.Text & " ' " & _
    " WHERE ID = ' " & Text1.Text & " ' "
    conn.Execute (sql)
    Private Sub Form Load()
    Set conn = New ADODB.Connection
    conn.Open "Provider=MSDASQL;" & "Data Source=my_table;"& "User ID =marketing;" & "Password=pass123;"
    I'm sorry about my language.
    What's wrong in my SQL statement, I need help ........ asap
    Best Regards,
    /Harso Adjie

    The syntax should be
    UPDATE TABLE XX
    SET FLD_1 = 'xxxx',
    FLD_2 = 'YYYY'
    WHERE ...
    'AND' is improperly placed in the SET.

  • Question about reconciliation, by using SQL statement

    Dear All,
    Does any know how to print out A/R invoice which are internally recon, by using SQL statement. It seems like GL report.
    For example:
    InvoiceNo                     Recon
    INV222000001              Yes
    INV222000002              No
    INV222000003              No
    From Samson

    Dear Samson,
    Please try this one:
    SELECT T0.DocNum AS 'Invoice No.',  CASE WHEN SUM(T1.IntrnMatch)=0 THEN 'NO' ELSE 'YES' END AS Recon
    FROM DBO.OINV T0
    INNER JOIN DBO.JDT1 T1 ON T1.TransId = T0.TransId
    WHERE T0.DocDate BETWEEN [%0\] AND [%1\]
    GROUP BY T0.DocNum
    Thanks,
    Gordon

  • Defaulting DFF Segment Value using sql statement in SSHR gives error when using parameter

    Dear All,
    i am having an issue that i am making one segment in DFF (SEGMENT3) being defaulted by using sql statement
    Select MAX(SEGMENT7) FROM PER_ANALYSIS_CRITERIA cri, PER_PERSON_ANALYSES ana where cri.Analysis_Criteria_id = ana.ANALYSIS_CRITERIA_ID and ana.PERSON_ID = :ANALYSES.PERSON_ID
    The Above Select Statement is working fine on the PUI form and getting the Default value correctly but when opening the SSHR page that contain this DFF, it  gives me the below error.
    "No field listener is registered to resolve field ANALYSES.PERSON_ID referenced by the flexfield with application short name PER and name PEA. Please contact your system administrator. "
    Any Help Please???

    Please see the following docs.
    Cannot Add Salary:No Field Listener is Registered to Resolve Field Review.assignment_id (Doc ID 558295.1)
    No Field Listener Is Registered To Resolve Field Assgt.Effective_start_date (Doc ID 889794.1)
    List of Current Enhancement Requests (ER) for Oracle EBS Self Service Human Resource (SSHR) (Doc ID 1381936.1)
    No field listener is registered to resolve field xxx.xxx referenced by the flexfield with application short name ASO... (Doc ID 1359270.1)
    Customer Form, Address Error: No field listener is registered to resolve field GLOB.FLEX_COUNTRY_CODE referenced by the flexfield with application short name AR (Doc ID 1276934.1)
    DFF issue : No Field Listener Is Registered To Resolve Field XXX Referenced By The Flexfield (Doc ID 555589.1)
    Thanks,
    Hussein

  • How do I use SQL statements to perform calculations with form fields????

    Please help!!! I don't know how to use a SQL statement within my APEX form......
    My form is below. The user will enter the values in the form. Click on Submit. Then we need to run a SQL select statement with those values.
    Our form looks like this:
    Start_Date ____________
    Per_Period ____________
    Period ____________
    [Submit Button]
    The user will enter these 3 values in the form.
    This is an example of an user providing the values:
    Start_Date 03/14/08_______
    Per_Period $200.00________
    Period 4____________
    [Submit Button]
    Then they will click the Submit Button.
    The SQL statement (BELOW) returns output based on the users selections:
    START_DATE PER_PERIOD PERIOD
    14-MAR-2008 00:00 200 Week 1 of 4
    21-MAR-2008 00:00 200 Week 2 of 4
    28-MAR-2008 00:00 200 Week 3 of 4
    04-APR-2008 00:00 200 Week 4 of 4
    Total 800
    This is the full text of the SQL that makes the output above:
    with criteria as (select to_date('03/14/08', 'mm/dd/rr') as start_date,
    4 as periods,
    'Week' as period,
    200 per_period from dual),
    periods as (select 'Week' period, 7 days, 0 months from dual
    union all select 'BiWeek', 14, 0 from dual
    union all select 'Month', 0, 1 from dual
    union all select 'ByMonth', 0, 2 from dual
    union all select 'Quarter', 0, 3 from dual
    union all select 'Year', 0 , 12 from dual
    t1 as (
    select add_months(start_date,months*(level-1))+days*(level-1) start_date,
    per_period,
    c.period||' '||level||' of '||c.periods period
    from criteria c join periods p on c.period = p.period
    connect by level <= periods)
    select case grouping(start_date)
    when 1 then 'Total'
    else to_char(start_date)
    end start_date,
    sum(per_period) per_period,
    period
    from t1
    group by rollup ((start_date, period))
    THANKS VERY MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    You're just doing a parameterized report, where the input fields are your parameters.
    Check out the Advanced Tutorial titled Parameterized Report here:
    http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/rprt_query.htm#BGBEEBJA
    Good luck,
    Stew

  • Sql loader using sql statement

    Hi All ,
    May i know any way used sql loader refer sql statement e.g "select a from test"
    import data into other table ?
    if you have any sample or link , please let me know , thanks a lot

    If you are using the database steps, the answer is yes. I've done it by creating a data source that uses the Microsoft Text Driver in the ODBC administrator. The Open Database step is then configured like any other ODBC database. In the .csv file, I have the first line define the column names (i.e. column1, column2) and the SQL statement I use is "SELECT * FROM junk.txt". I haven't tried anything with a WHERE clause but that should work as well.

  • Configuring the appbuilder chart using SQL Statements

    Hi all!
    I am able to create a chart using .mameta
    My Chart is able to read in data and display on a chart successfully.
    What i could not achieve was that the chart doesn't read and display the numbers correctly as shown below.
    It read by ID instead of TOTAL COUNT
    Does anyone knows how to display the count correctly?
    Your replies is much appreciated.

    Hi Satish,
    Modularity per se, i.e. using a function implies a new database object, source control et. al. which is an overhead.
    If we can use an sql statement and handle it in the control file itself, then any future enhancements/bug fixing would involve only modification to the control file, i.e. patching would be easier in this case.
    Thanks for the reply!!!
    Have a nice day!!!

  • Retrieve int using sql statements

    Hi there,
    Does anyone have any ideas as to how i can update a database table with an integer, returned from a second table as part of an sql statement.
    Here is part of the method to get the value i want out of the database:
    public int retrieveId() throws SQLException
      sta = c.prepareStatement("SELECT MAX(cid) FROM Customer");
      ResultSet rs = sta.executeQuery();
      //this method retrieves the first (and in this case the only)
      //value in the result set as an integer
      rs.getInt(1);
      //?????i am unsure as to what to do here to return this integer
    }To clarify my problem, this value will be used to update a second table in the database, i.e:
    public void updateHasAddress() throws SQLException
      sta = c.prepareStatement("INSERT INTO HasAddress(cid) VALUES(?);");
      sta.setInt(1, retrieveId());
      sta.executeUpdate();
      sta.close();
    }However, i have no idea how to return just the integer in the first method - and without all sorts of strange exceptions being thrown - i have tried all sorts of work arounds, but none have worked so far!
    Thanks for your Time

    One thing though, if the statment execution failed for any reason, then you are not closing your statement/result set which will cause problems down the line.
    public int retrieveId()
    String query = "";
    try { 
    query = "SELECT MAX(cid) FROM Customer";
    Statement stmt = connect.createStatement();
    ResultSet rs = stmt.executeQuery(query);
    rs.next();
    int a = rs.getInt(1);
    rs.close();
    stmt.close();
    return a;
    catch(Exception ex) {
    System.out.println(ex);
    return null;
    }Try this instead:
    public int retrieveId()
       String query = "";
       ResultSet rs = null;
       Statement stmt = null;
       try { 
        query = "SELECT MAX(cid) FROM Customer";
        stmt = connect.createStatement();
        rs = stmt.executeQuery(query); 
        rs.next();
        int a = rs.getInt(1);  
        return a;
       catch(Exception ex) {
        System.out.println(ex);
        return null;
       finally
         try { rs.close(); } catch ( Exception e ) {}
         try { stmt.close(); } catch ( Exception e ) {}
    }Now, you have no chance of leaving cursors open or getting memory leaks.

  • Avoid duplicate inserts using SQL statement?

    I have primary key on three columns and I want to write a sql statement to insert a row only if the matching three columns doesn't exist in the database.
    This is the condition I wrote but doesn't work. Could someone suggest me a query which meets this criteria.
    INSERT INTO JAVA_SERVICES (SERVICE_PAGE, SERVICE_TYPE, SERVICE_NAME,
      ROOT_PATH)
      VALUES ('AAAA', 'BBBB', 'CCCC', 'njdex') WHERE SERVICE_PAGE != 'AAAA' AND SERVICE_TYPE != 'BBBB' AND SERVICE_NAME != 'CCCC'Edited by: user626618 on Jun 12, 2009 2:39 PM

    you need to provide us more details such as what table name and column names are you using. using an insert into statement an example would be like:
    insert into java_services
    (service_page, service_type, service_name, root_path)
    select [column name], [column name], [column name]
      from [table name]
    where ([column name], [column name], [column name]) not in (select SERVICE_PAGE, SERVICE_TYPE, SERVICE_NAME
                                                                   from JAVA_SERVICES);
    begin
      for i in (select [column name] col1, [column name] col2, [column name] col3
                  from [table name]
                 where ([column name], [column name], [column name]) not in (select SERVICE_PAGE, SERVICE_TYPE, SERVICE_NAME
                                                                    from JAVA_SERVICES)) loop
        insert into java_services
          (service_page, service_type, service_name, root_path)
        values
          (i.col1, i.col2, i.col3);
      end loop;
    end;
    /

  • Problems in using SQL statement

    Is that a way that i could use java sql statement for COUNT or SUM SQL Statement
    String query = "SELECT S.Name,COUNT(TS.NoOfPoints) AS Points FROM TeamS,TeamStatistics TS WHERE S.TeamID = TS.TeamID ORDER BY TS.NoOfPoints DESC";
    i am trying to count the num of points for each team.
    I have eror message,execute the sql statement
    is the sql statement correct.

    String query= "SELECT S.TeamName,COUNT(TS.NoOfPoints) FROM Team T,TeamStatistics TS GROUP BY T.TeamName HAVING T.TeamID = TS.TeamID";
    Statement statement = connection.createStatement();
    ResultSet rs = statement.executeQuery(query);
    while(rs.next())
    System.out.println(rs.getString("TeamName"));
    System.out.println(rs.getString("NoOfPoints"));
    The sql doesn't work, i really dun konw what to do

  • How to view records frm higher to lower using sql statement

    Dear all
    i have tables
    RATING:
    50
    76
    55
    60
    80
    90
    95
    100
    20
    30
    32
    34
    i want to view this record into higher to lower and 5 records only will appear in sql ..
    Like this :
    100
    95
    90
    80
    76
    thank you very much

    select rating
    from
    (select rating
    from table_name
    order by rating desc)
    where rownum <=5;
    <br>
    <br>
    Message was edited by:
            jeneesh
    Misread the requirement first                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • My iphone 4 after update says that the accessories are not compatible. what should I do today makes iphone two weeks?

    my iphone 4 after update says that the accessories are not compatible. what should I do today makes iphone two weeks?

  • TNS-12560: TNS:protocol adapter error - Of a different sort

    Hi , Have a unique problem. System :- Win 2K I have installed 9iDB & 9iDS. They were working perfectly fine. I was able to connect to DB from forms. But due to some restrictions i had to resort to 6i forms. Now i installed 6i forms on the same machin

  • Streaming on iOS

    I cant use streaming apps at home (Netflix and Youtube) but only from iOS devices (iPad, iPod, iPhone and Apple TV), when I try to stream from other devices like PS3 or even my Macbook it works fine. I´ve tried to stream form a flash browser for iPad

  • Itunes wish list playlist

    I created a wish list playlist (as directed by support site) and accidently deleted it. Whenever I delete anything it goes to the trash. I cannot find this playlist using spotlight. Where would it be? Can I get it back???

  • IPad Mini 3 drops WiFi connection to hotspot under load

    I have a weird problem that appears to be device-specific.  Ingredients: iPad Mini 3 (WiFi) iOS 8.2 FreedomPop Sierra Wireless Hotspot I have no issues with network connectivity with my Mini 3 on high speed networks at home or work.  In particular, I