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

Similar Messages

  • 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 shared pool

    Hi,
    ALTER SYSTEM FLUSH SHARED POOL;
    when we issue the above command, it will fulsh the shared pool. it means, it will remove all the stored/parsed sql statements from shared pool. if any new query comes, first it has to parse and execute and show it to user.which will take time....
    So, in what scenarios we do flush the shared pool...how do we know there is fragmentation is shared pool....
    i am not experienced Performance Analayist..please share your experience.

    How can you reconcile what you wrote with the above statement from the Oracle docs?Um, because it's true?
    It's realy clear to me that you don't have much job experience with Oracle (also evidence by your hiding your credentials and work history).
    Back before cursor_sharing, the only way to relieve library cache stress was to make the shared_pool very small (see Metaink for the official recommendation), and the same holds true today for systems with ad-hoc query tools that can take-up 90% of the library cache with executions=1.
    BTW, Mr. Morgan, I WANT MY MONEY BACK for your con-job on me.
    When you told me that PSOUG was offering RAC classes, you knew that I believed that you were graciously volunteering a sevice to the community, and that's why you got all of those RAC books for your class at-cost, I wanted to help a good cause.
    Of course, now we know that it was all a ruse, and that you were profiting from the PSOUG training.
    When are you going to pay me back for those books that you conned me out of?
    Message was edited by:
    burleson

  • Alter system flushed shared pool in RMAN backup

    Hi,
    I am trying to take RMAN backup of 11.2.0.1 Database in IBM AIX 6.1 server.
    The RMAN is hanging .
    Though the backup gets completed, The channels allocated doesnt get released and the RMAN gets hanging.
    In earlier RMAN backup Scripts,
    the DBA was using alter system flush shared pool in RMAN backup script and the backup was getting succesful.
    Now my question is , is using ALTER SYSTEM FLUSH SHARED POOL have any performance impact on the database.
    Regards,
    TEJAS

    TEJAS_DBA wrote:
    Hi,
    I am trying to take RMAN backup of 11.2.0.1 Database in IBM AIX 6.1 server.
    The RMAN is hanging .
    Though the backup gets completed, The channels allocated doesnt get released and the RMAN gets hanging.Are you setting the large pool? If you don't, then rman uses the shared pool. Read about tuning rman performance in the docs.
    >
    In earlier RMAN backup Scripts,
    the DBA was using alter system flush shared pool in RMAN backup script and the backup was getting succesful.
    Now my question is , is using ALTER SYSTEM FLUSH SHARED POOL have any performance impact on the database.Yes, you are allowing the components in there to be loaded in the random order of whatever is called first. This may have a good impact if you had some fragmentation in there, or it could be mildly bad if everything was well sorted, or it could be very bad if you are unlucky or have some pattern of invalidations or should be pinning something or who-knows-what. It generally is considered not a good thing to do as a habit. You wind up with [url http://tkyte.blogspot.com/2012/05/another-debugging-story.html]rainy Monday scenarios.
    Edit: I notice there are some bugs, including very slow performance when using a catalog. When you say hang, how long are you waiting? Have you considered current patches?
    Edited by: jgarry on Aug 8, 2012 11:09 AM

  • 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" ??

  • Flushing shared pool

    hi,
    what is the impact of alter system flush shared pool on database.
    Regards,
    Mannu

    ORA-00604: error occurred at recursive SQL level 1
    ORA-04031: unable to allocate 4064 bytes of shared memory ("shared pool","update sys.job$ set this_dat...","sga heap(1,0)","kglsim heap")
    ORA-12012: error on auto execute of job 443
    ORA-04031: unable to allocate 4064 bytes of shared memory ("shared pool","SELECT NVL(DISABLED, 'F'), F...","sga heap(1,0)","kglsim heap")
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2254
    ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2460
    ORA-06512: at "SYS.DBMS_IREFRESH", line 683
    ORA-06512: at "SYS.DBMS_REFRESH", line 195
    ORA-06512: at line 1
    i am getting this errors continuosly in alert log file

  • How to find aged out sql_id of shared pool / after flushed shared pool in oracle 10g/11g

    i have one sql_id that was not in v$sql / v$sqltext
    when i flushed the shared pool now where can i find old sql_id

    Shared Pool is part of the SGA in Main Memory. So once you flush it the information is gone. You cant get it back.

  • 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.

  • Uanble to drop table/ flush shared pool

    I have a table that I'm not able to drop. When I query for this table, it exists. But when I try to drop it, I kept getting a "table does not exists". Someone suggested that I flush the shared pool. I didn't want to do this but I had to in order to drop this table. It worked but I'm not comfortable with this method.
    Is there a better way to do this ?

    Flushing the shared pool will mean nothing when deleting a table. It will only clear the memory reserved for the recently used cursors, but it won wipe your table away.
    Please post the exact command you issue, it could either be a synonym what you are trying to drop or it could be a table spelled in a mix with upper/lowercase letters.
    ~ Madrid
    http://hrivera99.blogspot.com/

  • 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

  • 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

  • Shared pool flushing

    Hi All,
    I'm trying to tune my sql. But when I make changes and run it again, the sql is running faster. (since this will be stored in the memory)
    Please suggest a way I can test my code.
    Else is there a way I can delete this sql_id from the memory?
    Oracle version: 11.2.0.3.0
    Thanks in Advance,
    Niroop

    Hi,
    user11228834 wrote:
    Else is there a way I can delete this sql_id from the memory?
    Oracle version: 11.2.0.3.0
           Flushing Shared pool is not a good Idea for testing a Code , It will slow down  the database.
    user11228834 wrote:
    I'm trying to tune my sql. But when I make changes and run it again, the sql is running faster. (since this will be stored in the memory)
    Please suggest a way I can test my code.
    To check whether the same sql_id is been used to execute ...
    select sql_id,SQL_FULLTEXT,PARSE_CALLS from v$sql;
    check the sql_id is same or not ,check the parse_calls is 1 or more than 1 to find the sql is hard parsed or soft parsed. .

  • Set a dbms job which will flush the shared pool on box everyday 12.00am on

    Hello ,
    i want to set dbms job to flush shared pool everyday at 12.00 am on windows box.
    so can you please provide me script for that or idea on that.
    also i want to know where i have to set that job on sys or system or in user account.
    Thanks

    Receiving the 404 on box. Since the Oracle 404 error is
    ORA-00404: Convert file not found: "string"
    Cause: The file used for converting the database from V7 to V8 could not be found.
    Action: Verify that the migration process has been started on this database and that the convert filename is accessable.
    I'm going to go out on a limb and assume that you're talking about the HTTP 404 (Not Found) error. If that's the case, that would seem to be an issue with your web server/ web application and not with the database. Why do you believe that the database has any involvement with the error you're getting or that flushing the shared pool will resolve the error?
    Justin

  • Delete a parse statement from shared pool

    Can anybody help me to delete a parse statement from shared pool without affecting other objects ( without using ALTER SYSTEM FLUSH SHARED POOL;). This i am trying in my personal training db and I am using 10g. Thanks in advance for all of your replies.

    Thank you for all your replies.
    I am a newbie to oracle. Just i am playing with usage of bind variables and parameter CURSOR_SHARING .Need to verify when the data is heavly skewed ,sql parsing will occur for the sql statement having bind variables with parameter CURSOR_SHARING=EXACT but not with CURSOR_SHARING=FORCE / SIMILAR .
    But infact i didn't see any sql parsing with parameter value EXACT . thinking of deleting my old parse statement from shared pool and try it again.
    thanks again

  • Shared Pool Free Memory

    The query 'select * from v$sgastat' showed that there is a shared pool free memory of 80MB. I read that a high value of free memory is a symptom of fragmentation. If that's also in my case, how can I defragment it? (I'm assuming that this has nothing to do with I/O tablespace fragmentation)

    The only was to really defragment the shared pool is to bounce Oracle.
    You can run a "alter system flush shared pool" command however this only makes contiguous chunks of free space available to be used. Oracle does not actually combine the chunks into one free extent like it does with dictionary managed tablespace free extents. The memory is managed by link lists and once a chunk is attached to a list it pretty much stays that way.
    A large amount of free space could also indicate an over allocated shared pool.
    HTH -- Mark D Powell --

Maybe you are looking for

  • Refresh data in a system form

    Hi all, i have the following scenario: i developed an addon to enable the user to modify the invoice billing address after the invoice has been created. to achieve it i used a UDF with a text edit field. everythings seems to works fine but i'd like t

  • ENVIO DE CORREO CON XML DE LA FACTURA ELECTRONICA

    HOLA CHICOS, BUEN DIA, Alguno de ustedes sabe como puedo configurar que el xml que se genera de factura electronica en SAP se envie una copia al correo del cliente? Agradezco de antemano su apoyo. SALUDOS NANCY

  • Can the lumia 620 be updated to 10.0 version from ...

    Can the lumia 620 be updated to 10.0 version from 8.1  in future? If yes by when?

  • Deleting directory contents

    Hi All. I have an application which read the contents of a directory and deletes the files in them. If the directory has subdirectories, i need to enter the subdirectory and delete the files in there too. however, I do not want to delete the director

  • VAT credit reverse

    Dear Expert, We have a situation with VAT. There is one material code which when purchased as consumables VAT credit can be availed. But when used for repair and maintenance we cannot avail the VAT Credit. We have created Non deductible condition typ