Search This Blog

Thursday, April 21, 2011

How to Redirect weblogic stdout to a log file

By configuring one option in the Admin console of weblogic
Server -> Admin server (or the Managed Server) -> Logging -> General -> Advanced Settings -> Redirect stdout logging enabled


or using JAVA_OPTIONS -Dweblogic.log.RedirectStdoutToServerLogEnabled=true

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

Monday, January 31, 2011

SOA Oracle Lite DB Tracing

SOA Uses 10.2 POLite.

Please refer to the link for more debuginfo.

Set OLITE_SQL_TRACE=TRUE in c:\windows\polite.ini file ,

The sql trace info is written to c:\windows\system32\oldb_trc.txt

OLITE_SQL_TRACE

Generates the SQL statement text, compilation time, execution plan, and the bind value.

For example:

OLITE_SQL_TRACE = TRUE


SQL trace output is dumped to a trace file named oldb_trc.txt in the current working directory of the database process. For a database service on Windows, Windows NT or the Oracle Database Lite daemon for a Linux platform, the current working directory is specified by the wdir parameter during the database startup service or daemon. Applications that use an embedded connection to connect to the database contain a working directory. This working directory is the application working directory. To implement the tracing feature, the database process must contain permissions to create the trace file in the current working directory. The trace output is always included in the trace file. If the trace file does not exist, it is created automatically.

Sunday, January 30, 2011

How to Install additional packages/upgrade OEL 5

  1. Download and Install Oracle Linux
  2. Download and copy the appropriate yum configuration file in place, by running the following commands as root:

    Oracle Linux 4, Update 6 or Newer
    # cd /etc/yum.repos.d
    # mv Oracle-Base.repo Oracle-Base.repo.disabled
    # wget http://public-yum.oracle.com/public-yum-el4.repo


    Oracle Linux 5


    # cd /etc/yum.repos.d
    # wget http://public-yum.oracle.com/public-yum-el5.repo


    Oracle VM 2


    # cd /etc/yum.repos.d
    # wget http://public-yum.oracle.com/public-yum-ovm2.repo




  3. Enable the appropriate repository by editing the yum configuration file




    • Open the yum configuration file in a text editor


    • Locate the section in the file for the repository you plan to update from, e.g. [el4_u6_base]


    • Change enabled=0 to enabled=1





  4. Begin using yum, for example:



    yum list ,  yum update  , yum install firefox





  5. You can also use  “system-config-packages” for this purpose.



Wednesday, January 26, 2011

How to setup iscsi target on OEL 5.5

http://fedoraproject.org/wiki/Scsi-target-utils_Quickstart_Guide

RedHat have included an iSCSI daemon which is also installable using yum:

yum install iscsi-initiator-utils

To connect to the target, edit /etc/iscsi/initiatorname.iscsi and change InitiatorName to something you prefer (Remember! it must be in the IQN format, iqn.yyyy-mm.{reversed domain name}:an_easy_to_remember_lablel. I usually use iqn.2009-02.com.hamzahkhan:hostname_of_box). Next start up iSCSId:

/etc/init.d/iscsid start

and use iSCSI target descovery to find the targets on the server:

iscsiadm -m discovery -t st -p $SERVERS_IP

If all is well, it should output the names of all the targets that the initiator is allowed to connect to!

Next, we need to create the disk nodes. To do this, RedHat have provided a nice start up script. This script will login to all the targets that the iSCSI daemon knows about. We have already used the iscsiadm command to tell the iSCSI daemon which targets exist on the server, so using the script is all that is left:

/etc/init.d/iscsi start

On Windows 7 use this note ,

http://www.windowsnetworking.com/articles_tutorials/Connecting-Windows-7-iSCSI-SAN.html

Monday, January 24, 2011

How to Find out which java thread takes the maximum cpu time in windows

On Error Resume Next
Const adVarChar = 200
Const MaxCharacters = 255
Set DataList = CreateObject("ADOR.Recordset")
DataList.Fields.Append "ProcessID", adVarChar, MaxCharacters
DataList.Fields.Append "ThreadID", adVarChar, MaxCharacters
DataList.Fields.Append "PercentUserTime", adVarChar, MaxCharacters
DataList.Fields.Append "PercentProcessorTime", adVarChar, MaxCharacters
DataList.Open
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_PerfFormattedData_PerfProc_Thread where IDProcess ="&WScript.Arguments.Item(0),,48)
For Each objItem in colItems
DataList.AddNew
DataList("ProcessID") = objItem.IDProcess
DataList("ThreadID") = objItem.IDThread
DataList("PercentUserTime") = objItem.PercentUserTime
DataList("PercentProcessorTime") = objItem.PercentProcessorTime
DataList.Update
Next
DataList.Sort = "PercentUserTime"
DataList.Reverse()
DataList.Reverse()
DataList.MoveFirst
Do Until DataList.EOF
Wscript.Echo DataList.Fields.Item("ProcessID") _
& vbTab & DataList.Fields.Item("ThreadID")_
& vbTab & Hex(DataList.Fields.Item("ThreadID"))_
& vbTab & DataList.Fields.Item("PercentUserTime")_
& vbTab & DataList.Fields.Item("PercentProcessorTime")
DataList.MoveNext
Loop
' Set WshShell = WScript.CreateObject("WScript.Shell")
'WshShell.Run "cmd /c C:\Oracle\Middleware\jdk160_18\bin\jstack.exe " &WScript.Arguments.Item(0)

Set objShell = WScript.CreateObject("WScript.Shell")
Set objExecObject = objShell.Exec("cmd /c C:\Oracle\Middleware\jdk160_18\bin\jstack.exe " &WScript.Arguments.Item(0))
Do While Not objExecObject.StdOut.AtEndOfStream
    strText = objExecObject.StdOut.ReadLine()
    Wscript.Echo strText
