Tuesday, July 22, 2014

SOA domain creation on Exalogic using Exadata

I had afew lesson learn while doing Oracle SOA Suite 11.1.1.7 platform provisioning on Exalogic using Exadata. These configurations will maximise your performance on your Oracle Engineered Systems investment.

Lesson #1:

Repository Creation Utility (RCU) has a limitation when it comes to Sockets Direct Protocol (SDP). Paul Done wrote a good article on which version of JVM is supports SDP.

The root cause with RCU is that the SDP classes are not in the startup therefore RCU only works with TCP. Therefore it is a recommended best practice to run the RCU step using the TCP during installation, example connection string below.

jdbc:oracle:thin:@(DESCRIPTION_LIST=(DESCRIPTION=(CONNECT_TIMEOUT=3)(TRANSPORT_CONNECT_TIMEOUT=3)(ADDRESS_LIST=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=db-node1-ib)(PORT=1522))(ADDRESS=(PROTOCOL=TCP)(HOST=db-node2-ib)(PORT=1522)))(CONNECT_DATA=(SERVICE_NAME=SOASID))))

Once the domain has been created and running, goto each of the JDBC Data Sources and update all connection string to SDP.

jdbc:oracle:thin:@(DESCRIPTION_LIST=(DESCRIPTION=(CONNECT_TIMEOUT=3)(TRANSPORT_CONNECT_TIMEOUT=3)(ADDRESS_LIST=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=SDP)(HOST=db-node1-ib)(PORT=1522))(ADDRESS=(PROTOCOL=SDP)(HOST=db-node2-ib)(PORT=1522)))(CONNECT_DATA=(SERVICE_NAME=SOASID))))

Lesson #2:

Modify setDomainEnv.sh to add support for SDP, this setting will be enabled for all servers in the current domain.

JAVA_OPTIONS="${JAVA_OPTIONS} -Doracle.net.SDP=true"

Lesson #3:

Managed Server is recommended to mounted exclusively by each compute node (ie. local volume). This is mention explicitly in the Exalogic Elastic Cloud Enterprise Deployment Guide for Oracle SOA Suite. This is to optimise I/O performance to disk by leveraging on Exalogic solid-state drive (SSD) technology.

However, the trade off is shared storage (NFS), shared storage enables reliability and availability through data replication and DR.

Lesson #4:

Ensures that Enable Exalogic Optimizations is selected under Domain > Configuration > General.

Refers to Oracle Support Note How To Enable Exalogic Optimizations For WebLogic Server Running On Exalogic Machine (Doc ID 1373571.1) for up-to-date details.

Database connectivity testing over SDP using Exadata

Optimising performance with Oracle Engineered Systems (Exadata). When running application such as SOA Suite, Siebel, JDE etc. connecting to database tier using Exadata.

Oracle best practice is that the Exadata is usually setup with a listener on port 1521 on the ETH / SCAN NIC(s) and on the IBoIP should be two listeners on port 1522 for TCP & SDP.

Below are steps to run on the application tier (soa-hostname in this case) to check the prerequisites before commencing product installation such as RCU.

Login to application server as oracle.
login as: oracle
oracle@soa-hostname's password:
Last login: Tue Jul 22 10:40:43 2014 from local-workstation
|-----------------------------------------------------------------|
| This system is for the use of authorized users only.            |
| Individuals using this computer system without authority, or in |
| excess of their authority, are subject to having all of their   |
| activities on this system monitored and recorded by system      |
| personnel.                                                      |
|                                                                 |
| In the course of monitoring individuals improperly using this   |
| system, or in the course of system maintenance, the activities  |
| of authorized users may also be monitored.                      |
|                                                                 |
| Anyone using this system expressly consents to such monitoring  |
| and is advised that if such monitoring reveals possible         |
| evidence of criminal activity, system personnel may provide the |
| evidence of such monitoring to law enforcement officials.       |
|-----------------------------------------------------------------|


Set the oracle environment variables to work as a client to databases.
-bash-3.2$ . oraenv
ORACLE_SID = [oracle] ? client
The Oracle base has been set to /opt/oracle/11.2.0.3


Change directory to the location of the file tnsnames.ora.
-bash-3.2$ cd $ORACLE_HOME/network/admin

Here is where you should be. This may varies based on where your DBA installed the client.
-bash-3.2$ pwd
/opt/oracle/11.2.0.3/client/network/admin


