Oracle Adrci commands
Alert log trimming to get contents for last 3 days
$ adrci exec="set home diag/rdbms/ctip/ctip1; show alert -p \\\"message_text like '%' and originating_timestamp > systimestamp-3\\\"" -term > alert_temp.log
$ ls -ltr alert_temp.log -rw-r--r-- 1 oracle dba 403615 Nov 7 21:18 alert_temp.log
To Purge Multiple adrci homes in schell script
1)
adrci exec="show homes"|grep -v : | while read file_line
do
echo "INFO: adrci purging diagnostic destination " $file_line
echo "INFO: purging ALERT older than 90 days"
adrci exec="set homepath $file_line;purge -age 129600 -type ALERT"
echo "INFO: purging INCIDENT older than 30 days"
adrci exec="set homepath $file_line;purge -age 43200 -type INCIDENT"
echo "INFO: purging TRACE older than 30 days"
adrci exec="set homepath $file_line;purge -age 43200 -type TRACE"
echo "INFO: purging CDUMP older than 30 days"
adrci exec="set homepath $file_line;purge -age 43200 -type CDUMP"
echo "INFO: purging HM older than 30 days"
adrci exec="set homepath $file_line;purge -age 43200 -type HM"
echo ""
echo ""
done
echo
echo "INFO: adrci purge finished at `date`"
2)
$OH/bin/adrci exec="show homes"|grep -v :|while read file_line
do
set home $file_line
echo "INFO: adrci purging diagnostic destination " $file_line
echo "INFO: purging ALERT older than 90 days"
$OH/bin/adrci exec="set homepath $file_line;purge -age 1 -type ALERT"
echo "INFO: purging INCIDENT older than 30 days"
$OH/bin/adrci exec="set homepath $file_line;purge -age 4 -type INCIDENT"
echo "INFO: purging TRACE older than 30 days"
$OH/bin/adrci exec="set homepath $file_line;purge -age 4 -type TRACE"
echo "INFO: purging CDUMP older than 30 days"
$OH/bin/adrci exec="set homepath $file_line;purge -age 4 -type CDUMP"
echo "INFO: purging HM older than 30 days"
$OH/bin/adrci exec="set homepath $file_line;purge -age 4 -type HM"
echo ""
echo ""
echo $line
done
https://oracle-base.com/articles/11g/automatic-diagnostics-repository-11gr1
Alert log trimming to get contents for last 3 days
$ adrci exec="set home diag/rdbms/ctip/ctip1; show alert -p \\\"message_text like '%' and originating_timestamp > systimestamp-3\\\"" -term > alert_temp.log
$ ls -ltr alert_temp.log -rw-r--r-- 1 oracle dba 403615 Nov 7 21:18 alert_temp.log
To Purge Multiple adrci homes in schell script
1)
adrci exec="show homes"|grep -v : | while read file_line
do
echo "INFO: adrci purging diagnostic destination " $file_line
echo "INFO: purging ALERT older than 90 days"
adrci exec="set homepath $file_line;purge -age 129600 -type ALERT"
echo "INFO: purging INCIDENT older than 30 days"
adrci exec="set homepath $file_line;purge -age 43200 -type INCIDENT"
echo "INFO: purging TRACE older than 30 days"
adrci exec="set homepath $file_line;purge -age 43200 -type TRACE"
echo "INFO: purging CDUMP older than 30 days"
adrci exec="set homepath $file_line;purge -age 43200 -type CDUMP"
echo "INFO: purging HM older than 30 days"
adrci exec="set homepath $file_line;purge -age 43200 -type HM"
echo ""
echo ""
done
echo
echo "INFO: adrci purge finished at `date`"
2)
$OH/bin/adrci exec="show homes"|grep -v :|while read file_line
do
set home $file_line
echo "INFO: adrci purging diagnostic destination " $file_line
echo "INFO: purging ALERT older than 90 days"
$OH/bin/adrci exec="set homepath $file_line;purge -age 1 -type ALERT"
echo "INFO: purging INCIDENT older than 30 days"
$OH/bin/adrci exec="set homepath $file_line;purge -age 4 -type INCIDENT"
echo "INFO: purging TRACE older than 30 days"
$OH/bin/adrci exec="set homepath $file_line;purge -age 4 -type TRACE"
echo "INFO: purging CDUMP older than 30 days"
$OH/bin/adrci exec="set homepath $file_line;purge -age 4 -type CDUMP"
echo "INFO: purging HM older than 30 days"
$OH/bin/adrci exec="set homepath $file_line;purge -age 4 -type HM"
echo ""
echo ""
echo $line
done
https://oracle-base.com/articles/11g/automatic-diagnostics-repository-11gr1
Comments
Post a Comment