How to Find Alert Log File Location in Oracle

cumulus clouds

In newer versions of Oracle Database it is not obvious where is the location of the alert file to investigate any potential issues.

If you want to know how to check alert log errors in Oracle, then keep reading.

You have a couple of ways to know where your Oracle alert file is located.

1. If the Oracle database is opened

You can use this query after connecting with: sqlplus / as sysdba

select * 
from v$diag_info 
where NAME = 'Diag Trace';

2. If the Oracle database is not opened

You can use adrci from the command line

# adrci

ADR base = "/u01/app/oracle"
adrci> show homes
ADR Homes:

You can see there are several homes.

If you want to check the alert file for database YP001P1 then you should use the ADR base followed by the ADR home (from the output above) and then add the trace folder at the end

cd /u01/app/oracle/diag/rdbms/yp001p/YP001P1/trace

Once in that folder you can check the alert file

ls -lrt alert*

Check All Apache Virtual Host Logs on Ubuntu

cloth with artistic design

Sometimes I need to check all my virtual hosts on my Apache server.

The best way to do it is with a cat command like this

/var/log/apache2# cat *.access.log

If I want to keep observing the log I use the command tail as follows

/var/log/apache2# tail -f *.access.log

But if I want to check something more specific I can use a grep too

/var/log/apache2# cat *.access.log | grep root

This is a quick way to verify my logs without having to check them one by one.