Check the file exists, if not it will have to be created. Ask your DBA for the tnsnames.ora file.
-bash-3.2$ ls
samples  shrept.lst  tnsnames.ora


These are the current settings for connection to the SOASID database via InfiniBand IPoIB (SDP) and E0IB (TCP).
-bash-3.2$ cat tnsnames.ora
SOASID_EXALOGIC =
        (DESCRIPTION_LIST=
                (LOAD_BALANCE=off)
                (FAILOVER=on)
                (FAILOVER_MODE = (TYPE = session)(METHOD = BASIC)(RETRIES = 2)(DELAY = 3))
                (DESCRIPTION=
                        (CONNECT_TIMEOUT=3)(TRANSPORT_CONNECT_TIMEOUT=3)
                        (ADDRESS_LIST= (LOAD_BALANCE=on) (ADDRESS=(PROTOCOL=SDP)(HOST=db-node1-ib)(PORT=1522)) (ADDRESS=(PROTOCOL=SDP)(HOST=db-node2-ib)(PORT=1522)) )
                        (CONNECT_DATA=(SERVICE_NAME= SOASID))
                )
        )

SOASID_CLIENT =
        (DESCRIPTION_LIST=
                (DESCRIPTION=
                        (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=nnn.nnn.nnn.nnn)(PORT=1521)))
                        (CONNECT_DATA=(SERVICE_NAME= SOASID))
                )
        )


Check the listener can be contacted on IPoIB (SDP).  The numeric 8 at the end of the command is the number of pings.
-bash-3.2$ tnsping soasid_exalogic 8

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Sandpit on 22-JUL-2014 11:25:01

Copyright (c) 1997, 2011, Oracle.  All rights reserved.

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION_LIST= (LOAD_BALANCE=off) (FAILOVER=on) (FAILOVER_MODE = (TYPE = session)(METHOD = BASIC)(RETRIES = 2)(DELAY = 3)) (DESCRIPTION= (CONNECT_TIMEOUT=3)(TRANSPORT_CONNECT_TIMEOUT=3) (ADDRESS_LIST= (LOAD_BALANCE=on) (ADDRESS=(PROTOCOL=SDP)(HOST=db-node1-ib)(PORT=1522)) (ADDRESS=(PROTOCOL=SDP)(HOST=db-node2-ib)(PORT=1522))) (CONNECT_DATA=(SERVICE_NAME= SOASID))))
OK (10 msec)
OK (10 msec)
OK (10 msec)
OK (10 msec)
OK (10 msec)
OK (20 msec)
OK (10 msec)
OK (10 msec)


Check the listener can be contacted on EoIB (TCP).
-bash-3.2$ tnsping soasid_client 8

TNS Ping Utility for Linux: Version 11.2.0.3.0 - Sandpit on 22-JUL-2014 11:25:10

Copyright (c) 1997, 2011, Oracle.  All rights reserved.

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION_LIST= (DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=nnn.nnn.nnn.nnn)(PORT=1521))) (CONNECT_DATA=(SERVICE_NAME= SOASID))))
OK (0 msec)
OK (0 msec)
OK (0 msec)
OK (0 msec)
OK (10 msec)
OK (0 msec)
OK (0 msec)
OK (0 msec)


Connect to the database service via IPoIB & verify the account has sysdba privileges.
-bash-3.2$ sqlplus sysdba/sysdba@soasid_exalogic as sysdba

SQL*Plus: Release 11.2.0.3.0 Sandpit on Tue Jul 22 11:25:52 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Sandpit
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Sandpit
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options


Connect to the database service via EoIB.
-bash-3.2$ sqlplus sysdba/sysdba@soasid_client as sysdba

SQL*Plus: Release 11.2.0.3.0 Sandpit on Tue Jul 22 11:26:07 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Sandpit
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Sandpit
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options


If you've reached this far it means connectivity test to your database via SDP on Exadata is successful!

Next step, run your Oracle Repository Creation Utility (RCU).

Here are some common issues:
  • DBA have not follow Oracle Support Note on Setup Listener on Infiniband Network using both SDP and TCP Protocol (Doc ID 1580584.1).
  • Some customer choose to run SDP and TCP on port 1521.
  • iptables on the VM may block the port(s) to the database.

Monday, July 21, 2014

Convert binary data in OSB context variable into string

The function will be use to convert binary data in OSB context variable into string.

Another useful POJO to add to your OSBToolkit.java.

