Where to find the SQL text in v$ views?

Hi All,
Oracle 11.2.0.3 on RedHat.
I am trying to find out SQL activity on my database for a very narrow time window. Please see the SQLs I did
SQL> select distinct user_id, sql_id
  2  from v$active_session_history
  3  where sample_time between to_date('20120704012000','yyyymmddhh24miss') and
  4            to_date('20120704012200','yyyymmddhh24miss')
  5  and user_id = 111 ;
   USER_ID SQL_ID
       111
       111 gjg25k7stx9ba
       111 a8m049aj31b1y
       111 asjw7b7h99w4m
       111 fvffk1aqrb55n
       111 9gskv9b1u7mau
       111 03tsb9pp3h1uj
       111 dm0jppss5z0ay
       111 44n0svyuc000x
       111 16t1tpr7mdqnf
       111 bzpu510tng689
       111 dsqzhqdvzamys
12 rows selected.
SQL> select * from v$sqltext where sql_id='16t1tpr7mdqnf' order by piece ;
no rows selected
SQL> select * from table( dbms_xplan.display_awr('16t1tpr7mdqnf') ) ;
no rows selectedI can see the text for all SQLs in v$sqltext, except 16t1tpr7mdqnf. User id 111 is the user used to run our batch processes.
Where can I find the text for this SQL id 16t1tpr7mdqnf ?
This SQL has run about 8 hours ago.
Thanks in advance

When you say, ASH captures active sessions, does that mean, it only captures "session" information, which may not include details about SQL ?Exactly, it's a snapshot of session level information for active sessions.
So, session X can be executing sql statement abc123 and be captured by ASH which takes a snapshot of all active sessions every 1 second in V$ACTIVE_SESSION_HISTORY.
1 in 10 of these active sessions is stored in the repository - DBA_HIST_ACTIVE_SESS_HISTORY (in practice, this 1 in 10 sample is literally as simple as store the active sessions from every 10th second).
Independently of this, obviously you have the shared pool and V$SQL. If your statements are in here then great.
Otherwise you have AWR which captures the top N sql from each interval.
So, as mentioned, perfectly normal to have references to sql ids and sql plan hash values captured in ASH but not AWR.
One interesting thing here is, sql_exec_id is blank. What does that say? It depends.
It's likely to be one of two things:
1. some sort of bug or limitation - there are certain operations and time limits were some of the ASH values get cleared out or don't get cleared out.
2. occasionally I've seen the ASH information be misleading when it comes to certain recursive operations - one specific example I can think of related to the recursive merge of sql plan baseline metric tracking operations.

