1

I have an issue:

when i issue this function below ti gives me the following error:

select 'EXECUTE DBMS_LOGMNR.ADD_LOGFILE(LOGFILENAME =>'''||name||'''||,OPTIONS=>DBMS_LOGMNR.NEW);'
 from v\$archived_log 
where name is not null;

select 'EXECUTE DBMS_LOGMNR.ADD_LOGFILE(LOGFILENAME =>'''||name||'''||,OPTIONS=>DBMS_LOGMNR.ADDFILE);' 
 from v\$archived_log 
where name is not null;


EXECUTE DBMS_LOGMNR.START_LOGMNR( STARTTIME => SYSDATE - 1, ENDTIME => SYSDATE,
OPTIONS => DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG + DBMS_LOGMNR.CONTINUOUS_MINE +
DBMS_LOGMNR.COMMITTED_DATA_ONLY + DBMS_LOGMNR.PRINT_PRETTY_SQL);

Error:

*
ERROR at line 1:
ORA-01291: missing logfile
ORA-06512: at "SYS.DBMS_LOGMNR", line 58
ORA-06512: at line 1

But i have added all the archived logs for several days before and my sysdate is at today.

Kindly help out on this issue.

thanks.

Reagrds

Ayo

OMG Ponies
  • 325,700
  • 82
  • 523
  • 502
  • You performed an DBMS_LOGMNR.ADD_LOGFILE(xxxxx) right before this call? Can you edit to show that as well? – curtisk Apr 23 '09 at 17:14

2 Answers2

1

You need to take the values from the first two queries and actually execute them, and you seem to have a syntax error in there anyway.

BEGIN
  FOR CUR_NEW IN ( 
    select 'CALL DBMS_LOGMNR.ADD_LOGFILE(' ||
           'LOGFILENAME =>'''||name||''','||
           'OPTIONS=>DBMS_LOGMNR.NEW);' as COMM
    from v$archived_log 
    where name is not null
  ) LOOP
    EXECUTE IMMEDIATE CUR_NEW.COMM;
  END LOOP;

  FOR CUR_ADD IN ( 
    select 'CALL DBMS_LOGMNR.ADD_LOGFILE(' ||
           'LOGFILENAME =>'''||name||''','||
           'OPTIONS=>DBMS_LOGMNR.ADDFILE);' as COMM
    from v$archived_log 
    where name is not null
  ) LOOP
    EXECUTE IMMEDIATE CUR_ADD.COMM;
  END LOOP;

  EXECUTE IMMEDIATE 'CALL DBMS_LOGMNR.START_LOGMNR( ' ||
    'STARTTIME => SYSDATE - 1, ' ||
    'ENDTIME => SYSDATE, ' ||
    'OPTIONS => ' ||
      '  DBMS_LOGMNR.DICT_FROM_ONLINE_CATALOG '||
      '+ DBMS_LOGMNR.CONTINUOUS_MINE '||
      '+ DBMS_LOGMNR.COMMITTED_DATA_ONLY '||
      '+ DBMS_LOGMNR.PRINT_PRETTY_SQL)';
END;
Adam Hawkes
  • 7,218
  • 30
  • 57
0

It seem like if you ran the select but no execute the sentences.

FerranB
  • 35,683
  • 18
  • 66
  • 85
  • Thanks for you reply, but what do you mean?, should i use the execute command only and remove the select . Kindly explain. regards –  Apr 24 '09 at 08:26