Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 24 Jan 2003 @ 18:45:08 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Data Retention of System Log Tables
 
From:   Christopher Platt

we run this through bteq using unix sys v cron to kick it off once a week in the wee hours

delete from dbc.sw_event_log where thedate lt date-30;
delete from dbc.hw_event_log where thedate lt date-30;
delete from dbc.logonoff where logdate lt date-60;
delete from dbc.resusagespma where thedate lt date-30;
delete from dbc.resusageipma where thedate lt date-30;
delete from dbc.resusagescpu where thedate lt date-30;
delete from dbc.resusageicpu where thedate lt date-30;
delete from dbc.resusagesctl where thedate lt date-30;
delete from dbc.resusagesvpr where thedate lt date-30;
delete from dbc.resusagesvpr2 where thedate lt date-30;
delete from dbc.resusageivpr where thedate lt date-30;
delete from dbc.resusageshst where thedate lt date-30;
delete from dbc.resusagesobj where thedate lt date-30;
delete from dbc.resusagesldv where thedate lt date-30;


there are macros that do this.... we just clean out what we use....

we have lots of little scripts that do stuff for us.... like this

i justed finished playing with this one it tails any mail file with size greater then 0 keep in mind i have no users on SYS V unix boxes so this is not alot of crap. It has helped me to find cron processes that do not run correctly and spew out errors into mail....

#!/bin/ksh
#
# simple mail checker to see if we have mail on any node
#
dirit=`ls -s /var/mail | grep -v ':'| grep -v 0 | grep -v total | awk
'{print $2}' |  xargs `
whoit=`uname`
print $dirit
for i in `print ${dirit}`
do
tail -40 /var/mail/$i | mailx -s " $whoit /var/mail/$i"
xxxx@na.ko.com
done

Christopher Platt
Teradata Systems Administration



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 27 Dec 2016