Solution ID: prim73199
API connections to an Oracle database list null as OSUSER in v_$session in API 6.1 SP2. 


Note:  In API 5.0 they listed SYSTEM as the OSUSER.

Status: Reviewed
Version(s): 6.1

Problem: API connections to an Oracle database list null as OSUSER in v_$session in API 6.1 SP2. 


Note:  In API 5.0 they listed SYSTEM as the OSUSER.

Fix: This is because of an Oracle bug (#3735857) in ojdbc14.jar version 10.2.0.1.0 and some other versions also.  In API 6.1 release we are including ojdbc14.jar version 10.2.0.1.0 therefore the OSUSER field is NULL.  Please refer to the Oracle Bug Report below for more detail:


Subject:    Null OSUSER Column in V$SESSION When Using the Thin JDBC Driver
    Doc ID: NOTE:363535.1   Type:   PROBLEM
    Last Revision Date:     20-OCT-2008 Status:     PUBLISHED


In this Document
  Symptoms
  Cause
  Solution
  References


Applies to:
JDBC – Version: 10.1.0.0.0 to 10.1.0.4.0
JDBC – Version: 10.2.0.0.0 to 10.2.0.1.0
This problem can occur on any platform.
Symptoms
The OSUSER column is null in V$SESSION when using the thin JDBC driver 10.2.0.1.
Cause
Bug 3735857 – OSUSER FIELD DOES NOT POPULATE IN V$SESSION USING JDBC 10G
Solution
Apply Patch 4677125 to a 10.2.0.1.0 JDBC driver. The following instructions use ojdbc14.jar as an example of the JDBC driver. The same technique can be applied to other JDBC drivers.
1. Downloaded ojdbc14.jar from
   
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc_10201.html 
2. Download Patch 4677125 from Metalink.
Unzip p4677125_10201_GENERIC.zip. This creates folder 4677125.
3. Ignore README.txt (in folder 4677125). It’s for applying the patch to a database server or database client installation. The objective here is to apply the patch to a JDBC driver.
4. Expand the nodes of folder 4677125 until it look like this.
- 4677125
  + etc
  – files
    – jdbc
      – lib
        + classes12.jar
        + classes12.zip


       + classes12dms.jar
        – ojdbc14.jar
          – oracle       <— This folder will be copied.
        
  – jdbc
              – driver   <— File T4CTTIoauthenticate.class is here
        + ojdbc14_g.jar
        + ojdbc14dms.jar
        + ojdbc14dms_g.jar
If you are updating a driver other than ojdbc14.jar, expand one of the other nodes. For example, ojdbc14dms.jar.
5. Create a folder. For example, D:\Work.
Copy ojdbc14.jar to D:\Work.
Copy the oracle folder from the patch to D:\Work.
So D:\Work looks like this:
- Work    <— ojdbc14.jar is here
  – oracle
    – jdbc
      – driver  <— T4CTTIoauthenticate.class is here
6. Inside ojdbc14.jar there is a T4CTTIoauthenticate.class in a directory structure that matches the patch. That structure can be seen if you unzip (or unjar) ojdbc14.zip elsewhere. However, do not unzip ojdbc14.jarto apply the patch.
7. In a command prompt window change directory to D:\Work.
Replace the existing T4CTTIoauthenticate.class with the one from the patch,
using the command:
    <path to jar.exe>\jar uf ojdbc14.jar oracle\jdbc\driver\T4CTTIoauthenticate.class
For example:
    d:\JDev\JDev1013Prod\jdk\bin\jar uf ojdbc14.jar oracle\jdbc\driver\T4CTTIoauthenticate.class
This replaces the existing T4CTTIoauthenticate.class with the one from the patch.
8. (optional) For information on updating a JAR file see:
   
http://java.sun.com/docs/books/tutorial/deployment/jar/update.html


References
Bug 3735857 – OSUSER FIELD DOES NOT POPULATE IN V$SESSION USING JDBC 10G
Keywords
V$SESSION ; V$SESSION ;