Download - OracleRecipes __ Monitor Long Running Oracle Operations

Transcript
  • 3/27/2015 OracleRecipes::MonitorlongrunningOracleoperations

    http://www.oraclerecipes.com/monitoring/monitorlongrunningoracleoperations/ 1/2

    oraclerecipes

    ProblemWanttoknowhowlongyouhavetowaituntiltheoperationfinishes?Sometimeswhenyourunaslowquerywhichproducesafulltablescan,you'llhavetoknowhowlongit'sgoingtotakeforthequerytofinish.There'sasimplequerywhichshowsyouhowmanysecondselapsedandhowmanysecondsyou'llhavetowait.

    Recipe#1GetdetailsaboutlongrunningoperationsRunthefollowingqueryandyou'llgetmostinformationyouneed:

    SELECTosuser,sl.sql_id,sl.sql_hash_value,opname,target,elapsed_seconds,time_remainingFROMv$session_longopsslinnerjoinv$sessionsONsl.SID=s.SIDANDsl.SERIAL#=s.SERIAL#WHEREtime_remaining>0

    Recipe#2ShowlongrunningSQLStatementsIfyoualsowanttoseetheSQLquerycausingthelongrunningoperation,justjoinv$sqllikeshowbelow:

    SELECTs.username,sl.sid,sq.executions,sl.last_update_time,sl.sql_id,sl.sql_hash_value,opname,target,elapsed_seconds,time_remaining,sq.sql_fulltextFROMv$session_longopsslINNERJOINv$sqlsqONsq.sql_id=sl.sql_idINNERJOINv$sessionsONsl.SID=s.SIDANDsl.serial#=s.serial#WHEREtime_remaining>0

  • 3/27/2015 OracleRecipes::MonitorlongrunningOracleoperations

    http://www.oraclerecipes.com/monitoring/monitorlongrunningoracleoperations/ 2/2

    Copyright20102015byOracleRecipes.comOracleistheregisteredtrademarkofOracleCorporation.