Posts Tagged olsnodes RAC oraenv
TOD – olsnodes hangs temporarily
Posted by Jay Caviness in RAC, Tip 'o the day, general on November 19th, 2008
In using rac, I have found it handy to modify oraenv to use the olsnodes -n -l command to find the local node number and append it to the database name for the real sid.
/home/oracle:()$ . oraenv ORACLE_SID = [oracle] ? qa /home/oracle:(qa1)$ echo $ORACLE_SID qa1
I find this easier than manually setting the sid as it is consistent on each node. One issue I have run into is that after a node has been around for a while there can be a lag time in using oraenv to set the sid.
Tracing the problem, I found it would hang for several seconds on the olsnodes command. Minor, but annoying, especially when in a hurry. In trying to find the cause I discovered that olsnodes would write a logfile to the $CRS_HOME/log/
The obvious solution is to remove these files, in most cases an “rm” command will not work as the file list is too long so a find command would be used:
find . -name "*.log" -exec rm -f {} \;The best resolution would be to create a cron job that would remove all old logs:
00 03 * * * /usr/bin/find /oracle/product/10.2.0/crs_1/log/lx52/client \( -name "css*.log" -o -name "*.trc" \) -mtime +1 -exec /bin/rm -f {} \;In the example above at 3am we find all the css*.log and *.trc files older than midnight yesterday and remove them. Based on running at 3am, it would remove all files over 27 hours old.