Search This Blog

Thursday, December 18, 2008

Opatch for the Application Server

1. Download this using the Patch Number 6880880
2. For AS 10.1.3 and 10.1.2 download the OPatch 10.1.0.X version.
For DB 10.1.X download Opatch 10.1.0.X version
For DB 10.2.X download Opatch 10.2.0.X version
For DB 11g download Opatch 11.0.X version.
3. After this run the command
unzip -d $ORACLE_HOME p6880880_101000_LINUX.zip
4. Now issue opatch lsinventory

For the customised Inventory location use the following /home/ias/infra101202/OPatch/opatch lsinventory -detail -invPtrLoc /etc/oraInst.loc

If you want to apply a patch meant for a different Platform use the command

export OPATCH_PLATFORM_ID=0 and then opatch apply

Thursday, December 11, 2008

Update Redhat4 Linux System via yum with the local repository

This small write up explains how to upgrade the RedHat linux system from one releaseto another one. For example you have RedHat linux 4 Update 2 installed and now youwant to update this to the latest one for example 7.
You can use the yum to do this on a local RPM repository.
1. Download the related rpm files
Set the http_proxy as we need to download some files from the internet.
export http_proxy=http://www-proxy.us.oracle.com/
wget wget http://iasbde.us.oracle.com/ohs_scripts/yum-2.0.7-1.noarch.rpm

2. Install these RPM's by using the command
rpm -ivh yum-2.0.7-1.noarch.rpm

3. Download the latest the RedHat linux version 4 from kernel.us.oracle.com
http://kernel.us.oracle.com/osinstall/RedHat/RHEL4/i386/AS/U7/RHEL4.7-i386-AS-DVD.iso
4. mount this ISO image
mount -o loop -t iso9660 RHEL4.7-i386-AS-DVD.iso /mnt/test

5. Copy all the RPM's to a local directory mkdir /home/localrpmscp /mnt/test/RedHat/RPMS/* /home/localrpms

6. Create the necessary header and other related files for the yum
cd /home/localrpms
yum-arch .

7. Open the /etc/yum.conf fileand change the entries of baseurl toi.e.from#baseurl=http://mirror.dulug.duke.edu/pub/yum-repository/redhat/updates/$releasever/tobaseurl=file:///home/RPMS
Modified yum.conf file
[main]cachedir=/var/cache/yumdebuglevel=2logfile=/var/log/yum.logpkgpolicy=newestdistroverpkg=redhat-releasetolerant=1exactarch=1
[base]name=Red Hat Linux $releasever - $basearch - Basebaseurl=file:///home/RPMS
[updates]name=Red Hat Linux $releasever - Updates#baseurl=http://mirror.dulug.duke.edu/pub/yum-repository/redhat/updates/$releasever/baseurl=file:///home/RPMS

8. yum update
Once the update is complete, you will need to reboot the system. It should automatically boot into the new kernel. If this does not happen, then you will need to update the /boot/grub/grub.conf file. The line 'default=0' means the first kernel listing. After yum completes, the new kernel should be the first listed.
If you have not installed previous iAS products, you will also want toperform the following so that all the packages needed are present.
# yum install gnome-libs
# yum install gnome-libs-devel
'yum update' or 'yum install ' to add additional or missing packages.

Thursday, October 16, 2008

How to set a classpatch for all the .jar files in a directory

On UNIX
C=.; for i in *.jar; do C=$C:$i; done
echo $C
java -cp $C org.jgroups.demos.Draw

On Windows

Tuesday, March 18, 2008

How to use WSDLReader for getting a WSDL File that needs authentication

package helloworldws;
import HTTPClient.AuthorizationInfo;
import HTTPClient.AuthorizationPrompter;
import HTTPClient.NVPair;
import java.util.Map;
import javax.wsdl.Definition;
import javax.wsdl.extensions.ExtensionRegistry;
import javax.wsdl.factory.WSDLFactory;
import javax.wsdl.xml.WSDLReader;
import oracle.j2ee.ws.wsdl.xml.WSDLReaderImpl;

public class Test1 {
public Test1() {
}
public static void main(String[] args) throws Exception {
Test1 test1 = new Test1();
//--Get the WSDLFactory. You must specifiy Oracle's implementation class name
WSDLFactory wsdlFactory = WSDLFactory.newInstance("oracle.webservices.wsdl.WSDLFactoryImpl");
//--Create a reader and register the standard extensions
WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
System.out.println(wsdlReader);
((WSDLReaderImpl)wsdlReader).getConnectionConfig().setAuthorizationPrompter(new MyAuthPrompter("oc4jadmin","welcome1"));
ExtensionRegistry extensionRegistry = wsdlFactory.newPopulatedExtensionRegistry();
wsdlReader.setExtensionRegistry(extensionRegistry);
//--Set a sixty-second timeout for reading the WSDL definition
System.setProperty(oracle.webservices.wsdl.WSDLFactoryImpl.WSDL_READ_TIMEOUT, "60" );
//--Read a WSDL file, including any imports
Definition def = wsdlReader.readWSDL("http://xxx.xxx.oracle.com:8888/SCRATCH-HelloWorldWS-context-root/MyWebService1SoapHttpPort?WSDL");
//--You can now explore the WSDL definition, for example,
Map services = def.getServices();
String targetNamespace = def.getTargetNamespace();
System.out.println(targetNamespace);
}
}
class MyAuthPrompter implements AuthorizationPrompter
{
private String pa_name, pa_pass;

MyAuthPrompter(String pa_name, String pa_pass)
{
this.pa_name = pa_name;
this.pa_pass = pa_pass;
}

public NVPair getUsernamePassword(AuthorizationInfo challenge, boolean forProxy) {
return new NVPair(pa_name, pa_pass);
}
}