Search This Blog

Thursday, March 31, 2011

How to apply WebLogic Private Patch

Patch Identifier: HJ5X
Passcode: I23H9PRN

1) First download the patch using the Smart Update tool (BSU):
    a) Launch Smart Update (BSU) as follows:
        -cd <MW_HOME>/utils/bsu where MW_HOME is location of 10.3.3 Install
        -Enter "bsu.sh" (for Unix/Linux) or "bsu.cmd" (for Windows)
    b) Login using your "My Oracle Support" account and password.
    c) If the 'Target Installation' (on left menu) is not correct then:
        - From menu bar, go to 'File -> Target Installation -> Find Other BEA Home'
        - Then choose the BEA Home for WebLogic 10.3.3
    d) Go to 'Get Patches' tab
    e) From menu bar, choose Patches -> Retrieve Private
    f) Enter the following:
          Patch Identifier: HJ5X
          Passcode: I23H9PRN
    g) Choose option to check for patch conflicts
    h) Patch will then be downloaded. The information is downloaded to these two files:
         i. <MW_HOME>/utils/bsu/cache_dir/HJ5X.jar
        ii. <MW_HOME>/utils/bsu/cache_dir/patch-catalog.xml

2) Next install the patch. There are two options for installing patch:
    Option 1: Install the patch using 'online mode' (this is the preferable option if you can run SmartUpdate Online, in the environment where you are applying patch)
    Option 2: Apply the patch in 'offline mode' (use this option in environments where you can't run SmartUpdate online due to firewall restrictions)

Below are instructions for 'Option 1' and 'Option 2'

Instructions for Option 1 (Smart Update Online)
-------------------------------------------------------------------------
a) If you aren't already logged into SmartUpdate, then log in using steps 1a through 1c (above)
b) Go to 'Manage Patches' tab
c) You will see the Patch 1Y9I in the 'Downloaded Patches' window (at bottom of page)
d) Click the'Apply' button next to the patch and it will be installed.

Instructions for Option 2 (Smart Update Offline)
------------------------------------------------------------------------------
a) Copy the files (that you downloaded in step 1) to the WebLogic environment where you are applying the patch.
    For example, if you downloaded the patch to MW_HOME1 but want to apply it to MW_HOME2, then do the following:
      i. copy <MW_HOME1>/utils/bsu/cache_dir/HJ5X.jar to <MW_HOME2>/utils/bsu/cache_dir/HJ5X.jar
     ii. copy <MW_HOME1>/utils/bsu/cache_dir/patch-catalog.xml to <MW_HOME2>/utils/bsu/cache_dir/patch-catalog.xml
b) Go to your <MW_HOME2>\utils\bsu and launch bsu.cmd (or bsu.sh)
c) When prompted for your Support ID, click the 'Work Offline' button
d) You will see the Patch HJ5X in the 'Downloaded Patches' window (at bottom of page)
e) Click the'Apply' button next to the patch and it will be installed.

To check whether the patch has been applied or not , start the weblogic server you will see the entry as

<Version: WebLogic Server Temporary Patch for 9833357 Fri Aug 13 13:14:52 EDT 2010
WebLogic Server 10.3.3.0  Fri Apr 9 00:05:28 PDT 2010 1321401 >

Wednesday, March 16, 2011

Sunday, March 13, 2011

How to enable JDBC SQL Statement Tracing in OC4J

Take a backup of ojdbc14.jar and  ojdbc14dms.jar files.

cd ORACLE_HOME\jdbc\lib

copy ojdbc14.jar ojdbc14.jar.org
copy  ojdbc14dms.jar ojdbc14dms.jar.org

Replace the  JDBC jar files with the JDBC log files
copy ojdbc14dms_g.jar ojdbc14dms.jar
copy ojdbc14_g.jar ojdbc14.jar

In the opmn.xml add the following values to the opmn.xml file
-Doracle.jdbc.Trace=true -Djava.util.logging.config.file=c:/temp/OracleLog.properties
 
 
For example ,

<process-type id="oc4j_soa" module-id="OC4J" status="enabled">
               <module-data>
                  <category id="start-parameters">
