Search This Blog

Thursday, December 01, 2011

How to Add a Hard Disk Space to Oracle VM

 

1. Create a 30GB file ,

dd if=/dev/zero of=fmw11g.img  bs=1024k count=30000

2. Add the file /OVM/linuxvm/fmw11g.img
to the vm.cfg file , for example ,

disk = ['file:/OVM/linuxvm/System.img,xvda,w','file:/OVM/linuxvm/fmw11g.img,xvdb,w',]

3. Now start the VM by using the command ,
xm create vm.cfg

4. In the fdisk -l command , you should be able to see this file ,

For example ,

fdisk -l

Disk /dev/xvda: 12.8 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          13      104391   83  Linux
/dev/xvda2              14        1264    10048657+  83  Linux
/dev/xvda3            1265        1566     2425815   82  Linux swap / Solaris

Disk /dev/xvdb: 31.4 GB, 31457280000 bytes
255 heads, 63 sectors/track, 3824 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

5. using fdisk /dev/xvdb command create a partion and format that partition
using the command ,

mkfs.ext3 /dev/xvdb1

6. After this mount this file system by adding this entry to the /etc/fstab file ,
/dev/xvdb1             /fmw11g                   ext3    defaults        1 2

run the command , mount -a

Friday, November 25, 2011

Find out whether a Schema is Valid or Not

 

Some times in SOA you need to find out whether the schema you have designed/developed is valid and conforms to XML schema standards etc.

For this you can use the JDK 1.6 tool xjc.exe to check ,

%JDK_HOME%\bin\xjc.exe <your-schema-file> and check whether you are getting errors or not.
When I ran the xjc command with the original schmea , I got the errors
parsing a schema...
[ERROR] sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of 'party,IdentificationType'.
  line 45 of file:/D:/bugs-download/Bug12965191/restriction_example/restriction/schema-restriction/xsd/party/party.xsd
[ERROR] rcase-Recurse.2: There is not a complete functional mapping between the particles.
  line 7 of file:/D:/bugs-download/Bug12965191/restriction_example/restriction/schema-restriction/xsd/local-party.xsd
[ERROR] derivation-ok-restriction.5.4.2: Error for type 'LocalPartyType7'.  The particle of the type is not a valid restriction of the particle of the base.
  line 7 of file:/D:/bugs-download/Bug12965191/restriction_example/restriction/schema-restriction/xsd/local-party.xsd
Failed to parse a schema.

The above error indicates that schema is not a valid schema.

Wednesday, November 23, 2011

How to set the SOA composite name

 

By default no composite name is set when a SOA componenet gets executed.


XPath for Mediator components:
Use the the following XPath expression in an Assign value dialog when you define a routing rule.

med:setCompositeInstanceTitle(title string)

and use the following target tracking.compositeInstanceTitle.
Note: this property will not appear in the property selection dialog, but can be used though.


Java for BPEL components
Add an Embedded Java activity inside your process flow and add the following function to it:

setCompositeInstanceTitle(title string);
for example ,

In the java embeding add the following code ,

System.out.println("Hello, World 11 "+ new java.util.Date());
setCompositeInstanceTitle("Hello, World 11 "+ new java.util.Date());

Reference

http://docs.oracle.com/cd/E15523_01/integration.1111/e10226/soacompapp_mang.htm

 

For 10g use

System.out.println("Hello, World 11 "+ new java.util.Date());
setTitle("Hello, World 11 "+ new java.util.Date());

Tuesday, October 11, 2011

HTTP Proxy Server Settings for the SOA/Weblogic Server

 

Set the following env variables before staring the SOA Server ,

On Unix

export JAVA_OPTIONS="-Dhttp.proxySet=true -Dhttp.proxyHost=www-proxy.xxx.xxx.com  -Dhttp.proxyPort=80  -Dhttp.nonProxyHosts=localhost.localdomain|127.0.0.1|localhost|*.idc.oracle.com"  

On Windows

On Unix

set JAVA_OPTIONS="-Dhttp.proxySet=true -Dhttp.proxyHost=www-proxy.xx.xx.com  -Dhttp.proxyPort=80  -Dhttp.nonProxyHosts=localhost.localdomain|127.0.0.1|localhost|*.idc.oracle.com"  

 

After this start the WebLogic Server.

Tuesday, October 04, 2011

BPEL Example of Inserting to Array

 

I have the following XSD Element ,

Basically this structure stores the name and address (multiple values) , state , country and pincode etc ,
My requirement is to add the data to this element from a BPEL process ,

<complexType>
     <sequence>
  <element name="fullname" type="string"/>       
          <element name="addrline" type="string" maxOccurs="unbounded"/>
                <element name="state" type="string"/>
        <element name="country" type="string"/>
        <element name="zip" type="string"/>
            </sequence>
  </complexType>

