Friday, October 30, 2015

DB Adapter Singleton behaviour in High Availability Environment

We faced a problem in high availability environment (clustered).

We had one Integration between Oracle Ebiz and third party system in which we get the data from Oracle Ebiz and send it to third party application. This integration was running fine till the time our server environment upgraded for high availability means clustered ones...

We had two clusters which were configured to be synchronous to idealize HA situation. But this causes a design issue.

The issue started in our DB Adapter. Cluster1 and Cluster2 starts initiating DB Adapter instances which polling the Staging Table(OEBS) in parallel. If the clusters increased in future from 2 to 10 then 10 instances of pooling components will be created and will hit the third party application in parallel. This could be a problem for the target system if it doesn't supports parallel processing.

The solution to this problem is Singleton property in our pooling component / DB Adapter.

To enable this feature in high availability environment for a given inbound adapter endpoint, one must add the singleton JCA service binding property in the element within the composite.xml and set it to true as shown below:

Singleton Property in composite.xml

I hope this will help.


MDS-01330: unable to load MDS

MDS-01330: unable to load MDS configuration document

After successful installation of SOA(11g) 11.1.1.5 on Oracle XE when I started the managed server I faced following exception which makes me worried.... and kept on thinking for few minutes ....do I need to reinstall everything but thanks God I got a solution.
I hope this helps to all who faced such an issue.

Exception

oracle.mds.lcm.exception.MDSLCMException: MDS-01330: unable to load MDS configuration document
MDS-01329: unable to load element "persistence-config"
MDS-01370: MetadataStore configuration for metadata-store-usage "soa-infra-store" is invalid.
ORA-04063: package body "DEV_MDS.MDS_INTERNAL_SHREDDED" has errors
ORA-06508: PL/SQL: could not find program unit being called: "DEV_MDS.MDS_INTERNAL_SHREDDED"
ORA-06512: at line 1.....


Solution

  1. First of all drop SOA Suite schemas and associated tablespaces using RUC.
  2. Then go to command line (cmd) and set environment variable RCU_JDBC_TRIM_BLOCKS=TRUE
  3. Run RCU again to re-create the SOA Suite schemas and tablespace


Now restart server and this time there will be no error associated with "MDS-01330: unable to load MDS configuration document"


SOA 11g Installation Guide

Download all the software to get started.

  1. Oracle Database OracleXEUniv.exe
  2. WebLogic Server wls1035_oepe111172_win32.exe
  3. Repository Creation Utility ofm_rcu_win_11.1.1.5.0_disk1_1of1.zip
  4. SOA Suite ofm_soa_generic_11.1.1.5.0_disk1_1of2.zip, ofm_soa_generic_11.1.1.5.0_disk1_2of2.zip
  5. OSB ofm_osb_generic_11.1.1.5.0_disk1_1of1.zip

Oracle Database Setup:

This is the first step towards Installation of SOA Suite.

For this you need to have anyone of following versions but I will be using Oracle XE Universal database version 10.2.0.1 as it is already installed on my machine

  • Oracle XE Universal database version 10.2.0.1
  • Oracle 10g database version 10.2.0.4+
  • Oracle 11g database version 11.1.0.7+

Note: You can not use any other database version in 11gR1 (certification of additional database is on the road map). Specifically, you cannot use XE Standard, It must be Universal.

Note: When you are using XE, you will see a warning when you install the database schema that this database version is too old. You can safely Ignore this warning as it applies only to production environments.

Once you are done with Installation of Oracle XE, you must update database parameters. Set the processes parameter to >=500 using the following instructions.

Login to sqlplus with sysdba and run following commands

sqlplus connect sys as sysdba
SQL> show parameter session
SQL> show parameter processes
SQL> alter system reset sessions scope=spfile sid='*';
SQL> alter system set processes=500 scope=spfile;
SQL> shutdown immediate
SQL> startup
SQL> show parameter session

SQL> show parameter processes

Schema Configuration

Note: If you want to use Oracle XE as your database, you need to set the RCU_JDBC_TRIM_BLOCKS environment variable to TRUE *prior* to running RCU

1. To create the new schema, unzip ofm_rcu_win_11.1.1.5.0_disk1_1of1.zip navigate to rcuHome\bin and open a command window and run rcu.bat

