Query executing faster after restart

Hi,
I have a query which used to take around 60 seconds to execute. The query is mainly made up of joins and has an order by condition. The query was showing a service time of 125ms when accessing the temp datafile.
When I restarted the server (windows) and database and I ran the query the execution time was 1 sec!! The query no longer seems to be accessing the temp file.
Any suggestions on what could have triggered this change?
Thanks
Keith

Because when you restart, the segments of the temp datafiles are deallocated. This means that you have space to do sort on disk if the sort of the query not have the sufficient space on SORT_AREA_SIZE
< src = http://www.csee.umbc.edu/help/oracle8/server.815/a67775/ch24_pex.htm#43319 >
SORT_AREA_SIZE
The recommended values for this parameter fall in the range from 256KB to 4MB.
This parameter specifies the amount of memory to allocate per query server process for sort operations. If you have a lot of system memory, you can benefit from setting SORT_AREA_SIZE to a large value. This can dramatically increase the performance of sort operations because the entire process is more likely to be performed in memory. However, if memory is a concern for your system, you may want to limit the amount of memory allocated for sort and hash operations.
If the sort area is too small, an excessive amount of I/O is required to merge a large number of sort runs. If the sort area size is smaller than the amount of data to sort, then the sort will move to disk, creating sort runs. These must then be merged again using the sort area. If the sort area size is very small, there will be many runs to merge and multiple passes may be necessary. The amount of I/O increases as SORT_AREA_SIZE decreases.
If the sort area is too large, the operating system paging rate will be excessive. The cumulative sort area adds up quickly because each query server process can allocate this amount of memory for each sort. For such situations, monitor the operating system paging rate to see if too much memory is being requested.
< >

