Home » SQL & PL/SQL » Client Tools » removal of ORACLE_BASE/rbdms/ORACLE_SID/alert.xml files
removal of ORACLE_BASE/rbdms/ORACLE_SID/alert.xml files [message #536892] Fri, 23 December 2011 13:27 Go to next message
BeefStu
Messages: 192
Registered: October 2011
Senior Member
I am running Oracle 11.1.0.7 and 11.2.0.2 of various flavors
of UNIX (AIX, SOLARIS, HPUX, LINUX).

I currenlty use adrci to remove TRACE,DUMP,ALERT,... files.

Is there a tool other than "rm" that can be called to clean
up *.XML files



pwd
/u01/app/oracle/diag/rdbms/otapdev/otapdev

-rw-r-----    1 oracle   dba        10486112 Apr 17 2010  ./alert/log_1.xml
-rw-r-----    1 oracle   dba        10485856 Apr 23 2010  ./alert/log_10.xml
-rw-r-----    1 oracle   dba        10485761 Apr 24 2010  ./alert/log_11.xml
-rw-r-----    1 oracle   dba        10486111 Apr 27 2010  ./alert/log_12.xml
-rw-r-----    1 oracle   dba        10485972 May  6 2010  ./alert/log_13.xml
-rw-r-----    1 oracle   dba        10485925 May  9 2010  ./alert/log_14.xml
-rw-r-----    1 oracle   dba        10485862 May 12 2010  ./alert/log_15.xml
-rw-r-----    1 oracle   dba        10485864 Aug 26 2010  ./alert/log_16.xml
-rw-r-----    1 oracle   dba        10485941 Aug 29 2010  ./alert/log_17.xml
-rw-r-----    1 oracle   dba        10485770 Sep  1 2010  ./alert/log_18.xml
-rw-r-----    1 oracle   dba        10485938 Sep  4 2010  ./alert/log_19.xml
-rw-r-----    1 oracle   dba             285 Apr 17 2010  ./alert/log_2.xml
-rw-r-----    1 oracle   dba        10486281 Sep  6 2010  ./alert/log_20.xml




Thanks to all who answer. Happy holidays

Re: removal of ORACLE_BASE/rbdms/ORACLE_SID/alert.xml files [message #536894 is a reply to message #536892] Fri, 23 December 2011 14:24 Go to previous messageGo to next message
Michel Cadot
Messages: 58578
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
http://mudasblog.wordpress.com/2011/04/05/oracle-11g-r2-11-2-0-2-housekeeping-adr-and-listener-logfiles/
http://www.richtechnologies.com/?p=28

Regards
Michel
Re: removal of ORACLE_BASE/rbdms/ORACLE_SID/alert.xml files [message #536907 is a reply to message #536894] Fri, 23 December 2011 16:27 Go to previous messageGo to next message
BeefStu
Messages: 192
Registered: October 2011
Senior Member
Michel,
Thanks, but I already have something similiar to the adrci
example in the link.. As mentioned, I am looking for a way to
clean up the .xml files.... I really don't want to hard-code
directories if there is not need too.

I will keep searching.
Re: removal of ORACLE_BASE/rbdms/ORACLE_SID/alert.xml files [message #536921 is a reply to message #536907] Sat, 24 December 2011 00:45 Go to previous messageGo to next message
Michel Cadot
Messages: 58578
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
If you have a closer look at the second script you will see there is no hard coded directories, it finds them from instance parameters. You can adjust it as you want.

Anyway, you can always use "find" to remove the files you want accordingly to the policy you want.

Regards
Michel
Re: removal of ORACLE_BASE/rbdms/ORACLE_SID/alert.xml files [message #537289 is a reply to message #536907] Tue, 27 December 2011 09:33 Go to previous messageGo to next message
LKBrwn_DBA
Messages: 425
Registered: July 2003
Location: WPB, FL
Senior Member
If you have setup the purging policies, perhaps this is simpler:
#!/bin/ksh
# cleanup_files.sh
#
export ORACLE_SID=orcl
ORAENV_ASK=NO
. /usr/local/bin/oraenv
HOMEPATH=$(adrci exec="show homes"|grep -v '^ADR Homes:')
echo "spool adrci_`date +%Y%m%d\-%H%M`.log">adrci_cmds.adi
echo "set echo on">>adrci_cmds.adi
for h in $HOMEPATH
do  
  echo "set homepath $h">>adrci_cmds.adi
  echo "purge">>adrci_cmds.adi
done
echo "spool off">>adrci_cmds.adi
echo "quit">>adrci_cmds.adi

adrci script=adrci_cmds.adi

[Updated on: Wed, 04 January 2012 12:50] by Moderator

Report message to a moderator

Re: removal of ORACLE_BASE/rbdms/ORACLE_SID/alert.xml files [message #537292 is a reply to message #537289] Tue, 27 December 2011 10:04 Go to previous messageGo to next message
BeefStu
Messages: 192
Registered: October 2011
Senior Member
All:
Thanks for the input but I still can't seem to get rid of the
the *.XML files. Is anybody else having this issue. I am trying
on both 11.1.0.7 and 11.2.0.3

Any expamples would be greatly appreciated.
Re: removal of ORACLE_BASE/rbdms/ORACLE_SID/alert.xml files [message #537295 is a reply to message #537292] Tue, 27 December 2011 10:12 Go to previous messageGo to next message
Michel Cadot
Messages: 58578
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
find . -name '*.xml' -exec rm {} \;

Regards
Michel
Re: removal of ORACLE_BASE/rbdms/ORACLE_SID/alert.xml files [message #537296 is a reply to message #537292] Tue, 27 December 2011 10:23 Go to previous messageGo to next message
LKBrwn_DBA
Messages: 425
Registered: July 2003
Location: WPB, FL
Senior Member
Perhaps your purging policy is too long, did you try something like this in you script?:
set homepath diag/rdbms/otapdev/otapdev
purge -age 60 -type alert



[Updated on: Tue, 27 December 2011 11:27] by Moderator

Report message to a moderator

Re: removal of ORACLE_BASE/rbdms/ORACLE_SID/alert.xml files [message #537297 is a reply to message #537296] Tue, 27 December 2011 10:32 Go to previous messageGo to next message
BeefStu
Messages: 192
Registered: October 2011
Senior Member
LkBrn
This does not appear to work with 11.1.0.7


$ find . -name "*.xml" -exec ls -lt {} ";" | wc -l
      36
opadev1:/u01/app/oracle/diag/rdbms/otapdev/otapdev
$ adrci

ADRCI: Release 11.1.0.7.0 - Production on Tue Dec 27 11:26:52 2011

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

ADR base = "/u01/app/oracle"
adrci> set homepath diag/rdbms/otapdev/otapdev
adrci> purge -age 60 -type alert

adrci> adrci> exit
opadev1:/u01/app/oracle/diag/rdbms/otapdev/otapdev
$
opadev1:/u01/app/oracle/diag/rdbms/otapdev/otapdev
$
opadev1:/u01/app/oracle/diag/rdbms/otapdev/otapdev
$ find . -name "*.xml" -exec ls -lt {} ";" | wc -l
      36



Michel, I know I can use the find/rm command but that is
what I am trying to avoid as this will require me to hard
code a starting point for the find command....

I would have hoped adrci would have handled XML files like
it does ALERT/TRACE/CDUMP...

Thanks all


Re: removal of ORACLE_BASE/rbdms/ORACLE_SID/alert.xml files [message #537300 is a reply to message #537297] Tue, 27 December 2011 11:29 Go to previous messageGo to next message
Michel Cadot
Messages: 58578
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
Michel, I know I can use the find/rm command but that is
what I am trying to avoid as this will require me to hard
code a starting point for the find command....


Which part should be variable? Tell us.

Regards
Michel
Re: removal of ORACLE_BASE/rbdms/ORACLE_SID/alert.xml files [message #537314 is a reply to message #537300] Tue, 27 December 2011 12:47 Go to previous messageGo to next message
BeefStu
Messages: 192
Registered: October 2011
Senior Member
find $starting_place -name "*xml" .... I want to ensure I
delete the right XML files...

I dont want to pass in starting_place as a parameter to a script
if it can be avoided.

Re: removal of ORACLE_BASE/rbdms/ORACLE_SID/alert.xml files [message #537315 is a reply to message #537314] Tue, 27 December 2011 12:50 Go to previous message
Michel Cadot
Messages: 58578
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
And so how your script should know how to start?
In other words, define your starting point, till now you NEVER did it.

Regards
Michel
Previous Topic: Explain Plan problem - oracle toad
Next Topic: IntelliSense and Function Usage/Preview in Toad
Goto Forum:
  


Current Time: Sat Jul 26 04:38:02 CDT 2014

Total time taken to generate the page: 0.11160 seconds