CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: DBI:
Need help on how to use Perl DBI script to poll logs from oracle databases?


New User

Jul 27, 2010, 7:52 AM

Post #1 of 2 (6196 views)
Need help on how to use Perl DBI script to poll logs from oracle databases? Can't Post


Am not sure if this has anything to do with perl programming but would like to seek your advice.

I have 2 separate servers each with oracle database installed.I am trying to pull oracle logs from these 2 databases to my main linux server using perl DBI. On this linux server I have 1 script and 2 wrapper scripts that pass in parameters to

The scripts I've used are found here:

Here is the sample wrapper script that I've used to call script with different parameters for each databases used):

export ORACLE_HOME=/ora-main/app/oracle/product/
export ORACLE_SID=rmdev1
/usr/bin/ -dbtype=oracle -server=servername1 -dbport=1521 -d +b=development -user=myuser -xpassword=/etc/dbipasswd -table=dba_audit +_trail -columns="OS_PROCESS,OS_USERNAME,USERNAME,USERHOST,ACTION,ACTI +ON_NAME,TRANSACTIONID,SCN,SQL_BIND,SQL_TEXT,TO_CHAR(EXTENDED_TIMESTAM +P,'MM/DD/YYYY HH24:MI:SS'),EXTENDED_TIMESTAMP" -countfile="/app/oracl +e/product/monitor/countfile1" -countkey="EXTENDED_TIMESTAMP" -o="/opt +/oracledb1.log"

As you can see,the script should retrieve logs and write to oracledb1.log and update the countfile1 with the latest timestamp.The wrapper scripts are scheduled to run at 5mins interval.

The first wrapper script,which I've named as runs fine. I am able to retrieve events and both oracledb1.log and countfile1 are successfully updated.

However,the second wrapper script, is successful only for the first run. For subsequent runs,I've noticed that countfile2 does not get updated with the latest timestamp(ie. the file returns to blank) and oracledb2.log returns to blank as well. Therefore,am unable to pull new events then. Unable to determine what went wrong here..

Here is sample of my second wrapper script that tries to retrieve events from the 2nd database:

export ORACLE_HOME=/ora-main/app/oracle/product/
export ORACLE_SID=rmdev2
/usr/bin/ -dbtype=oracle -server=servername2 -dbport=1521 -d +b=development -user=myuser -xpassword=/etc/dbipasswd -table=dba_audit +_trail -columns="OS_PROCESS,OS_USERNAME,USERNAME,USERHOST,ACTION,ACTI +ON_NAME,TRANSACTIONID,SCN,SQL_BIND,SQL_TEXT,TO_CHAR(EXTENDED_TIMESTAM +P,'MM/DD/YYYY HH24:MI:SS'),EXTENDED_TIMESTAMP" -countfile="/app/oracl +e/product/monitor/countfile2" -countkey="EXTENDED_TIMESTAMP" -o="/opt +/oracledb2.log"

Is there anything wrong with it?Anyone can advice on the problem or has any solutions/workarounds to solve it? Thanks in advance.

Veteran / Moderator

Jul 27, 2010, 8:21 AM

Post #2 of 2 (6194 views)
Re: [remy06] Need help on how to use Perl DBI script to poll logs from oracle databases? [In reply to] Can't Post

Cross posted:


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives