Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Temporary tablespace growth

Re: Temporary tablespace growth

From: hgha <houman_at_globe-tekcorp.com>
Date: 7 Dec 2006 09:19:07 -0800
Message-ID: <1165511947.294536.32130@79g2000cws.googlegroups.com>

Charles Hooper wrote:
> hgha wrote:
> > my temporary tablespace has grown to it's maximum (32GB) in two
> > separate incidents. is there
> > any way I can find out what query has been responsible for this growth?
> > V$sort_usage doesn't tell me much.
> >
> > thanks
>
> In addition to what has already been suggested, one possible way to
> track this down, assuming that the user who executed the SQL statement
> has not disconnected from Oracle, and the SQL statement has not aged
> out of the shared pool, is to use something similar to the following to
> track down the user who made extensive use of the temporary tablespace:
> SELECT
> S.SID,
> S.USERNAME,
> S.PROGRAM,
> S.MACHINE,
> S.OSUSER,
> SN.NAME,
> SS.VALUE
> FROM
> V$SESSION S,
> V$SESSTAT SS,
> V$STATNAME SN
> WHERE
> SN.STATISTIC#=SS.STATISTIC#
> AND SN.NAME IN ('physical writes direct temporary
> tablespace','physical writes direct','sorts (disk)','workarea
> executions - multipass')
> AND SS.VALUE>0
> AND SS.SID=S.SID
> AND S.USERNAME IS NOT NULL
> ORDER BY
> S.SID,
> SN.NAME;
>
> You may also be able to use the wait event interface to track down the
> user:
> SELECT
> S.SID,
> S.USERNAME,
> S.PROGRAM,
> S.MACHINE,
> S.OSUSER,
> SE.EVENT,
> SE.TIME_WAITED
> FROM
> V$SESSION S,
> V$SESSION_EVENT SE
> WHERE
> SE.EVENT IN ('direct path write','direct path read','direct path
> write temp','direct path read temp')
> AND SE.SID=S.SID
> AND S.USERNAME IS NOT NULL
> ORDER BY
> SE.TIME_WAITED DESC;
>
> Tracking down the SQL statements:
> SELECT
> SQL_TEXT,
> SHARABLE_MEM,
> PERSISTENT_MEM,
> RUNTIME_MEM,
> SORTS,
> FETCHES,
> EXECUTIONS,
> FIRST_LOAD_TIME,
> DIRECT_WRITES,
> PARSING_USER_ID
> FROM
> V$SQL
> WHERE
> PARSING_USER_ID=offending_sid_here
> AND SORTS>0;
>
> Charles Hooper
> PC Support Specialist
> K&M Machine-Fabricating, Inc.

Thanks you. These queries helped me find out who has the most use of temporary tablespace. Received on Thu Dec 07 2006 - 11:19:07 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US