<data id="java-options" value=" -Doracle.jdbc.Trace=true -Djava.util.logging.config.file=c:/temp/OracleLog.properties   -Xrs -server -XX:MaxPermSize=128M -ms512M -mx1024M -XX:AppendRatio=3 -Djava.security.policy=$ORACLE_HOME/j2ee/oc4j_soa/config/java2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false -Doraesb.home=d:\soa1013\integration\esb -Dhttp.proxySet=false -Doc4j.userThreads=true -Doracle.mdb.fastUndeploy=60 -Doc4j.formauth.redirect=true -Djava.net.preferIPv4Stack=true -Dorabpel.home=d:\soa1013\bpel -Xbootclasspath^/p:d:\soa1013\bpel/lib/orabpel-boot.jar -Dhttp.proxySet=false"/>                  </category>
                  <category id="stop-parameters">
         

Sample OracleLog.properties  file
==================================

#### Console Handler ######

#java.util.logging.ConsoleHandler.level = ALL
#java.util.logging.ConsoleHandler.formatter =
#java.util.logging.SimpleFormatter
#handlers = java.util.logging.ConsoleHandler

#### File  Handler ######

oracle.jdbc.handlers=java.util.logging.FileHandler
java.util.logging.FileHandler.level=ALL
java.util.logging.FileHandler.pattern=c:/temp/jdbc.log
java.util.logging.FileHandler.count=1
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter

# Uncomment and/or change the levels for more detail
#oracle.jdbc.level = FINEST
#oracle.jdbc.connector.level = FINE
#oracle.jdbc.driver.level = FINEST
#oracle.jdbc.internal.level = FINEST
#oracle.jdbc.oci.level = FINE
#oracle.jdbc.oracore.level = FINE
#oracle.jdbc.pool.level = FINE
#oracle.jdbc.rowset.level = FINEST
#oracle.jdbc.util.level = FINEST
#oracle.jdbc.xa.level = FINE
#oracle.jdbc.xa.client.level = FINE
#oracle.jpub.level = FINE
#oracle.net.level = FINE
#oracle.sql.level = FINEST
#.level=CONFIG
#oracle.level=CONFIG
#oracle.jdbc.pool.level=CONFIG
#oracle.jdbc.util.level=CONFIG
#oracle.sql.level=CONFIG

#oracle.jdbc.driver.level=FINE


# This is the setting needed for sql debug
oracle.jdbc.driver.level=FINE
oracle.level=OFF

oracle.level=OFF
#oracle.jdbc.driver.level=CONFIG
#oracle.sql.level = FINEST


#set JAVA_OPTIONS=-Doracle.jdbc.Trace=true  -Djava.util.logging.config.file=c:/temp/OracleLog.properties

Saturday, March 12, 2011

How to use the JDBC Driver Tracing in Weblogic/SOA 11g to capture the sql statements issued by the JDBC Drivers

Before starting the weblogic server set the following environment variables ,

On Windows

set EXT_PRE_CLASSPATH=C:\Oracle\Middleware\wlserver_10.3\server\ext\jdbc\oracle\11g\ojdbc6_g.jar
set JAVA_OPTIONS=-Doracle.jdbc.Trace=true -Djava.util.logging.config.file=c:/temp/OracleLog.properties 

On Unix

set EXT_PRE_CLASSPATH=/home/oracle/Middleware/wlserver_10.3/server/ext/jdbc/oracle/11g/ojdbc6_g.jar
set JAVA_OPTIONS=-Doracle.jdbc.Trace=true -Djava.util.logging.config.file=/tmp/OracleLog.properties 


In the OracleLog.properties have the following entries ,

#### Console Handler ######

#java.util.logging.ConsoleHandler.level = ALL
#java.util.logging.ConsoleHandler.formatter =
#java.util.logging.SimpleFormatter
#handlers = java.util.logging.ConsoleHandler

#### File  Handler ######

oracle.jdbc.handlers=java.util.logging.FileHandler
java.util.logging.FileHandler.level=ALL
java.util.logging.FileHandler.pattern=c:/temp/jdbc.log
java.util.logging.FileHandler.count=1
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter

# Uncomment and/or change the levels for more detail
#oracle.jdbc.level = FINEST
#oracle.jdbc.connector.level = FINE
#oracle.jdbc.driver.level = FINEST
#oracle.jdbc.internal.level = FINEST
#oracle.jdbc.oci.level = FINE
#oracle.jdbc.oracore.level = FINE
#oracle.jdbc.pool.level = FINE
#oracle.jdbc.rowset.level = FINEST
#oracle.jdbc.util.level = FINEST
#oracle.jdbc.xa.level = FINE
#oracle.jdbc.xa.client.level = FINE
#oracle.jpub.level = FINE
#oracle.net.level = FINE
#oracle.sql.level = FINEST
#.level=CONFIG
#oracle.level=CONFIG
#oracle.jdbc.pool.level=CONFIG
#oracle.jdbc.util.level=CONFIG
#oracle.sql.level=CONFIG

