LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-20-2009, 09:11 AM   #1
exboy
LQ Newbie
 
Registered: Apr 2009
Posts: 3

Rep: Reputation: 0
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.
 
Old 04-20-2009, 09:16 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,960

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by exboy View Post
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.
Hard to help, when you don't give details.

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.
 
Old 04-20-2009, 09:29 AM   #3
exboy
LQ Newbie
 
Registered: Apr 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
Hard to help, when you don't give details.

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.
thanks TB0ne, what i am trying to do is to use a linux bash script to automate the logminer utility:

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.
 
Old 04-20-2009, 09:35 AM   #4
exboy
LQ Newbie
 
Registered: Apr 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
Hard to help, when you don't give details.

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.
thanks TB0ne, what i am trying to do is to use a linux bash script to automate the logminer utility:

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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
archived gmail not downloading with mutt + imap fakie_flip Linux - Software 1 07-13-2008 10:26 PM
What are the best utilities to look through archived logs? abefroman Linux - Security 3 04-24-2008 08:31 AM
LXer: Debian GNU/Linux 3.0 archived LXer Syndicated Linux News 0 01-10-2007 11:21 PM
silly question, maybe, about archived files permissions sl4ckw4re Slackware 2 08-23-2006 10:28 AM
not able to include archived C library into my program gauravsahni Programming 4 11-15-2004 03:30 AM


All times are GMT -5. The time now is 05:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration