User Tools

Site Tools


maintenance

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
maintenance [2018/12/06 21:05] – created 91.177.234.129maintenance [2019/01/30 11:32] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Maintenance ======+  *  [[Purging trace and dump files in 11g with adrci]] 
 +  *  [[Rotate alert logs (alertlog) with shell script]] 
 +  *  [[Patching]]
  
-  * [[Purging trace and dump files in 11g with adrci]] +==== Rotate the listener logs ====
-  * [[Rotate alert logs (alertlog) with shell script]] +
-  * [[Patching]] +
- +
-=====Rotate the listener logs=====+
 Get hold of the listener log files using a method that should be usable for all versions from 9i. This can then be fed into the rotate script. Get hold of the listener log files using a method that should be usable for all versions from 9i. This can then be fed into the rotate script.
-<code>0@@</code>+<code> 
 +  - !/usr/bin/ksh 
 + 
 +ps -ef | grep tnslsnr | grep inherit | grep -v grep | while read -r psline 
 +do 
 +    listener_name=$(echo ${psline} | awk '{print $(NF-1)}'
 +    listener_process=$(echo ${psline} | awk '{print $(NF-2)}'
 +    ORACLE_HOME="$(echo ${listener_process} | sed -e 's;/bin/tnslsnr;;')" 
 +    export TNS_ADMIN=$(echo ${ORACLE_HOME}/network/admin) 
 + 
 +    listener_log_file=$(${ORACLE_HOME}/bin/lsnrctl status ${listener_name} | awk '/Listener Log File/ {print $NF}'
 +    if [[ -r "${listener_log_file}" ]]; then 
 +        echo rotate_listener_log "${listener_log_file}" 
 +    else 
 +        echo "No listener log file found for ${listener_name}, skipping." 
 +    fi 
 +done 
 +</code> 
maintenance.1544130326.txt.gz · Last modified: 2018/12/06 21:05 by 91.177.234.129

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki