![]() |
|
Archives of the TeradataForumMessage Posted: Thu, 09 Nov 2006 @ 20:13:10 GMT
Here is a series of scripts that I wrote to automate this process. You can set this up to run via cron once a week to keep the leftover spool from building up to high: There are three files that I created for my client:
dbclogon.user
spool_users.btq
spool_users.ksh
The scripts are as follows: Dbclogon.user
.logon dbc/username,password;
spool_users.btq
.run file=/-your directory path here-/dbclogon.user
.os rm /-your directory path here-/spool_users.out
.set titledashes off
.export report file=/-your directory path here-/spool_users.out
SELECT distinct(DATABASENAME) (title '')
FROM DBC.DISKSPACE
WHERE DATABASENAME NOT IN (SEL USERNAME FROM DBC.SESSIONINFO)
AND DATABASENAME <> 'DBC'
AND CURRENTSPOOL > 0
ORDER BY 1;
.export reset
.logoff
.quit
spool_users.ksh
#!/usr/bin/ksh
bteq < spool_users.btq
export CNT=`cat /-your directory path here-/spool_users.out | wc -w |
sed -e 's/ //g'`
if [[ $CNT = 0 ]];
then
print "Nothing to do."
exit
else
for users in `cat /-your directory path here-/spool_users.out`;
do
cnsrun -utility updatespace -commands "{update spool space for $users;} {quit}"
sleep 3
done
fi
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||