Create a simple BPEL process , and for the output select the above XSD element , in the BPEL

 


























Near Dairy Circle




Next to Christ University




Bannerghata Road







How to start the VM in Single user mode in Oracle VM 2.2/3.0/XEN

 

Add the following line to the end of the file vm.cfg file ,

extra = 'single'

to the xen domU config file

After this start the VM using the command ,

xm create vm.cfg

This will start the VM in single user mode.

How to Run the Oracle VM 2.2 Images on Oracle VM 3.0 With out the Oracle VM Manager

 

I am having problems with the Oracle VM manager 3.0 as it needs 6GB machine to run in my home. Here is the procedure I followed to run the Oracle VM 2.2 images on Oracle VM 3.0.

 

1. You need to set the Bridged Networking on Oracle VM 3.0

open the file

vi /etc/xen/xend-config.sxp

Uncomment the following line , (Line no 163)

(network-script network-bridge)

And also ensure that you have the following line uncommented (line 178)

(vif-script vif-bridge)

After this restart the Oracle VM Server

Run the command ,

brctl show  (This displays the following , )

bridge name     bridge id               STP enabled     interfaces
bond0           8000.0021918b3e8a       no              pbond0

In the linux guest vm I have the following line ,

vfb = ['type=vnc,vncunused=1,vnclisten=0.0.0.0']
vif = ['type=netfront']

In the Windows Guest OS I have the following line ,

vif = ['bridge=bond0,mac=00:16:3E:26:BE:CE,type=ioemu']

Start the VM’s manually using the command

xm create vm.cfg

Sunday, July 31, 2011

Wants to Send SMS Reminder at a future data and only one

 

I want to fire a job at 9:59 AM on July-14-2011 , 7/14/2011 (MM/DD/YYYY)

echo /home/ias/Oracle/Middleware/jdk160_18/bin/java -cp /home/ias/JavaUtils Sms160By2 9198808XXXXX "\"Test 5"\" | at 9:59 AM 7/14/2011

Install VmWare ESXI Server from USB

 

1) Format the US Drive with fat32.
2) Get Syslinux, not the version 4, but an older version. Use 3.86 from http://www.kernel.org/pub/linux/utils/boot/syslinux/3.xx/
Version 4 can give you an error on boot, "invalid c32 image".
3) Run syslinux: syslinux.exe -m -f -a G: (G: being the drive letter).
4) Get the ESXi iso,  VMware-VMvisor-Installer-4.1.0.update1-348481.x86_64.iso
5) Extract the iso, using the 7-Zip and copy contents to usb drive
6) Rename isolinux.cfg to syslinux.cfg
7) Modify the syslinux.cfg, add "ks=usb" after vmkboot.gz

For example ,

append vmkboot.gz ks=usb --- vmkernel.gz --- sys.vgz --- cim.vgz --- ienviron.vgz --- install.vgz

8) Create the ks.cfg file in the USB root directory with the following contents

vmaccepteula
rootpw Welcome1
autopart --firstdisk --overwritevmfs
install usb
network --bootproto=dhcp --device=vmnic0

9) Boot it from the USB and install the ESXi software

Sunday, July 24, 2011

Installing VMware ESXi on a USB Memory Stick

1.The first thing you’ll need is a spare USB memory stick. I used 1 8GB USB drive for this. But 4GB or 2GB is also sufficient for this.
                                                                                                                                                                                                                                                                                                                                         2.  The next step is to download ESXi from VMware here and burn if off onto CD.

3. Now insert the USB memory stick into a USB port which is able to be booted.
Though at this stage make sure that your server can boot from the CD/DVD drive.

4. Insert the CD containing the ESXi install into the servers CD/DVD drive and boot or restart the server.
Choose the default options.

5. At this stage you will see a list of all your storage devices connected to your VMware ESXi host – select your USB memory stick and press 'Enter'

6. Wait while the ESXi is written down to your USB flash drive – at this point you should see it flashing away
                                                                                                                                                                                                        
7. Once the installation has completed you will receive the screen below.  At this point remove the ESXi installation CD from the servers CD/DVD drive and press ‘Enter’ to reboot the server.
IMPORTANT: Upon the server rebooting ensure that its boot priority order is set so that the USB port(s) are booted from first.


Your server should now be booting successfully off of the USB memory stick to VMware ESXi  4 – all you need to do now is configure it!

After this you have to create a VMFS file system that can be used as a data store ,

For this you need to create a VMFS file system. First run the command ,

fdisk -l                                                        
                                                                                                                                                 
Disk /dev/disks/t10.ATA_____WDC_WD10EARS2D00Y5B1__________________________WD2DWCAV5H240740: 1000.2 GB, 1000204886016 bytes                      
255 heads, 63 sectors/track, 121601 cylinders                                                                                                   
Units = cylinders of 16065 * 512 = 8225280 bytes                                                                                                
                                                                                                                                                
                                                                                  Device Boot      Start         End      Blocks  Id System      
