-- ==========================================================
-- ALERT LOG
-- ==========================================================
$ORACLE_BASE/diag/rdbms/$DB_UNIQUE_NAME/$ORACLE_SID/trace/
SQL> set lines 200
SQL> col name format a10
SQL> col value format a60
SQL> SELECT inst_id,name,value FROM v$diag_info WHERE name = 'Diag Trace';
INST_ID NAME VALUE
---------- ---------- ------------------------------------------------------
1 Diag Trace /u01/app/oracle/diag/rdbms/dbname/instance_name/trace
SQL> SHOW PARAMETER BACKGROUND_DUMP_DEST
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------------------
background_dump_dest string /u01/app/oracle/diag/rdbms/DB_UNIQUE_NAME/SID/trace
-- locate command
locate alert_$ORACLE_SID.log
-- Leitura -- (more/less/cat)
cat Alert_SID.log
tail -F Alert_SID.log
tail -f $ORACLE_BASE/diag/rdbms/dbname/instance_name/trace/alert_SID.log
-- Localizando arquivos de Trace
SQL> SELECT VALUE FROM V$DIAG_INFO;
-- Para determinar o arquivo de rastreamento para cada processo do banco de dados Oracle
SQL> SELECT PID, PROGRAM, TRACEFILE FROM V$PROCESS;
--For 9i and 10g
$ORACLE_BASE/admin/$ORACLE_SID/bdump/
-- ==========================================================
-- ALERT LOG - Limpeza
-- ==========================================================
find /u01/app/oracle/diag/rdbms/dbname/instance_name/trace -name "*.trc" -mtime +3 -exec rm {} \;
find /u01/app/oracle/diag/rdbms/dbname/instance_name/trace -name "*.trm" -mtime +3 -exec rm {} \;
find /u01/app/oracle/diag/rdbms/dbname/instance_name/trace -name "*.gz" -mtime +3 -exec rm {} \;
find /u01/app/oracle/diag/tnslsnr/hostname/listener_dbname/alert -name ""log*xml"" -mtime +3 -exec rm {} \;
(or)
find . -name "*.aud" -mtime +7 -exec rm -f {} \;
find /u01/app/oracle/diag/rdbms/dbname/instance_name/cdmp* -mtime +1 -exec rm {} \;