fbpx

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:
diag/rdbms/yp001p/YP001P1
diag/rdbms/azamoa/azamoa1
diag/clients/user_oracle/host_2133002082_110
diag/tnslsnr/xm1iddb21/listener_dg
adrci>

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*