Aug 27, 2015, 10:06 AM
Post #1 of 7
I need some help for a Perl code.
I have a logfile which I parse with perl line by line searching for ORA errors i .e. ORA-28000: , ORA-04063: etc
Say we have this in the logfile:
16:34:45: 16:34:45 SQL> begin pk_system_deploy_meta.upgrade_resource('MA_V_CCAR_DLY_BAL_POSN', TRUE); end;
16:34:45: 16:34:45 2 /
16:34:45: begin pk_system_deploy_meta.upgrade_resource('MA_V_CCAR_DLY_BAL_POSN', TRUE); end;
16:34:45: ERROR at line 1:
16:34:45: ORA-20001: ORA-20001: ^M
16:34:45: artos_ma CREATE OR REPLACE FORCE VIEW v_ccar_dly_bal_posn
16:34:45: dly_bal_posn.adjmt_id AS adjmt_id
16:34:45: , dly_bal_posn.adjmt_oprn_typ AS adjmt_oprn_typ
16:34:45: , dly_bal_posn.ati AS ati
16:34:45: , ^M
16:34:45: ORA-24344: success with compilation error^M
16:34:45: ORA-06512: at "ARTOS_PROC.PK_SYSTEM_DEPLOY_META", line 3297
16:34:45: ORA-06512: at "ARTOS_PROC.PK_SYSTEM_DEPLOY_META", line 3447
16:34:45: ORA-06512: at line 1
So my search will match first "ORA-20001: ORA-20001:"
and I will have line "16:34:45: ORA-20001: ORA-20001: ^M " in variable
SO I would like to get the failed file (MA_V_CCAR_DLY_BAL_POSN) assosiated with this error ORA-20001: ORA-20001:
I am thinking of going backwards from matched line until beggining of logfile searching for first regex match -for example upper case letters inside ()
Do you have any idea how this can be achieved?