Query to return all SQL statements ran for a particular user.

Good Morning,
Is it possible to find all the SQL statements run for a particular user using the v$ views? I can do it it 10g however I am currently using 9i and the query below does not work.
select a.username,a.logon_time,b.sql_fulltext
from v$session a,v$sqlarea b
where a.sql_id=b.sql_id
and a.username='USER'
order by a.logon_time descI assume some columns in these views do not exist in 9i. The release of 9 I am using is 9.2.0.1.0.
You help is much appreciated.
Thanks,
Mark.

Dear Mark!
I suggest you to use auditing instead of v$sqlarea. Oracle Onlinedocumentation says the following about v$sqlarea:
>
V$SQLAREA lists statistics on shared SQL area and contains one row per SQL string. It provides statistics on SQL statements that are in memory, parsed, and ready for execution.
>
That means that you'll get only those SQL-Statements that are currently in memory. Older statements which are already deleted from memory are not visible for your query.
By the way if you simply want to know what is wrong with your query then please post your errormessage.
Yours sincerely
Florian W.
Edited by: Florian W. on 29.07.2009 12:03

Similar Messages

  • SQL query  which return all the NET SERVICES which are avaiable in tnsname

    hi all
    how to write a sql query which return all the net services which are avaiable in tnsname.ora
    Regards
    s

    Also, tnsnames.ora is stored on the client, and not necessarily on the server; it's possible (and quite likely) that the name I use for a database in my tnsnames.ora could be different from the name you use for the same database; conversely we might use the same name for two different databases.
    Regards Nigel

  • SQl query to remove all dbms_output statement

    Hi
    Can u please tell me Single SQl query to remove all dbms_output statement from package and procedure
    Umesh

    >
    Can u please tell me Single SQl query to remove all
    dbms_output statement from package and procedure
    If you are comfortable with scripting languages like Perl, Python, Ruby etc., then removing lines having the dbms_output statements from your files should be a trivial matter.
    pratz

  • Apex 4.0 display image item :BLOB column returned by SQL statement

    Hello
    I'm creating an display image item in apex 4.0. The source is a BLOB column returned by SQL statement.
    When I'm issuing an sql statement like this:
       select lado.blob_content
       from   large_documents      lado
       ,        large_doc_headers    ladh
       where lado.ladh_nr = ladh.nr
       more criteriait works fine.
    When I create a function inside a package with the same query (in a cursor)
    function get_image(some parameters in) return blob
    Following in apex by:
    select get_image(some parameters) from dualI get a
    ORA-06502: PL/SQL: numeric or value error: character string buffer too smallAnybody any idea why this does not work?
    Regards Erik

    Hi Eric,
    the environment assumes varchar2-output by default, which will be limited to 32767 characters and may have problems with binary formats. You could define a blob-variable to select the value into.
    DECLARE
      l_blob BLOB;
    BEGIN
      SELECT get_image(some parameters)
        INTO l_blob
        FROM dual;
    END;
    /If you expect the BLOB-Content to be text (you should consider CLOB then), you may use UTL_RAW.CAST_TO_VARCHAR2 to convert the content. If your object is larger than the maximum varchar2 size, or you want to convert BLOB to CLOB, you might be interested in some converter like described here: {message:id=559749}
    Hope this is what you were searching for.
    -Udo

  • Capture all sql statements within an hour period

    Hi there,
    Is it possible to capture all the all sql statement? When I query the v$sql view I still missed few statements. Basically I want to statements from our in house applications.
    Thanks

    Thanks for the reply.
    It really doesn't help. I have a datatbase with three schemas and the number on connections in the v$session are 55. The SID and SERIAL# constantly changed.
    I've tried the sql_trace_in_session but the sid the changed every time I query. Also I tried set sql_trace to "true" but I have open the trace files to determine the schema.
    Is there a way capture a specific schema only?
    Thanks

  • Capture all SQL statements and archive to file in real time

    Want to Capture all SQL statements and archive to file in real time?
    Oracle Session Manager is the tool just you need.
    Get it at http://www.wangz.net
    This tools monitor how connected sessions use database instance resources in real time. You can obtain an overview of session activity sorted by a statistic of your choosing. For any given session, you can then drill down for more detail. You can further customize the information you display by specifying manual or automatic data refresh, the rate of automatic refresh.
    In addition to these useful monitoring capabilities, OSM allows you to send LAN pop-up message to users of Oracle sessions.
    Features:
    --Capture all SQL statement text and archive to files in real time
    --Pinpoints problematic database sessions and displays detailed performance and resource consumption data.
    --Dynamically list sessions holding locks and other sessions who are waiting for.
    --Support to kill several selected sessions
    --Send LAN pop-up message to users of Oracle sessions
    --Gives hit/miss ratio for library cache,dictionary cache and buffer cache periodically,helps to tune memory
    --Export necessary data into file
    --Modify the dynamic system parameters on the fly
    --Syntax highlight for SQL statements
    --An overview of your current connected instance informaiton,such as Version, SGA,License,etc
    --Find out object according to File Id and Block Id
    Gudu Software
    http://www.wangz.net

    AnkitV wrote:
    Hi All
    I have 3 statements and I am writing some thing to a file using UTL_FILE.PUT_LINE after each statement is over. Each statement takes mentioned time to complete.
    I am opening file in append mode.
    statement1 (takes 2 mins)
    UTL_FILE.PUT_LINE
    statement2 (takes 5 mins)
    UTL_FILE.PUT_LINE
    statement3 (takes 10 mins)
    UTL_FILE.PUT_LINE
    I noticed that I am able to see contents written by UTL_FILE.PUT_LINE only after statement3 is over, not IMMEDIATELY after statement1 and statement2 are done ?
    Can anybody tell me if this is correct behavior or am I missing something here ?Calling procedure must terminate before data is actually written to the file.
    It is expected & correct behavior.

  • How to see all sql statements on sql commands under history link

    Hi All,
    How to see the all the sql history on sql commands tab.
    I want see all sql statements.
    Where to set if we need to store more sql statments in history.
    We are using Apex3.2 and 10g database(EE).
    Thanks,
    Nr

    I just checked the source code of the SQL commands history region and that report fetches a maximum of 1000 records. I don't know if you change the setting somewhere in the builder, but seeing the code it looks as though 1000 is hard-coded in the report definition(apex 4.0).
    If you need to see all the command history,you can query the original table: APEX_040000.WWV_FLOW_SW_SQL_CMDS
    Note that is an internal table used by apex and hence you might not find any documentation about it(google got me one valid hit: Identifying Inactive Workspaces which seem to confirm the table's use).
    Anyway, here's what you need to do, ask your dba to grant your workspace user select access on this table
    Connect as dba user and run
    GRANT SELECT ON APEX_040000.wwv_flow_sw_sql_cmds to '<WORKSPACE SCHEMA>'Now you can run the following command from your workspace to see the entire command history using
    select * from APEX_040000.WWV_FLOW_SW_SQL_CMDS where parsed_schema = '<WORKSPACE SCHEMA>';You might want to revoke the grant once you have seen the data/taken out an export due to security issues.

  • See all SQL statements that have been executed in an active transaction?

    When I query v$transaction, v$session and v$sql, all I can see is the SQL statement that is currently running in an active transaction.
    How can I view all SQL statements that have been executed in a currently running transaction since that transaction began?

    Dana N wrote:
    When I query v$transaction, v$session and v$sql, all I can see is the SQL statement that is currently running in an active transaction.
    How can I view all SQL statements that have been executed in a currently running transaction since that transaction began?In the general case: impossible.
    In some special cases you can use v$sql, v$open_cursor, or "Availabilty>View and Manage Transactions" or something else.
    But be aware, transaction could be started long time ago, all cursor could be flushed from shared pool and closed, and redo (the page from Grid Control bring Log Miner) may not always be available.

  • Trace all sql statements

    Hi,
    Is it possible to trace all the SQL's into one trace file or any other alternative to capture all the SQL statements.

    1. Export will take some time or a long time to run.
    You will have to either
    a. Use CONSISTENT=Y (and hope that you are able to get a consistent export)
    b. Stop Transactions for the duration.
    In option a. if you do allow transactions those transactions will appear neither in the Export NOR in the "trace file" that you will be generating later !! You WILL lose transactions.
    2. There's no way to get a "trace file" to capture all SQL statements and bind values across multiple database sessions such that they are properly synchronised in time.
    a. You can't get a trace file that you can simply run to reapply transactions.
    b. You can't sequence transactions from multiple sessions running concurrently.
    3. How fast do you REALLY think you will be able to apply that "trace file" (which, in any case, you CANNOT generate) ? It will take noticeable to considerable time.
    4. How do you propose to transfer the Export dump to the remote location ? When you have no network connectivity ? Via tapes, transfered by courier ? Then why can't you transfer a Database Hot Backup and ArchiveLogs via tapes, transferred by courier ?
    Hemant K Chitale
    http://hemantoracledba.blogspot.com

  • All SQL statements in a session

    Hi OTN,
    It's possible to get all SQL statements executed in a session?
    In V$SESSION and V$ACTIVE_SESSION_HISTORY are only the current and pre current statements.
    -JSG

    Hi, you can enable the sql trace to a especific session with dbms_trace and get all sql statements, if you need more information review the Note:104239.1 into Metalink site.
    Luck.
    Have a good day.
    Regards.

  • How to see all sql statements passed to the db?

    Is it possible to configure Jdevloper (11.1.1.4) in way so that it shows all sql statements in the console?
    thx in advance

    Hi,
    under your ViewController-Project Properties you'll find the Run Configurations. Under Java Options enter the following statement:
    -Djbo.debugoutput=console
    Marc

  • Query to return week no. 1 for 01-04-1999.

    Dear Oracle users,
    I want suggestions for the query, which returns week no. 1 for
    starting Fiscal Year( 1-04-1999 ) and week no. 52 for the last
    day of the Fiscal Year. ( 31-03-2000 ). Oracle has format mask
    "WW" in Date Format Model, but it returns week no. 1 for
    starting calender year ( 1-01-1999 ).
    Thanks
    Nishit
    null

    Nishit Turakhia (guest) wrote:
    : Dear Oracle users,
    : I want suggestions for the query, which returns week no. 1 for
    : starting Fiscal Year( 1-04-1999 ) and week no. 52 for the last
    : day of the Fiscal Year. ( 31-03-2000 ). Oracle has format mask
    : "WW" in Date Format Model, but it returns week no. 1 for
    : starting calender year ( 1-01-1999 ).
    : Thanks
    : Nishit
    =================================================
    Hi Nishit,
    If you require only this logic in the particular
    program then use decode function ,in oracle financial apps
    you can set up your fiscal year any date.
    Bye
    Debasis
    null

  • How to get all the approver list for a particular transaction in iExpense

    Is there any API to get all the approver list for a particular transaction in iExpense workflow after submitting an expense report?

    Hi All,
    Could anyone please let me know API to get all AME approvers in one go.
    I am currently using below API to get approver list.
    ame_api.getallapprovers (applicationidin => 201 , -- PO
    transactionidin => l_document_id , -- req header id
    transactiontypein => 'PURCHASE_REQ'
    ,approversout => l_appr_list
    But if any of the approver is INACTIVE then API is going into exception and not showing all approvers. Requirement is like to show all approvers with their statuses (ACTIVE / INACTIVE).
    Reply ASAP.

  • Search for a particular user

    I have configured LDAP authentication and mapped few LDAP user groups to BOXI. When an user group is added all the user will also be mapped to BOXI. For the users mapped the distinguished name is added as one of the alias.
    The requirement is to search for a particular user in the BOXI using the distinguished name(DN), hence need to query on the alias name or ID. I tried the query something like but didn't worked.
    SELECT * FROM CI_SYSTEMOBJECTS WHERE SI_KIND='User' AND SI_ALIASES.1.SI_NAME like '%DISTINGUISHED_NAME%'
    IF the DN is like cn=userName,ou=users,ou=group1, dc=myorg, dc=com and the query is written as it works.
    SELECT * FROM CI_SYSTEMOBJECTS WHERE SI_KIND='User' AND SI_ALIASES like '%userName%'
    Could you help in writing a query on the user alias.
    Thanks in advance.

    Here is yours for all posts, sorted chronologically from oldest to newest in descending order and showing 100 entries per page...
    http://forums.sdn.sap.com/search.jspa?userID=3743484&rankBy=1&threadID=&q=&objID=&dateRange=all&numResults=100
    You can play around with the available parameters a bit to tune it further.
    Cheers,
    Julius

  • Unable to see a column of a table in portal for a particular User

    Hi,
    A particular user is unable to see a particular column of a table in the portal . The application is developed in Webdynpro ABAP. The table contains two columns. Both the columns contain text type fields. What appears to the user is that the left column has disappeared and the right hand column has shifted to the left.
    This is occuring for a particular user only. We have checked in our development and quality systems but we are unable to replicate the issue. Please help.
    Thanks and regards,
    Satya.

    Hi Vikas.
    You can use BAPI in LSMW to craete Material or You can use direct input method. Both methods as follows below:
    Using BAPI in LSMW:
    First maintain IDOC Inbound Processing steps by giving PORT and Partner Type and Partner Numberby clicking 'settings' icon in menu path in LSMW Screen.
    Adn then execute LSMW and maintain the values as below in the first step.
    BusinessObject Method(BAPI)
    Business Object       BUS1001006                      Standard material
    Method                     SAVEDATA                        Create and change materia
    Message Type         MATMAS_BAPI                   Create and change materia
    Basic Type               MATMAS_BAPI03               Create and Change Materia.
    For the selecting of views, you can maintain fields for all views(From Basic view to costing view) in your excel and populate with 'X' in respective fields for activating views.
    In the 6th step (Maintain field mapping and conversion rules). you can map those fields for views which you want to activate since we have all views are in the standard structure.
    Using Direct Input Method:
    Standard Batch/Direct Input
    Object                      0020                                             Material master
    Method                     0000
    Program Name          RMDATIND
    Program Type           D                                                  Direct Input
    For the selecting of views, you can maintain fields for all views(From Basic view to costing view) in your excel and populate with 'X' in respective fields for activating views.
    In the 6th step (Maintain field mapping and conversion rules). you can map those fields for views which you want to activate since we have all views are in the standard structure.

Maybe you are looking for

  • Error while updating pricing item

    Hi All, I have an issue to ask, the problem is this issue not happen every time, and sometimes it can solved it self. We are using SRM 5.0 SRM_SERVER     550     0008     SAPKIBKT08     SRM_SERVER SAP_AP                  700     0008    SAPKNA700    

  • Cfquery insert error

    I am trying to use the attached code to insert records into a table. BUT, it gives me the following error: Error Executing Database Query. [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error (missing

  • CSS Questions :: Renaming Class Styles & Replacing Styles Globally

    1) Renaming Class Styles I have a large website that I redesigned over a year ago and now manage. I've been doing some housekeeping and attempting to rename some of the class styles I've applied to different parts of each page. Problem: When I change

  • Solaris Cluster Server Homogeneous System Copy

    Hi, We have SAP ECC 6.0 on Solaris Sparc server. Our database is Oracle 10.2.0.2. We will buy 2 new solaris server and we want to use these server as cluster. We want to make homogeneous system copy from current server to new cluster server. How can

  • Track Menu Selection on UCCX Script

    Dear NetPro gurus, I have a working script where on a Menu prompt, my client just wants to track how many PSTN caller has press the keypad 1 on the Menu. Is there any way i can achieve this?? Cheers, Hunt