Oracle XE: Clearing out unwanted trace files

Posted by Christian Ashby on April 9, 2010

If left unchecked, Oracle XE installations can balloon in size quite quickly – this is due to the trace files being written by the server. The following run in a cron script can be used to remove files more than 7 days old.

find $ORACLE_HOME/../../../admin/$ORACLE_SID/bdump -name "*.trc" -mtime +7 -exec rm "{}" \;
find $ORACLE_HOME/../../../admin/$ORACLE_SID/udump -name "*.trc" -mtime +7 -exec rm "{}" \;
find $ORACLE_HOME/../../../admin/$ORACLE_SID/cdump -name "*.trc" -mtime +7 -exec rm "{}" \;

This tip was found and modified for XE in the following a useful article ‘Oracle Linux – Using the “find” command to manage files’.


Linux: Arrow keys don’t work?

Posted by Christian Ashby on March 26, 2010

Some Linux applications such as sqlplus still use readline to read what you type, which doesn’t properly support arrow keys, home, end, etc in most terminals.

You can fix this with a small wrapper called rlfe (for older Ubuntu/Debian variants) or rlwrap (for RedHat and most new distributions).

Once installed (apt-get install rlwrap for Debian/Ubuntu) you can enable it by default for your user by doing the following:

echo "alias {command}='rlwrap {command}'" >> ~/.bashrc
source ~/.bashrc