#oracle.jdbc.driver.level=FINE


# This is the setting needed for sql debug
oracle.jdbc.driver.level=FINE
oracle.level=OFF

 

TRACE_1: Public Enter: "DELETE FROM MDS_LABELS WHERE LABEL_NAME = ? AND LABEL_PARTITION_ID =?"
Mar 12, 2011 10:18:10 PM oracle.jdbc.driver.PhysicalConnection prepareStatement
TRACE_1: return: oracle.jdbc.driver.OraclePreparedStatementWrapper@1d56ac0
Mar 12, 2011 10:18:10 PM oracle.jdbc.driver.PhysicalConnection prepareStatement
TRACE_1: Exit
Mar 12, 2011 10:18:10 PM oracle.jdbc.driver.OracleStatement setPoolable
TRACE_1: Public Enter: true
Mar 12, 2011 10:18:10 PM oracle.jdbc.driver.OracleStatement setPoolable
TRACE_1: Exit
Mar 12, 2011 10:18:10 PM oracle.jdbc.driver.OraclePreparedStatement setString
TRACE_1: Public Enter: 1, "preDeployLabel_soa-infra"
Mar 12, 2011 10:18:10 PM oracle.jdbc.driver.OraclePreparedStatement setString
TRACE_1: Exit
Mar 12, 2011 10:18:10 PM oracle.jdbc.driver.OraclePreparedStatement setLong
TRACE_1: Public Enter: 2, 1
Mar 12, 2011 10:18:10 PM oracle.jdbc.driver.OraclePreparedStatement setLong
TRACE_1: Exit
Mar 12, 2011 10:18:10 PM oracle.jdbc.driver.OraclePreparedStatement executeUpdate
lTRACE_1: Public Enter:
Mar 12, 2011 10:18:10 PM oracle.jdbc.driver.OracleStatement doExecuteWithTimeout
CONFIG: SQL: DELETE FROM MDS_LABELS WHERE LABEL_NAME = ? AND LABEL_PARTITION_ID =?

The sql statement is "DELETE FROM MDS_LABELS WHERE LABEL_NAME = ? AND LABEL_PARTITION_ID =?"
The bind variales are "preDeployLabel_soa-infra" and 1.
Mar 12, 2011 10:18:10 PM oracle.jdbc.driver.OraclePreparedStatement setString
TRACE_1: Public Enter: 1, "preDeployLabel_soa-infra"
Mar 12, 2011 10:18:10 PM oracle.jdbc.driver.OraclePreparedStatement setLong
TRACE_1: Public Enter: 2, 1

The sql statement is "DELETE FROM MDS_LABELS WHERE LABEL_NAME = 'preDeployLabel_soa-infra' AND LABEL_PARTITION_ID =1"

Another example ,

TRACE_1: Public Enter: "SELECT PARTITION_ID FROM MDS_PARTITIONS WHERE PARTITION_NAME=?"

Mar 12, 2011 10:18:10 PM oracle.jdbc.driver.OraclePreparedStatement setString
TRACE_1: Public Enter: 1, "soa-infra"
Mar 12, 2011 10:18:10 PM oracle.jdbc.driver.OraclePreparedStatement setString

The sql statement is "SELECT PARTITION_ID FROM MDS_PARTITIONS WHERE PARTITION_NAME='soa-infra'


If you want only the sql statements with out bind variables use
oracle.jdbc.driver.level=CONFIG

This displays the sql statemnets as

CONFIG: 13EEB53C SQL: update  MEDIATOR_CASE_INSTANCE  set  STATUS ='locked',  LOCK_TIME =?,  CONTAINER_ID =? where  STATUS  = 'ready' and rownum < ?
CONFIG: 466208C SQL: SELECT CASE_ID, CONTAINER_ID, MSG_ID, OPERATION, COMPONENT_DN, PRIORITY, LOCK_TIME, QNAME_LOCAL_PART, IS_EVENT, QNAME_NAMESPACE, CASE_INFO, SOURCE_URI, COMPONENT_STATUS, INSTANCE_CREATED, CREATION_DATE, STATUS, DUMMY1 FROM MEDIATOR_DEFERRED_MESSAGE WHERE (((STATUS = ?) AND (LOCK_TIME = ?)) AND (CONTAINER_ID = ?))