public class OSBToolkit
{

    public OSBToolkit()
    {
    }

    public static String convertOSBBinaryContentToString(DataSource ds) throws Exception
    {
        InputStream is=ds.getInputStream();
        BufferedReader din = new BufferedReader(new InputStreamReader(is));
        StringBuffer sb = new StringBuffer();
        try {
            String line = null;
            while((line=din.readLine()) != null){
                sb.append(line+"\n");
            }
        }
        finally{
            try{
                is.close();
            } catch(IOException ex){}
        }
        return sb.toString();
    }
}

 

Convert Siebel datetime to XML

Class to parse Siebel datetime format into XML standard format.

Another useful POJO to add to your OSBToolkit.java.

public class OSBToolkit
{

    public OSBToolkit()
    {
    }

    public static Date convertSiebelDateTimeToXML(String dateString) {
        Date stringDate = null;
       
        try
        { //If dateTime
            if(dateString.trim().length() > 10)
            {
                stringDate = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss").parse(dateString);

            }// If just a date
            else if(dateString.trim().length() > 0)
            {
                stringDate = new SimpleDateFormat("MM/dd/yyyy").parse(dateString);
            }
        }
        catch(Exception e)
        {
            e.printStackTrace();   
        }
       
        return stringDate;
     }
 
 
    public static String convertXMLToSiebelDate(Date date) {
      String formattedDate ="";
      if(date != null)
      {
          SimpleDateFormat format =
            new SimpleDateFormat("MM/dd/yyyy");
          formattedDate = format.format(date);
      }
      else
      {
         
      }
        return formattedDate;
     }
}

 

Sleep/pause/throttle the transaction in OSB

From time-to-time you have requirement to sleep/pause/throttle the transaction in OSB. You can do this by using a simple POJO.

Below is a class to add to your OSBToolkit.java.

public class OSBToolkit
{

    public OSBToolkit()
    {
    }

    public static String sleep(long l)
    {
        String s;
        try
        {
            Thread.sleep(l);
            s = "Success";
        }
        catch(Exception exception)
        {
            s = "Error";
        }
        return s;
    }
}


Then from OSB, reference to the OSBToolkit and the sleep class, specify the following value as input:
xs:long(5000)
 

Friday, July 18, 2014

Oracle SOA 12c (12.1.3) silent mode installation on Linux

Step-by-step guide to installing Oracle SOA 12c (12.1.3) in silent mode for Linux, though the same can be used Windows.

Download software

  1. Download fmw_12.1.3.0.0_soaqs_Disk1_1of1.zip bundle from http://www.oracle.com/technetwork/middleware/soasuite/downloads/index.html
  2. Download jdk-8u11-linux-x64.tar.gz from http://www.oracle.com/technetwork/java/javase/downloads/index.html

Preparation

Setting up user accounts and group.
[root@sandpit ~]# adduser oracle
[root@sandpit ~]# passwd oracle
[root@sandpit ~]# groupadd oinstall 
[root@sandpit ~]# usermod -a -G oinstall oracle

 Create the oraInst.loc file.
[root@sandpit ~]$ cat /etc/oraInst.loc
inst_group=oinstall
inventory_loc=/home/oracle/oraInventory


 Logon as oracle user and unpack the software.
[oracle@sandpit ~]$ su - oracle 
[oracle@sandpit ~]$ tar -xzvf jdk-8u11-linux-x64.tar.gz
[oracle@sandpit ~]$ /home/oracle/jdk1.8.0_11/bin/java -version
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)

[oracle@sandpit ~]$ unzip fmw_12.1.3.0.0_soaqs_Disk1_1of1.zip
Archive:  fmw_12.1.3.0.0_soaqs_Disk1_1of1.zip
  inflating: fmw_12.1.3.0.0_soa_quickstart.jar 
  inflating: fmw_12.1.3.0.0_soa_quickstart2.jar


Prepare the Response file, call it say custom_installtype_soa12.1.3.rsp.
[oracle@sandpit ~]$ cat /home/oracle/custom_installtype_soa12.1.3.rsp

[ENGINE]

#DO NOT CHANGE THIS.

Response File Version=1.0.0.0.0

[GENERIC]

#Set this to true if you wish to specify a directory where latest updates are downloaded. This option would use the software updates from the specified directory

SPECIFY_DOWNLOAD_LOCATION=false

#

SKIP_SOFTWARE_UPDATES=true

