Solved

v$session

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

Title # Comments Views Activity
Shredding xml into an oracle 11g Database 2 59
exp/imp 25 88
Oracle dataguard 5 47
Row_number in SQL 6 34
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

820 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