ba6.us - Dave's Database Related Stuff

  • home
  • blog
  • notebooks
  • projects
  • recent
  • about
  • manifesto
  • !
Home

Tag Cloud

apex Application Express Auditing data dbi development export funnies HTML Java linux monitoring oem oracle performance perl rman scripting sql SQL Developer sqlplus tuning unix windows
more tags

Search

RSS Feed

Blog Posts :

Navigation

  • Feed aggregator

User login

  • Request new password

perl

New Project: trc2sql.pl - Extract SQL from an Oracle Trace...

dmann — Fri, 10/14/2011 - 16:18

I started a new project for a utility I started writing. It has some basic functionality now but will probably increase in utility int he future.

It is a Perl script that extracts the SQL statements from an Oracle 10046 trace file. This is useful if you need to re-run SQL that was captured during a trace. It also helps reduce the amount of junk you have to slog through if you are interested in

trc2sql.pl - Extract SQL Statements From Oracle 10046 Trace File

-Dave

  • oracle
  • perl
  • sql
  • dmann's blog
  • Add new comment

trc2sql.pl - Extract SQL Statements From Oracle 10046 Trace File

dmann — Fri, 10/14/2011 - 16:00

Purpose:

This Perl script will extract the SQL Statements out of an Oracle 10046 Trace File.

Usage:

trc2sql.pl < input.trc > output.sql

Source Code

trc2sql.pl :
#!/usr/bin/perl

# David Mann
# ba6.us
# Extract SQL from an Oracle SQL Trace File (10046)
#
# Usage:
# Data is read from STDIN
# trc2sql.pl < input.trc > output.sql
#
# Change log:
# 13-OCT-2011 : Release

$InSQL = 0;
while (<>) {
  $MyLine = $_;
  $LineNum = $LineNum + 1;

  # If END OF STMT found, stop printing
 Read more »
  • perl
  • sql trace
  • 2 comments

Long Operations Real Time Viewer - Perl

dmann — Sat, 03/27/2010 - 23:50

Purpose

Monitor Long Operations inside an Oracle Database using Perl/DBI. This can be useful for monitoring Table Scans, Index Rebuilds, and Exports.

Source Code

http://ba6.us/CodeExamples/Perl-LongOps
  • monitoring
  • perl
  • Add new comment

DBI and mod_perl for Oracle 10g HTTP Server

dmann — Fri, 04/25/2008 - 22:36

Looks like Oracle has finally come around and made it easier to incorporate the DBI module into the Oracle HTTP Server. The 10gR2 HTTP Server Administrators guide also has a laundry list of other modules that are enabled by default or easily turned on. Here is the mod_perl section of the 10gR2 HTTP Server Admininistrators Guide: click here
Read more »
  • dbi
  • oracle
  • perl
  • dmann's blog
  • Add new comment

Installing Perl/DBI/DBD on Win32 just got a little simpler...

dmann — Mon, 01/14/2008 - 12:53

I just downloaded and installed the latest version of ActiveState Perl for Win32. After installation I started to hit the laundry list of post-install tasks and noticed that 1) there is a new graphical Perl Package Manager and 2) I couldn't install DBI and DBD-Oracle because they were already installed! No more looking for the old ESoftmatic drivers!
Read more »
  • perl
  • windows
  • dmann's blog
  • Add new comment

Perl has been Eclipsed...

dmann — Wed, 10/03/2007 - 22:49

I've been using TextPad for writing Perl programs forever. TextPad is a pretty lightweight editor with a lot of decent features. Its nice because you can set up a PL document class with a syntax file to enable highlighting whenever you edit a *.pl file.

But today I'm working on a more complicated script with multiple functions. My main requirement is that there be an outline view so I can quickly jump between functions. Read more »

  • development
  • perl
  • dmann's blog
  • Add new comment

Getting return value and output text with Perl...

dmann — Wed, 09/05/2007 - 14:51

I know using Perl backticks call I can execute an OS command and easily get the output. I know using Perl system() call I can execute an OS command and easily get the return value. Today I found out a way to get both. This example is on Windows, but if you are on Unix, substitute 'ls' for 'dir'.
#!/bin/perl

# Execute dir command
$command = `dir`;

# Show the output of the command
#split by newlines, put into @alloutput array
@alloutput = split /\n/, $command;  

#loop once for each item in @alloutput array
foreach $outputline (@alloutput) {   
 Read more »
  • perl
  • dmann's blog
  • Add new comment

Tim Bunce on the future of Perl DBI

dmann — Tue, 01/16/2007 - 13:54

PerlCast.COM has posted a interview with Tim Bunce available here.

Audio is here: http://www.perlcast.com/audio/Perlcast_Interview_038.mp3

– Dave

  • dbi
  • perl
  • dmann's blog
  • Add new comment

Like the v$session_longops progress bar in OEM? You'll love this…

dmann — Wed, 12/13/2006 - 16:31

One of the redeeming qualities of the Java Oracle Enterprise Manager client is the progress bar that comes up when you are viewing the long operations of a session. I wanted this functionality but didn’t want to wake up the big lug to get this info (it takes a long time to start up the OEM client and navigate to the screen to see the long operations progress bar).

So I decided to write a short script to emulate that functionality but take it one step further and show me info about _all_ the longops currently running on an instance. Read more »

  • monitoring
  • oracle
  • perl
  • dmann's blog
  • Add new comment

otop , a 'top' utility for Oracle

dmann — Wed, 12/13/2006 - 12:00

I recently discovered that someone else is publishing some Perl utilities to monitor Oracle!

I've been using Perl to get things done with Oracle for a while and have found it extremely helpful. The current environment that I work in has a mixture of OSes so sometimes its easier to install Perl and DBI everywhere and write a simple Perl Script than to try to do something in DOS Batch for one client and then do it again in a bash shell script for another.

Sean Hull published a video of his talk about otop, the PowerPoint slides, and the downloadable source on his company's site: Read more »

  • monitoring
  • oracle
  • perl
  • dmann's blog
  • Add new comment
Syndicate content


Cornify
  • home
  • blog
  • notebooks
  • projects
  • recent
  • about
  • manifesto
  • !

Content Copyright 2006-2010. Links are copyright of respective owners.