Solved

v$session

Posted on 2001-08-24
3
865 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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

770 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