Similar Messages

  • Query executes faster 2nd time

    Hi,
    So, the result% parameters are as follows, on a specific instance:
    AME                                                                                   TYPE VALUE
    result_cache_mode                                                                         2 MANUAL
    result_cache_max_size                                                                     6 20971520
    result_cache_max_result                                                                   3 5
    result_cache_remote_expiration                                                            3 0
    Executed in 0,156 secondsWell, if i run first time a large query, which takes much time (WITHOUT result_cache hint), this executes in 10 minutes. Then, some of my collegue said me second time i run the query i obtain the results faster than the first time, but i told him caching is not enabled, so why we got faster the results? The query execution plan is the same.
    So, are any buffers, or something, from which the database retrieves the results when executing again that query? Or any explanation why it executes faster on subsequent invocations?
    Thanks

    Roger22 wrote:
    So even if the result caching is not used, the data can be retrieved from the buffers.? okA fundamental concept for all databases and all modern file systems. A read-write memory cache that sits between the s/w and spinning rust.
    Also the basic reason why measuring performance for comparison using elapsed time is flawed - as the very SAME query with the SAME execution plan on the SAME data can show DIFFERENT elapsed times. Amount of I/O is constant, but the type of I/O (logical/fast versus physical/slow) is not.

  • Sql query executes faster 2. time despite clearing buffer cache/shared pool

    Hi All,
    I want to test query performance, so i clear cache in following way before each execution:
    alter system flush buffer_cache;
    alter system flush shared_pool;
    But, first execution takes more time than second and consequent executions. For example first execution takes 30 seconds, consequent executions take 3 seconds.
    Before each execution I clear the cache.
    What can be the reason? I use TOAD for query execution. Does TOAD caches something after first execution?
    And last question. Is there a dynamic query that query execution duration is stored?
    Any help will be appreciated.
    Thanks.

    >
    So there shouldn't be problem from the parameter, can you post result from V$SGA_DYNAMIC_COMPONENTS and v$SGAINFO ?
    V$SGA_DYNAMIC_COMPONENTS
    COMPONENT CURRENT_SIZE MIN_SIZE MAX_SIZE USER_SPECIFIED_SIZE OPER_COUNT LAST_OPER_TYP LAST_OPER LAST_OPER GRANULE_SIZE
    shared pool 436207616 402653184 0 0 125 GROW IMMEDIATE 02-JUL-09 16777216
    large pool 201326592 117440512 0 83886080 12 SHRINK DEFERRED 02-JUL-09 16777216
    java pool 16777216 16777216 0 0 0 STATIC 16777216
    streams pool 16777216 16777216 0 0 0 STATIC 16777216
    DEFAULT buffer cache 1895825408 1711276032 0 16777216 137 GROW DEFERRED 02-JUL-09 16777216
    KEEP buffer cache 0 0 0 0 0 STATIC 16777216
    RECYCLE buffer cache 0 0 0 0 0 STATIC 16777216
    DEFAULT 2K buffer cache 0 0 0 0 0 STATIC 16777216
    DEFAULT 4K buffer cache 0 0 0 0 0 STATIC 16777216
    DEFAULT 8K buffer cache 0 0 0 0 0 STATIC 16777216
    DEFAULT 16K buffer cache 0 0 0 0 0 STATIC 16777216
    DEFAULT 32K buffer cache 0 0 0 0 0 STATIC 16777216
    ASM Buffer Cache 0 0 0 16777216 0 STATIC 16777216
    V$SGA_INFO
    NAME BYTES RESIZEABL
    Fixed SGA Size 2086392 No
    Redo Buffers 14688256 No
    Buffer Cache Size 1895825408 Yes
    Shared Pool Size 436207616 Yes
    Large Pool Size 201326592 Yes
    Java Pool Size 16777216 Yes
    Streams Pool Size 16777216 Yes
    Granule Size 16777216 No
    Maximum SGA Size 2634022912 No
    Startup overhead in Shared Pool 218103808 No
    Free SGA Memory Available 50331648

  • Several times after restarting Final Cut X was very slow and it always kept repeating rendering on same three clips. Later it stops rendering on every restart and the machine was normal and faster. Now it keeps crushing on every restart

    My Final Cut X changed behaviour after conneting the external monitor via HDMI. Several times after restarting Final Cut X was very slow and it always kept repeating rendering on same three clips after every restart. Later the dual screen icon disapeared on the top of my screen and it stops rendering on every restart like before and the machine was normal and faster. Now Final Cut won't start anymore whenever I start it loads and crushes immediately on every restart.

    Upgrade FCPX

  • Is there a way that I can get Automator to start a server for me after restart of Mac

    Hello!
    I have a serverprogram from an external company that doesnt start after a restart of the mac that I run that server on. It starts the program but it doesnt start up the server of the program. All settings are right and I have consulted others with same config. After a restart the server turns up in the statusbar but as turned off. So I can go to the statusbar, click on the symbol and choose "start server".
    As I cant get the server to start up automaticly I was wondering if I can get the automator to start it up for me after a restart of the mac?
    Ifso how?
    / Mikke
    Macmini i5 Mavericks

    I found out how to make a flow and how to make a program of that. BUT it wont execute after restart. Anyone?

  • Asset query execution performance after upgrade from 4.6C to ECC 6.0+EHP4

    Hi,guys
    I am encounted a weird problems about asset query execution performance after upgrade to ECC 6.0.
    Our client had migrated sap system from 4.6c to ECC 6.0. We test all transaction code and related stand report and query.
    Everything is working normally except this asset depreciation query report. It is created based on ANLP, ANLZ, ANLA, ANLB, ANLC table; there is also some ABAP code for additional field.
    This report execution costed about 6 minutes in 4.6C system; however it will take 25 minutes in ECC 6.0 with same selection parameter.
    At first, I am trying to find some difference in table index ,structure between 4.6c and ECC 6.0,but there is no difference about it.
    i am wondering why the other query reports is running normally but only this report running with too long time execution dump messages even though we do not make any changes for it.
    your reply is very appreciated
    Regards
    Brian

    Thanks for your replies.
    I check these notes, unfortunately it is different our situation.
    Our situation is all standard asset report and query (sq01) is running normally except this query report.
    I executed se30 for this query (SQ01) at both 4.6C and ECC 6.0.
    I find there is some difference in select sequence logic even though same query without any changes.
    I list there for your reference.
    4.6C
    AQA0FI==========S2============
    Open Cursor ANLP                                    38,702  39,329,356  = 39,329,356      34.6     AQA0FI==========S2============   DB     Opens
    Fetch ANLP                                         292,177  30,378,351  = 30,378,351      26.7    26.7  AQA0FI==========S2============   DB     OpenS
    Select Single ANLC                                  15,012  19,965,172  = 19,965,172      17.5    17.5  AQA0FI==========S2============   DB     OpenS
    Select Single ANLA                                  13,721  11,754,305  = 11,754,305      10.3    10.3  AQA0FI==========S2============   DB     OpenS
    Select Single ANLZ                                   3,753   3,259,308  =  3,259,308       2.9     2.9  AQA0FI==========S2============   DB     OpenS
    Select Single ANLB                                   3,753   3,069,119  =  3,069,119       2.7     2.7  AQA0FI==========S2============   DB     OpenS
    ECC 6.0
    Perform FUNKTION_AUSFUEHREN     2     358,620,931          355
    Perform COMMAND_QSUB     1     358,620,062          68
    Call Func. RSAQ_SUBMIT_QUERY_REPORT     1     358,569,656          88
    Program AQIWFI==========S2============     2     358,558,488          1,350
    Select Single ANLA     160,306     75,576,052     =     75,576,052
    Open Cursor ANLP     71,136     42,096,314     =     42,096,314
    Select Single ANLC     71,134     38,799,393     =     38,799,393
    Select Single ANLB     61,888     26,007,721     =     26,007,721
    Select Single ANLZ     61,888     24,072,111     =     24,072,111
    Fetch ANLP     234,524     13,510,646     =     13,510,646
    Close Cursor ANLP     71,136     2,017,654     =     2,017,654
    We can see first open cursor ANLP ,fetch ANLP then select ANLC,ANLA,ANLZ,ANLB at 4.C.
    But it changed to first select ANLA,and open cursor ANLP,then select  ANLC,ANLB,ANLZ,at last fetch ANLP.
    Probably,it is the real reason why it is running long time in ECC 6.0.
    Is there any changes for query selcection logic(table join function) in ECC 6.0.

  • What are the ways to make Query run fast?

    Hi Experts,
    When a query runs slow, we generally go for creating an aggregate. My doubt is - what other things can be done to make a query run faster before creating an aggregate? What is the thumb rule to be carried out for creating an aggregate?
    Regards,
    Shreeem

    Hi Shreem,
    If you keep Query simple not complicate it with runtime calculations , it would be smooth. However as per business requirements we will have to go for it anyways mostly.
    regarding aggregates:
    Please do not use the standard proposal , it will give you hundreds based on std. rules , which consumes lots of space and adds up to load times. If you have users already using the Query and you are planning to tune it  then go for the statistics tables:
    1.RSDDSTAT_OLAP    find the query with long runtimes  get the Stepuid
    2. RSDDSTAT_DM
    3. RSDDSTATAGGRDEF  - use the stepuid above to see which aggregate is necessary for which cube.
    Another way to check ; check the users as in 1 to find the highest runtime users and find the last used bookmarks by user thru RSZWBOOKMARK for this query and check if the time matches and create the aggregates as in 3 above.
    You can also Use Transaction RSRT > execute & debug  (display stats ) - to create generic aggregates to support navigations for New queries and later refine as above.
    Hope it helps .
    Thnks
    Ram

  • Linked Server unable to Connect in SQL Server 2012 after Restarting SQL Server Service it works fine. Why?

    I have created a Linked Server to Access Database of 64 MB in Size located in Remote System to SQL Server 2012.In Start for Some time it works fine and after it is giving the Error 
    OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "LANDLINE_TEST" returned message "Cannot open a database created with a previous version of your application.".
    Msg 7303, Level 16, State 1, Procedure Insert_Records_Into_Actual_Calls_History, Line 29
    Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "LANDLINE_TEST".
    Previously I thought it as Permission Issue. By trying some fixes proposed in forums it not fixed. But, after restarting the SQL Server Services without changes to the linked Server it works perfectly. How could i fix it. I don't want restart the SQL Server
    Service it leads to Some other process failures.
    RehaanKhan. M

    After all the Errors, When I am restarting the SQL Server its working correctly.
    Whats the problem it is clearing itself after restarting of SQL Server. Why ?. I can't find anything regarding this in SQL Server .
    The following are the Errors i got connecting to SQl Server.
    OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "LANDLINE_TEST" returned message "Cannot open a database created with a previous version of your application.".
    Msg 7303, Level 16, State 1, Procedure Insert_Records_Into_Actual_Calls_History, Line 29
    Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "LANDLINE_TEST".
    Error-2:
    Executed as user: RMS\Administrator. Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "LANDLINE_TEST". [SQLSTATE 42000] (Error 7303)  OLE DB provider
    "Microsoft.ACE.OLEDB.12.0" for linked server "LANDLINE_TEST" returned message "Cannot open a database created with a previous version of your application.". [SQLSTATE 01000] (Error 7412).  The step failed.
    After unchecking the Allow In Process in OLEDB.ACE Provider Properties.
    Msg 7399, Level 16, State 1, Procedure Insert_Records_Into_Actual_Calls_History, Line 29
    The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "LANDLINE_TEST" reported an error. Access denied.
    Msg 7301, Level 16, State 2, Procedure Insert_Records_Into_Actual_Calls_History, Line 29
    Cannot obtain the required interface ("IID_IDBCreateCommand") from OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "LANDLINE_TEST".
    for to fix above error i have followed the instructions in the following link,
    http://blogs.msdn.com/b/dataaccesstechnologies/archive/2010/08/19/permissions-needed-to-set-up-linked-server-with-out-of-process-provider.aspx
    This also failed to work. I Restarted SQL Server and make the Linked Server Properties Default to my Configuration and it works fine.
    Can you suggest me a solution for this issue. Every time i don't want to restart SQL Server Services as it effects other jobs and Processes.
    Thank you.
    RehaanKhan. M

  • Query executes in RSRT but not in BEx Analyzer

    Hi Everyone,
    I have a query for an infocube and ods object, in the bex analyzer for the infocube the query executes which has around 5000 records but for the ods object which has also 5000 records comes up with this error.
    <b>An exception with the type CX_SY_EXPORT_NO_SHARED_MEMORY occurred, but was
    neither handled locally, nor declared in a RAISING                                                                               
    Message no. RS_EXCEPTION000</b> 
    when I execute the query in RSRT it comes up.
    After closing and re logging into bex analyzer executes the query for the first but for the second time again it throws up this error.
    What could be the problem? Can anyone please let me know. Its really really urgent.
    Thanks,
    Prashant.

    hi Prashant,
    try check in RSRT, after choose your query, click 'properties' and set cache mode to 'main memory cache without swapping'.
    also check oss note 656060-OLAP: Cache main memory displacement not functioning.   
    hope this helps.
    Symptom
    Although one of the following two cache modes
    Main Memory Cache Without Swapping (mode 1)
    Main Memory Cache With Swapping (mode 2)
    is set for a query, long runtimes occur when you execute the query. The statistics (table RSDDSTAT) display the database times.
    If there is a heavy system load, the following message can also appear: RS_EXCEPTION000: No left space in shared memory.
    Other terms
    Cache, performance, displacement, shared buffer
    Reason and Prerequisites
    This problem occurs because the shared memory is insufficiently dimensioned.
    <b>Solution</b>
    Increase the amount of shared memory. The size of the shared memory should be at least 200 MB. You can refer to transaction RSRCACHE for the amount of memory reserved by the main memory cache (RSRCACHE -> Main Memory: Shared Memory/Buffer Reserved).
    The corresponding settings are (at least):
    rsdb/esm/buffersize_kb = 200000
    and, as a precaution, also
    rsdb/esm/max_objects = 10000.
    Alternatively, for queries with large resulting quantities, you can convert the Cache Mode in transaction RSRT1 to
    Cluster/Flat File Cache for Each Application Server (mode 3)
    Cluster/Flat File Cache Across Each Application Server (mode 4)

  • Why battery is dying too fast after iso5.01 upgrade

    why battery is dying too fast after iso5.01 upgrade,  It is dying on an average of 13% every hour and a half, in sleep mode.  I've tried hard restart and restore in I tunes, no difference!  It got worse after I upgraded to 5.01.  This has to fixed If I dont use the phone it will need a full charge by noon.

    Do a forum search and try some of the suggestions there before starting a whole new thread about battery issues.

  • Data pump error ORA-39065, status undefined after restart

    Hi members,
    The data pump full import job hung, continue client also hung, all of a sudden the window exited.
    ;;; Import> status
    ;;; Import> help
    ;;; Import> status
    ;;; Import> continue_client
    ORA-39065: unexpected master process exception in RECEIVE
    ORA-39078: unable to dequeue message for agent MCP from queue "KUPC$C_1_20090923181336"
    Job "SYSTEM"."SYS_IMPORT_FULL_01" stopped due to fatal error at 18:48:03
    I increased the shared_pool to 100M and then restarted the job with attach=jobname. After restarting, I have queried the status and found that everything is undefined. It still says undefined now and the last log message says that it has been reopened. Thats the end of the log file and nothing else is being recorded. I am not sure what is happening now. Any ideas will be appreciated. This is 10.2.0.3 version on windows. Thanks ...
    Job SYS_IMPORT_FULL_01 has been reopened at Wednesday, 23 September, 2009 18:54
    Import> status
    Job: SYS_IMPORT_FULL_01
    Operation: IMPORT
    Mode: FULL
    State: IDLING
    Bytes Processed: 3,139,231,552
    Percent Done: 33
    Current Parallelism: 8
    Job Error Count: 0
    Dump File: D:\oracle\product\10.2.0\admin\devdb\dpdump\devtest%u.dmp
    Dump File: D:\oracle\product\10.2.0\admin\devdb\dpdump\devtest01.dmp
    Dump File: D:\oracle\product\10.2.0\admin\devdb\dpdump\devtest02.dmp
    Dump File: D:\oracle\product\10.2.0\admin\devdb\dpdump\devtest03.dmp
    Dump File: D:\oracle\product\10.2.0\admin\devdb\dpdump\devtest04.dmp
    Dump File: D:\oracle\product\10.2.0\admin\devdb\dpdump\devtest05.dmp
    Dump File: D:\oracle\product\10.2.0\admin\devdb\dpdump\devtest06.dmp
    Dump File: D:\oracle\product\10.2.0\admin\devdb\dpdump\devtest07.dmp
    Dump File: D:\oracle\product\10.2.0\admin\devdb\dpdump\devtest08.dmp
    Worker 1 Status:
    State: UNDEFINED
    Worker 2 Status:
    State: UNDEFINED
    Object Schema: trm
    Object Name: EVENT_DOCUMENT
    Object Type: DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
    Completed Objects: 1
    Completed Rows: 78,026
    Completed Bytes: 4,752,331,264
    Percent Done: 100
    Worker Parallelism: 1
    Worker 3 Status:
    State: UNDEFINED
    Worker 4 Status:
    State: UNDEFINED
    Worker 5 Status:
    State: UNDEFINED
    Worker 6 Status:
    State: UNDEFINED
    Worker 7 Status:
    State: UNDEFINED
    Worker 8 Status:
    State: UNDEFINED

    39065, 00000, "unexpected master process exception in %s"
    // *Cause:  An unhandled exception was detected internally within the master
    //          control process for the Data Pump job.  This is an internal error.
    //          messages will detail the problems.
    // *Action: If problem persists, contact Oracle Customer Support.

  • Application authentication works fine after restart

    Team,
    I have a problem with an application. when the users start working it works fine. After some time it starts problem.
    Login page will not allow to login. As we observed threads start stuck at login page authentication.
    Application configured to external LDAP authentication,we verified LDAP sever level performance which is normal.
    But when we restart the managed server on which the application is hosted, it works normal.
    Authentication process:
    Applicaiton checks for username existance in an oracle DB , if it is found then it is authenticated by LDAP.
    Observations:
    Increase in opensocket count to 250 approx(Native IO is Enabled)
    Appllication Authentication level Threads stuck
    Session timeout = 3600 seconds
    Environment:
    Weblogic server 8.1.4.0
    OS: Solaris 10
    What are the parameters do i need to check in weblogic server ?
    If there is a problem with LDAP server application should not work after restart of the managed server.
    Also checked that the session bean deployed to check the user id in the database returned result quickly during the issue.
    Note: The session bean is deployed on a different managed server(conection pool on different server)
    LDAP,DB level query returns are fine when there is issue.

    Can you first located the problem?
    Click on the domain_name, monitoring, health. This shows an overview of all the server and their health.
    When you open a certain tree, the heath per subsystem is shows.
    In your case (stuck threads) you can click on the threadpool. Now a screen is shows that shows the threads
    in the stuck column it is shown which thread is stuck.
    You can create a thread dump and than analyze it to see what is being called by the thread

  • How to get SQL statement from (Collection) query.execute();

    We have a JDO Persistence class ClassName that execute query using following code. After this statement get executed, record does not get updated in the DB. Is there a way to check what SQL statement got submitted in the (Collection) query.execute(); ??? <br><br>
    Extent extent = pm.getExtent(ClassName.class, false); <br>
    Query query = null; <br>
    try { <br>
    query = pm.newQuery(extent, filter); <br>
    Collection results = (Collection) query.execute();<br>
    Iterator i = results.iterator();<br>
    if (i.hasNext()) {<br>
    ...<br>
    }<br>

    You can always find out the names of tables that are views, using java.sql.DatabaseMetaData and its getTables() method.
    This tends to be a nice source of examples:
    javaalmanac.com
    However, if you're asking for the underlying SQL used to CREATE VIEW, I don't see anything in the API that will give you that. After all, JDBC shouldn't have to know if it's dealing with an ordinary table or a view. I think you'd have to ask your DBA for the underlying SQL.
    Once you have it, what do you plan to do with it?
    %

  • Mac Pro 2013 fan speeds up to maximum after restart.

    My brand new Mac Pro 2013, hanged on shutdown..
    so I had to restart by using the button on the cylinder, when it restarted it sounded like a vacuum cleaner, the fan started to spin fast and didn't stop anymore and my mac was suddenly very slow :S.
    After restarting the mac pro works fine again! this happened 2 times now...
    Already called with apple they said that i should try and work with it and see if the problem comes back again.
    Maybe any of you knows what could be wrong.??????
    I'm mainly using the machine for Logic Pro X and sometimes for some video editing.
    OS : Yosemite - 10.10.2
    Mac Pro 6core 2013

    Reset the SMC and PRAM
    Intel-based Macs: Resetting the System Management Controller (SMC)
    About NVRAM and PRAM

  • The battery of my iPad four drawn very fast after update to iOS 8.1 and the sensitivity of my iPad decrease until I cannot swipe it and is very lag please fix it immediately

    The battery of my iPad four drawn very fast after update to iOS 8.1 and the sensitivity of my iPad decrease until I cannot swipe it and is very lag >< please fix it immediately

    Hello alicelan,
    After reviewing your post, I have located an article that can help with device errors. You may want to consider restoring your device to factory settings to resolve the issues you've described:
    Use iTunes to restore your iOS device to factory settings
    Restoring iOS software deletes all your data and content from your device, including songs, videos, contacts, photos, and calendar info.
    Before you restore your device
    Make sure you’re using the latest version of iTunes.
    Use iTunes to back up your device. Transfer and sync any additional content to your computer.
    Turn off Find My iPhone in Settings > iCloud on your device to disable Activation Lock.
    Restore your iOS device
    Connect your iOS device to your computer using the cable that came with it.
    Select your iPhone, iPad, or iPod touch when it appears in iTunes. In the Summary panel, click Restore.
    Click Restore again to confirm that you want to restore your device to factory settings and delete all data and content. iTunes will download the iOS software file and restore your iOS device.
    After your iOS device is restored to factory settings, it will restart. Once it does, you’ll see the "Slide to set up” welcome screen. Follow the steps in the iOS Setup Assistant. You can set up your device as new or using a previous backup. If your iOS device has cellular service, it will activate after you restore.
    Learn more
    If you get an error message, find out how to fix most update and restore errors.
    If your iOS device with cellular service doesn’t activate after restoring, find out how to fix activation issues.
    If your iOS device restarts repeatedly or isn’t responding, for example if you see a stopped progress bar or no progress bar, put the device into recovery mode and restore it again.
    Thank you for contributing to Apple Support Communities.
    Cheers,
    BobbyD

Maybe you are looking for