depura_statspack.sh
#!/bin/bash
################################################# Depura las estadisticas del statspack dejando los ultimos 30 dias.
#
#################################################
source ~/.bash_profile
sqlplus perfstat/perfstat @$HOME/scripts/depura_statspack.sql
exit
____________________________________________________________
depura_statspack.sql
spool /home/oracle/logs/depura_statspack.log
col menor format 999999 new_value losnapid
col mayor format 999999 new_value hisnapid
select min(snap_id) as menor, max(snap_id) as mayor from stats$snapshot
where snap_time < sysdate - 30;
@?/rdbms/admin/sppurge
spool off
exit
No hay comentarios:
Publicar un comentario