Search This Blog

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

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