Similar Messages

  • Where to find the SQL log by crystal reports

    i want to watch the sql log by crystal report loading,but i don't know how to find it , somebody knows it? thanks advanced!

    Hi Wang,
    If you mean to look at the SQL query CR generates, then open the report in the CR Designer > Go to the Database option on the top > Click Show SQL.
    -Abhilash

  • Where can I find the appropriate text string for China Time zone?

    Hi,
    Where can I find the appropriate text string for China Time zone?

    Hi,
    The following timezone strings are supported in Oracle8i 8.1.7:
    AST, ADT: Atlantic Standard or Daylight Time
    BST, BDT: Bering Standard or Daylight Time
    CST, CDT: Central Standard or Daylight Time
    EST, EDT: Eastern Standard or Daylight Time
    GMT: Greenwich Mean Time
    HST, HDT: Alaska-Hawaii Standard Time or Daylight Time.
    MST, MDT: Mountain Standard or Daylight Time
    NST: Newfoundland Standard Time
    PST, PDT: Pacific Standard or Daylight Time
    YST, YDT: Yukon Standard or Daylight Time
    Since your's isn't one of these, I'm hoping this is in reference to the Web Agent's ORDWEBUTL package, in which case, you can use an offset from GMT instead. For example, here in New Hampshire, USA, we are 5 hours behind GMT, so the offset would be -5, while in France, it would be +1 as they are one hour in front of GMT. According to my Windows clock, Beijing is GMT +8. Of course, you'll have to figure daylight-savings time into the equation, if you have to deal with such changes.
    Regards,
    Simon
    null

  • Where to find the user groups in SQL Server

    Hello All,
    where to find the user groups created in Shared Services in SQL Server tables?

    Yes thats correct its stored in Openldap
    Native Directory (OpenLDAP), an open source Lightweight Directory Access Protocol (LDAP)-enabled user directory, is bundled and configured with Shared Services.
    Native Directory functions:
    **Used to maintain and manage the default Shared Services user accounts required by Hyperion products*
    **Is the central storage for all Hyperion provisioning information because it stores the relationships between users, groups, and roles.*
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Where to download the SQL Server 2000 plug-in for Migration Workbench

    Dear All,
    I am new to Migration WorkBench, I want to migrate the SQL Server 2000 database to Oracle 9i. When i start the Migration WorkBench, it requires me to select the plug-in (SQL Server) for the migration source. Before i have download and install the Access plug-in for testing. Can anybody tell me where i can find the SQL Server 2000 Plug-in for migration workbench.
    thx.
    Alan,

    here on OTN; on the same page like all the other plugins:
    http://otn.oracle.com/software/tech/migration/workbench/htdocs/utilsoft.html

  • In which tables can I find the sd texts in the material register?

    Hi,
    In which tables can I find the sd texts in the material register?  
    Thanks.

    Hi,
    The texts are stored in tables STXH , STXL etc. But it is not possible to fetch the details directly from the tables. You have to use the function module READ_TEXT where you have pass the parameters  Text ID, Language, object as material number etc to fetch the text.
    You can take the help of an ABAPer to create a program for this.

  • Where to see the SQL statement that CMP Entity bean excuted?

    hi, I'm wondering where I can find the SQL that a CMP entity bean executed in a transaction?
    thank you!

    You can do it in many ways. If you are using eclipse then using eclipse
    plugins for weblogic you van do it. I have heard that in weblogic workshop
    also you can do it. If the above do doesn;t solves your problem then check
    this out.
    http://www.p6spy.com/documentation/install.htm
    Hope that helps.
    <Xin Zhuang> wrote in message news:[email protected]..
    hi, I'm wondering where I can find the SQL that a CMP entity bean executed
    in a transaction?
    thank you!

  • How to find the SQL Server Instances running across the given activer directory domain?

    How to find the SQL Server Instances running across the given activer directory domain?
    I have though of OSQL -L , Microsoft Assessment and Planning ( MAP ) tool and SQLPing3 (SQLSecurity) might help me.
    I would appreciate if there any other way of finding the SQL Servers / Instances running across the given active directory domain.
    Sivaprasad S
    http://sivasql.blogspot.com
    Please click the Mark as Answer button if a post solves your problem!

    Dear ,
    Very simple u find all instances through the customized sp which is get all details about inventory. Like i put the sp bellow. This is without any tool. 
    USE [master]
    GO
    /****** Object:  StoredProcedure [dbo].[DBStatus]    Script Date: 08-01-2015 19:46:11 By Damodar Patle Sr. DBA Mumbai India ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[DBStatus] 
    AS
    SELECT 
    SERVERPROPERTY('servername') AS ServerName,
    ConnectionProperty('local_net_address') AS 'local_net_address',
    ConnectionProperty('local_tcp_port') AS 'local_tcp_port',
    CONVERT(VARCHAR(25), @@VERSION) as  VERSIONSQL,
    SERVERPROPERTY('ErrorLogFileName') AS ErrorLogFilePath,
    database_id,
    CONVERT(VARCHAR(25), DB.name) AS DBName,
    CONVERT(VARCHAR(10), DATABASEPROPERTYEX(name, 'status')) AS [Status],
    CONVERT(VARCHAR(10), DATABASEPROPERTYEX(name, 'Recovery')) AS [Recovery_Model],
    create_date as DBCreate_Date, --physical_device_name,
     (SELECT COUNT(1) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'rows') AS DataFiles,
     (SELECT SUM((size*8)/1024) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'rows') AS [Data MB],
     (SELECT COUNT(1) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'log') AS LogFiles,
     (SELECT SUM((size*8)/1024) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'log') AS [Log MB],
     (SELECT physical_name FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'rows') AS MDF_File_Location,
     (SELECT physical_name FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'log') AS  LDF_File_Location,
       user_access_desc
       FROM sys.databases DB
       ORDER BY dbName, [Log MB] DESC, NAME

  • Can you please tell me where i find the spellchecker

    == Issue
    ==
    I have another kind of problem with Firefox
    == Description
    ==
    can you please tell me where i find the spellchecker...............if not on here already how do i download it.
    == Firefox version
    ==
    3.6.6
    == Operating system
    ==
    Windows Vista
    == User Agent
    ==
    Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 ( .NET CLR 3.5.30729)
    == Plugins installed
    ==
    *-Default Plug-in
    *Shockwave Flash 10.1 r53
    *Windows Presentation Foundation (WPF) plug-in for Mozilla browsers
    *Google Update

    Dee,
    See [[Using the spell checker]] and make sure you have spellchecking enabled and a dictionary is installed.
    From the [[Options window - Advanced panel]] article:
    * '''Check my spelling as I type''': When this preference is enabled, Firefox will check your spelling and offer possible corrections as you type in web forms. Note that you may need to download a dictionary; to do so, right-click on any text field, enable spellchecking if necessary, and then use the provided Languages menu to download a dictionary.

  • History of the sql text by session

    Hi all,
    My manager want to have if possible the history of the sql text for each session runned in our database to trace some user activities. Does someone know where and how to retrieve that information. And i want also those information daily and report to my manager what should i do.
    Thanks for the help
    raitsarevo.

    V$SQL and V$SQL_TEXT can get you the SQL that has been executed.
    Getting it by session after the fact is where you will run into issues.
    Auditing is the only way to really get what your manager wants.

  • I cannot send email over 3G. Receiving email is ok. Using wifi from my landfibre allows me to send email. No idea where to find the solution. Suggestions please. Thanks ia

    I cannot send email over 3G. receiving email over 3G is ok. Using wifi from my landline (glass) is ok. No idea where to find the solution. Suggestions please. Thanks i.a.
    TheOne

    You need a DATA service enabled by your carrier to be able to send e-mail via thier network.  Do you have a data plan with your carrier ?  If so - is it enabled ?
    Can you access internet thru your network (not wifi) ?

  • HT200285 I want to change my wallpaper to an image that was available before I upgraded to IOS 8.1.3 - a close-up image of long reedy  grasses with hazy light in the background. Greyish hues. Where can find the image & how do I get it back on my phone?

    I want to change my wallpaper to an image that was available
    before I upgraded to IOS 8.1.3 - a close-up image of long reedy  grasses with hazy light in the background.
    Greyish hues. Where can find the image & how do I get it back on my phone?

    I want to change my wallpaper to an image that was available
    before I upgraded to IOS 8.1.3 - a close-up image of long reedy  grasses with hazy light in the background.
    Greyish hues. Where can find the image & how do I get it back on my phone?

  • Hey guys, do you know where to find the Equalizer in the new updated iTunes?

    Hey guys, do you know where to find the Equalizer in the new updated iTunes? THANKS

    Hi
    When I got this new PC I did a complete audit. I found that this was kenotify.exe at startup.
    Different info I found on the internet say it is essential to the functioning of FN.
    I also noticed that when I press the FN apuie it generates no code. I have a small java script code returns me all the keys pressed on the keyboard.
    I am surprised that the FN will work for you while you do not have this executable.

  • Where to find the OC4J-ready Pet Store Demo file jps112.zip

    where to find the OC4J-ready Pet Store Demo file jps112.zip in OTN
    So that we may better diagnose DOWNLOAD problems, please provide the following information.
    - Server name
    - Filename
    - Date/Time
    - Browser + Version
    - O/S + Version
    - Error Msg

    You have to execute the installer jar file.
    This will create a folder with all the source codes inside.
    I wasn't aware of any need for cvs.

  • Where to find the downloadpack, I have purchased the licensekey

    Where to find the downloadpage for Lion

    Open the Mac App Store, go to its homepage, and choose Redeem under Quick Links.
    (118317)

Maybe you are looking for

  • Letter of credit release with VXA3

    Hello,   I have this scenario: - Created a Letter of Credit with 100.000 EUR of amount; - Assigned the letter of Credit to a Sales Order of 250.000 EUR of amount --> the Sales Order is blocked from credit control because the value of the Financial Do

  • Cash Book Report

    Hi Guys, I am Looking for a Cash Book Report from sap b1. I have tried using the General Ledger Report  but i need it as Column wise. and i have searched for ' 'XL-CashBook.ixr' but i didnt find this file. If i have 3 Accounts i need it to display it

  • Force Reporting Services 2012 use https

    I have recently set up a new instance of SQL Server Reporting Services. I have it running and am in the testing phase of the deploy. I have set it up to use SSL and basic Authentication. This all works. The report writer has been able to deploy repor

  • Dynamic modifcation rule / Skip

    Hi It is hard for me to understand the rule and the skip procedure . Can any explain me please with and without skip( Settings ) Stage Change Defined for Inspection Stage No of inspections New stage Max skip duration Rejection New inspection Thanks J

  • Smart Data Access

    Hi All, I have one BW on HANA system rev 80.. I learnt that SDA is out of box funtionality. so if i need to get data from other BW system netweaver 7.01.. Can i get data from that system ( Cube ) and build my query. Also if someone has any guide on h