Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Alert log files...

827207Oct 18 2012 — edited Oct 19 2012
Hi,

It is really very difficult to go through the alert log files.

Is there any tools or any method is there to read the alert log files in a easy way.
This post has been answered by Niket Kumar on Oct 18 2012
Jump to Answer

Comments

Fran
Pravin	
 	
 	
Handle:	 Pravin  
Status Level:	 Newbie
Registered:	 Dec 28, 2010
Total Posts:	 95
Total Questions:	 33 (24 unresolved)
Name	 Mapa
Location	 Mumbai
Occupation	 System Administrator
Biography	 Now me working as System Admin. Trying for the full time DBA. I am OCP certified.
......................
spur230
How are you going through you alter logs now?

I use vi or grep to go search alter log.
Helios-GunesEROL
Hi;

please review:
http://www.orafaq.com/wiki/Alert.log

@Fran
Man, You make me smile :)

Regard
Helios
Fran
@Helios-Gunes EROL
Always a pleasure

if anyone else shares my mood:
http://9gag.com/gag/5628807
http://9gag.com/gag/5628670
827207
@ spur....me too use vi or cat for going through the alert logs. but do you know any tools to read the alert file, which can make my life easier. Going through the whole alert logs in vi editor is really very painfull.

@fran....keep ur smartness with yourself....
Niket Kumar
Answer
you don't have to read whole alert log all the time.....
use tail command it will give you last line like....

tail -50 alert_database.log (for last 50 lines...)

A new command ADRCI is also there but i think first learn basics....

use Enterprise manager which help you to get alert easily.

Edited by: Niket Kumar on Oct 18, 2012 9:16 PM
Marked as Answer by 827207 · Sep 27 2020
Girish Sharma
create directory BDUMP as '/u01/app/oracle/admin/mysid/bdump';

create table
alert_log ( msg varchar2(80) )
organization external (
type oracle_loader
default directory BDUMP
access parameters (
records delimited by newline
)
location('alrt_mysid.log')
)
reject limit 1000;

Now we can easily extract important Oracle alert log information without leaving SQL*Plus, something like this SQL:

select msg from alert_log where msg like 'ORA-00600%';

http://www.dba-oracle.com/t_oracle_alert_log_sql_external_tables.htm

Regards
Girish Sharma
spur230
you can also mail it to yourself and use any text editor if you are not comformtable with vi.

cat filename| mail <email address>

Also, WinSCP tool lets you open file in notepad like texteditor.
Osama_Mustafa
Why you need tools ? its clear and sorted ...


But if you need tools for reading Alert log use One the below
-TOAD FOR ORACLE
-EnterPrise manager .
EdStevens
Pravin wrote:
@ spur....me too use vi or cat for going through the alert logs. but do you know any tools to read the alert file, which can make my life easier. Going through the whole alert logs in vi editor is really very painfull.
It doesn't have to be. Being moderately proficient in vi is just one of those basic skills you should have if you are going to be an Oracle DBA. You don't have to be proficient with every arcane editing command. But simple page up/page down, search up/search down, and use of grep for simple search/filter is no more difficult in vi than it is in notepad.

Edited by: EdStevens on Oct 18, 2012 11:44 AM
Mark Malakanov (user11181920)
It is really very difficult to go through the alert log files.
Is there any tools or any method is there to read the alert log files in a easy way.
why do you have to "go through the alert log files" ?

a) if it is one time job for something specific, just use text editor viewer and search whatever you need.

b) if it is a daily routine job, when you have to search for some errors or anomalies - automate it. Write a script that searches whatever you need, cuts it and sends email report/alert. Schedule this script. done.
Raj Jamadagni
EdStevens wrote:
It doesn't have to be. Being moderately proficient in vi is just one of those basic skills you should have if you are going to be an Oracle DBA. You don't have to be proficient with every arcane editing command. But simple page up/page down, search up/search down, and use of grep for simple search/filter is no more difficult in vi than it is in notepad.
On Windows, better than notepad, use notepad++ (you can set it to autoscroll) or vim, install cygwin and use tail or less command. There are so many choices ... but yes, thse are essential tools as Ed mentions.

Edited by: rjamya on Oct 18, 2012 1:02 PM
Aman....
Pravin wrote:
@ spur....me too use vi or cat for going through the alert logs. but do you know any tools to read the alert file, which can make my life easier. Going through the whole alert logs in vi editor is really very painfull.
Yeah reading a file since the time db got created is not going to be painful but also would be a waste of time. Why on earth you want to go through the alert log? What for? If rather than asking solution for a question which doesn't make much sense, you tell us the actual requirement of yours, we may be able to give you a proper reply.

Aman....
Raj Jamadagni
use something like logrotate .. rather than a single file.
Osama_Mustafa
Also if you have 11g database you can you ADRCI tools which is amazing tools will give you features like rotate , purge and reading alert log (Only Errors)
DipakKalamkar
You can read the alert log through external table.

Oracle 10g
create or replace directory bdump as ‘/u01/app/oracle/admin/SID/bdump/’;
Oracle 11g
create or replace directory bdump as '/u01/app/oracle/diag/rdbms/db_name/instance_name/trace/’;

Of course, ‘/u01/app/oracle/admin/dipak/bdump/’ OR
‘/u01/app/oracle/diag/rdbms/dipak/dipak/trace/’
must point to the directory where the file actually resides.

In order to prevent a ORA-29913, someone must grant read and write on the directory to the user that uses the directory:
SQL> grant read, write on directory bdump to username;

Creating External table:
create table
alert_log ( msg varchar2(100) )
organization external (
type oracle_loader
default directory bdump
access parameters (
records delimited by newline
)
location('alert_DIPAK.log')
)
reject limit 1000;


SQL> select msg from alert_log where msg like 'ORA-00600%';


*11g New Feature - ADR (Automatic Diagnostic Repository) Viewing and Maintaining the alert log file*

The DIAGNOSTIC_DEST parameter identifies the location of the ADR and it defaults to the
$ORACLE_HOME/log or $ORACLE_BASE if this environment variable has been set.

Let us assign this location the environment variable $ADR_DUMP.
The alert log is stored in both XML as well as standard text format in the ADR. In this
example the database name is ‘dipak’.

The standard text alert log file (alert_DIPAK.log) is located
at $ADR_DUMP/diag/rdbms/dipak/dipak/trace and is maintained for backward
compatibility purposes.
The view V$DIAG_INFO also has information on the location of the various components of
the ADR.
SQL> col value format a50
SQL> SELECT NAME,VALUE FROM v$diag_info WHERE NAME LIKE '%Alert%';
NAME VALUE
-------------------- --------------------------------------------------
Diag Alert /u01/oracle/diag/rdbms/apex/apex/alert


Using the ADR CLI to view Alert Log Information:
The command ‘adrci’ will take us to the prompt.
adrci>

SHOW ALERT -TAIL (to view the last 10 entries)
SHOW ALERT -TAIL 50 (to view the last 50 entries)
SHOW ALERT -TAIL -F (keeps the alert log open to view as entries arrive until Control C is
pressed)
show alert -p “message_text like ‘%ORA-07445%’” (to show all occurrences of the
string ‘ORA-07445′ in the alert log.)
1 - 16
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 16 2012
Added on Oct 18 2012
16 comments
5,684 views