/dev/disks/t10.ATA_____WDC_WD10EARS2D00Y5B1__________________________WD2DWCAV5H240740p1   *         1        13    102400    7  HPFS/NTFS       
Partition 1 does not end on cylinder boundary                                                                                                   
/dev/disks/t10.ATA_____WDC_WD10EARS2D00Y5B1__________________________WD2DWCAV5H240740p2            13     19123 153497600    7  HPFS/NTFS       
/dev/disks/t10.ATA_____WDC_WD10EARS2D00Y5B1__________________________WD2DWCAV5H240740p3         19123     31871 102400000    7  HPFS/NTFS       
...      
/dev/disks/t10.ATA_____WDC_WD10EARS2D00Y5B1__________________________WD2DWCAV5H240740p8         39573     51731  97659146   83  Linux 
 
And run the command
fdisk /dev/disks/t10.ATA_____WDC_WD10EARS2D00Y5B1__________________________WD2DWCAV5H240740

and create a partion , and specify the format type as "fb". This is for the VMFS file system.

In the fdisk , type "t". It will ask you for partition number. This is where that first fdisk is useful. You need to know what the new partition number is.
It will be one more than the last number on fdisk. Type this number in

You will now be prompted for the hex code for the partition type. You can also type "L" for a list of codes. The code you want is "fb". So type "fb" in the space. This will return that the partition has been changed to fb (unknown).

Now run the command to create the VMFS file system ,

vmkfstools -C vmfs3 -S storage1 /vmfs/devices/disks/vml.0100000000202020202057442d574341563548323430373430574443205744:9                                      
Checking if remote hosts are using this device as a valid file system. This may take a few seconds...                                                          
Creating vmfs3 file system on "t10.ATA_____WDC_WD10EARS2D00Y5B1__________________________WD2DWCAV5H240740:9" with blockSize 1048576 and volume label "storage1".
Successfully created new volume: 4e2c8868-54253438-de36-001aa0c2472f        
 
 
If you do not specify the VMFS file system , while creating the vmfs file system you may get the error as ,

vmkfstools -C vmfs3 -S storage1 /vmfs/devices/disks/vml.0100000000202020202057442d574341563548323430373430574443205744:9                                      
Checking if remote hosts are using this device as a valid file system. This may take a few seconds...                                                          
Creating vmfs3 file system on "t10.ATA_____WDC_WD10EARS2D00Y5B1__________________________WD2DWCAV5H240740:9" with blockSize 1048576 and volume label "storage1".vmkfstools -C vmfs3 -S storage1 /vmfs/devices/disks/vml.0100000000202020202057442d574341563548323430373430574443205744:9
/vmfs/devices/disks/vml.0100000000202020202057442d574341563548323430373430574443205744:9: Permission denied.  (Have you set the partition type to 0xfb?)       
Error: Permission denied

Now in the VMWare VSphere Client you can see the datastore.

Thursday, July 21, 2011

Sending SMS to Multiple People

 

Sending SMS to Multiple People

I used the following code available at

https://sourceforge.net/projects/servalivecheck/

I have a file say sms.txt with the following entries I want to send an SMS to all the people in this file.

Sms.lst has the following entries

Ravi,9198808XXXXX

Naveen,919663XXXXX

In Unix create an shell script with the following entries

cat dd.sh

#!/bin/bash

for x in `awk -F',' '{ print $2 }' sms.lst`

do

/home/ias/Oracle/Middleware/jdk160_18/bin/java -cp /home/ias/JavaUtils Sms160By2 $x "\" We are playing Cricket on this Saturday "\"

Done

On Windows run the following batch file ,

for /F "tokens=2* delims=," %i in (sms.lst) do java -cp . Sms160By2 %i "We are playing Cricket on this Saturday"

This sends the SMS to all the people in the group.

Tuesday, July 12, 2011

Yum Configuration With OEL

Refer to the URL , http://public-yum.oracle.com/ for more details on this.

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 5

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

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

Begin using yum, for example:

yum list

yum install firefox


After this install the oracle-validated package this will install the necessary packages and sets the kernel parameters
and also creates oracle user etc.

yum install oracle-validated

Sunday, July 10, 2011

Parsing Railway’s PNR Data (JSON Parsing)

 

Here I am using a Service from the following URL ,

http://pnrapi.appspot.com/<pnr-number>

for example ,

http://pnrapi.appspot.com/1416780219

This gives the data in the following format ,

{'status': 'OK', 'data': {'passenger': [{'status': 'G3  , 45', 'seat_number': 'W/L   15,CK'}],
'from': 'SC', 'alight': 'YPR', 'pnr_number': '1416780219', 'train_number': '*12735',
'to': 'YPR', 'board': 'SC', 'train_name': 'YPR GARIB RATH',
'travel_date': {'date': '26-6-2011', 'timestamp': 1309046400}, 'class': '3A'}}