#If the Software updates are already downloaded and available on your local system, then specify the path to the directory where these patches are available and set SPECIFY_DOWNLOAD_LOCATION to true

SOFTWARE_UPDATES_DOWNLOAD_LOCATION=

#Write the name of the Oracle Home directory. The Oracle Home directory name may only contain alphanumeric , hyphen (-) , dot (.) and underscore (_) characters, and it must begin with an alphanumeric character.

ORACLE_HOME=/home/oracle/fmw12_1_3_0


#Write the complete path to a valid Middleware Home.

MIDDLEWARE_HOME=/home/oracle/fmw12_1_3_0

#Set this to true if typical installation must be done. If this is set to true then variable "CUSTOM TYPE" must be set to false as the variables are mutually exclusive

TYPICAL TYPE=false

#Set this to true if custom installation must be done, all other required variables need to be provided. If this is set to true then variable "TYPICAL TYPE" must be set to false as the variables are mutually exclusive.

CUSTOM TYPE=true

[SYSTEM]

[APPLICATIONS]

[RELATIONSHIPS]

Dry run test

First run for prerequisite checks.
[oracle@sandpit ~]$ /home/oracle/jdk1.8.0_11/bin/java -jar fmw_12.1.3.0.0_soa_quickstart.jar -silent -responseFile /home/oracle/custom_installtype_soa12.1.3.rsp
Launcher log file is /tmp/OraInstall2014-07-18_11-35-27AM/launcher2014-07-18_11-35-27AM.log.
Extracting files......................................................................
Starting Oracle Universal Installer

Checking if CPU speed is above 300 MHz.   Actual 1999.999 MHz    Passed
Checking swap space: must be greater than 512 MBChecking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required) 

Checking temp space: must be greater than 300 MB.   Actual 24743 MB    Passed

Some system prerequisite checks failed.
You must fulfill these requirements before continuing with the installation.

Exiting Oracle Universal Installer.
Log(s) for this session can be found in /tmp/OraInstall2014-07-18_11-35-27AM/launcher2014-07-18_11-35-27AM.log.


If the you the prerequisite failed at swap space error, run these additional commands.
[oracle@sandpit ~]$ su - root
[root@sandpit ~]# dd if=/dev/zero of=/swapfile bs=1M count=520
520+0 records in
520+0 records out
545259520 bytes (545 MB) copied, 0.880694 seconds, 619 MB/s
[root@sandpit ~]# mkswap /swapfile
Setting up swapspace version 1, size = 545255 kB
[root@sandpit ~]# swapon /swapfile


Run silent installation

[oracle@sandpit ~]$ /home/oracle/jdk1.8.0_11/bin/java -jar fmw_12.1.3.0.0_soa_quickstart.jar -silent -responseFile /home/oracle/custom_installtype_soa12.1.3.rsp
Launcher log file is /tmp/OraInstall2014-07-18_12-10-26PM/launcher2014-07-18_12-10-26PM.log.
Extracting files.........................................................
Starting Oracle Universal Installer

Checking if CPU speed is above 300 MHz.   Actual 1999.999 MHz    Passed
Checking swap space: must be greater than 512 MB.   Actual 532472 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)
Checking temp space: must be greater than 300 MB.   Actual 17987 MB    Passed


Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2014-07-18_12-10-26PM
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
Log: /tmp/OraInstall2014-07-18_12-10-26PM/install2014-07-18_12-10-26PM.log
Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
Reading response file..
Starting check : CertifiedVersions
Expected result: One of enterprise-4,enterprise-5,enterprise-6,redhat-6,redhat-4,redhat-5,SuSE-11
Actual Result: enterprise-5
Check complete. The overall result of this check is: Passed
CertifiedVersions Check: Success.
Starting check : CheckJDKVersion
Expected result: 1.7.0_15
Actual Result: 1.8.0_11
Check complete. The overall result of this check is: Passed
CheckJDKVersion Check: Success.
Validations are enabled for this session.
Verifying data......
Copying Files...
You can find the log of this install session at:
 /tmp/OraInstall2014-07-18_12-10-26PM/install2014-07-18_12-10-26PM.log
-----------20%----------40%----------60%----------80%--------100%

The installation of Oracle Fusion Middleware 12c SOA Quick Start 12.1.3.0.0 completed successfully.
Logs successfully copied to /home/oracle/oraInventory/logs.


That's all, enjoy!

Next step, creating the domain topology.