Loop

Find out the java process , but running the command , jps and run the vbscript using the command “cscript test1.vbs”

Thursday, January 13, 2011

How to create Bootable Image in USB Drive

Download MultiBootISOs-2.1.4.7.exe

  1. Run MultiBootISOs-2.1.4.7.exe following the onscreen instructions
  2. Select the ISO you want to Boot from the Menu and enjoy!
  3. The best thing about this tool is that you can select multiple images in one USB drive

Please also refer to this URL for more details on this ,

http://www.pendrivelinux.com/boot-multiple-iso-from-usb-multiboot-usb/

Friday, January 07, 2011

How to create RAW Partions on linux (to be used for ASM and RAC)

First create the HDD Partitions , ensure that you have 3 partions
say /dev/sdb1 , /dev/sdc1 and /dev/sdd1

run the command fdisk -l and verifiy them

1. Edit the /etc/sysconfig/rawdevices file, and add the following lines.

/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdc1
/dev/raw/raw3 /dev/sdd1

2. service rawdevices restart

3. raw -qa

4. Create the softlinks for the files

ln -s /dev/raw/raw1 /u01/oradata/ocr
ln -s /dev/raw/raw2 /u01/oradata/votingdisk
ln -s /dev/raw/raw3 /u01/oradata/asm1

5. Add the following lines in the "/etc/rc.local" file.

chown oracle:oinstall /dev/raw/raw1
chown oracle:oinstall /dev/raw/raw2
chown oracle:oinstall /dev/raw/raw3
chmod 600 /dev/raw/raw1
chmod 600 /dev/raw/raw2
chmod 600 /dev/raw/raw3

How to Clean up failed RAC Install on linux