you need to have the following jar files in the classpath ,

D:\fmw1114\Middleware\jdk160_21\bin\javaw.exe -client -classpath C:\JDeveloper\mywork\Application5\Project1\classes;D:\commons-httpclient-3.1\commons-io-2.0.1.jar;D:\commons-httpclient-3.1\json-lib-2.4-jdk15.jar;D:\commons-httpclient-3.1\commons-httpclient-3.1.jar;D:\commons-httpclient-3.1\commons-lang-2.6.jar;D:\commons-httpclient-3.1\commons-logging-1.1.1.jar;D:\commons-httpclient-3.1\commons-logging-adapters-1.1.1.jar;D:\commons-httpclient-3.1\commons-logging-api-1.1.1.jar;D:\commons-httpclient-3.1\commons-logging-tests.jar;D:\commons-httpclient-3.1\ezmorph-1.0.6.jar;D:\commons-httpclient-3.1\commons-collections-3.2.1.jar;D:\commons-httpclient-3.1\commons-beanutils-1.8.3.jar;D:\commons-httpclient-3.1\commons-beanutils-bean-collections-1.8.3.jar;D:\commons-httpclient-3.1\commons-beanutils-core-1.8.3.jar project1.ParsePNR


package project1;

import java.io.BufferedReader;
import java.io.InputStream;

import java.io.InputStreamReader;

import java.net.URL;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import net.sf.json.JSONSerializer;
import org.apache.commons.io.IOUtils;


public class ParsePNR {
public ParsePNR() {
super();
}

public static void main(String[] args) throws Exception {
// InputStream is =
// ParsingJSON.class.getResourceAsStream( "c:\\sample-json.txt");
// String jsonTxt = IOUtils.toString( is );
/*
String test = "\"status\" : \"OK\",\n" +
"\"data\" : { \n" +
" \"train_name\" : \"ERNAKULAM EXP\",\n" +
" \"train_number\" : \"*12677\",\n" +
" \"from\" : \"SBC\",\n" +
" \"to\" : \"CBE\",\n" +
" \"alight\" : \"CBE\",\n" +
" \"board\" : \"SBC\",\n" +
" \"class\" : \"2S\",\n" +
" \"travel_date\" : \"2- 6-2011\"\n" +
" \"passenger\" : [ { \"seat_number\" : \"D8 , 31,GN\", \"status\" : \"CNF\" },\n" +
" { \"seat_number\" : \"D8 , 32,GN\", \"status\" : \"CNF\" } ]\n" +
" }";

// Sample Data (1 passenger)
{'status': 'OK', 'data': {'passenger': [{'status': 'G3 , 45', 'seat_number': 'W/L 15,CK'}], 'from': 'SC', 'alight': 'YPR', 'pnr_number': '1416780219', 'train_number': '*12735', 'to': 'YPR', 'board': 'SC', 'train_name': 'YPR GARIB RATH', 'travel_date': {'date': '26-6-2011', 'timestamp': 1309046400}, 'class': '3A'}}


// Sample Data (2 passenger)
{'status': 'OK', 'data': {'passenger': [{'status': 'G3 , 45', 'seat_number': 'W/L 15,CK'},{'status': 'G3 , 46', 'seat_number': 'W/L 16,CK'}], 'from': 'SC', 'alight': 'YPR', 'pnr_number': '1416780219', 'train_number': '*12735', 'to': 'YPR', 'board': 'SC', 'train_name': 'YPR GARIB RATH', 'travel_date': {'date': '26-6-2011', 'timestamp': 1309046400}, 'class': '3A'}}

Replace the class with class1 as class is a reserved word in java.

*/
String pnr="";
if (args.length == 0 )
pnr = "1416780219";
else
pnr = args[0];
System.setProperty("http.proxyHost", "www-proxy.us.oracle.com");
System.setProperty("http.proxyPort", "80");
System.setProperty("http.nonProxyHosts","*.us.oracle.com|*.oraclecorp.com|*.idc.oracle.com|*.uk.oracle.com|localhost");

URL url = new URL("http://pnrapi.appspot.com/"+pnr);
// Read all the text returned by the server
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String str="";
String line;
while ((line = in.readLine()) != null) {
// str is one line of text; readLine() strips the newline character(s)
str= str.concat(line );
// System.out.println(line);
System.out.println(str);
}
in.close();
str= str.replace("'class':","'class1':");
/*String jsonTxt ="{'status': 'OK', 'data': {'passenger': [{'status': 'G3 , 45', 'seat_number': 'W/L 15,CK'},{'status': 'G3 , 46', 'seat_number': 'W/L 16,CK'}], " +
"'from': 'SC', 'alight': 'YPR', 'pnr_number': '1416780219', " +
"'train_number': '*12735', 'to': 'YPR', 'board': 'SC', " +
"'train_name': 'YPR GARIB RATH', 'travel_date': {'date': '26-6-2011', 'timestamp': 1309046400}, " +
"'class1': '3A'}}"; */
String jsonTxt = str;
JSONObject json = (JSONObject) JSONSerializer.toJSON( jsonTxt );
String status = json.getString( "status" );
if (status.compareToIgnoreCase("INVALID") == 0) {

System.out.println("Status is "+status);
System.exit(0);

}
JSONObject data = json.getJSONObject("data");
String train_name = data.getString("train_name");
String train_number = data.getString("train_number");
String class_d = data.getString("class1");
String from = data.getString("from");
String alight = data.getString("alight");


JSONObject travel_date = data.getJSONObject("travel_date");
String date = travel_date.getString("date");




System.out.printf( "status: %s\n", status );

System.out.printf( "Train number : %s Tain Name : %s \n", train_number, train_name );
System.out.printf( "From : %s To : %s Date Of Travel : %s Class : %s\n", from, alight , date , class_d );

JSONArray passenger = data.getJSONArray("passenger");
int i1=0;
for (Object o : passenger) {
i1++;
JSONObject passengerDetails = (JSONObject) o;
String status_p = passengerDetails.getString("status");
String seat_number = passengerDetails.getString("seat_number");

System.out.printf( "Passenger : %d Current Status : %s Previous Staus : %s\n", i1, status_p, seat_number );

}



}
}

