Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DBUA and the preupgrade utility need to check JAVA_DEV_ALLOWED from sys.java_dev_status

user10070103Dec 15 2014 — edited Jan 11 2016

I just had an aborted 12c upgrade because the new java development was disabled, previously, by the installation of the Oct  2014 java mitigation patch (not the Oct 2014 CPU). I had run the preupgrade.sql (after getting the latest using Oracle document 884522.1 ).

Neither it, nor DBUA, bothers to run this query and stop me before I start an upgrade:

     select JAVA_DEV_ALLOWED  from sys.java_dev_status;

If the result is 'NO', you better stop then, exit DBUA, and enable java development and bounce the database. I didn't know this and I had to recover my database and redo the upgrade after enabling new development.

Its a small change, but will save hours of time if your upgrade abort in the middle because of this.  I now added this to my upgrade document:

--- check to see if java development is disabled by the mitigation
patch; if so,

--- enable it

declare

  sql_stmt varchar2(4000);

  h_JAVA_DEV_ALLOWED varchar2(500);

  begin

  select JAVA_DEV_ALLOWED into h_JAVA_DEV_ALLOWED from sys.java_dev_status;

    dbms_Output.put_line('JAVA_DEV_ALLOWED ='||h_JAVA_DEV_ALLOWED);

   if trim(upper(h_JAVA_DEV_ALLOWED)) = 'NO' then

  sql_stmt := 'begin sys.dbms_java_dev.enable; end;';

    dbms_Output.put_line(sql_stmt);

    execute immediate sql_stmt;

    dbms_Output.put_line('***** now bounce the database ***** ');

   else

     dbms_Output.put_line('its enabled, no action needed ');

   end if;

  end;

  /

  select JAVA_DEV_ALLOWED   fromsys.java_dev_status;



Comments

unknown-7404
I'm facing an issue when I upgrade my ojdbc14.jar to ojdbc6.jar

Issue :

          data_type value for Date and Timestamp is same  ie., 93 if we use ojdbc6.jar.

          data_type value for Date and Timestamp is different as 91 and 93, if we use ojdbc14.jar.

          My Batch job fetches the data_type of the Oracle 11g TABLE and inserts value according to the data_type value it fetches.

          I have tried using ResultSetMetaData and DatabaseMetaData to get data_type value using getMetadata() method.

          Is there anyway to differentiate the Date and Timestamp data_type value using ojdbc6.jar?.

The Oracle JDBC FAQ explains the issue that existed in the older JDBC driver and how Oracle fixed the problem.

Oracle JDBC Frequently Asked Questions

What is going on with  DATE and  TIMESTAMP

This section is on  simple data types. :-) 

Prior to 9.2, the Oracle JDBC drivers mapped the  DATE SQL type to  java.sql.Timestamp. This made a certain amount of sense because the Oracle  DATE SQL type contains both date and time information as does  java.sql.Timestamp. The more obvious mapping to  java.sql.Date was somewhat problematic as  java.sql.Date does not include time information. It was also the case that the RDBMS did not support the  TIMESTAMP SQL type, so there was no problem with mapping  DATE to  Timestamp

In 9.2  TIMESTAMP support was added to the RDBMS. The difference between  DATE and  TIMESTAMP is that  TIMESTAMP includes nanoseconds and  DATE does not. So, beginning in 9.2,  DATE is mapped to  Date and  TIMESTAMP is mapped to  Timestamp. Unfortunately if you were relying on  DATE values to contain time information, there is a problem. 

There are several ways to address this problem in the 9.2 through 10.2 drivers:

. . .

Oracle JDBC 11.1 fixes this problem. Beginning with this release the driver maps SQL DATE columns to  java.sql.Timestamp by default.

Read the entire FAQ.

What 'differentiation' are you talking about? For Oracle the ONLY difference between date and timestamp is, as the quote says, that timestamp includes nanoseconds.

If you need more help than the above then you need to SHOW US (not just tell us):

1. WHAT you do - post the actual code that supports the statements you made in your post

2. HOW you do it

3. WHAT results you get - show us the results

1 - 1

Post Details

Added on Dec 15 2014
1 comment
2,323 views