Flush shared_pool hang

During the production when I try to flush the shared_pool with the command alter system flush shared_pool it hang.
What should I do to resolve this problem?
Any help

yours scenario depicting a clear picture that yours shared pool areas is not utilizing properly ,this situation occurs usually when yours application code not using bind varabiles ,there would be lot of hard parsing which require more CPU power as well more memory (shared pool).
For a quick go through one workaround to identify what are the queries and piece of code are not using propelry the shared pool is by turining on trace at system wide level and then review this trace file using tkrpof which will show up you exactly the hard coded queries.
for a detailed tkprof utility you can go through this link ,if possibke paste the tkprof result here.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/sqltrace.htm#PFGRF01020Khurram

Similar Messages

  • How to get the date/time of flush shared_pool commands?

    I think there´s some script, which in been runned with a privileged user, that is recurring flushing the shared_pool.
    Is there a way to know the last date/time when an 'alter system flush shared_pool' was issued?
    Or, better, how can I tell Oracle RDBMS to log these commands on alert.log?
    Best regards,
    Luis Santos

    You can audit the alter system commands:
    audit alter system;
    You probably want to ensure the following two system parameters check the doc for your version:
    audit_trail=db_extended
    audit_sys_operations=true
    They require a system bounce, but by default sys operations are not audited so you'll need the latter.
    Query the dba_audit_trail.

  • Locked Objects while flushing shared_pool?

    Hello guys,
    a little understanding about flushing shared pool and the stored objects in it.
    What happens to objects (SQL Statements, DDIC cache, and so) that are needed at this time for execution.
    For example an user is executing a select statement on a table and its is running while i am executing "alter system flush shared_pool".
    What happens to the parsed sql statment which is used at this time by the sql query... and what is happens to the row cache (ddic cache) of the table which is queried at this time?
    For my understanding this objects have to be locked (latch) by the user that is executing the query... are they invalidated after the query ends or what happens?
    I know that this are internals but maybe someone of you knows it.
    Regards
    Stefan

    Objects in the shared pool can be both "locked" and "pinned"; locks and pins can be held in null, shared, or exclusive mode.
    If you are holding a cursor open you are locking it (with an item from the structure x$kgllk); if you are executing a cursor you will also be pinning it (with an iterm from the structure x$kglpn). Roughly speaking, if you hold a lock you are an interested party and want to know if the object gets changed or eliminated; if you hold a pin you are using the current version of the object and it must not change or disappear until you have finished with it.
    If you flush the shared pool, pinned objects cannot be removed from the shared pool and (due to some oddities which are probably not deliberate design) there may be some objects which are in "the same chain" as a pinned object which are accidentally protected because the pinned object is "in the way".
    I believe the same rationale of 'objects in use are protected' applies to the dictionary cache (row cache) - and there may be some objects there which are permanently pinned anyway. Normally you would only have a dictionary cache object pinned whilst optimising a statement, though, which might be quite rare.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk

  • ALTER SYSTEM FLUSH SHARED_POOL

    I am currently using oracle 8.1.5.0 standard edition and created a new index. Now to start using this index on some of my constant scripts that are already cached I need to flush the cache. What would be the effect of using this command while there are other sessions active?? Would it effect these in anyway if I used the above command?? Thank you in advance.

    I don't think that the sql that is currently running will be affected, but all new sql launched by the sessions will have to be hard parsed (there is no prior sql anymore in the shared_pool)
    I don't think you will hace to flush your shared pool since by creating an index on a table you have broken the breakable parse lock on that table. Oracle uses this lock to allow the parsed, cached statement to be invalidated (flushed) in the shared pool if the lock is broken (in case of a drop or alter).
    so by adding the index, you break the parse lock and all cached statements that are referring to that table are flushed.
    Greetings
    Freek
    I am currently using oracle 8.1.5.0 standard edition and created a new index. Now to start using this index on some of my constant scripts that are already cached I need to flush the cache. What would be the effect of using this command while there are other sessions active?? Would it effect these in anyway if I used the above command?? Thank you in advance.

  • Flush SHARED_POOL and BUFFER_CACHE

    I have a nightly process that executes several steps. One of the last steps is taking about 4-5hrs but if i bounce the instance just before the last step, the step completes within 30-40mins. I'm 10gR1. I even tried flusing shared_pool and buffer_cache without bouncing the instance but still didn't help. Stats are up to date. Any thoughts on what to try next to stay with 30-40mins and not bounce the instance to clear up SGA?

    I worked a lot with Oracle on this issue, sending the trace, stastspack, addm and awr reports but the issue is still not resolved.
    I thought flusing shared_pool and buffer_cache should clenup SGA and should act like bouncing the instance. I'm i missing something here? How do i clear up SGA and NOT bounce the instance?

  • Flush Shared Pool without Alter System Priv

    I am trying to device a way to flush the shared pool by a user who doesn't have ALTER SYSTEM priv. I tried creating a stored proc in user's schema who has DBA role
    with the following:
    execute immediate 'alter system flush shared_pool';
    and then granted execute on this to a normal user without explicit alter system priv, but the execution fails and seems that I need to grant alter system explicitly to this user. Is there any other workaorund for this?
    Thank You
    Kevin

    it works for me! V10.2.0.4 too.
    SQL> set time on
    12:11:24 SQL> @privs
    12:11:28 SQL> SET TERM ON ECHO ON
    12:11:28 SQL> SET SERVEROUTPUT ON
    12:11:28 SQL> CREATE USER PTST IDENTIFIED BY PTST DEFAULT TABLESPACE USERS QUOTA UNLIMITED ON users TEMPORARY TABLESPACE TEMP;
    User created.
    12:11:28 SQL> grant create session to ptst;
    Grant succeeded.
    12:11:28 SQL> grant alter system to dbadmin;
    Grant succeeded.
    12:11:28 SQL> connect dbadmin/admindb
    Connected.
    12:11:28 SQL> set term on echo on
    12:11:28 SQL> create or replace procedure flush_pool
    12:11:28   2  as
    12:11:28   3  begin
    12:11:28   4  execute immediate 'alter system flush shared_pool';
    12:11:28   5  end flush_pool;
    12:11:28   6  /
    Procedure created.
    12:11:28 SQL> grant execute on flush_pool to ptst;
    Grant succeeded.
    12:11:28 SQL> connect ptst/ptst
    Connected.
    12:11:28 SQL> SET TERM ON ECHO ON
    12:11:28 SQL> execute dbadmin.flush_pool;
    PL/SQL procedure successfully completed.
    12:11:29 SQL> connect / as sysdba
    Connected.
    12:11:29 SQL> drop user ptst;
    User dropped.

  • Flushing Database Buffer Cache

    I am trying out variants of a SQL statement in an attempt to tune it. Each variant involves joins across a different combination of tables, although some tables are common across all variants. In order to be able to do a valid comparison of the TKPROF outputs for the variants, I believe I need to flush the database buffer cache between variants so that the db block gets, consistent gets and physical reads parameters are true for each variant. By doing this, data retrieved for one variant is not already in the buffer cache for the next variant, thus not influencing the above parameters for the next variant.
    Is it possible to flush the buffer cache? The shared pool can be flushed with the ALTER SYSTEM FLUSH SHARED_POOL command. I've searched but have not been able to find an equivalent for the buffer cache. The NOCACHE option to the ALTER TABLE command only pushes retrieved data to the LRU list in the buffer cache, but does not remove it from the buffer cache.
    I'm hoping to be able to do this without bouncing the database between variants. It is a development instance, and I have it to myself after hours.

    Hi,
    I never tried this before, but if you want make a test you can try corrupt the block ID's returned by one of these queries below:
    Try corrupt the ID of the block containing the segment header
    select dbms_rowid.rowid_block_number(rowid) from hr.regions;
    Try corrupt one of the blocks returned by the query, which shows the ID of the block where each row is located
    select s.owner,t.ts#,s.header_file,s.header_block
    from
    v$tablespace t, dba_segments s
    where
    s.segment_name='REGIONS' and
    owner='HR' and
    t.name = s.tablespace_name;Legatti
    Cheers

  • Flush shared pool in 8i

    Is it possible to clear the buffers in 8i?
    I tired but getting this error:
    16:25:00 SQL> alter system flush shared_pool;
    alter system flush shared_pool
    ERROR at line 1:
    ORA-02000: missing SHARED_POOL keyword

    But that's not necessarily any better...
    - Blocks may be cached by the operating system. Are you going to flush that?
    - Blocks may be cached by the disk controller. Are you going to flush that?
    - In a real system, you're going to have a warm buffer cache, so benchmarking with no blocks cached isn't any more realistic.
    Generally, it is better to take one of the following approaches
    - Run the same query N times (say 5 times). Throw out the first run and average the next 4. Repeat with the second query.
    - Concentrate on things like logical I/O's rather than strict runtime. Decreasing logical I/O's is almost certainly going to mean that your query is going to run faster and/or generate less load in the production sysem.
    Justin

  • Is it recommened to flush shared pool after taking statistics??

    Hi, all.
    The database is 2 node RAC 10.2.0.2.0 on 32-bit windows 2003 EE SP1.
    I stoped the default statistics-gathering-job of GATHER_STATS_JOB
    because it takes statistics of all objects in database and it runs everyday.
    In addition, it seems to cause "library cache related" wait events in a RAC
    environment.
    I have a plan to take statistics of ONLY an application schema, not all objects
    of a database, by using GATHER_SCHEMA_STATS procedure.
    Is it recommended to flush shared pool after taking statistics of an application
    schema??
    Thanks and Regards.

    Is it recommended to flush shared pool after taking
    statistics of an application
    schema??neednt cause whenever you gather stats either its system or not oracle age out the plan and regenerate the new plan on the basis of new gathered stats,see how oracle is smart.
    SQL> create table t as select rownum a,object_name
      2    from all_objects
      3  /
    Table created. 
    SQL> alter system flush shared_pool
      2  /
    System altered.
    SQL> alter session set sql_trace=true
      2  /
    Session altered.
    SQL> declare
      2   va  t.a%type;
      3  begin
      4   for i in 1..100
      5   loop
      6    execute immediate 'analyze table t compute system statistics';
      7    select a into va
      8      from t
      9     where a=i;
    10   end loop;
    11  end;
    12  /
    PL/SQL procedure successfully completed.
    SELECT a from t
       where a=:b1
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute    100      0.12       0.11          0          0          0           0
    Fetch      100      0.26       0.32          0      11800          0         100
    total      201      0.39       0.44          0      11800          0         100
    Misses in library cache during parse: 1
    Misses in library cache during execute: 99
    Optimizer goal: CHOOSE
    Parsing user id: 59     (recursive depth: 1)
    Rows     Row Source Operation
          1  TABLE ACCESS FULL T
    Misses in library cache during execute: 99 shows you aging out the plan after every gathering stats.
    Khurram

  • Shared pool flush

    If I execute this while users are connected to database, does it impact their transactions?
    'ALTER SYSTEM FLUSH SHARED_POOL'

    Its mentioned up here...
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_23a.htm#SQLRF00902
    It clearly mentions...
    "This statement does not clear shared SQL and PL/SQL areas for items that are currently being executed. You can use this clause regardless of whether your instance has the database dismounted or mounted, open or closed."

  • Stuck when Flush Shared pool

    dear all ,
    i have case around shared pool ,
    when im do
    sql > sqlplus "/ as sysdba"
    sql > alter system flush shared_pool ;
    query will be stuck and nothing happen ,
    i try to check alert.log but nothing error
    anybody help me

    hi hussein ,
    i have seen error in alert.log
    ORA-00060: Deadlock detected. More info in file /oracle11/PROD/db/tech_st/11.1.0/admin/PROD_smjkt-prfn01/diag/rdbms/prod/PROD/trace/PROD_ora_10356130.trc
    and 20 last line in PROD_ora_10356130.trc
    kxscphp=0x1112be2f8 siz=1992 inu=920 nps=312
    Symbolic dump of process state object:
    KSUPRFLG = 0
    KSUPRSER = 122
    KSUPRIOC = 0
    KSLLALAQ = 0X0000000000000000
    KSLLAWAT = 0X0000000000000000
    KSLLAWHY = 0
    KSLLAWER = 0
    KSLLALOW = 0
    KSLLAPSC = 6
    KSLLAPRC = 5
    KSLLAPRV = 2
    KSLLAPSN = 25
    KSLLID1R = 129
    KSLLID2R = 0
    KSLLRTYP = 'EV'
    KSLLRMTY = 0
    KSUPRPID = <INVALID LENGTH SIZE OF 8>
    KSUPRUNM = <INVALID LENGTH SIZE OF 8>
    KSUPRMNM = <INVALID LENGTH SIZE OF 8>
    KSUPRPNM = <INVALID LENGTH SIZE OF 8>
    KSUPRTID = <INVALID LENGTH SIZE OF 8>
    KSSRCOBJ = 0X0000000000000000
    KSSRCFRE = 0X0000000000000000
    KSSRCSRC = 0X0000000000000000
    KSSRCDST = 0X0000000000000000
    KSASTQNX = 0X07000018E58A0BF8
    KSASTQPR = 0X07000018E58A0BF8
    KSASTRPL = 0
    KSUPRPUM = 9741322
    KSUPRPNAM = 1034898
    KSUPRPRAM = 10158080
    KSUPRPFM = 720896
    KSUPRPMM = 11192978
    KSFD PGA DUMPS
    Number of completed I/O requests=0 flags=8
    END OF PROCESS STATE
    *** 2012-05-02 14:10:57.498
    Attempting to break deadlock by signaling ORA-00060
    theres any relation between this error with my case "stuck when Flush Shared pool" ??

  • Quesion abort flush shared pool?

    HI ,
    when I execute command alter system flush shared_pool,does oracle flush the shared pool memory to swap space ,anybody can intepret detail about alter system flush shared_pool?

    An sql cursor is not data. It does not have to be stored. The memory area allocated to the cursor is marked as "free" -- that is how it is "discarded".
    The next cursor can re-use the same memory area.
    (Think about it : If Oracle had "write" the sql out each time, how many unnecessary writes it would be doing every day , every hour in busy database ?!)
    The sql statement would just have to be re-parsed the next time it is executed.
    If the SQL comes from a stored procedure, it is the "stored" procedure that is the permanent storage. If it is a trigger, it is the trigger code in the database that is the permanent storage.
    What is in the shared pool is not data, but only executable code.
    When you run a program (say, any non - Oracle program : take your MSInternetExplorer or MSWord), the program is loaded in memory as an "executable". It can be closed or killed or "discarded" at any time. The Word document that you may be editing has to be saved -- the document is the data that needs storage.
    As for MSIE or MSWord, it is the .EXE (or .DLL files) that are "permanent" and can be reloaded from disk at any time.
    The same goes for SQL statements -- which are the .EXEs or .DLLs. And rows in tables -- which are the Word Docs.
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • Flushing shared pool in Apps database

    Dear Experts,
    Is it ok, to run ALTER SYSTEM FLUSH SHARED_POOL in an apps environment? I am getting ORA-4031 error while performing some tasks in Projects module.
    Need suggestion.
    Thanks
    SA

    Hi Hussein,
    I actually raised an SR and they suggested to bounce the database. So I did not try to flush the shared pool. It was working fine before and no changes were done to the system.
    Before bouncing the database, i regenerated the forms using f60gen, but it did not help, and since I was not sure about flush shared pool thing, I took half an hour downtime and bounced the db. After bouncing the db, the issue did not come up. I also increased the shared pool from 1.5G to 2G.
    I was confused with the the accompanying error which appeared to be some package errors.
    Regards
    SA

  • Flush memory in Loop

    I am trying to flush the memory in between the loop. But I am getting an error while doing so. pls suggest. I am using 10g. Here is the code:
    BEGIN
    for c2 in (select seq, function_name from REP_FUNC_LIST order by seq)
    loop
    dbms_output.put_line('Seq_Number - '||c2.seq||'; Function - '||c2.function_name);
    EXECUTE IMMEDIATE 'BEGIN '||c2.function_name||'.START_PROCESS;'||' END;';
    ALTER SYSTEM FLUSH BUFFER_CACHE;
    end loop;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('ERROR') ;
    END;

    I tried both ways. got rid of EXCEPTION and wrote EXECUTE IMMEDIATE. I am still getting an error: ORA-00911: invalid character.
    BEGIN
    for c2 in (select seq, function_name from REP_FUNC_LIST order by seq)
    loop
    dbms_output.put_line('Seq_Number - '||c2.seq||'; Function - '||c2.function_name);
    EXECUTE IMMEDIATE 'BEGIN '||c2.function_name||'.START_PROCESS;'||' END;';
    EXECUTE IMMEDIATE 'ALTER SYSTEM FLUSH SHARED_POOL;';
    end loop;
    END;
    ALTER SYSTEM FLUSH SHARED_POOL;

  • Web ADI works only when cache is cleared

    I have created a custom integrator and the web ADI component works only when I clear the cache from the functional administrator responsibility in Oracle Apps. The component has a lot of validations for the fields and is expected to insert upto 2000 lines, It works fines for a small number of lines but the web ADI hangs for a large number of lines (>500). But if I clear the cache, it works fine. Anyone has a solution for this, cause I cant clear the cache always and I cant tell my customer to do the same.
    G. Arun
    Oracle SSI

    The WebADI caching can be very confusing. I made a little summary of what you can do to avoid caching problems like:
    "ORA-06508: PL/SQL: Could not Find Program Unit being Called in Custom Web ADI" or
    "SQL exception occurred during PL/SQL upload"
    A) clear cache with http://<machine>:<port>/OA_HTML/BneAdminServlet
    B) clear IE cache & restart
    C) clear the cache from the functional administrator responsibility
    D) Bounce the Apache server
    E) SQL command: Alter system flush shared_pool
    F) Download another WebADI spreadsheet (but you can re-use your old spreadsheet)
    G) log out and log back in EBS
    H) login at another computer and try it there
    ...or sometimes just wait for a while till it works again.
    Jeroen

Maybe you are looking for