2. The bat command returns to the prompt immediately and, after a few seconds, the Repository Creation Utility opens (if you just ran the utility to drop the schema, it opens the second time much more quickly).

3. On the Welcome screen, click on Next..

4. Select Create and click on Next.

5. Enter the database information.

6. Click on Next.

7. If you are using XE, you will see a warning at this point that this version is too old. You can safely ignore this warning as it applies only to production environments.

8. The pre-requisites are reviewed. When complete, click on OK. The utility moves to the next page ---with a slight delay, just wait for it.

9. On the Select Components screen, enter DEV in the field for creating a new prefix.

10. Select the component SOA Infrastructure. Dependent schemas are selected automatically.

11. If you choose to select other components, these install instructions may not match your install experience. Also, you may have to increase processes in XE (you will get a message telling you what is required).

12. Click on Next.

13. The pre-requisites for this step are checked. When completed, click on OK.

14. Select the radio button to Use the same password for all schemas. Enter a schema password. The password welcome1 is assumed in this document but you should choose your own secure password or a different one for each schema and be sure to record your passwords as you will need them later.

15. Click on Next.

16. Review the tablespaces and schema owners for the components.

17. Accepting the defaults, click on Next, and then click on OK to create the tablespaces.

18. When the pre-requisites for this step are completed, click on OK.

19. Click on Create to create the tablespaces. This takes about two minutes.

20. When completed, click on Close.

WebLogic Installation

First, you install Oracle WebLogic Server.

1. To install WebLogic Server run wls1035_oepe111172_win32.exe

2. When the Welcome screen for the install wizard comes up, click on Next.

3. Select Create a new Middleware Home and enter: C:\Oracle\Middleware\home_11gR1.

4. Click on Next.

5. Enter email address to register for security alerts or deselect the checkbox and decline—whichever you prefer—and click on Next.

6. Select Typical, and click on Next.

7. Review installation directories.

8. Click on Next.

9. Select "All Users" Start Menu folder and click on Next.

10. Review Summary.

11. Click on Next to start the installation process. Installation takes about three minutes.

When the installation is complete, deselect the Run Quickstart checkbox and click on Done.

Installing SOA

Once the database is configured, and WebLogic is installed now you can install the SOA server into the Oracle Home on the WebLogic server. Extract ofm_soa_generic_11.1.1.5.0_disk1_1of2.zip, ofm_soa_generic_11.1.1.5.0_disk1_2of2.zip at C:\SOA (this can be any path where you want to extract these zip files)

1. In a command window, enter:

C:\SOA\Disk1\Setup –jreLoc C:\Oracle\Middleware\home_11gR1\jdk160_11

2. When the install wizard Welcome screen comes up, click on Next.