Saturday, March 05, 2011

OPatch on Windows 7 fails with the error OPATCH_JAVA_ERROR: Wrong number of arguments

"Opatch apply" went smooth till verify patch and then exit with following error description:

"OPATCH_JAVA_ERROR: Wrong number of arguments. VerifyPatch needs ORACLE_HOME, OUI location, patch location, patch I
Exception in thread "main" java.lang.Exception: Wrong number of arguments. VerifyPatch needs ORACLE_HOME, OUI location, patch location, patch ID and path to 'ar' command, no_inventory, OS_ID.

at opatch.VerifyPatch.main

Verification of the patch failed.
ERROR: OPatch failed as verification of the patch failed.

Even rolling back a patch is failing.

The OS_ID is retruning as "0" , that was the main reason why it is failing on Windows 7.


Please set the environment variable

set OPATCH_PLATFORM_ID=233 and run the opatch apply command.

Friday, March 04, 2011

How to use different JDBC drivers with SOA 10g

Please refer to the following note for the certification information on the jdbc drivers with OAS 10.1.3.

JDBC Driver Support for Oracle Application Server (Fusion Middleware) (Doc ID 365120.1)

Couple of points ,

Please note that we can use only thin drivers. Please also note that replacing the shipped JDBC drivers with the new ones are not supported. We have to use the application library support
feature available in 10.1.3.x versions.

How to Use The Latest Thin JDBC Driver Across All Applications For a 10.1.3.x OAS Container (Doc ID 420303.1)


The procedure given below should help you in configuring the 11g JDBC thin drivers with OAS 10.1.3. Please also refer to the BUG 8726607 - 10.1.3.5 CERT WITH 11G JDBC DRIVERS : EXTRA STEPS TO NOTE 420303.1

1. Within each container, create the following directory to host the
shared library:

  $OH/j2ee/<container>/shared-lib/oracle.jdbc/11.1.0.7
2. From the Oracle Database 11g installation, copy the following files
into the newly created directory above:

   $OH/rdbms/jlib/aqapi.jar
   $OH/jdbc/lib/ojdbc5.jar *
   $OH/oc4j/j2ee/home/lib/ojms-provider.jar

ojdbc5.jar is for application server installs using JDK 5 (the
default in 10.1.3).  For installs configured to use JDK 6, copy
ojdbc6.jar instead.

3. Create the following oracle.jdbc shared-library entry in the
container $OH/j2ee/<container>/config/server.xml file with the version
attribute set to 11.1.0.7, and at the same time specify the new version
for the BPEL and ESB imported oracle.jdbc shared libraries.

- Make sure the oracle.jdbc library is defined before the oracle.bpel.common
and oracle.esb libraries.
- Replace "[$OH]" in the below example with the path to your Oracle Home
directory.

 

<application-server ?

   <shared-library name="oracle.jdbc" version="11.1.0.7">
     <code-source path="ojdbc5.jar"/>
     <code-source path="aqapi.jar"/>
     <code-source path="ojms-provider.jar"/>
      <code-source path="[$OH]/opmn/lib/ons.jar"/>
      <code-source path="[$OH]/jdbc/lib/ocrs12.jar"/>
    </shared-library>
    <shared-library name="oracle.bpel.common" ?>
     
      <import-shared-library name="oracle.jdbc"   min-version="11.1.0.7"/>
     
    </shared-library>
    <shared-library name="oracle.esb" ?>
     
      <import-shared-library name="oracle.jdbc" min-version="11.1.0.7"/>
     
    </shared-library>
 
</application-server>
 
4. Open the AppsAdapter, AqAdapter and DbAdapter config in these files:
 
$OH/j2ee/oc4j_soa/application-deployments/default/AppsAdapter/oc4j-ra.xml
$OH/j2ee/oc4j_soa/application-deployments/default/AqAdapter/oc4j-ra.xml
$OH/j2ee/oc4j_soa/application-deployments/default/DbAdapter/oc4j-ra.xml
 
Edit the config as below to specify the same minimum version of the
oracle.jdbc shared-library.
 
    <import-shared-library name="oracle.jdbc" min-version="11.1.0.7"/>
 
5. Restart the container