grep next / previous few lines of key word

grep next / previous few lines of key word


This helped me in identifying the lines before the errors in alert log and trace files

Select lines after the Keywords

grep -A 5 "current SQL:" /database/diag/rdbms/ORCL/ORCL/trace/*.trc

Output was as below :-

/database/diag/rdbms/ORCL/ORCL/trace/ORCL_ora_10406.trc:  current SQL:
/database/diag/rdbms/ORCL/ORCL/trace/ORCL_ora_10406.trc-  UPDATE  CEE_SEES SET N_ENDING_STATUS = :1 , N_LAST_RETRY_DATE = :2 , N_COMPLETION_DATE = :3 , N_ERROR_CODE = :4 , N_ERROR_DETAIL = :5 , N_ERROR_ID = :6 , C_ERROR_MSG = :7  WHERE N_CAMPAIGN_ID = :8  AND C_TARGET = :9  AND N_SERVICE_INDEX = :10
/database/diag/rdbms/ORCL/ORCL/trace/ORCL_ora_10406.trc-
/database/diag/rdbms/ORCL/ORCL/trace/ORCL_ora_10406.trc------ End of information for the OTHER waiting sessions -----
/database/diag/rdbms/ORCL/ORCL/trace/ORCL_ora_10406.trc-
/database/diag/rdbms/ORCL/ORCL/trace/ORCL_ora_10406.trc-Information for THIS session:






No comments:

Post a Comment