Re: limit temp usage before error or out of space condition?
Date: Tue, 22 Oct 2013 14:22:56 -0700 (PDT)
Message-ID: <1382476976.37903.YahooMailNeo_at_web162002.mail.bf1.yahoo.com>
You can easily set this up as a metric extension, but to be honest, I used to do it as shell script. Here is the script and you can steal what you need from it: function mail_page {
echo|mailx -s "${HOST} resumable transactions found in ${ORACLE_SID} at ${DATE}" ${MAIL_LIST}
\rm -f ${OUT_FILE}
}
export ORAENV_ASK=NO
. oraenv > /dev/null
export ORAENV_ASK=YES
DATE=`date '+%m/%d/%y %H:%M:%S'`
MAIL_LIST="<email_add>"
HOST=`hostname`
WORKING_DIR=~/scripts
OUT_FILE=${WORKING_DIR}/`basename $0`_${ORACLE_SID}.lst
let ERR_CNT=0
ERR_CNT=$(sqlplus -s << EOF
/ as sysdba
set feedback off
set pagesize 0
set timing off
select count(*) from dba_resumable where suspend_time is not null and name not like 'User SYSTEM(5)%';
EOF)
echo "error count is: " ${ERR_CNT}
if [ ${ERR_CNT} -ne 0 ]
then
mail_page
exit 2
else
echo "everything OK"
fi
exit 0
Kellyn Pot'Vin
Senior Technical Consultant
Enkitec
DBAKevlar.com
RMOUG Director of Training Days Conference
~Tombez sept fois, se relever huit!
On Tuesday, October 22, 2013 2:56 PM, Josh Collier <Josh.Collier_at_banfield.net> wrote:
Yes, I use resumable already. Just wanted to see if I could catch them before they suspend. I have lowered the warning threshold on the full condition for the tablespace. It doesn't look like OEM has anything to monitor temp usage by query tho. I could write something in perl but I was hoping to avoid having to build a wheel.
From: Kellyn Pot'vin [mailto:kellyn.potvin_at_ymail.com]
Sent: Tuesday, October 22, 2013 1:47 PM
To: oracle-l_at_freelists.org; Josh Collier
Subject: Re: limit temp usage before error or out of space condition?
Look into setting up resumable in your database. .. your life will be so much better for it. ...:)
Sent from Yahoo Mail on Android<http://overview.mail.yahoo.com/mobile/?.src=Android>
From: Josh Collier <Josh.Collier_at_banfield.net<mailto:Josh.Collier_at_banfield.net>>; To: oracle-l_at_freelists.org<mailto:oracle-l_at_freelists.org> <oracle-l_at_freelists.org<mailto:oracle-l_at_freelists.org>>;
Subject: limit temp usage before error or out of space condition? Sent: Tue, Oct 22, 2013 8:38:02 PM
Does anyone have any ideas how to limit temp usage before the query at hand fills up the temp tablespace and then suspends everyone else until the condition is cleared? Is there a way to monitor queries that are using too much temp and send an email? Maybe in OEM? Thanks for your thoughts,
Josh C.
-- http://www.freelists.org/webpage/oracle-l -- http://www.freelists.org/webpage/oracle-l -- http://www.freelists.org/webpage/oracle-lReceived on Tue Oct 22 2013 - 23:22:56 CEST