Wednesday, July 06, 2011

How to start the vncserver automatically

 

Open the file

vi .vnc/xstartup

and add the line


exec gnome-session &

and remove the line that starts with "twm"


chkconfig --level 3 vncserver on
chkconfig --level 5 vncserver on

 

Add the following line in /etc/sysconfig/vncservers

VNCSERVERS="1:root"

service vncserver start

Tuesday, July 05, 2011

XE On Linux

Oracle is installed to: /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle

To start XE

/etc/init.d/oracle-xe start

To stop XE

/etc/init.d/oracle-xe stop

 

export PATH=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin:$PATH
export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
export ORACLE_SID=XE

sqlplus "/ as sysdba"

 

If you want to use Oracle XE as your database, you have to set the RCU_JDBC_TRIM_BLOCKS environment variable to TRUE *prior* to running RCU. As a reminder as to support level, when running RCU against XE you will receive a warning stating that the database version is not supported by Oracle.

Wednesday, June 22, 2011

Adding Source Code to a Blog

http://codeshode.blogspot.com/2010/06/format-my-source-code-for-blogging.html

Copy the following Code

  • Copy the following code and paste it into your Blogger Template just above the </head> tag

 

<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/> 

<link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/> 

<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'></script

<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'></script

<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js' type='text/javascript'></script

<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'></script

<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'></script

<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'></script

<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js' type='text/javascript'></script

<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js' type='text/javascript'></script

<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js' type='text/javascript'></script

<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'></script

<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js' type='text/javascript'></script

<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'></script

<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js' type='text/javascript'></script

<script language='javascript'

SyntaxHighlighter.config.bloggerMode = true;

SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf';

SyntaxHighlighter.all();

</script>

 

  • Save the template
  • Then you can start creating code blocks in your existing or new Blog entries.
  • There are 2 ways to add a code block using syntaxhighlighter

Add the following cdoe ,

<pre class="brush: java">
// Comment
public class Testing
{
public Testing() {
}
public void Method()
{
/* Another Comment
on multiple lines */
int x = 9;
}
}
</pre>

How to use AQ with WebLogic Server

Create the jmsuser user for accessing the AQ
sqlplus SYS/manager1@ORCL AS SYSDBA

grant connect,resource,aq_administrator_role to jmsuser identified by jmsuser;
grant select on sys.DBA_PENDING_TRANSACTIONS to jmsuser;
grant execute on sys.dbms_aqadm to jmsuser;
grant execute on sys.dbms_aq to jmsuser;
grant execute on sys.dbms_aqin to jmsuser;
grant execute on sys.dbms_aqjms to jmsuser;
exec dbms_aqadm.grant_system_privilege('ENQUEUE_ANY','jmsuser');
exec dbms_aqadm.grant_system_privilege('DEQUEUE_ANY','jmsuser');


package webserv1;

import java.util.Hashtable;

import javax.jms.Message;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueReceiver;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.TextMessage;

import javax.naming.Context;
import javax.naming.InitialContext;

