Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009
    Location
    India
    Posts
    50

    Unanswered: Retrieve SQL from unix user processes / connections

    Hi Team,

    Is there any way that I can come to know, what SQL statements are being executed by below unix user connections for Instance PRODINST (Oracle 10g) in sqlplus.


    Code:
      oracle  9274     1  0   Nov 19 ?        0:06 oraclePRODINST (LOCAL=NO)
      oracle 22586     1  0   Jan 19 ?        0:46 oraclePRODINST (LOCAL=NO)
      oracle 16996     1  0   Sep 29 ?       17:54 oraclePRODINST (LOCAL=NO)
      oracle 13730     1  0   Sep 29 ?       20:49 oraclePRODINST (LOCAL=NO)
      oracle 13585     1  0   Sep 29 ?       22:09 oraclePRODINST (LOCAL=NO)
    As I am new to Oracle, coudl you please help on above query.

    Thanks

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    this should give you a starting point

    Code:
      1  select username, process, sql_fulltext
      2  from v$session ss, v$sql sql
      3* where ss.sql_id = sql.sql_id
    SQL> /
    
    USERNAME		       PROCESS
    ------------------------------ ------------
    SQL_FULLTEXT
    --------------------------------------------------------------------------------
    SYS			       7874
    select username, process, sql_fulltext
    from v$session ss, v$sql sql
    where ss.sql_id = sql.sql_id
    
    
    SQL> !ps -ef | grep LOCAL=YES
    oracle    7875  7874  0 Jan24 ?        00:00:00 oraclev102 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
    oracle   18869  7874  1 07:40 pts/1    00:00:00 /bin/bash -c ps -ef | grep LOCAL=YES
    oracle   18871 18869  0 07:40 pts/1    00:00:00 grep LOCAL=YES
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •