Monday, 1 June 2020

Oracle Opatch utility 12c

 Hi Blog Viewers,


This post will describes the how to apply single or multiple patches at a time.


Prerequisites :

Set the Oracle Home and Opatch utility home in bashrc profile. So that you no need to set these properties every time, when your applying the patches.


After the prerequisites next step to apply the patch on oracle home.

1. Create the PATCH_TOP folder inside Oracle Middleware Home ( Oracle Home directory).

2. Run the below command to test opatch working on system.

opatch version



3. Copy the patches to PATCH_TOP folder and extract the zip here.

    Example, you have 2 patches  in this directory.

4. Run the below command to apply multiple patches in single shot.

   opatch napply -id 30355873,30359542

5. Single patch use -> opatch apply 30355873



.bashrc profile:

export ORACLE_BASE=/u01/app/oracle
export MW_HOME=${ORACLE_BASE}/product/fmw/Oracle_Home
export DOMAIN_HOME=${ORACLE_BASE}/domains/soa_domain
export JAVA_HOME=${ORACLE_BASE}/product/java/jdk
export WLS_HOME=${MW_HOME}/wlserver

# Path Settings
export PATH=$PATH:$HOME/bin:$JAVA_HOME/bin:$MW_HOME/OPatch:


Happy coding !!!


Thanks


Wednesday, 1 April 2020

User Memory Arguments Settings in Weblogic 12c Domain

 Hi  Viewers,