public class SendMsgQueue {
public SendMsgQueue() {
}

public static void main(String argv[]) throws Exception {

Hashtable env = new Hashtable();
// Standalone OC4J connection details
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "weblogic");
env.put(Context.SECURITY_CREDENTIALS, "welcome1");
env.put(Context.PROVIDER_URL, "t3://localhost:7001");
// env.put(Context.PROVIDER_URL, "t3://ceiacb5.us.oracle.com:7001");
InitialContext context = new InitialContext(env);


// The producer and consumer need to get a connection factory and use it to set up
// a connection and a session

QueueConnectionFactory connFactory = (QueueConnectionFactory) context.lookup("AQJMS_XAConnectionFactory");
QueueConnection conn = connFactory.createQueueConnection();
// This session is not transacted, and it uses automatic message acknowledgement
QueueSession session = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
Queue q = (Queue) context.lookup("jms/JMSDEMO_QUEUE1");
// Sender
QueueSender sender = session.createSender(q);
// Text message
TextMessage msg = session.createTextMessage();
msg.setText("Hello Test123");
System.out.println("Sending the message: "+msg.getText());
sender.send(msg);

session.close();
conn.close();
}
}


Program for Receving the Message


package webserv1;

import java.util.Hashtable;

import javax.jms.Message;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueReceiver;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.Session;
import javax.jms.TextMessage;

import javax.naming.Context;
import javax.naming.InitialContext;

public class RecvMsgQueue {
public RecvMsgQueue() {
super();
}

public static void main(String argv[]) throws Exception {

Hashtable env = new Hashtable();
// Standalone OC4J connection details
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "weblogic");
env.put(Context.SECURITY_CREDENTIALS, "welcome1");
env.put(Context.PROVIDER_URL, "t3://localhost:7001");
// env.put(Context.PROVIDER_URL, "t3://ceiacb5.us.oracle.com:7001");
InitialContext context = new InitialContext(env);

// The producer and consumer need to get a connection factory and use it to set up
// a connection and a session

// QueueConnectionFactory connFactory = (QueueConnectionFactory) context.lookup("jms/oc4jQueueConnFactory");
QueueConnectionFactory connFactory =(QueueConnectionFactory) context.lookup("AQJMS_XAConnectionFactory");


QueueConnection conn = connFactory.createQueueConnection();
// This session is not transacted, and it uses automatic message acknowledgement
QueueSession session = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

Queue q = (Queue) context.lookup("jms/JMSDEMO_QUEUE1");
// Queue q = (Queue) context.lookup("jms/oc4jQueue");
/* // Sender
QueueSender sender = session.createSender(q);
// Text message
TextMessage msg = session.createTextMessage();
msg.setText("Hello there!");
System.out.println("Sending the message: "+msg.getText());
sender.send(msg);

*/
// Receiver
QueueReceiver receiver = session.createReceiver(q);
conn.start();
Message m = receiver.receive();
if(m instanceof TextMessage) {
TextMessage txt = (TextMessage) m;
System.out.println("Message Received: "+txt.getText());
}
session.close();
conn.close();
}
}

Monday, June 20, 2011

How to Install multiple Linux Distributions in the same Machine

My requirement is to have the following OS's in my computer.

Windows 7
Redhat Linux 4
Oracle Enterprise Linux 5


First install Windows 7.

