Solved

v$session

Posted on 2001-08-24
3
862 Views
Last Modified: 2007-12-19
When I use v$session, i am able to see all oracle clients connected by m/c names etc. parameters. But when java clients are connected only jdbcclient shows up in all relevant columns. How can I see the machine or terminal names of java clients connected only via jdbc. Which other views and tables of the 1500+ help me.
0
Comment
Question by:k_murli_krishna
3 Comments
 
LVL 1

Accepted Solution

by:
dbasupport earned 15 total points
ID: 6428110
I don't have jdbc users, but try this anyway

select decode(a.type,'BACKGROUND','BACKGROUND',a.username) "Username",
       a.sid "Session ID" ,
       a.serial# "Serial #",
       a.status "Status" ,
       a.osuser "OS User",
       b.spid "OS Process ID",
       a.machine "Machine Name",
       a.program "Program",
       TO_CHAR(a.logon_time,'dd-Mon-YYYY HH24:MI:SS') "Logon Time"
       from v$session a, v$process b where a.paddr=b.addr order by a.sid
0
 
LVL 2

Expert Comment

by:dbaora
ID: 6435352
Hi,
You can user the select caluse dbasupport suggested, but
you can also set four lines in your java code in order to log all clients connected:

try {
CallableStatement cs = connection.prepareCall("begin dbms_application_info.set_client_info(?); end;");
cs.setString(1,"ApplicationName - "+InetAddress.getLocalHost().toString());
cs.execute();
cs.close();
} catch(Exception e) {
System.out.println("did not manage to get local host");
}

Then you can use:
select
  client_info "Client Application Info",
  logon_time "Logon Time"
from
  v$session
where
  program like '%JDBC%';

regards,
dbaora.
0
 
LVL 17

Author Comment

by:k_murli_krishna
ID: 6448659
I am sorry, dbaora i can give answer to only one. dbasupport's answer which came first solves my problem. Your's could also have but we are using atg dynamo in which we write RQL and not jdbc. thanx a lot to both of you.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now