View source of all sql which oracle executed

Dear Experts,
I want to see which action (Select, insert, update, delete) user requested oracle for executing. For example
When a user execute "Select * from dual". As a DBA, I want to see this source SQL. can you tell me the way to get this informatioin?
Thank you and best regards
- Tu

First get the session id of the user from[b] v$session.
Then u can use v$sql,v$sqltext or v$sqlarea for to see all the sql executed in that instance.
Regards,
Sanju

Similar Messages

  • Detemine ALL sql queries being executed by a session

    Hi All,
    I want to find out ALL SQL queries being executed by a session on the DB. I have thought of enabling the SQL Trace for that session, then create my trace file for the session in the udump area and then check that trace file to view all the SQL's being executed in that session till the time i set my trace to FALSE.
    Would enabling the trace for that session suffice for capturing each and every SQL fired in that session? Or do i need to check anything else?
    Thanks in advance.

    hi,
    select sql_text
      from   v$session, v$sqltext
      where v$session.sql_address = v$sqltext.address
      and   V$session.sql_hash_value = v$sqltext.hash_value
      and  sid = &sid
    order by piece
    /thanks,
    baskar.l

  • Tablespace size report for SQL and oracle servers

     
       Hi All
      is it possible to get tablespace size for all sql and oracle server in the form of report in SCOM.
      Regards
      Madhavi

    Oracle: Table size report of Oracle is depend on the MP which yu imported into SCOM
    SQL :
    1) Create a group which contains folowing dynamic rule
    2) Reporting workspace --> Microsoft Gneric Report --> Performace Detail
    3) in the parameter area, create a new series, add group which create in step 1) and select the rule: MSSQL XXX: Collect Database Allocated Size(MB)
    4) Run the report
    5) In the report, click actions and select "Performance details for every object"
    Roger

  • Just updated Firefox -- But where is the "view source"?

    I use the "view source" feature all the time, but now it's gone! Is it gone for good? Can I find it somewhere else on Firefox?

    Tools > Web Developer > Page Source (Command+U)

  • View in which all sql scripts are stored

    Hello Guys,
    I am a Oracle DBA (Fresher in the field). I want to know in which view or table all the sql queries are stored as i have a performance tuning problem. I want to know which sql scripts are afffecting the most time to execute which in turn affecting the overall performance of the database. I am working on oracle 10g.

    You should also look at V$SQL_PLAN table for example:
    rem fts report
    rem based on V$SQL_PLAN table
    col operation format a13
    col object_name format a32
    col object_owner format a10
    col options format a15
    col executions format 999,999,999
    column dt new_value today noprint
    select to_char(sysdate,'ddmonyyyyhh24miss') dt from dual;
    set pages 55 lines 132 trims on
    ttitle 'Full Table/Index Scans'
    spool fts&&today
    select
    a.hash_value,a.object_owner,a.object_name, rtrim(a.operation) operation,
    a.options, sum(b.executions) executions, c.bytes, (sum(b.executions)*c.bytes)/(1024*1024) fts_meg
    from
    v$sql_Plan a, v$sqlarea b, dba_segments c
    where
    (a.object_owner=c.owner
    and a.object_name=c.segment_name)
    and a.address=b.address
    and a.operation IN ('TABLE ACCESS','INDEX')
    and nvl(a.options,'NULL') in ('FULL','NULL','FULL SCAN')
    and a.object_owner not in ('SYS','SYSTEM','PERFSTAT','SYSMAN','WKSYS','DBSNMP')
    and b.executions>1
    group by a.hash_value,a.object_owner, a.object_name, operation, options, c.bytes
    order by a.object_owner,a.object_name,operation, options, executions desc
    spool off
    set pages 20
    ttitle off
    It will show you for active SQL what the plans are and some other important stats.
    Mike

  • Which view contains the exact sql statement

    Dear All,
    Developers have used bind variables in their sql inside their applications (for example: SELECT Name FROM Employee WHERE EmployeeID =:empno)
    This bind variable is supplied a value within the application. I wanted to know which data dictionary view will give me the exact sql statement which gets executed.
    For example SELECT Name FROM Employee WHERE EmployeeID = 100;
    When I query V$SQL, V$SQLAREA, V$SQLTEXT, I get the same query with the bind variables (SELECT Name FROM Employee WHERE EmployeeID =:empno), instead can i get the query which actually holds the value for the bind variable.
    Regards,
    qA

    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4254158186083#75306330816538

  • SQL to Oracle Migraton - Unable to create source model in Migration Workben

    We are trying to use Oracle Migration Workbench utility to transfer data from SQL to Oracle. when we start creating the source model we get the following error :-
    failed to load source model ora-01401 inserted value too large for column.. this is the error at the ss2k_syslogins table. this is a logical model creation from sql server db.
    In case if this is a data issue with the syslogins table/view, is there any way to overcome this or whether we can do any settings at Workbench Level to overcome this..
    Thanks in advance,
    John.

    I think I figured it out.
    1 - I used the Migration Work Bench that came with the 9.2.0.1 client - BAD IDEA.
    2 - I down loaded the OMWB (10.x) - GOOD IDEA. I also downloaded the plugins so that the versions would match each other. Get rid of any existance of the 'old' OMWB directory under the OracleHome, so as not to get confused.
    3 - I realized that you just extract the OMWB.zip file to the C: drive like some third world DOS application, so it won't show up in under your start menu.**
    **I find this kinda cheesy that the Oracle installer is not involved here to add it to the Oracle Configuration and Migration menu in start up. I suppose you can copy the unzipped struture over top of the existing clint directory structure, but still dumb.
    3 - The other odd piece, you down load the plugin as a zip (and not a jar), BUT DON'T UNZIP IT!! Rather place it in the ..\plugins directory, underneath wherever you unzipped the OMWB, and RENAME IT with a .JAR extension (again don't unzip).
    4 - Make a shortcut on your desktop to the omwb.bat file (from where ever you unzipped the OMWB product)
    5 - Fire up that icon and the product will look at the new .JAR in the plugin folder and 'tada', you have OMWB with your specific database plugin available.
    The new product didn't hang for me. Now I just need to figure out how port this into a shema name OF MY CHOSING, and not the generic OMWB_Login1 that it created.
    I f anyone has info on that, let me know.... I think its in the destination creation (step two of the whole process).
    Jeff Ferrel - State of Nevada

  • How to find out all SQLs executed by a procedure

    I need to find out all SQLs executed by a procedure. I can trace and check but in my case the issue happened 4 hours back and i know what procedure was causing it. There are multiple dynamic queries fired from this procedure. I need to track down all SQLs fired by this procedure constructed dynamically during the time issue was happening.
    I have the sql_id of the statement which was executing the procedure. How do I track down all "child" SQLs using this sql_id?
    Will appreciate any pointers.
    -ravi

    Thanks for your suggestion and looking into this.
    We already have that functionality built in. Version is 10.2.0.3...But the issue is the proc is called thousands of time in a day and we can not keep the tracking of sqls and parameters passed on all the time. When the issue happened we were not tracking. The bind variables are not captured as the SQL is constructed within the proc by looking up the values dynamically from secondary tables dynamically based on the parameters passed to the procedure. Now the SQLs which are generated from the proc will have the bind variables captured as they will come as predicates and will have no clob types (condition for the binds to be captured).
    I need a query to track down all "child" SQLs by using the sql_id of the parent process which is the procedure's sql_id.

  • Bat file execute all *.sql files in a folder

    Hi all,
    How to write a *.bat file to execute all *.sql files in a folder?
    Because have about 20 *.sql file in a folder. There are used to fix data in my database. The number of *.sql file increases day by day. So I want to write a *.bat file to execute all *.sql file in the folder. Since I just run this *.bat file.
    Mai Thanh Hải.

    user545846 wrote:
    Hi
    I have done this many times. can guide you. :)And did it fail to work all the times you tried it?
    c:\>type test1.sql
    select 1 from dual;
    exit
    c:\>type test2.sql
    select 2 from dual;
    exit
    c:\>sqlplus scott/tiger@testdb @c:\test*.sql
    SQL*Plus: Release 10.2.0.3.0 - Production on Thu Aug 6 12:37:04 2009
    Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SP2-0556: Invalid file name.
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining optionsWildcards in SQL*Plus filenames don't work. So why do you suggest that?
    Better is to use the DOS command FOR...
    c:\>for %i in (test*.sql) do sqlplus scott/tiger@testdb @%i
    c:\>sqlplus scott/tiger@testdb @test1.sql
    SQL*Plus: Release 10.2.0.3.0 - Production on Thu Aug 6 12:38:06 2009
    Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
             1
             1
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    c:\>sqlplus scott/tiger@testdb @test2.sql
    SQL*Plus: Release 10.2.0.3.0 - Production on Thu Aug 6 12:38:06 2009
    Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
             2
             2
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    c:\>... although even better would be to proceduralise the SQL into packages/procedures on the database and have just a single procedure call do all the work.

  • When on my secondary monitor, firefox will not perform any action that opens a new window (View page source, show all bookmarks, etc).

    I'm using Mac OSX with Firefox 5, but also had this problem with Firefox 4.
    I use an external monitor as my primary monitor and my laptop monitor as a secondary. When the window is on the secondary monitor, I can't open new windows to do things such as view source and manage bookmarks.
    Any solutions or workarounds would be greatly appreciated.

    Both Firefox and IE have the same problem. The cursor instead of being a finger when pointing to a link is still an arrow. However I can click anywhere on the page and an ad will pop up. I have eliminated all unwanted bars in Firefox, I ran Malwarebytes until it came out clean. I also have AVG which had detected a few items on it's own. But when I get into Firefox I still have exactly the same problem. Now it will not let me download Browser Safeguard. Usually after one click the pointer returns to normal for a few screens. When I try to click to download Browser Safeguard it keeps bringing up different ads or it tries to get me to upgrade Firefox or some other browser helper program which I know are all BS tactics to get me to load their junk again. PLease help I'm an engineer and pretty good with PCs but this one has me beat at least so far.

  • Oracle 9 , show all SQL selects on  particular table

    I wish to do some analysis on all the database accesses to a table over a period like the last week for example. The db version is 9.2.0.5. I am looking for similar views to the V$SQL view but with longer retention or any useful queries.
    Regards

    To the best of my knowledge (and I'm referring to 10g so 9i will be lesser if not the same), the amount of space reserved by Oracle for storing SQL statements is limited and they are only held onto really for query re-use, so queries can disappear after a period of time if they are not being re-used, to make room for new queries coming along. And these will be cleared out if the database is shut down e.g. if there's a problem or if it's taken down for backup purposes etc.
    I don't believe Oracle holds onto SQL's for such long periods as you are describing. You may be lucky if the database is little used, but if it's a well used production system, then your time is going to be more limited.

  • I need a sql statment that return the platform on which oracle is installed

    hi all
    in Oracle 10g there is a column in v$database names platform_name that contain the platform name on which oracle is installed.
    do you know how can I check it in oracle 9i/9i ?

    And just to note:
    Sandeep's solution only works if your user has access to the V$DATABASE view which most standard users won't.
    Kamal's solution will work with most users providing they haven't had permission taken away from them in regards the dbms_utility package.

  • 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.

  • How can i track the all sql/query executed from application

    How we can track all sql/query that has executed or being executing on oracle database server 10g r2.
    regards
    Prabhaker

    select s.sid,
           s.status,
           s.process,
           s.osuser,
           a.sql_text,
           p.program
    from v$session s,
         v$sqlarea a,
         v$process p
    where s.sql_hash_value = a.hash_value
      and s.sql_address    = a.address
      and s.paddr          = p.addr
      and s.schemaname     = '&1'
      and s.status         = 'ACTIVE'

  • Executing psadmin.sql for Oracle

    I am trying to insatll Peoplesoft using Oracle 10g Release2,Websphere,Tuxedo 9.1, PeopleTools 8.49 and FSCM9.0.
    I have successfully installed Oracle 10g, Websphere,Tuxedo,Peopletools and FSCM9.0.
    Now, when I am trying to create database from C:\PT8.49\setup\PsMpDbInstall\setup.exe, the Installer after asking the paths get stuck in "Executing psadmin.sql for Oracle" for more than 2 days.
    I read in other threads that some people could resolve this by running the scripts manually. If that is the solution can anyone please help me with the scripts in sequence.
    Thanks in advance!!!!

    Peoplesoft database wizard for Oracle was/is a quite buggy. You should follow the Peopletools Installation Guide for the manual installation tasks instead.
    All the steps can be found in the doc :
    http://download.oracle.com/docs/cd/E05406_01/psft/acrobat/hwtools849_itora.pdf
    If it is not clear, you can have a look to my blog (see my profile), I tried to explain simple as possible the main steps.
    Nicolas.

Maybe you are looking for

  • Open and Closed Time Outside of the 15 Minute Options

    I have a 13 agent Call Center with one CSQ with Skills based  routing. The Call Center closes at 8 pm on Weekdays and 12  pm on Saturday EST. The time of day function only allows me to choose 15 min  increments for open and closed.  So the Call Cente

  • Is the Catalyst 3750v2 backward compatible with the version 1 of the 3750. As far as stacking.

    I have a customer who has a pair of WS-C3750-48PS-S v05 stacked and would like to add additional switches to the stack. That model is end of life and we are quoting WS-C3750V2-48PS-S for the customer. Can the V2 be added to an existing 3750 (original

  • Confirmation TO  IDOC WMTCID03

    Hi , This IDOC is used for confirmation that comes from external syste. SAP confirms the TO in the background. SAP confirms that based on the function module.. my question is what are minimum fields that SAP should have inorder to confirm the Transfe

  • VBA needed that utilizes replace function

    Hi,  I have this simple VBA that allows me to select my range and put a symbol in front of the data: Sub AddtoFront() Dim Rng As Range For Each Rng In Selection Rng.Value = "~" & Rng.Value Next Rng End Sub However, I am looking to expand this in a bi

  • Does the Zen Touch show up as a drive lett

    I am trying to replace my Archos Jukebox recorder and am looking for alternati'ves. So far, it looks like the Zen Touch is the best alternati've. I am looking for an MP3 player that records and acts as a portable hard dri've, but I don't want to have