Using Windows 7 Disk Manager, create 3 partitions
say
hda5 => 50 GB (For RedHat Linux)
hda6 => 6 GB (For the Swap , we can use the same Swap for other linux install also)
hda7 => 50GB ((For Oracle Linux)

Now this install Redhat Linux 5 , select the root(/) partition as hda5
and swap as hda6. In the install screen please select the option to install the grub.

Now install Oracle Linux 5 , here select the root(/) partition as hda7
and swap as hda6.

In the install do not choose to install the grub option as you already have grub installed
by the first install.

Now Boot the machine in to Redhat Linux and mount the hda7 partition.

mount /dev/hda7 /test

Find out the files under the directory /test/boot directory ,

ls vm* init*

initrd-2.6.18-194.el5.img     vmlinuz-2.6.18-194.el5
initrd-2.6.18-194.el5PAE.img  vmlinuz-2.6.18-194.el5PAE

Now edit the /etc/grub.cong file and add the following entries

title Enterprise Linux (2.6.18-194.el5PAE)
        root (hd0,7)
        kernel /boot/vmlinuz-2.6.18-194.el5PAE ro root=LABEL=/ rhgb quiet
        initrd /boot/initrd-2.6.18-194.el5PAE.img
title Enterprise Linux-base (2.6.18-194.el5)
        root (hd0,7)
        kernel /boot/vmlinuz-2.6.18-194.el5 ro root=LABEL=/ rhgb quiet
        initrd /boot/initrd-2.6.18-194.el5.img

After this restart the machine and now you will see OEL , Windows 7 and Redhat in the grub boot screen.

Saturday, June 18, 2011

Changing the SOA Suite database Username etc in 10g

Changing the SOA Suite database Username etc in 10g

SOA 10g by default installs to orabpel and oraesb user. In a testing environment you may want to create more then one SOA 10g instance in one db. This procedure explains how to do that

1. First run the irca to create the necessary schemas.

./irca.sh all "xxxx.xxx.oracle.com 1521 xxx.xxx.oracle.com" welcome1 -overwrite ORABPEL welcome1  ORAESB welcome1 ORAWSM welcome1

Then run irca gaian with a different username's for example ORABPEL_OracleAS_3 , ORAESB_OracleAS_3 and ORAWSM_OracleAS_3.

./irca.sh all "xxx.xxx.oracle.com 1521 xxx.xxx.oracle.com" welcome1 -overwrite ORABPEL_OracleAS_3 welcome1  ORAESB_OracleAS_3 welcome1 ORAWSM_OracleAS_3 welcome1

2. Install the SOA Suite normally. SOA Suite 10g by default install in the orabpel and oraesb schema's only.

3. Now open the ${SOA_HOME}\j2ee\home\config\data-sources.xml file ,

and change the username and password etc for the data-sources. You can also use the EM Application Server control
for this purpose.


4.  From the ${SOA_HOME}\bpel\install\extensions directory, copy the following files to ${SOA_HOME}\bpel\domains\default\deploy:

    bpel_TaskActionHandler_1.0.jar
    bpel_TaskManager_1.0.jar

5. Connect to the oraesb schema  and run the following sql script ,

SQL> spool params.sql
SQL> SELECT 'INSERT INTO esb_parameter VALUES (''' || param_name || ''', ''' || param_value || ''');' FROM esb_parameter;
SQL> spool off
SQL> quit

Take the params.sql file and run it against the schema ORAESB_OracleAS_3.


6. Now apply the latest SOA 10g patch set ,
and run the schema upgrade scripts on the new schemans i.e ORABPEL_OracleAS_3 , ORAESB_OracleAS_3

If your SOA Suite is 10.1.3.3 or later, you will have to also run an additional script that updates the BPEL schema. This is documented in the install guides for each version, but in summary, the script is:

    ${SOA_HOME}\bpel\system\database\scripts\upgrade_10131_10135_oracle.sql


7. For OWSM open the file ,
${SOA_HOME}\owsm\bin\install_properties

Scroll down to the section that contains the install.db.* properties. After backing up the existing settings, modify them for your environment:

    install.db.type=oracle
    install.db.driver.type=thin
    install.db.host=localhost
    install.db.port=1521
    install.db.name=xe
    install.db.userid=oraowsm_OracleAS_1
    install.db.password=oraowsm

8. Run the command ,

${SOA_HOME}\owsm\bin\wsmadmin.bat install

9. Restart all the oc4j containers and check whether every thing is working fine or not.

Saturday, June 11, 2011

How to Add Shared Folders in VmWare Player

First Install the VMWare tools on the Guest OS.

With out the vmware tools the sharing feature may not work.

Launch VMWare Player. Confirm that the virtual machine that you want to modify the settings for it powered off, then right click it and click "Edit VM."

Click the "Options" tab on the top of the window, then click the "Shared Folders" category below.

Click the radio button labeled "Enabled." And add the directories you want to share.

Thursday, June 09, 2011

Search Oracle Forums

http://myforums.oracle.com/jive3/forum.jspa?forumID=3150 (integration_ww@oracle.com)
http://myforums.oracle.com/jive3/forum.jspa?forumID=3209 (helpwls_ww@oracle.com)
http://myforums.oracle.com/jive3/forum.jspa?forumID=3213 OC4J (helpj2ee_us@oracle.com)
http://myforums.oracle.com/jive3/forum.jspa?forumID=3208 Oracle Application Server (helpias_us@oracle.com)

SOA PS3 Purging Scripts With the Debug Option

spool soainfra_purge_n2_output3.txt
set serveroutput on
set pages 1000
ALTER PROCEDURE debug_purge  COMPILE PLSQL_CCFLAGS = 'debug_on:TRUE' REUSE SETTINGS;
ALTER PROCEDURE log_info COMPILE PLSQL_CCFLAGS = 'debug_on:TRUE' REUSE SETTINGS;

DECLARE

   MAX_CREATION_DATE timestamp;
   MIN_CREATION_DATE timestamp;
   batch_size integer;
   max_runtime integer;
   retention_period timestamp;

BEGIN

   MIN_CREATION_DATE := to_timestamp('2011-02-01 10:00:00','YYYY-MM-DD HH24:MI:SS');
  MAX_CREATION_DATE := to_timestamp('2011-07-08 09:00:00','YYYY-MM-DD HH24:MI:SS');
  max_runtime := 60;
   retention_period := to_timestamp('2011-07-08','YYYY-MM-DD');
    --batch_size := 10000;
    batch_size := 100000;
      soa.delete_instances(
      min_creation_date => MIN_CREATION_DATE,
      max_creation_date => MAX_CREATION_DATE,
      batch_size => batch_size,
      max_runtime => max_runtime,
      retention_period => retention_period,
      purge_partitioned_component => false);
   END;
   /

ALTER PROCEDURE debug_purge COMPILE PLSQL_CCFLAGS = 'debug_on:false' REUSE SETTINGS;
ALTER PROCEDURE log_info COMPILE PLSQL_CCFLAGS = 'debug_on:false' REUSE SETTINGS;
spool off

How to add swap space in linux

http://www.thegeekstuff.com/2010/08/how-to-add-swap-space/

 

dd if=/dev/zero of=/extraswap bs=1M count=512
mkswap /extraswap
cp /etc/fstab /etc/fstab.mybackup
Add this line at the end of the file
/extraswap   none   swap   sw   0   0
or
swapon /extraswap

Verify whether the newly created swap area is available for your use.
swapon -s

Tuesday, June 07, 2011

Create RAC Instance using Oracle VM

First Install the Oracle VM Server on a new machine.

On Some other linux machine (or an vmware instance) install the Oracle VM manager.

Extract the Oracle VM manager zip file and mount the iso file on a unix machine.
Install the Oracle VM manager by running the command ,
sh runInstaller.sh 

The Oracle VM manager asks a series of questions like db connect info etc
after this it will install Oracle XE and OC4J etc. If you have an existing DB you can use that
database instead of XE.

On the Oracle VM Server , create a HDD partion say about 100GB in /dev/sdb6
(ensure that you have atleast you have 80GB partition else the RAC install will fail)

and run the following commands to create the storage repository ,

mkfs.ext3 /dev/sdb6
/opt/ovs-agent-2.3/utils/repos.py -n /dev/sdb6
/opt/ovs-agent-2.3/utils/repos.py -i
/opt/ovs-agent-2.3/utils/repos.py -l
/opt/ovs-agent-2.3/utils/repos.py -r 90ab429e-a00f-488d-9680-91dd878e3f48

Output of the above commands ,

[root@oraclevm ~]# /opt/ovs-agent-2.3/utils/repos.py -n /dev/sdb6
[ NEW ] 90ab429e-a00f-488d-9680-91dd878e3f48 => /dev/sdb6
[root@oraclevm ~]# /opt/ovs-agent-2.3/utils/repos.py -i
*** Storage repositories initialized.
[root@oraclevm ~]# /opt/ovs-agent-2.3/utils/repos.py -l
[   ] 90ab429e-a00f-488d-9680-91dd878e3f48 => /dev/sdb6
[root@oraclevm ~]# /opt/ovs-agent-2.3/utils/repos.py -r 90ab429e-a00f-488d-9680-91dd878e3f48
[ R ] 90ab429e-a00f-488d-9680-91dd878e3f48 => /dev/sdb6

In the VM manager create a server pool and assign the Oracle VM Server to this pool.

Copy the RAC Vmware template file to /OVS/seed_pool and extract the file ,

After this run the following commands ,

# cd /OVS/seed_pool
# unzip -q /tmp/OVM_EL5U5_X86_11107RAC_PVM.zip
# tar xzf OVM_EL5U5_X86_11107RAC_PVM.tgz (or X86_64 for the 64-bit version)
(You may now delete the ZIP & TGZ files)
This will create the following, e.g.on 32bit:
/OVS/seed_pool/OVM_EL5U5_X86_11107RAC_PVM (or X86_64 for the 64-bit version)
|- System.img (OS image file)
|- Oracle11107RAC_x86-xvdb.img (database software image file)
|- vm.cfg (VM configuration file)
|- README
|- These PDF documents
|- lsinventory-sample.crs-32bit lsinventory-sample.rac-asm-32bit (or 64bit)

Now create 5 shared disks i.e say ASM1 to ASM5 each of 2GB.

Import the template using Oracle VM manager

Create 2 Virtual Machines using the imported template

Add the shared disks in the exact same order to both VMs.

Power ON both virtual machines

Complete the boot interview questions like private IP , public IP , VIP IP and hostnames etc.
For the private IP use 10.10.10.201 ,

If you have only one network card then use eth0:1 for the private interface.


Now Install Oracle RAC
First login as root user , (password is ovsroot) and run the command ,
cd /u01/clone/buildcluster.sh

This will install the RAC software.

For the command line tools , please download the following rpm’s

wget http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/oracle_addons/x86_64/ovmcli-2.2-9.el5.noarch.rpm

wget http://public-yum.oracle.com/repo/EnterpriseLinux/EL5/addons/x86_64/python-ZSI-2.1-a1.el5.noarch.rpm

Run the command to configure the ovm client

ovm config

run the command ,

ovm -u admin -p welcome1 vm ls
Name    Size(MB) Mem  VCPUs Status  Server_Pool
fmwrac1 29086    1400 1     Running oraclevm1_test
fmwrac2 29086    1400 1     Running oraclevm1_test

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