3. Wait for the pre-requisite check to complete (it's quick!).

4. Click on Next.

5. On the Specify Installation Location screen, select the middleware home:

C:\Oracle\Middleware\home_11gR1.

6. Enter Oracle home: Oracle_SOA1. If you use a different Oracle home, then adjust accordingly when Oracle_SOA1 is referenced throughout this document.

7. Click on Next.

8. Review Summary.

9. Click on Install.

10.Wait for the installation to complete—it takes a few minutes. Click on Finish.

Oracle Service Bus (OSB) Installation

Once SOA is installed into Oracle Home we are ready to Install OSB on that.
Extract ofm_osb_generic_11.1.1.5.0_disk1_1of1.zip at C:\OSB (this can be any path where you want to extract these zip files)

1. In a command window, enter:
C:\OSB\Disk1\Setup –jreLoc C:\Oracle\Middleware\home_11gR1\jdk160_11

2. When the install wizard Welcome screen comes up, click on Next.

3. Select “Skip Software Updates” and click “Next”

4. Leave default values for location:

5. Select “Typical” Installation and click Next:

6. Pre-requisites will be checked - click Next once done:

7. Accept default locations and click Next:

8. Review the summary and click Install

9. When it reaches to 100% - click Next and Finish

Domain Creation

This step describes detail for configuring the WebLogic server domain for the SOA server.

1. In a command window, enter:
C: /Oracle/Middleware/home_11gR1/Oracle_SOA1/common/bin
Config.cmd

2. When the configuration wizard's Welcome screen comes up, select Create a new WebLogic domain, and then click on Next.

3. Select Generate a domain and select SOA Suite, Enterprise Manager, and Business Activity Monitoring. Dependent products are selected automatically.

4. Click on Next.

5. Enter the domain name: domain1. or any other desired domain name

6. Click on Next.

7. Enter the user name as weblogic and a password. The password welcome1 is assumed in this document but you should choose your own secure password and remember it for later in the document when the password is referenced.

8. Click on Next.

9. Select the Sun SDK 1.6_11 and leave Development Mode checked.

10. Click on Next.

11. On the Configure JDBC Component Schema screen, you select the components that you want to change, and then enter the property value for those components. First, select all of the components and enter welcome1 for the password in the Schema Password field.

12. With all of the checkboxes selected, enter the Service, Host, and Port values.

13. Now, look at the table. Review the Schema Owner column and confirm that the values are the same as what you configured in the Configure Schema section when you ran the RCU. Go back and review the screenshots in that section of this document for the schema owners if you do not remember them.

14. Complete the following if the schema owners need to be updated:

  1. Deselect all the component checkboxes.
  2. Select BAM Schema only.
  3. Enter the Schema Owner for BAM.
  4. Next, deselect BAM Schema and select the next one.
  5. Enter the schema owners one-by-one.
  6. Continue until all schema owners are entered.

15. Click on Next.

16. The data source connections are all tested.

17. If all are successful, click on Next, otherwise click on Previous and correct any errors.

18. You will now see options for optional configurations. Select Administration Server, Managed Servers Cluster and Machines and Deployments and Services.

19. Next screen is for configuring managed servers. Select bam_server1 and click Delete, select soa_server1 and click Delete. Then Click Next.

20. And then again Next, On the Configure Machine screen Click next.

21. On the next screen Move AdminServer to the right and click Next.

22. For Target Services to Cluster or Servers,If not already done, select AdminServer on the left and click Select All on the right. Click Next.

23. You reach the Configuration Summary screen.
Click on Create.

24. Wait for the creation to finish it takes few minutes. Click on Done.

This ends the process of Oracle Fussion Middleware (SOA 11g) installation.

Now you can access Oracle Enterprise Manager on http://:7001/em

Weblogic Server Console on http://:7001/console


Thursday, October 22, 2015

Oracle Service Bus Interview Questions with Answers - Part IV

Part - IV

1. What is Message Flow?

Ans: Message Flow is an OSB component which is part of proxy service. We define our business logic in message flow.

2. Can we delete Start Node in Message flow?

Ans: Start Node comes by default in message flow once we create a proxy service. Every message flow should always have a start node and we can't delete the start node in message flow.

3. Can we add multiple pipeline pairs in one message flow?

Ans: Yes, we can add more than one pipeline pair in one message flow.

4. Can we directly add actions under request or response pipeline?

Ans: No, we can't add actions directly under request or response pipeline, we need to add stage node in request or response pipeline and inside that stage, we can add all required actions.

5. Can we have more than one route node in message flow?

Ans: No, we can't add more than one route node in message flow.

6. Which node you will use when you need to route the message based on content?

Ans: We will use Conditional Branch to route the message to different business services based upon content, this is also called content based routing.

7. Which node you will use to route the message based upon operations?

Ans: We will use operation Branch to route the message to different business services based upon operation.

8. Can we delete the default branch in conditional or operational branch?

Ans: No, we can't delete the default branch in conditional or operational branch.

9. Can we add more than one route in one conditional or operation branch?

Ans: Yes, if we need more than one branch then we add one route node in each branch as each branch will be independent and only one branch will execute at one time.

10. Can we add stage node under route node?

Ans: No, we can't add stage node under route node. Stage node can be added only under request and response pipeline or in error handlers.

11. What is Dynamic Routing action?

Ans: This action is used when we need to route the message to business service dynamically that means at design time we don't know to which business service we have to route the message and that is determined at run time.

12. Which action we use to throw fault/error in message flow?

Ans: We use "raise-error" action to throw business fault in message flow.

13. What is reply action?

Ans: It specify that immediate reply is sent to invoker.

14. What actions we use for OSB reporting?

Ans: We use Alert, Log and Report for OSB reporting.

15. Can we change the file name in message flow at runtime?

Ans: Yes, we can change file name at runtime using Transport Header action.

16. Can we change the endpoint URI of the external service that we invoke using business service?

Ans: Yes, we can do it by using routing option action.

Part - I | Part - II | Part - III


Oracle Service Bus Interview Questions with Answers - Part III

Part - III

1. What is Service Result caching in OSB?

Ans: Service Result Caching is one of the options that you can use when you want to improve Oracle Service Bus performance. Service Result caching is used when we have business service which connects to external service which returns somewhat static response. So by using Service Result Caching we don’t hit external service for same request instead it will take the response from cache which improve the OSB performance

2. How to perform Service Callout in OSB?

Ans: We use Service Callout option inside Oracle Service Bus to call any service inside message flow to get the required data.

3. When we invoke proxy 2 from proxy 1 then which protocol we need use?

Ans: When there is internal proxy call in OSB then we use "local" transport instead of HTTP.

4. What is content based routing in OSB?

Ans: When we route the request message to different business services based on request message content, that is called content based routing.

5. What are different options available in OSB to read flat file?

Ans: We can read flat file in two different ways.

  • Using Message Format Language (MFL): we can MFL in OSB to read flat files.
  • File Adapter: Create file adapter which read flat file in Jdeveloper, copy JCA, WSDL & XSD file of file adapter in OSB and create proxy service which will read that flat file.

6. What is SLA alert in OSB?

Ans: A service-level agreement (SLA) is a contract between a service provider and a service consumer. In OSB monitoring framework we have SLA alerts which come into picture when there is violation of service level agreements.

7. How to move large file without reading it in OSB?

Ans: In Oracle SOA Suite we use "Move" opeartion to move large files from one location to another. But in Oracle Service Bus we don’t have that option available. But we can use Content Streaming option available for file protocol in OSB to move large files.

8. By how many ways we can do OSB development?

Ans: We can do development in OSB by two ways. Either we can use Eclipse which is IDE tool for OSB or we can use SB console for the development.

9. Will you prefer Eclipse or SB console for OSB development?

Ans: It is simple to work with SB console as compared to eclipse, so during initial phase we can opt for SB console and later go for eclipse. When we work at enterprise level, Eclipse is always recommended.

10. Do we need to create a session when we develop projects in Eclipse?

Ans: No, we need not to create a session when we develop projects in Eclipse, session will only come into picture when we deploy the project to server from eclipse.

11. Can multiple users work on SB console at one time?

Ans: Yes, multiple users with different user roles can work on SB console at same time as session will be created for each users individually.

12. Can we test the proxy service from Eclipse?

Ans: Yes, we can test the proxy service from Eclipse, for that we need to right click on the proxy service and then click on Run As and run it on server.

13.Can we create Xquery transformation in design mode in SB Console?

Ans: No, we have to write Xquery in source mode. We can create Xquery transformation in Eclipse.

14. Do we have the option to test the Xquery Transformation?

Ans: Yes, we can test the Xquery transformation.

15. Can we use XSLT file in OSB?

Ans: Yes, OSB support both Xquery and XSLT.

Part - I | Part - II | Part - IV


Oracle Service Bus Interview Questions with Answers - Part II

Part - II

1. What is throttling in OSB?

Ans: Throttling means we want to process certain messages in one time, then we need to set some parameters in OSB to do the required task.

2. To transform from binary to XML or XML to binary format what we will use in OSB?

Ans: We use Message Format Language (MFL).

A Message Format Language (MFL) document is a specialized XML document used to describe the layout of binary data. It is an Oracle proprietary language used to define rules to transform formatted binary data into XML data. An MFL document conforms to the mfl.dtd, which includes elements and attributes used to describe each field of data, as well as groupings of fields (groups), repetition, and aggregation.

When you create a business services or proxy services of Messaging Service type, you can select MFL types as the request message type or the response message type of the service

3. Can we use MDS in OSB?

Ans: No, Oracle Service Bus does not support MDS.

4. Can we use DVM’s in Oracle Service Bus?

Ans: No, we can’t use DVM’s in Oracle Service Bus.

5. How Security works in OSB?

Ans: Oracle Service Bus leverages Weblogic Security Framework.

6. Can we use OWSM to secure OSB services?

Ans: Yes, we can use OWSM to secure OSB services.

7. To secure OSB proxy service, which OWSM policy you will use?

Ans: To secure OSB proxy service, we use OWSM service side policy.

8. Can we invoke secure web service from OSB?

Ans: Yes, we can use OWSM client policy and invoke secure web service from OSB.

9. When we use service Account?

Ans: We use Service Account when we are invoking a service which required static authentication.

10. Can we re-use Service Account for other Business Services as well?

Ans: Yes, we can re-use the Service Account.

11. What is Transport-Level Security?

Ans: It refers to transport protocol security means secure the connection over which messages are transferred. E.g. HTTPS means HTTP over SSL.

12. What is Message-Level security?

Ans: Message level security is used when we want to protect the message exchanged between two applications.

13. What is Service pooling in OSB?

Ans: In OSB we can group together more than one service so that whenever one service goes down, request will route to next available service and end user can continue his work without any interruption.

14. How file pooling works in OSB?

Ans: There are below two ways to poll a file in OSB.

  • OSB file protocol: We can use file protocol available in proxy service to poll the file.
  • File adapter: we can create file adapter in Jdeveloper and import JCA, WSDL & XSD file of that adapter into OSB and generate proxy service from that.

15. Types of pipeline available in OSB?

Ans: We have two pipelines in OSB, Request and Response pipeline.

16. Can we invoke Restful service from OSB?

Ans: Yes, we can invoke Restful service from OSB.

17. We don’t have any DB protocol in OSB then how to read/write data from database using OSB?

Ans: We can use database adapter to read/write data from database. We can create database adapter in Jdeveloper, import adapter JCA,WSDL & XSD files to OSB and generate proxy or business service as per our requirement.

18. How to perform file listing in OSB?

Ans: To perform file listing in OSB, you need to create file adapter with file listing operation in Jdeveloper and use that only.

Part - I | Part - III | Part - IV


Oracle Service Bus Interview Questions with Answers - Part I

Part - I

1. To connect to source system which service we will use?

Ans: We will use Proxy service to connect to Source system.

2. To connect to target system which service we will use?

Ans: We will use Business service to connect to target system.

3. What is Business Service?

Ans: It is a service in OSB which is used to connect to target system.

4. What is Message Flow?

Ans: Message flow is there in proxy service, we do all types of transformation, routing and other processing message flow only.

5. Do we have global variable in OSB (Can we access variable which is defined in proxy service message flow from other proxy service message flow)?

Ans: No, we can't access variable in proxy service message flow from other proxy service message flow.

6. Can we use direct bindings to call SOA composites?

Ans: Yes, we can direct binding-bindings to call SOA composites along with SOAP bindings.

7. Where the file will go if there is any error while polling the file?

Ans: During configuring file or ftp protocol in OSB, we need to specify error directory, so you can see file to that directory if file polling failed.

8. Why we use Split-Joins in OSB?

Ans: In short - For parallel processing. (Split-Joins let you send message invocations in parallel (in addition to sequentially) and to aggregate the responses.)

Oracle Service Bus's Split-Join feature lets you split a service payload, such as an order, into individual messages for concurrent processing. Concurrent processing, as opposed to sequential processing, greatly improves service performance. Split-Join achieves this task by splitting an input message payload into sub messages (split), routing them concurrently to their destinations, and aggregating the responses into one overall return message (join). This process of payload splitting and response aggregation is called a Split-Join pattern.

9. Types of Split-Joins?

Ans: Static and dynamic.

  • Static Spilt-Join: The static Split-Join branches from the main execution thread of an OSB message flow by splitting a payload into a fixed number of new branches according to the configuration of the Split-Join. At design time you determine the number and variety of services to be invoked.
  • Dynamic Spilt-Join: The dynamic Split-Join branches from the main execution thread of an OSB message flow by dynamically creating new branches according to the contents of the incoming payload. The dynamic Split-Join uses conditional logic to determine the number of branches to create. All requests are handled simultaneously, and the responses are aggregated into a single reply.

10. How to call Java code from OSB?

Ans: By using Java callout activity.

11. Can we use more than one route node in message flow?

Ans: No, we can't we use more than one route node in proxy service message flow.

12. When we call asynchronous service from OSB then how to get response back from that asynchronous service to OSB?

Ans: Design the proxy service which in turn calls business service which in turn calls asynchronous service. In the message flow of this proxy change the message header to below.

You need to specify ReplyTo value so that asynchronous service response came to CallSyncCompositeProxy proxy service.

Remember ReplyTo address refers to CallSyncCompositeProxy endpoints.

Part - II | Part - III | Part - IV