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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: identify CTAS from v$ tables

RE: identify CTAS from v$ tables

From: Baumgartel, Paul <paul.baumgartel_at_credit-suisse.com>
Date: Tue, 25 Apr 2006 12:54:39 -0400
Message-ID: <D97D1FAE0521BD44820B920EDAB3BBAC0BF9409B@ENYC11P32005.corpny.csfb.com>


And if you are on 9i and want the full text, you can query v$sql, which contains the full sql text in pieces:

select sql_text from v$sqltext t1, v$session t2 where t2.sid = &sid and t1.address = t2.sql_address order by t1.piece

Paul Baumgartel
CREDIT SUISSE
Information Technology
DBA & Admin - NY, KIGA 1
11 Madison Avenue
New York, NY 10010
USA
Phone 212.538.1143
paul.baumgartel_at_credit-suisse.com
www.credit-suisse.com

-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Christian Antognini Sent: Tuesday, April 25, 2006 12:48 PM
To: Joseph Amalraj
Cc: oracle-l_at_freelists.org
Subject: RE: identify CTAS from v$ tables

Joseph

>I need to know the sql being run by the session.

This is another question ;-) Then use the following query:

select sql_text from v$sql where command_type = 1

Be careful that SQL_TEXT is a VARCHAR2(1000). If the statement is longer you should use SQL_FULLTEXT which is a LOB (10g only).

HTH
Chris

--
http://www.freelists.org/webpage/oracle-l



==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================

--
http://www.freelists.org/webpage/oracle-l
Received on Tue Apr 25 2006 - 11:54:39 CDT

Original text of this message

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