dba:oracle_rac_logfile_handling
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende ÜberarbeitungNächste ÜberarbeitungBeide Seiten der Revision | ||
dba:oracle_rac_logfile_handling [2019/02/21 19:51] – [Audit Logs der Datenbank(en)] gpipperr | dba:oracle_rac_logfile_handling [2019/02/21 20:56] – [Job um automatisch zu löschen] gpipperr | ||
---|---|---|---|
Zeile 368: | Zeile 368: | ||
Script Fragment: | Script Fragment: | ||
- | <code bash > | + | <code bash cleanDiagHome.sh |
#!/bin/sh | #!/bin/sh | ||
- | # clean DIAG HOMES | + | # ###################################### |
# | # | ||
+ | # Purge DIAG HOMES | ||
+ | # www.pipperr.de | ||
+ | # see https:// | ||
+ | # | ||
+ | # ##################################### | ||
+ | # Crontab | ||
+ | # | ||
+ | # M H D M | ||
+ | # Oracle purge DIAG Logs | ||
+ | # 0 20 * * * / | ||
+ | # | ||
+ | # ##################################### | ||
- | #set the enviroment to the grid home | + | #set the enviroment to the ${USER} |
- | source /home/grid/.profile | + | source /home/${USER}/.profile |
- | + | ||
- | # set the home switch ot the current user! | + | |
- | ORA_HOME_SWITCH = 1 | + | # set the home switch to the current user! |
+ | # Set this for each installation | ||
+ | setdb 1 > /dev/null 2>&1 | ||
# Fill out the diag home | # Fill out the diag home | ||
+ | # Set this for each installation | ||
DIAG_HOME=/ | DIAG_HOME=/ | ||
- | |||
# write log | # write log | ||
- | LOG_FILE=/ | + | LOG_FILE=/ |
# set rentation policy days | # set rentation policy days | ||
# 263520= 183 days | # 263520= 183 days | ||
- | HOURS=263520 | + | # Set this for each installation |
+ | MINUTES=263520 | ||
echo "Info - start to analyses all DIAG Homes - start at -- `date` -- " | echo "Info - start to analyses all DIAG Homes - start at -- `date` -- " | ||
- | echo "Info - clean all 12c homes after for files older than ${HOURS} minutes" | + | echo "Info - clean all 12c homes after for files older than ${MINUTES} minutes" |
for a in $(adrci exec=" | for a in $(adrci exec=" | ||
Zeile 399: | Zeile 412: | ||
| | ||
- | | + | |
| | ||
# check the user for this home | # check the user for this home | ||
Zeile 410: | Zeile 423: | ||
| | ||
if [[ ${USER} = ${FILE_OWNER} ]]; then | if [[ ${USER} = ${FILE_OWNER} ]]; then | ||
- | + | | |
- | setdb ORA_HOME_SWITCH | + | adrci exec=" |
- | | + | |
- | adrci exec=" | + | |
- | fi | + | |
+ | echo " | ||
+ | |||
+ | fi | ||
| | ||
- | | + | done |
- | | + | echo "Info - finish at -- `date` -- " |
</ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
(Achtung, falls Ihr das Script kopiert, müsste Ihr die Oracle Home Umgebung manuell setzen oder .profile von mir verwenden) | (Achtung, falls Ihr das Script kopiert, müsste Ihr die Oracle Home Umgebung manuell setzen oder .profile von mir verwenden) | ||
dba/oracle_rac_logfile_handling.txt · Zuletzt geändert: 2019/02/23 09:31 von gpipperr