Solved

v$session

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to count the number of rows in multiple Oracle Tables 10 63
sql query 5 70
join 2 views with 5 conditions 3 46
Export table into csv file in oracle 10 47
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
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…

867 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

23 Experts available now in Live!

Get 1:1 Help Now