archived logs
Hi all,
I need help on executing archived log files in the database, instead of inserting each of the logs in the execute statement below one by one is there a way i can include all the logs at once in one single statement in a linux shell script? EXECUTE DBMS_LOGMNR.ADD_LOGFILE(LOGFILENAME => '/u02/arch/1_50662_581101112.arc' ,OPTIONS => DBMS_LOGMNR.NEW); EXECUTE DBMS_LOGMNR.ADD_LOGFILE(LOGFILENAME => '/u02/arch/1_50706_581101112.arc' I need to mine over a thousand logs for a report and including them one by one is not feasible. What i want to achieve is automation of my archived logs to populate a table in my database called v$logmnr_contents. Kindly help out. Regards. |
Quote:
You need to provide samples of the logs you're trying to work with, and say something about the database, and what you're doing now. |
Quote:
1.which includes a statement to pick all the archived logs at once and then populate the v$logmnr_contents with it. I am using a oracle 10g database and below is what i have done so far and i am doing now. #!/bin/ksh echo " Type the STARTTIME(DD-MM-YYYY HH24:MI:SS): " read STARTTIME echo "Type User ENDTIME(DD-MM-YYYY HH24:MI:SS): " read ENDTIME echo $STARTTIME sqlplus "/as sysdba" << EOF EXECUTE DBMS_LOGMNR.ADD_LOGFILE(LOGFILENAME => '/u02/arch/1_50662_581101112.arc',OPTIONS => DBMS_LOGMNR.NEW); EXECUTE DBMS_LOGMNR.ADD_LOGFILE(LOGFILENAME => '/u02/arch/1_50706_581101112.arc'); EXECUTE DBMS_LOGMNR.START_LOGMNR(); set lines 100 set pages 10 col USERNAME format a10 col SQL_REDO format a10 col SQL_UNDO format a10 select username,sql_redo,sql_undo FROM v\$logmnr_contents; EXIT EOF 2. how do i pick over 1000 logs, since i can add them manually? 3. how do i loop the logs from v$archived_log to populate V$logmnr_content table? Kindly help out. |
Quote:
1.which includes a statement to pick all the archived logs at once and then populate the v$logmnr_contents with it. I am using a oracle 10g database and below is what i have done so far and i am doing now. #!/bin/ksh echo " Type the STARTTIME(DD-MM-YYYY HH24:MI:SS): " read STARTTIME echo "Type User ENDTIME(DD-MM-YYYY HH24:MI:SS): " read ENDTIME echo $STARTTIME sqlplus "/as sysdba" << EOF EXECUTE DBMS_LOGMNR.ADD_LOGFILE(LOGFILENAME => '/u02/arch/1_50662_581101112.arc',OPTIONS => DBMS_LOGMNR.NEW); EXECUTE DBMS_LOGMNR.ADD_LOGFILE(LOGFILENAME => '/u02/arch/1_50706_581101112.arc'); EXECUTE DBMS_LOGMNR.START_LOGMNR(); set lines 100 set pages 10 col USERNAME format a10 col SQL_REDO format a10 col SQL_UNDO format a10 select username,sql_redo,sql_undo FROM v\$logmnr_contents; EXIT EOF 2. how do i pick over 1000 logs, since i can add them manually? 3. how do i loop the logs from v$archived_log to populate V$logmnr_content table? Kindly help out. |
All times are GMT -5. The time now is 01:29 AM. |