Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Monitoring the contents of SQL statements

Re: Monitoring the contents of SQL statements

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: 2000/05/17
Message-ID: <8ftooh$o5s$1@soap.pipex.net>#1/1

there are a number of third party tools you can get hold of (TOAD seems the most recommended).

We use an in house application to monitor sql by connection. The relevant code (j++) is reproduced below and contains the sql statement I think you might be looking for. Also Oracle Performance pack for ent manager gives some tools as well

 public void refresh ()
 {
  Statement statement;
  ResultSet resultSet;

  try
  {
   statement = connection.createStatement();

   resultSet = statement.executeQuery
   (
"SELECT sql_text " +
"FROM v$sqltext t,v$session s " +
"WHERE t.address = s.sql_address " +
"AND s.sid = " + sid + " " +
"ORDER BY piece"

   );

   String s = "";
   StringBuffer b = null;
   int j;

   while (resultSet.next ())
   {
    b = new StringBuffer(resultSet.getString(1));     for (j = 0;j < b.length();j++)
    {

     switch (b.charAt(j))
     {
      case '\r' :
      case '\n' :
       b.setCharAt(j,' ');
      break;
     }

    }
 s = s + b;
   }

   edit1.setText (s);
   sqlText = s;

   statement.close ();
  }
  catch (SQLException e)
  {
   MessageBox.show (e.getMessage (),"SQL Error 3.1");   }
 }

--
Niall Litchfield
Oracle DBA
Audit Commission UK
"Tom Lewis" <telewis_at_my-deja.com> wrote in message
news:8fp2t0$a60$1_at_nnrp1.deja.com...
> I'm trying to monitor the contents of SQL statements issued by an
> application (mainly selects and inserts).  I've tryed to monitor
> V$SQLAREA but its rather messy.  Any better ways to do this?
>
> --
> Tom Lewis
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Wed May 17 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US