This post will explain you, how to customize the memory arguments in weblogic 12c.


  1. Login into the your respecticve weblogic domain and go to the bin directory.
  2. Cat the setDomain.sh file to verfy the below lines are existed , if not copy from here and update the file.

    # Set user overrides, if available.
    if [ -f ${DOMAIN_HOME}/bin/setUserOverrides.sh ] ; then
            . ${DOMAIN_HOME}/bin/setUserOverrides.sh
    fi

      3. Next step, create the setUserOverrides.sh file inside bin directory.

      4. Add the following lines inside the setUserOverrides.sh file, in order to customize the memory                arguments for your domain admin server and managed servers.

       if [ "$SERVER_NAME" == "managed server name" ]; then

            MEM_ARGS="-Xms2048m -Xmx2048m -XX:MaxPermSize=2048m"

            export MEM_ARGS

    elif [ "$SERVER_NAME" == "managed server name" ]; then

            MEM_ARGS="-Xms2048m -Xmx2048m -XX:MaxPermSize=2048m"

            export MEM_ARGS

    elif [ "$SERVER_NAME" == "AdminServer" ]; then

            MEM_ARGS="-Xms1024m -Xmx1024m -XX:MaxPermSize=512m"

            export MEM_ARGS

    fi


    Happy to share with you !!!.

    Thanks,

    Madhu




    Tuesday, 31 January 2017

    Previous Month in xlst 1.0

    This logic will be useful when your passing date value and try to looking for previous month.

    <xsl:template name="PreviousMonth ">
        <xsl:param name="value"/>
        <xsl:if test="$value != ''">
          <xsl:variable name="year"
                        select="substring-before(substring-after(substring-after($value,'/'),'/'),' ')"/>
          <xsl:variable name="month"
                        select="substring-before(substring-after($value,'/'),'/')"/>
          <xsl:variable name="day"
                        select="substring-after(substring-after($value,'/'),'/')"/>
          <xsl:choose>
            <xsl:when test="$month = 01">
              <xsl:variable name="chgYear" select="$year - 1"/>
              <xsl:value-of select="concat('December',' ','12',',',$chgYear)"/>
            </xsl:when>
            <xsl:when test="$month='02'">
              <xsl:value-of select="concat('January',' ','12',',',$year)"/>
            </xsl:when>
            <xsl:when test="$month='03'">
              <xsl:value-of select="concat('February',' ','12',',',$year)"/>
            </xsl:when>
            <xsl:when test="$month='04'">
              <xsl:value-of select="concat('March',' ','12',',',$year)"/>
            </xsl:when>
            <xsl:when test="$month='05'">
              <xsl:value-of select="concat('April',' ','12',',',$year)"/>
            </xsl:when>
            <xsl:when test="$month='06'">
              <xsl:value-of select="concat('May',' ','12',',',$year)"/>
            </xsl:when>
            <xsl:when test="$month='07'">
              <xsl:value-of select="concat('June',' ','12',',',$year)"/>
            </xsl:when>
            <xsl:when test="$month='08'">
              <xsl:value-of select="concat('July',' ','12',',',$year)"/>
            </xsl:when>
            <xsl:when test="$month='09'">
              <xsl:value-of select="concat('August',' ','12',',',$year)"/>
            </xsl:when>
            <xsl:when test="$month='10'">
              <xsl:value-of select="concat('September',' ','12',',',$year)"/>
            </xsl:when>
            <xsl:when test="$month='11'">
              <xsl:value-of select="concat('October',' ','12',',',$year)"/>
            </xsl:when>
            <xsl:when test="$month='12'">
              <xsl:value-of select="concat('November',' ','12',',',$year)"/>
            </xsl:when>
            <xsl:otherwise/>
          </xsl:choose>
        </xsl:if>
      </xsl:template>

    Input:

    <outputDate>
    <call-template name="PreviousMonth">
    <xsl:with-param name="value">
    <xsl:value-of select="11/01/2017 00:00:00"/>
    </xsl:with-param>
    </call-template>
    </outputDate>

    Output:

    <outputDate>December 12,2016</outputDate>



    Monday, 23 May 2016

    Oracle SOA 11g to 12.2.1c Upgradation Steps

      1. First step to configure JDK1.8 version, because RCU  12.2.1 won’t support for JDK 1.7 version. JDK1.7 will support up to 12.1.3 version.

      2. For upgrading to 12.2.1 version, the database should be 11.2.0.4  and also we have to shut down the all the servers in existing domain before starting upgrading.

      3. Next we have to create new soa instance for SOA12c.Both SOA11g and 12c should be in same server.

      4. Next step  configure 12c schemas using rcu command from 12c middleware -> oracle_common->bin. Here we have to select existing soa-infra schemas   and creating new schemas for 12c as well.

      5.After the above setup upgrade existing schemas to 12c version using ua.cmd  , run this command from 12c middleware location -> oracle_common->upgrade (select schemas option here in this window ex: opss,oracle soa)

        Use this  sql command for checking soa schemas updated version(connect as sys)

        SELECT MRC_NAME, COMP_ID, OWNER, VERSION, STATUS, UPGRADED FROM SCHEMA_VERSION_REGISTRY ORDER BY MRC_NAME, COMP_ID;

      6. Next reconfigure the existing domain. Go to the 12c middleware location -> oracle_common->common->bin  run the reconfig.cmd -> here we have to choose 11g domain path.

      7. After the above setup upgrade existing domain to 12c version using ua.cmd  , run this command from 12c middleware location -> oracle_common->upgrade(WebLogic domain configuration related UMS, OWSM,JRF and System Components Infrastructure).

      8. Next run the pack.sh command from  soa12c oracle_common->common->bin   for creating snapshot of weblogic domain.

           ./pack.sh –domain=/u01/app/fmw11g/user_projects/domains/soadomain –template_name=soadomainupgradetemplate –template= soadomainupgradetemplate.jar –manged=true.

    Friday, 29 April 2016

    Integrating File and SOA Service using Oracle Managed File Transfer 12C

    1.       Login to the mfl console using below url:


    2.       In mfl console you can see three components in top side right corner.






    1.       Click on design tab-> left side navigator as you can see source, targets and transfer. Click on source - > enter file location in content folder path.


    In advance properties select Trigger file strategy as below and  mention which file name and rest of options keep same .

    In Operation tab select  action type as per your requirement.



    Source creation completed. Next we have to configure target, before creating target , we should configure soa service.

    1.       Create SOA project  with empty bpel component-> next copy the mft wsdl from below location, once you configure mft ,it will create default wsdl’ s in below location

    /home/oracle/OracleFMW/Middleware/Oracle_Home/mft/integration/wsdl

    Copy the MFTAnyTypeService.wsdl  in your project.
     



    1.       Create bpel process using above wsdl file. In my case reading data from mft and inserting into db.


    Inserting records into the DB. Here am using assign activity for mapping purpose.




    Next deploy the composite into the server.
    1.       Next go to the mft console create target as below:



    In url place don’t pass entire wsdl-> pass only upto endpoint-> create

    Select message type as XML  in Advance properties.

    8. Next create transfer between source and target. Target we can create multiple, here I created file and soa service.


    In Target service delivery preference properties select delivery method as Inline and Reference File.
    Next save the changes and deploy. Click on the   Monitoring, here you can see the transfer instance for your project.



    This is the file am sending from folder location.

    Now you can see the instance in soa server as well. Go to the em console and check the instance of service.




    Here is flow of the instance:


    Thank  you Guys.

    Wednesday, 3 June 2015

    Fixed Length Records Processing to DB in JBOSS Fuse Service Works



     Today am going to explain how to insert fixed length records into db.
     Here is the example:
    For processing fixed length file, we need BeanIO or camel BeanIO, in this example am using bean IO.
    Bean IO is open source frame work for processing all type of files like fixed length, csv, xml, separated by special characters.

    1.      Fixed length file looks like below

        


    Based on file we have to define pojo class like below:
    package order.sample.com.orderitemsdb;

    public class OrerItems {

           String ORDERNUMBER;
           String DATE1;
           String DATE2;
           String AMOUNT;
           String REFNUM;
                  …………………,
                  …………………,
                 …….etc.

                 Getter and Setter methods here
    }

    Add BeanIO dependency in pom.xml



    Mapping File for converting fixed length file to xml


    Mapping file looks like below, in this mapping file we  have to create the stream like input stream and out stream and each stream use to refer pojo class for fetching property values and we have to mention what is root element for input record .here we can give any name. But if you’re getting inputs from service we have to mentioned exact name of xsd root element.





    Call Mapping File from Exchange Process Class


    Here am using camel processor for calling java class.

    package order.sample.com.orderitemsdb;
    import org.apache.camel.Exchange;
    import org.apache.camel.Processor;
    import org.beanio.*;
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
    import org.hibernate.Transaction;
    import org.hibernate.cfg.Configuration;
    import java.io.*;
    import java.util.ArrayList;
    import javax.inject.Named;

    @Named("OrderInput")
    public class OrderInputFileProcessor implements Processor {

                    // public static void main(String[] args) throws Exception
                    @SuppressWarnings("null")
                    @Override
                    public void process(Exchange exchange) throws Exception {      
                                   
    System.out.println("OrderInputFileProcessor fixedlenght File coverting into xml file");
                                    // create a StreamFactory
                                    StreamFactory factory = StreamFactory.newInstance();
                                    // load the mapping file
                                    factory.load(/order/MappingFile/OrderPaymentInboundMapping.xml);         
                                    // use a StreamFactory to create a BeanReader
                    BeanReader in = factory.createReader("OrderPaymentInboundRequest",new File(/u01/app/jboss/order/FIN/order.txt));
                                    // OrderPaymentInboundRequest this name should match with mapping file input stream name
                                     Object record = null;                     
                                     ArrayList< OrerItems > collectionlist = null;
                                     collectionlist = new ArrayList< OrerItems >();
                    //            OrerItems collection = null;              
                            // read records from "input fixed length file"                             
                               Configuration cfg = new Configuration();         
                                cfg.configure("OrderInbound.cfg.xml");
                            Here am using hibernate for inserting records into DB.
                                SessionFactory sessionfactory = cfg.buildSessionFactory();
                                 Session session = sessionfactory.openSession();
                                  while ((record = in.read()) != null) {
                                      // process each record
                                    OrerItems collection = (OrerItems) record;
                                 if ("OrderPaymentRequest".equals(in.getRecordName()))
    Note: OrderPaymentRequest this name should match with input record in the mapping file.
                                 {                             
                                   // process the OrerItems
                                 collectionlist.add(collection);
                                     try{
                                             session.save(collection);
                                             session.flush(); 
                                                            session.beginTransaction().commit();
                                                            session.clear();
                                             }
                                            catch(Exception e)
                                            {
                                             System.out.println("----------ErrorTrace-------------"+e);
                                            }                     
                                }            
                            }           try{
                      session.close();
                            /*Transaction tx = session.beginTransaction();
                             tx.commit();
                             session.close();
                             sessionfactory.close();*/
                            }        catch(Exception e)
                            {
                             System.out.println("----------ErrorTrace-------------"+e);
                            }
    }

    Deploying the Project into the JBOSS Server


    Before deploying this project add jboss-deployment-structure.xml in below folder structure



    Adding external jar files into the sever


    If you want add any external jar files into the jboss eap server follow the below steps.
    Go to jboss eap folder -> module folder-> system->
    \jboss-eap-6.1\modules\system\layers\base
    In above location you can see org folder inside create BeanIO folder next create main inside this folder place BeanIO jar.

    Next create module.xml like below:



    Note: if you are getting class not found exception means some dependency missed in your module folder….
    Hope you guys understand this code.

    Cheers,

    Madhu

    Thursday, 18 December 2014

    Oracle Service Registry 11g Installation Guide

    1. Introduction to Oracle Service Registry:


    Oracle Service Registry is not part of Oracle SOA Suit 11g, Oracle Enterprise Repository /Service Registry is a Critical part of SOA governance. The combination of the Enterprise Repository with a UDDI-compliant Service Registry provides a common communication channel for the automated exchange of metadata and service information between service consumers, producers, providers, and additional governance tooling. It provides the visibility, feedback, controls, and analytics to keep your SOA on track to deliver business value. The intense focus on automation helps to overcome barriers to SOA adoption and streamline governance throughout the lifecycle.
    Oracle Service Registry (OSR) is a fully V3-compliant implementation of UDDI (Universal Description, Discovery and Integration), and one of the key components of Oracle SOA Suite 11g. It allows us to publish and discover services and service providers, and manage metadata about services (security, transport, or quality service) using taxonomies. Therefore, it plays an important role when trying to improve visibility and promote service reuse. It is also important in the scope of SOA governance.

    Service registry is very important for various reasons. It provides a central place where all service definitions are stored. This becomes important when the number of services (including BPEL processes) grows. It helps to maintain overview of services. Service registry also provides a central place where developers can search for existing services. This improves service reuse, which is one of the most important aspects of SOA. Of course, service registry also provides means to publish services for other developers to discover and reuse.

    In addition to reuse, service registry can also be helpful when we need to migrate services from one server to the other. This can happen because of various reasons, but one of the most common reasons is the migration between the development, test, and production environments. Service registry is also helpful when we need to version services and manage changes. With service registry we can also develop more loosely-coupled composite applications, because we do not need to hard-code the service URLs. Rather, the application will resolve URLs at run-time. In all cases, service registry is often used together with the ESB. We will not discuss all OSR details in this article. We will demonstrate how to publish a service, how to export/import resources between OSB and OSR, how to browse the OSR using JDeveloper, and how to enable dynamic endpoint lookup in a SOA composite application.

    2. OSR User Creation in DB:

    2.1. First we need to create OSR user in oracle DB with admin privileges as sysdba.


    2.2. Next run the osr jar file from command line welcome window open click on next.

















    2.3. Select Installation type as Standalone registry click on next.
















    2.4.Create registry folder in middleware home directory 














    2.5. Select Registry home path from middleware and select check boxes for shortcuts for the Registry from start and desktop.
















    2.6. This windows is optional if we want email configuration we need to configure SMPT server details.














    2.7. Administrator Account Configuration  here we need give user name and password to the service Registry controls click on next.













    2.8.Database setup here we have to connect to the schema here selecting Populate schema then Click on next.














    2.9. Select DB type here select Oracle 10g/11g click on next.














    2.10. Provide DB Details of OSR Schema user.














    2.11. Select JDBC Data source as default no need to change.















    2.12. Next select JDBC Driver location from your db or from web logic server click on next.














    2.13. Select account provider information store in DB click on next.













    2.14. Select Application server as Oracle Web logic 11g 














    2.15. Choose deployment of Domain Configuration.
    2.16. Select HTTP port for Service Registry Console click on next.














    2.17. Confirmation window click on next if we want change the property go back.















    3. Installing Oracle Service Registry in the Same Domain as Oracle SOA Suite:

    When installing Oracle Service Registry 11g in the same Weblogic Domain as Oracle SOA Suite, you may see the following error message on the WebLogic Server console when Oracle Service Registry is starting up:


    java.lang.LinkageError: loader constraint violation in interface itable
    initialization:....

    To work around this issue:
    Please refer below link:


    Solution: Better to create managed server in separate web logic domain. 

     4. Domain Configuration for Service Registry

     4.1. We can configure the domain at levels extending the existing domain. Create new domain with new   
             Application server and managed server.

             Here I am creating separate domain for service registry.








    Click on next.


    4.2. Select Domain Source as Oracle Service Registry click on next.













    4.3. Enter domain location click on next.
















    4.4. Enter Password for web logic user click on next.








    4.5. Select JDBC Data source as jdbc/registry enter osr db password and click next.















    4.6. Select Admin Server setting click on next.













    4.7. Change the Admin server port by default it is 7001 we can use any port out of Web logic click on next.















    4.8. Click on Done.














    5. OSR Server Start:

           Now we can start the Server from OSR_Domain.

           From command line we need to start admin server and osr server as below:








    6. Oracle Service Registry Consoles:

    Console windows for login to Oracle Service Registry Console and Business Service Control go to Programs-> Oracle Service Registry 11.1.1 click on here we can open consoles.

    6.1. Oracle Service Registry:

    Login Page: http://localhost:7101/registry/uddi/web











    6.2. Business Service Control:

    Login Page: http://localhost:7101/registry/uddi/bsc/web











    7. UDDI Registry Connection in Oracle JDeveloper11g:

    Start JDeveloper and add a new UDDI Registry Connection. We need to provide the UDDIv2 inquiry url ( http://localhost:7101/registry/uddi/inquiry).

       1. Open the JDeveloper -> click on file menu go to new ->Categories -> General ->click on connections.
    Select UDDI Registry Connection click on ok.













    2.   Enter Inquiry Endpoint URL click on next.













    3.Next click on finish and test the connection finally we can see UDDI Registry at Resource palette


















     8. Oracle Service Registry reference links:


    Download Oracle Service Registry 11g patch setup from below link:

    http://www.oracle.com/technetwork/middleware/registry/downloads/index.html

    Download Oracle Service Registry reference guide from below link:

    http://www.oracle.com/technetwork/middleware/registry/documentation/index.html


    Cheers...happy installation.

    Oracle Opatch utility 12c

     Hi Blog Viewers, This post will describes the how to apply single or multiple patches at a time. Prerequisites : Set the Oracle Home and Op...