rm -rf /etc/oracle/*
rm -f /etc/init.d/init.cssd
rm -f /etc/init.d/init.crs
rm -f /etc/init.d/init.crsd
rm -f /etc/init.d/init.evmd
rm -f /etc/rc2.d/K96init.crs
rm -f /etc/rc2.d/S96init.crs
rm -f /etc/rc3.d/K96init.crs
rm -f /etc/rc3.d/S96init.crs
rm -f /etc/rc5.d/K96init.crs
rm -f /etc/rc5.d/S96init.crs
rm -Rf /etc/oracle/scls_scr
rm -f /etc/inittab.crs
cp -f --reply=yes /etc/inittab.orig /etc/inittab
rm -rf /u01/crs
rm -rf /u01/app/oracle
rm -f /etc/oraInst.loc
dd if=/dev/zero of=/dev/raw/raw1 bs=1M count=256000
dd if=/dev/zero of=/dev/raw/raw2 bs=1M count=256000

Migrate from VMWare Server to VirtualBox

1.Important: From VMWare Server, start your virtual machines and uninstall VMWare toolbox!

2.Locate the main VMDK file you want converted. It's usually a XML file, or a binary
file with a XML header.

3.From the command line, CD to the location of that file. Say the VMWare disk image to convert is Root_Disk.vmdk.

4.Run the following command to convert to VDI:

C:\Program Files\Oracle\VirtualBox\VBoxManage clonehd --format vdi "c:\Virtual Machines\XP\Windows XP Professional.vmdk" "c:\Virtual Machines\XP\WinXP.vdi"

5.That's it! If you're in Linux, the VDI file will be created under ~/.VirtualBox/Harddisks/.

6.Add that to your media manager and create the virtual machine as you normally would.

Saturday, January 01, 2011

How to use Wifi Tethering on Samsung Galaxy i5801

1. First download the z4root apk file from z4root.1.3.0.apk

2. Download the file fw_bcm4329.bin from
http://dl.dropbox.com/u/1496809/fw_bcm4329.bin
3) Mount your sdcard
4) Create a directory named "android.tether" (without quotes)
5) Open this directory and copy fw_bcm4329.bin into it. (downloaded file)
6) Uninstall old versions of "wireless tether"
7) Install the latest 2.0.5 release of WiFi Tether from: http://code.google.com/p/android-wifi-tether/downloads/list

Saturday, December 25, 2010

Monday, December 06, 2010

Soa Suite 11gR1 (11.1.1.3.0) installation guide for Windows

http://vtkrishn.wordpress.com/2010/09/25/soa-suite-11gr1-11-1-1-3-0-installation-guide-for-windows/

http://adfproject.googlecode.com/files/SOA_Installation_guide.doc

How to find the SOA Version

/home/ias/Oracle/Middleware/Oracle_SOA1/bin/soaversion.sh

*****************************************************************************
Oracle SOA Server version 11.1.1.3.0
          Build: 0
          Build time: Thu Apr 15 22:20:11 PDT 2010
          Build type: release
          Source tag: PCBPEL_11.1.1.3.0_GENERIC_100415.2045.2557

Oracle BAM Source Tag:ORABAM_11.1.1.3.0_GENERIC_100406.2108

Oracle BPM Source Tag: BPM_11.1.1.3.0_GENERIC_100415.1757.0684

Oracle Implementation-Version: Oracle Middleware 11.1.1 (ASKERNEL_11.1.1.3.0_
GENERIC_100411.1150, ADMINSERVER_11.1.1.3.0_GENERIC_100408.2100, J2EE
_11.1.1.3.0_GENERIC_100408.1504, JDEVADF_11.1.1.3.PS2_GENERIC_100408.
2356.5660, TOPLINK_11.1.1.3.0_GENERIC_100323.1800, ENTSEC_11.1.1.3.0_
GENERIC_100403.1733)

Thursday, November 11, 2010

Reducing the PDF Page Size when printing

Sometimes we need to print a pdf on a page that is lesser then A4 size. The main reason for this kind of printing is that size reduction. Carrying a A4 PAGE book is not that handy most of the times.

For this we need to reduce the size of the page while printing. Unfortunately in Acrobat PDF Reader this option is not present.

For this we can use the the PDF-XChange Viewer free edition.

Download the PDF-XChange Viewer from http://www.tracker-software.com/product/downloads/

Select File->Print option and Select the Page Scaling as => Custom Scale and Page Zoon as 75% and Select Auto-Center pages in sheets

Please refer to the screen below

image

After this you can cut the extra white space using a paper cutter.

Sunday, November 07, 2010

How to attach a pdf file to an email from a shell script

Write the following shell script ,

---
echo "Training Calendar on ` date +%d-%b-%Y` " > /tmp/mailmessage.txt
wget -O /tmp/blr.pdf http://xxx.xxxx.xxx.com/test.pdf
mutt -s "Training Calendar on ` date +%d-%b-%Y` " -a /tmp/trg_blr.pdf ravi.reddy@oracle.com < /tmp/mailmessage.txt
---

To change the from email address while using mutt
create a .muttrc in the users home directory if it doesnot exist, then enter the feild

set realname="ravi.reddy@oracle.com" this will change the name in the senders name .

Wednesday, September 15, 2010

How to Hide Username/Passwords in shell scripts

Please refer to this article for more details on this.

I have lot of shell scripts where I have to store my username and passwords for accessing the data. This is a big security rish as my passwords are exposed.

I need some executable which can convert my shell script to exe so that it will be difficult for the people to get my password.

Download the sources from http://www.datsi.fi.upm.es/%7Efrosal/sources/shc-3.8.6.tgz

Extract the tar file

tar xvfz shc-3.8.6.tgz

Make the executable

cd shc-3.8.6
make

cp shc to /usr/bin directory

I have a shell script which fetches some password protected pages , here
there is no other option for me other then embedding the password as the wget does
not support encrypted passwords

for example ,

cat getcookie.sh

#!/bin/ksh
/usr/bin/wget --keep-session-cookies --save-cookies=/home/ias/cookie.txt  -O /home/ias/dd.txt   --input-file=/home/ias/urls.txt --http-user=xx.xxx@test.com --http-password=xxxxxxx > /dev/null
cat /home/ias/cookie.txt  | grep test  | cut --fields=7 > /home/ias/cookie.txt

with the shc script I can convert the shell script as executable so that the passwords are hidden
from the people who has access to my unix system.

Run the shc command

shc -f getcookie.sh

This creates the getcookie.sh.c and getcookie.sh.x where .c is the c source file and .x is the executable.

Now run the getcookie.sh.x executable and change the password from the original getcookie.sh script.

Please refer to the http://blogs.koolwal.net/2009/01/20/howto-encrypting-a-shell-script-on-a-linux-or-unix-based-system/
for more details on this.

Saturday, September 11, 2010

How to Upgrade samsung galaxy firmware

Actually many firmware are available for each area (Europe, Asia and America). Last firmware version are:


Europe: I5800XWJH2
Asia: I5801DDJG6
America: I5800LVIJG8

You can download the ODIN Multi Downloader from

http://download968.mediafire.com/skeyfniqhphg/gnzzbkix0nd/Odin4_03-Spica_ops.zip

Flashing with ODIN it's very simple (sorry for picture):

screenshot.32

Before running this utility you need to set the samsung phone in the download firmware mode , for this press

Home+VolDown+Power and hold this for about 30 seconds to 1 minute

In the ODIN screen ,

1) Select "One Package"
2) Select OPS file for I5801 (apollo.ops)

Create apollo.ops file with the following contents ,

0,boot
1,Sbl
2,logo
3,efs
4,zImage
5,factoryfs
6,datafs
7,cache
8,
9,modem


3) In one package select the firmware that you want to flash. (I5801DDJG6.tar) Download the firmware from http://uploading.com/files/1314471a/I5801DDJG6.rar/


4) Start


In about five minutes your mobile will be upgrades.

Tuesday, September 07, 2010

Setup XMail Server on Windows

Please refer to the link http://www.halfdone.com/Articles/XMailInstall/ for more details on this.

Here are the simplified steps to configure the XMail Server’s on Windows Machine

1. Download the XMail Server from http://www.xmailserver.org     

2. Extract this to a directory say C:\xmail-1.27

3. Copy the exe’s and dll’s to C:\xmail-1.27\MailRoot\bin directory

4. Create the HKEY_LOCAL_MACHINE\SOFTWARE\GNU\XMAIL. Create the Sting (REG_SZ) values called MAIL_ROOT and MAIL_CMD_LINE. For the value of MAIL_ROOT put in the "MailRoot folder" location like C:\xmail-1.27\MailRoot. For MAIL_CMD_LINE you can leave it blank or put in "-Pl -Sl -Ql -Fl -Cl -Ll"

screenshot.28

5. Here we are using the default domain , that is xmailserver.test , so no need to modify the configuration files.

6. Run xmcrypt.exe to create an encoded password. It's used in the format of XMCRYPT.EXE <password>.

xmcrypt.exe welcome1

1100161115041616120a1701

7. Open the file C:\xmail-1.27\MailRoot\ctrlaccounts.tab and enter the following values "admin" <tab>   "120009060a080054"

8.  User and alias creation

Check the domain

ctrlclnt -s localhost -u admin -p welcome1 domainlist "xmailserver.test"

Create two domain users

ctrlclnt -s localhost -u admin -p welcome1 useradd "xmailserver.test" test1 welcome1 U
ctrlclnt -s localhost -u admin -p welcome1 useradd "xmailserver.test" test2 welcome1 U

Check the users

ctrlclnt -s localhost -u admin -p welcome1 userlist "xmailserver.test"

Create aliases for these two users

ctrlclnt -s localhost -u admin -p welcome1  aliasadd  "xmailserver.test" test1 ravi1
ctrlclnt -s localhost -u admin -p welcome1  aliasadd  "xmailserver.test" test2 ravi2

Check the aliases for these users

ctrlclnt -s localhost -u admin -p welcome1 aliaslist

9. Set up the POP3 email server and SMTP Outgoing server from Thunderbird. For the POP3 accounts set the SMTP Server as the localhost:25

screenshot.30

Monday, August 16, 2010

How to find the Patch Set Version that has been applied on your Oracle_Home

For the OAS 10g release you can run the following.

cd $ORACLE_HOME/j2ee/home

$ORACLE_HOME/jdk/bin/java -jar  oc4j.jar -version
Oracle Containers for J2EE 10g (10.1.3.4.0)  (build RELEASE.26167)

or you can also do

cd $ORACLE_HOME/inventory/ContentsXML

cat comps.xml | grep patchset

This shows the o/p as

cat comps.xml | grep patchset
<PATCHSET NAME="oracle.as.j2ee.patchset" VER="10.1.3.4.0" BUILD_NUMBER="0" RELEASE="Production" INV_LOC="PatchSets/oracle.as.j2ee.patchset/10.1.3.4.0/3/" XML_INV_LOC="PatchSets21/oracle.as.j2ee.patchset/10.1.3.4.0/" ACT_INST_VER="10.1.0.6.0" DEINST_VER="10.1.0.2.0" INSTALL_TIME="2009.Mar.17 09:21:56 IST">
      <INFO NAME="helpDir" VAL="PatchSets/oracle/as/j2ee/patchset/v10_1_3_4_0/help/"/>
      <INFO NAME="resourceClass" VAL="PatchSets.oracle.as.j2ee.patchset.v10_1_3_4_0.resources.CompRes"/>
      <REF NAME="oracle.as.j2ee.patchset" VER="10.1.3.4.0" HOME_IDX="5"/>

For the FMW 11g release perform the following

cd $ORACLE_HOME/inventory/ContentsXML

cat comps.xml | grep patchset

This shows the o/p as

<PATCHSET NAME="oracle.as.soa.top.patchset" VER="11.1.1.3.0" BUILD_NUMBER="0" RELEASE="Production" INV_LOC="PatchSets/oracle.as.soa.top.patchset/11.1.1.3.0/1/" XML_INV_LOC="PatchSets21/oracle.as.soa.top.patchset/11.1.1.3.0/" ACT_INST_VER="11.1.0.8.0" DEINST_VER="11.1.0.0.0" INSTALL_TIME="2010.Aug.06 21:53:00 IST">
      <INFO NAME="helpDir" VAL="PatchSets/oracle/as/soa/top/patchset/v11_1_1_3_0/help/"/>
      <INFO NAME="resourceClass" VAL="PatchSets.oracle.as.soa.top.patchset.v11_1_1_3_0.resources.CompRes"/>
      <REF NAME="oracle.as.soa.top.patchset" VER="11.1.1.3.0" HOME_IDX="5"/>

For the DB you can issue the command ,

$ORACLE_HOME/bin/sqlplus and note down the version details for example ,

SQL*Plus: Release 10.2.0.4.0 - Production on Mon Aug 16 14:24:29 2010

or you can connect to the DB and find out the version details.

Tuesday, August 03, 2010

How to Install WebLogic Standalone Server

1. Download the WebLogic stand alone zip file from the location ,

http://download.oracle.com/otn/nt/middleware/11g/wls1033_dev.zip

2. Extract this zip to a directory say C:\wlsdev

3. Set the following env variables

set JAVA_HOME=C:\jdk16
set MW_HOME=c:\wlsdev

4. Run the installation configuration script in the MW_HOME directory
(This step is required to be run only once. If you move the installation to
another location/machine, you need to rerun this step)  configure.cmd
5. Create the domain using the script by running the utility

c:\wlsdev\wlserver\common\bin\config.cmd

6. Create a domain say testdomain in the directory
C:\wlsdev\user_projects\domains\testdomain

7. Start the WLS server by running the command

C:\wlsdev\user_projects\domains\testdomain\startWebLogic.cmd

Friday, July 02, 2010

How to find a file is 32bit or 64 bit on Windows

Download the utility file.exe from
http://www.vowles-home.demon.co.uk/utils/file.zip

Now run the command

file pidgin-2.6.6.exe

pidgin-2.6.6.exe, DOS/Win, i386 32bit executable, GUI, PE format

file c:\wordpad.exe

c:\wordpad.exe, DOS/Win, x86-64 64bit executable, GUI, PE format

file c:\TeraCopyExt64.dll

c:\TeraCopyExt64.dll, DOS/Win, x86-64 64bit executable, dll, GUI, PE format

file c:\TeraCopyExt.dll

c:\TeraCopyExt.dll, DOS/Win, i386 32bit executable, GUI, PE Modifed

Thursday, June 03, 2010

How to Configure Exchange Connector

1. Try to get hold of a system where exchange and active directory are installed.

2. Install AD Connector on the OIM Server and provision a user (For testing purpose)

3. Install Microsoft Exchange connector on the OIM Server. Please note that you need the Remote Manager only when you are using the exchange server 2007. Otherwise you do not need to any thing on the OIM Server.

4. Create a IT Resource for Exchange and leave all the attributes as blank.

5. Run the “Exchange Mail Store Lookup Reconciliation” task , before running this task scheduler change the “AD IT resource” attribute to the AD Connector that you created in the step no:2.

6. This schedule task populates the “Lookup.ExchangeReconciliation.MailStore” lookup values. For example in my case it populated my mail box name as “celvpint0309-ADInstance~CN=Mailbox Store (MSBOX),CN=First Storage Group,CN=InformationStore,CN=MSBOX,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=MSExchange2003Org,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=vm,DC=oracle,DC=com”

7. Now provision the AD User to the Exchange System. Only mandatory fields are Email Alias Name and the mail store name.

8. Now log in to the AD Server machine and check the AD User. For the exchange user you will see more attributes in the AD User TAB.

Thursday, May 20, 2010

How to use the ADAM Connector with OIM

1. Download the ADAM Installer from the microsoft site ADAMSP1_x86_English.exe

2. Install the ADAM Executables

3. Click on the menu option Create ADAM Instance

image

image 

image

image

image

image

image image

image

image

4. Now open the ADAM ADSI Edit Program and connect to the ADAM Server

Use the port number as 50000 and the Naming Context as O=Oracle,c=in

5. Create a user under the directory tree “O=Oracle,c=in” with the username as Admin and set the password as Welcome1.

6. Add this user to the group “CN=Administrators,CN=Roles,O=Oracle,C=in”

image

7. Create an Organization Unit with the name say BDE

8. From the OIM Create a IT Resource and change the following values

image

AdminFQDN=CN=Admin,O=BDE,CN=BDE,DC=idc,DC=oracle,DC=com      RootContext=o=BDE,cn=BDE,dc=idc,dc=oracle,dc=com                        AtMap ADGroup=AtMap.ADAMGroup 
AtMap ADUser=AtMap.ADAM 
isADAM=yes 

9. Open the Lookup.ADReconciliation.Organization and add the Organization to the LOV “OU=BDE,O=Oracle,cn=India”

10. Create a user in OIM and provision this user to the ADAM Resource

Monday, April 19, 2010

Find out Zero Byte Files

import java.io.*;
import java.util.*;

import java.util.zip.*;

public class FindZeroByteFiles {
    public FindZeroByteFiles() {
    }

    public static void main(String[] args) {
        FindZeroByteFiles findZeroByteFiles = new FindZeroByteFiles();
        File f1 = new File(args[0]);
  traverse(f1);
    }
    public static void traverse(File f) {
          String s1 = f.getAbsolutePath();

if (f.isFile())
         {
            long i =  filesize(s1)    ;
            if (i==0 ) {
                System.out.println(s1);
            }
         }

          if (f.isDirectory()) {
            String[] children = f.list();
            for (int i=0; i<children.length; i++) {
              traverse(new File(f, children[i]));
            }
          }
        }

    public static long  filesize(String filename)  {
        long  i = 0;
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
            File f = new File(filename);
          if(f.exists()){
           long file_size = f.length();
            //  System.out.println("Size of the file : " + file_size);
               i = file_size;
           }
      return i;
    }
}

Run this program with the following arguments.

java  -client -classpath C:\ravi FindZeroByteFiles d:\Test

Thursday, March 25, 2010

How to JailBreak and Unlock iphone

I recently bought an iphone 3g in ebay. The phone came up AT&T sim card and locked.

The phone is having 3.1.2(7D11) firmware and 05.11.07 baseband.

I initially tried to use the blackra1n. I used the following article to
jailbreak and unlock my iphone 3g version. It is extremely easy to use this utility. You just need to connect your iphone to the computer and run the blackrain utility.

http://www.iphonedownloadblog.com/2009/11/03/tutorial-jailbreak-iphone-3-1-2-blackra1n/

But after unlocking I found various problems like GPS not working and ssh to the iphone is not working etc. I found that all these problems are due to some bugs in the blackra1n jail breaking code.

Because of these problems I decided to use some other jail broken solutions so that I can get back my GPS and other stuff that were broken with the blackra1n.

Here is the procedure that I followed for this.

First I downloaded the utility from the site
http://downloads.ih8sn0w.com/f0recast-1.1.exe

Connect your iphone to the computer and run this utility.

Here is the screen shot from that utility.

screenshot.8

From here I found that I can use any jail broken utility so I decided
use redsn0w for this as this is from iphone dev team.

As my phone was already jailbroken I want to restore to the base settings.

I downloaded the 3.1.2 firmware from the location given below ( Please note that you need to check your firmware version from iphone using Settings-> General -> Version , my version is 3.1.2(7D11) and download the correct version only.


so I downloaded the corresponding the firmware version from the location

http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-7468.20100202.pbnrt/iPhone1,2_3.1.3_7E18_Restore.ipsw

After downloading connect your iphone to the itunes and Press the Shift button and Click on Restore button , this will ask
for the iphone firmware file and here select the file iPhone1,2_3.1.3_7E18_Restore.ipsw.

iTunes will automatically put the iphone in the restore mode and reboots the iphone. After this operation iphone will be in the factory condition with locked. In this mode you will be only able to make emergency calls only. Do not get panic at thing point of time. We need to jailbreak this to get the iphone screen back.

Download redsnow 9.2 from the following link

http://xs1.iphwn.org/rs//redsn0w-win_0.9.2.zip

extract this file to a directory and copy the file iPhone1,2_3.1.3_7E18_Restore.ipsw  to the same directory.

Now run the program redsn0w.exe and click on the browse button and select the  iPhone1,2_3.1.3_7E18_Restore.ipsw
file.

Here is the screen shot for that ,

screenshot.9

Now click on the next button and select the option's
Install Cydia etc.

screenshot.14

After this follow the exact steps mentioned in the screen, You need to enter the iphone in to DFU mode and the redSn0w does the rest. If you are not a expert of iphone you may need to try this 3 or 4 times.

screenshot.15

screenshot.16

After this operation your phone is Jail Broken.

Now you need to unlock the phone. Please use the following link to unlock the phone using the blacksn0w.

Ensure that you have a wi-fi connection in your home before trying this. Enable the wi-fi connection on your iphone so that you can download the unlock utility using this wi-fi connection.

This is also extremely easy you , you can follow the url given below for more details on this.

http://www.aboutonlinetips.com/unlock-iphone-3g-3gs-os-3-1-2-using-blacksn0w-via-cydia/

Step 1 - Start ‘Cydia’ on your iPhone springboard.
Step 2 - Select ‘Manage’ tab at the bottom of your iPhone screen and then select ‘Sources’.
Step 3 - Select ‘Edit’ and then select ‘Add’. Now enter a url source. Type ‘http://blackra1n.com’ and select on ‘Add Source’. Once Cydia has added the source click on ‘Return to Cydia’ button.
Step 4 – Once the installation is completed. Search for ‘blacksn0w’ in Cydia and install it.
Step 5 - Reboot your iPhone. Your iPhone 3G or 3GS on 3.1.2 firmware will be unlocked automatically.

Disabling Windows 2003 Internet explorer security settings

Windows Server 2003 shipped with security locked down by default.  Part of this locking down is Internet Explorer Enhanced Security which is an extra layer of protection when surfing the internet using Internet Explorer (more information can be found by going here on a Windows Server 2003 [test] machine). 

Click Start, put your mouse over Control Panel, and click Add/Remove Programs

Now click Add/Remove Windows Components

After a few seconds a window will pop-up.  Click the check mark next to Internet Explorer Enhanced Security Configuration (to make it unchecked).  If you'd like to only disable it for Administrators or only for Users you can click Details and do so.

Press Next, after this internet explorer will work in the same way that is used to work with Windows XP.

Monday, March 22, 2010

How to use Custom ringtones in iPhone

1. Get access to the mp3 or wav file that you want to convert to a ringtone. In my example, I am looking for a rock drummer loop as a ringtone for my friend who is a monkey percussionist.

2. Drag the file into iTunes

3. Select the file in iTunes and then select Convert Selection to AAC in the Advanced menu.

4. Select your new AAC file and select Show in Finder in the File menu

5. In finder, select the file and select Get Info from the File menu and iPhone features

6. Change the file extension from .m4a to .m4r

7. Confirm when the dialog asks if you really want to make the change

8. Drag the new file back into iTunes. The original files will remain but the ringtone will disappear. (It is actually being moved to following location: ~/Music/iTunes/iTunes Music/Ringtones )

9. Connect your iPhone and select the Ringtone tab in iTunes. Select the new ringtone that has been created.

10. Now simply sync your iphone with iTunes.

11. Now you can select the Ringtone you wish.

Monday, March 08, 2010

How to find out the OIM code that gets executed when you click a link on the OIM WebConsole

1. Most of the code is present in the file
C:\oim9102-Jboss\oim-server\xellerate\webapp\xlWebApp.war

2. Extract this file to a temporary directory

3. From the WebConsole note down the URL
i.e.  http://localhost:8080/xlWebApp/AboutXl.do

4. Open the file tiles-defs.xml and look for the entry "AboutXl" in this file

From this we can find out that this is the JSP tjspAboutXlTiles.jsp that gets executed

<definition name="site.AboutXl.page" extends="site.mainLayout">
        <put name="title" value="global.window.title.aboutOIM" />
        <put name="body" value="/tiles/tjspAboutXlTiles.jsp" />
  </definition>

5. Open the file struts-config.xml and look for the entry "tjspAboutXl"

Here you will find the entries as

  <action type="com.thortech.xl.webclient.actions.tcAboutXlAction"
           name="AboutXlForm"
           scope="request"
                 path="/AboutXl" >
    <forward name="success" path="/pages/tjspAboutXl.jsp" />           
    </action>
6. Open the com.thortech.xl.webclient.actions.tcAboutXlAction.class file and here you will find this is
calling some EJB code

if (localActionForward != null)
        return localActionForward;
      HttpSession localHttpSession = paramHttpServletRequest.getSession();
      tcAboutXlForm localtcAboutXlForm = (tcAboutXlForm)paramActionForm;
      Hashtable localHashtable = new Hashtable();
      tcHelpOperationsIntf localtcHelpOperationsIntf = getHelpOperIntf(paramHttpServletRequest.getSession(), null);
      localHashtable = (Hashtable)localtcHelpOperationsIntf.getHelpAbout();
      localtcAboutXlForm.setAboutXl(localHashtable);
      logger.debug(LoggerMessages.getMessage("LeftMethodDebug", "tcAboutXlAction/execute"));
      return paramActionMapping.findForward("success");
7. tcHelpOperationsIntf is the Interface and the corresponding class for this is
tcHelpOperationsBean.java file.

This is actual EJB code it is calling

public Map getHelpAbout()
    throws tcAPIException
  {
    logger.debug(LoggerMessages.getMessage("EnteredMethodDebug", "tcHelpOperationsBean/getHelpAbout"));
    Hashtable localHashtable = new Hashtable();
    localHashtable.put("Version", "9.1.0.1865.28");
    localHashtable.put("Build", "1865.28");
    String str = "select xsd_value as build from xsd where xsd_code='XL_BUILD_NUMBER'";
....
..

How OIM find's out the Version Details

OIM checks the version information from 3 places

1. It checks from the database by issuing the following query

select XSD_VALUE from XSD where XSD_CODE='XL_BUILD_NUMBER';

XSD_VALUE
--------------------------------------------------------------------------------
9.1.0.1866.25

2.  OIM-HOME\config\Version.prop file , this file contains the following entries

#Wed Feb 17 21:14:42 PST 2010
build.number=9.1.0.1866.25
product.version=9.1.0.2

3. There is a third place where this information is hardcoded in the EJB code.

When you click on the OIM WebConsole Help->About this is the EJB code that gets executed. This class is present in the xlDataObjectBeans.jar file.

Check the file tcHelpOperationsBean.java in the com.thortech.xl.ejb.beansimpl package.

com.thortech.xl.ejb.beansimpl.tcHelpOperationsBean.class file contans the version info

public Map getHelpAbout()
    throws tcAPIException
  {
    logger.debug(LoggerMessages.getMessage("EnteredMethodDebug", "tcHelpOperationsBean/getHelpAbout"));
    Hashtable localHashtable = new Hashtable();
    localHashtable.put("Version", "9.1.0.1866.25");
    localHashtable.put("Build", "1866.25");
    String str = "select xsd_value as build from xsd where xsd_code='XL_BUILD_NUMBER'";

....
..

Friday, March 05, 2010

OIM is accepting connections from local host only

1. Open the file C:\oim9102-Jboss\jboss-4.2.3.GA\server\default\deploy\jboss-web.deployer\server.xml
2. Change the line 
<Connector port="8080" address="${jboss.bind.address}" 
to 
<Connector port="8080" address="0.0.0.0" 
After this restart the JBoss server

Friday, February 26, 2010

How to TRACE JDBC Statements from a JDBC Program

1. Copy the jar file ojdbc14_g.jar in to the classpath. In the case of JBOSS application Server copy the file in to the directory D:\OIM9101-Jboss\jboss-4.2.3.GA\server\default\lib.

Please note that if there is a ojdbc14.jar you need to remove this file first.

2. Add the following java arguments to your java program

-Doracle.jdbc.Trace=true -Djava.util.logging.config.file=OracleLog.properties 

If you are using JBOSS App Server then use the following

set JAVA_OPTS=%JAVA_OPTS% -Xms256m -Xmx1024m -XX:PermSize=128m -Doracle.jdbc.Trace=true -Djava.util.logging.config.file=OracleLog.properties 

3. The OracleLog.properties  file contains 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=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
# This is the setting needed for sql debug
oracle.jdbc.driver.level=CONFIG
#oracle.jdbc.pool.level=CONFIG
#oracle.jdbc.util.level=CONFIG
#oracle.sql.level=CONFIG

#oracle.jdbc.driver.level=FINE

6. Run your JDBC Program , assuming you statement is

select pty_key , pty_value from pty  where pty_keyword = :1

This is the Bind Parameter value

INFO: OraclePreparedStatement.setString(paramIndex=1, x=XL.MaxLoginAttempts)

Feb 27, 2010 12:00:41 PM oracle.jdbc.driver.PhysicalConnection getDefaultFixedString
INFO: PhysicalConnection.getDefaultFixedString() returning false
Feb 27, 2010 12:00:41 PM oracle.jdbc.driver.OraclePreparedStatement setString
INFO: OraclePreparedStatement.setString(paramIndex=1, x=XL.MaxLoginAttempts)
Feb 27, 2010 12:00:41 PM oracle.jdbc.driver.OracleStatement doExecuteWithTimeout
CONFIG: SQL: "select pty_key , pty_value from pty  where pty_keyword = :1"
Feb 27, 2010 12:00:41 PM oracle.jdbc.driver.T4CPreparedStatement allocateTmpByteArray
SEVERE: oracle.jdbc.driver.T4CPreparedStatement.allocateTmpByteArray : Re-allocate byte array of size : 80
Feb 27, 2010 12:00:41 PM oracle.jdbc.driver.OracleResultSetImpl findColumn
INFO: OracleResultSetImpl.findColumn(columnName=pty_value)
Feb 27, 2010 12:00:41 PM oracle.jdbc.driver.OracleResultSetImpl getString
INFO: OracleResultSetImpl.getString(columnIndex=2)
Feb 27, 2010 12:00:41 PM oracle.jdbc.driver.OracleResultSetImpl close
INFO: OracleResultSetImpl.close()

Friday, December 04, 2009

How do you find whether a Java file is compiled with the debugging info or not

Open the file using the JD-GUI utility
http://java.decompiler.free.fr/?q=jdgui
Click on a particular .class file , after this go to the menu option
Navigate -> Go to Line option
If this option is not grayed out then that particular jar file has the debug info included.
To find the line info you can also use the following
javap -l SearchJars
This will display LineNumberTable
LineNumberTable:
line 13: 0
line 14: 16
line 15: 27
If this comes up then that means the debugging info is included in to the class file.

Wednesday, November 11, 2009

Windows Mobile Programming Tips

How to start the Windows Mobile Emulators from the command line.

"C:\Program Files\Microsoft Device Emulator\1.0\DeviceEmulator.exe"   "C:\Program Files\Windows Mobile 6 SDK\PocketPC\Deviceemulation\0409\PPC_USA.BIN" /memsize 128 /s "d:\EmulatorState_prof.dess"

"C:\Program Files\Microsoft Device Emulator\1.0\DeviceEmulator.exe"   "C:\Program Files\Windows Mobile 6 SDK\Smartphone\Deviceemulation\0409\SP_USA_GSM_QVGA_LS_VR.bin" /memsize 128 /s "d:\EmulatorState_std.dess"

Monday, November 02, 2009

How to use the same server session with the Terminal Server's

1. First try to run the command mstsc /v:fmwbde
(If you are lucky you will be connected to the same session)
2. If you are not able to connect to the same session then run the command mstsc /v:fmwbde /admin
This will connect to the admin server console.
3. Open the terminal service manager and select a particulr session and try to connect to this session.

Monday, October 05, 2009

Deployment Management Links are not working On Weblogic 10. 3.1.0

When trying to access the Deployment Management Links Export and Import are not working with the Weblogic 10.3.1.0 version. This fails with the following error
Either Your Session timed out or you are trying to access a page without logging in.
How ever this works fine on WebLogic 10.3.0.0 version.

There is some change in the functionality due to cross-site scripting vulnerability reasons. Please refer to the Note 866405.1 Applet/Javascript does not have access to JSESSIONID (httponly) cookie for more details on this.

For the Deployment Management Links to work you need to edit the file

C:\oim_server\xellerate\OIMApplications\WLXellerateFull.ear\xlWebApp.war\WEB-INF\weblogic.xml

and add the following entries

<session-descriptor>

<cookie-http-only>false</cookie-http-only>

</session-descriptor>

After the changes the weblogic.xml should look like this ,

<?xml version='1.0' encoding='UTF-8'?> 
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd"> 
<security-role-assignment> 
<role-name>User</role-name> 
<principal-name>User</principal-name> 
</security-role-assignment> 
<jsp-descriptor> 
<encoding>UTF-8</encoding> 
</jsp-descriptor> 
<container-descriptor> 
<filter-dispatched-requests-enabled>false</filter-dispatched-requests-enabled> 
</container-descriptor> 
<session-descriptor> 
<cookie-http-only>false</cookie-http-only> 
</session-descriptor> 
</weblogic-web-app> 

Restart the weblogic server after the above changes.

Friday, September 04, 2009

How to Install OIM On WebLogic

This summary is not available. Please click here to view the post.

Friday, August 14, 2009

Sorting the files on the drive (USB Drive)

Sony music system in my car reads files in the order they are stored on the flash drive , which is very stupid in my opinion. Ideally it
should read the file in some alphabetical order or based on the last modified date. I found a program call DriveSort which reorganizes the files on a drive so they are in alphabetical order.

Download this program from the location http://www.anerty.net/software/file/DriveSort.php
and open the drive. After this sort the files and save the directory.

Please also refer to this URL for more details on this

http://www.murraymoffatt.com/software-problem-0010.html

Monday, July 27, 2009

Vncviewer clipboard operations like copy/cut+paste suddenly stops on linux

Many times you must have observed that clipboard operations like copy/cut and paste suddenly stops workings with the vncviewer. The main reason for this there is a program called as vncconfig responsible for these clipboard transfers. Some times the program may get closed because of some bug in vnc or some other reasons like you closed that window.

To get those clipboard operations back you need to run the program "vncconfig &".

After this your clipboard actions should work fine with out any problems.

Friday, July 24, 2009

Set up environment for linux to install Oracle Software

// Change sysctl.conf file to add the kernel parmeters

cat >> /etc/sysctl.conf << EOF
#This sets SEMMSL, SEMMNS, SEMOPM, SEMMNI
kernel.sem = 256 32000 100 142
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.msgmnb = 65535
kernel.msgmni = 2878
fs.file-max = 206173
EOF

// Persist the sysctl.conf entries

sysctl –p

// Change the ulimit values

cat >> /etc/security/limits.conf << EOF
# Oracle Application Server settings
* soft nofile 2048
* hard nofile 65536
* soft nproc  2047
* hard nproc  16384
EOF

cat >> /etc/pam.d/login << EOF
session required /lib/security/pam_limits.so
EOF

cat >> /etc/profile << EOF
ulimit -u 16384 -n 65536
EOF

#### Oracle requirements for 11gR2 database ########
kernel.sem = 256 32000 100 142
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.shmall = 2097152
kernel.msgmnb = 65535
kernel.msgmni = 2878
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048576
fs.aio-max-nr = 1048576


RPMs needed for 11gR2 Database


libaio-devel-0.3.106-3.2.i386.rpm
sysstat-7.0.2-3.SEL5_2.i386.rpm
unixODBC-devel-2.2.11-7.1.i386.rpm


local copy at \\disco1bdeapac\home\oracle\softwares\RPM112DB (oracle/oracle) windows browseable

Saturday, July 18, 2009

How to Use Jmeter to do the LDAP/OID Load Testing

This summary is not available. Please click here to view the post.

How to use Jmeter to load test Portal Application

1. Download the latest Jmeter version from http://jakarta.apache.org/jmeter/

2. Set the JDK 1.5 or JDK 1.6 in your path and run jmeter.bat batch file

3. Create a Thread Group with the following values

Set the number of Threads to 50 and the Loop Count to 10. This will send 500 requests to the server

screenshot.9 

4. Under the ThreadGroup create HTTP Cookie Manager with the following values

The CookieManager is required to pass the cookie values across the different page requests. Otherwise Jmeter ignores the cookie value.

In the cookie manager select the Check Bog Clear Cookies each iteration and set the Cookie Policy to Default.

screenshot.10

5. Under the Thread group create a Loop Controller

Right Click on the Thread Group and Add Logical Controller –> Loop Controller

6. Under the Loop Controller Add Sampler –> HTTP Request HTTP Client

Set the Server Name as say xxx.xxx.oracle.com and Port as 7784 enter the Path as /portal/page?_pageid=33,1&_dad=portal&_schema=PORTAL&_mode=16 Select the CheckBox “Follow Redirects”

screenshot.11

7. Under HTTP Request HTTP Client add the HTTP Authorization Manager

Add the Portal username and password in this example I used orcladmin and welcome1.

screenshot.12

8. Add another Portal Page for testing

Under the Loop Controller Add Sampler –> HTTP Request HTTP Client

screenshot.14

9. Add another SSO Protected  Page for testing

Under the Loop Controller Add Sampler –> HTTP Request HTTP Client

Use the following values shown below

screenshot.13

10. This is how the JMeter project looks like after doing the above steps

screenshot.15

11. Now run the Jmeter project by Pressing  Control+R or the Menu option Control+R

12. Check the access_log file for the requests from the Jmeter load test