dbTalk Databases Forums  

ADRCI in 11g

comp.databases.oracle.server comp.databases.oracle.server


Discuss ADRCI in 11g in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
The Magnet
 
Posts: n/a

Default ADRCI in 11g - 09-10-2011 , 07:55 PM






Hi,

I've noticed that the PURGE command in the new Adrci seems to work
rather strangely. It does not seem to operate on the contents of the
log.xml, but the actual file date / time. So, if my alert log gets
messages throughout the day, then trying to purge a day will not work.

I ran a test, had some entries created, waited 30 minutes, created
more entries, then issues a purge to purge everything older than 5
minutes. I did SHOW ALERT, and nothing was removed.

How is one to remove entries from the log.xml? We'll be putting this
all into a shell script to help us manage / rotate the logs.

Reply With Quote
  #2  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: ADRCI in 11g - 09-10-2011 , 09:20 PM






On Sat, 10 Sep 2011 17:55:06 -0700, The Magnet wrote:

Quote:
Hi,

I've noticed that the PURGE command in the new Adrci seems to work
rather strangely. It does not seem to operate on the contents of the
log.xml, but the actual file date / time. So, if my alert log gets
messages throughout the day, then trying to purge a day will not work.

I ran a test, had some entries created, waited 30 minutes, created more
entries, then issues a purge to purge everything older than 5 minutes.
I did SHOW ALERT, and nothing was removed.

How is one to remove entries from the log.xml? We'll be putting this
all into a shell script to help us manage / rotate the logs.
Don't you ever read old threads? I started one thread exactly about this
few days ago. The outcome was this:

Bug 12426625: ORACLE 11.2.0.2 CONFIGURATION, ADRCI "SET CONTROL" AND
"PURGE" DO NOT WORK



--
http://mgogala.byethost5.com

Reply With Quote
  #3  
Old   
Mladen Gogala
 
Posts: n/a

Default Re: ADRCI in 11g - 09-10-2011 , 10:11 PM



On Sat, 10 Sep 2011 17:55:06 -0700, The Magnet wrote:

Quote:
How is one to remove entries from the log.xml? We'll be putting this
all into a shell script to help us manage / rotate the logs.
There is but one God and Larry is his prophet. Larry gave us the tool to
do that, the pathologically eclectic rubbish lister. May the camel and
the llama help you with your burden, my grasshopper.

#!/usr/bin/env perl
# CLEAN_LOG: This script removes all messages older than a week from
# log.xml in $DIAG_HOME/alert.
use warnings;
use strict;
use Date::Simple qw(date today);
my $cutoff_date = today() - 7;
my $msg_date = today() - 365;
my $out = 0;
while (<>)
{
if (!$out and /<msg time='(\d{4}-\d{2}-\d{2})T/)
{
$msg_date = Date::Simple->new($1);
$out = 1 if ($msg_date > $cutoff_date);
}
print $_ if $out;
}


[oracle@medo alert]$ ~/bin/clean_log log.xml >log1.xml
[oracle@medo alert]$ mv log1.xml log.xml
[oracle@medo alert]$



--
http://mgogala.byethost5.com

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.