Wednesday, 26 September 2018

Oracle SOA Mediator

Oracle SOA Mediator

Mediator is one of the service component of the Oracle SOA Suite, there are four main functionality of Mediator
  1. Routing : Mediator route incoming payload to the external service based on routing rule
  2. Validate: Mediator performs XSD schema validation , it describes the structure of xml payload
  3. Filter: Mediator defines a filter expression that specifies the service to be invoked if the payload satisfy filter condition
  4. Transform: Mediator performs XSLT transformation , it transforms data suitable for the target                                                                                                                                                                                                                                                                    In this Demo we will be creating a composite application that routs the incoming payload to the BPEL process based on filter expression
    Step 1: Click File –> new –> project –> SOA Project                                                                                                                                       OracleSOAMediator1                                                                                                                                                                                                                              Click OK                                                                                                                                                                                                     Step 2: Enter the project name and click nextOracleSOAMediator2                                                                                                                                                                                                                                         Click Finish                                                                                                                                                                                                     Step 3: Create a Schema for input and output                                                                                                                                                                                                                                            OracleSOAMediator3                                                                           Step 4: Expose a SOAP service, drag a Soap from component panel and drop it in exposed service OracleSOAMediator4                                                                                                                                                                                                                                                                            Name it as ProductDeliver, in WSDL URL click on Generate WSDL from schema as shown aboveOracleSOAMediator5                                                                                                                                                                                                                                                                                   In Interface Type choose Synchronous Interface  and click on + sign at input and name it as Request  , browse for input schema element
    OracleSOAMediator6                                                                                                                                                                                                                                                                                                                      Choose the input element and click OKDo the same for output click on + sign at output and name it as Response, browse for output schema element and click ok OracleSOAMediator7                                                                                                                                                                                                                                                                                                                   Now u have exposed a SOAP Service                                                                                                                                            Step 5: Drag a mediator component from component panel and drop it in Components                                                                                                                                                                                                                                                OracleSOAMediator8                                                                                                                                                                                                                                                                                                 and click OK                                                                                                                                                                            OracleSOAMediator9                                                                                                                                                                                                                               Now connect SOAP service with mediatorStep 6:Drag a BPEL process from component panel and drop it in components, name it as DLF and in Template choose Synchronous BPEL ProcessOracleSOAMediator10                                                          In input click browse and select input schema element, Click OK
    OracleSOAMediator11                                                                                               In output click browse and select output schema element, Click OK
    OracleSOAMediator12                                                                                                 And uncheck Expose as a SOAP Service and click OKNow that u have create a BPEL Process (DLF), Follow same steps to create two more BPEL name it as Emirates and FedExOracleSOAMediator13Now connect this three BPEL to the mediatorOracleSOAMediator14
Double click on mediator, u will find three section pointing to DLF, Emirates and FedEx BPEL
OracleSOAMediator15
In DLF section click on filter to specifies routing rule
OracleSOAMediator16
In routing rule we are going to compare payload element i.e. deliveryLocation  with India,if  true it will route to DLF BPEL
Click OK
Now assign payload to the input of DLF BPEL by click Assign value in mediator
OracleSOAMediator17
After mapping payload with input of DLF BPEL
Click OK
Now that u have mapped input to DLF BPEL, u should get the out from DLF BPEL and mapped it to SOAP response
In Synchronous reply click on Assign value
OracleSOAMediator18
Map the out of DLF BPEL to the SOAP response, Click OK
Now that u have done with DLF BPEL, do the same for Emirates and FedEx
BPEL and assign value for request and response
OracleSOAMediator19
If deliveryLocation  is Dubai,it will route to Emirates BPEL else if deliveryLocation  is USA,it will route to FedEX BPEL
Step 6: Click on DLF BPEL , drag  assign from components panel and place it in BPELOracleSOAMediator20
Double click on assign and concat product name with courier name as shown below
OracleSOAMediator21
Do the same for Emirates and FedEx BPEL
OracleSOAMediator22
OracleSOAMediator23
Save all the changes and deploy the application
Step 7: Test the Application
1)
Request
OracleSOAMediator24
Response
OracleSOAMediator25
2)
Request
OracleSOAMediator26
Response
OracleSOAMediator27
3)
Request
OracleSOAMediator28
Response
OracleSOAMediator29

Oracle SOA Database Adapter

Database adapter –

This is one of the important part of Oracle SOA. Using database adapter we can do all Database operations like insert, update, delete, select, calling a stored procedure, polling records from DB and executing Pure SQL.
To call database adapter we should do some configuration on weblogic console like creating a datasource and creating a JNDI. Now we will see how to create a datasource and JNDI.
Creating Datasource :
http://localhost:7001/console login into local weblogic console using username and password.
1) After login to console go to Services and then click on Data Sources.
image1
On this page provide a valid Datasource name. Ex : “TestDataSource”.
Give Jndi name. Ex : jdbc/db/nonxa/prod.
Database type : Can be given as per use. I am selecting here “Oracle”.
Click on Next.
image2
2) On next page select Oracle driver version as per requirement. Here I am selecting default one and click on Next.
image3
3) On next page there will not be anything to select or enter anything, just click on Next.
In the next page we should provide details like database name, host name, port, username and password.
After providing all correct details click on next.
image4
4) In the next page we should check whether provided data in last page are valid are not, for we should click on Test configuration. If provided data are correct then we will see message as Connection test succeeded. Click on next.
image5
If connection wasn’t successful then go back to previous page and make sure that valid data is entered.
5) Now select a target server, here I am selecting bam_server1. Click on finish.
image6
Now we are done with creating datasource.
Creating JNDI :
1) To start creating with JNDI, click on Deployments, after that click on DbAdapter.
image7
2) Now click on Configuration and then click on Outbound Connection Pools, after that click on New as shown picture below.
image8
3) In next page just select a checkbox and click on next.
image9
4) Give the proper name in place of JNDI name: eis/db/nonxa/qa and click on finish.
image10
5) Now we should provide Datasource name to created JNDI. Click on javax.resource.cci.ConnectionFactory.
image11
6) Click on created JNDI name : eis/db/nonxa/qa.
image12
7) In the next page we should change two properties
  1. a) xADataSourceName : As created datasource.
  2. b) sequencePreallocationSize Note : By default this value will be 50. If we keep this default value as it is then whenever we create a sequence for a table then every time that sequence value will be incremented by 50.
Ex : If initial value of sequence is 1000 then next value will 1050, 1100, 1150 and so on.
Note : Simply if we provide these two values and click on save will not work. First provide sequencePreallocationSize as 1 or as per requirement and click enter. Then next provide xADataSourceName value and again click on enter. And then click on save. If we do in this way then only changes will effective.
image13
Database Adapter :
Integration of Database Adapter
Drag a Database Adapter from component palette and drop it in exposed services.
Step 1.
image14
Click Next
Step 2.
Enter Service name and click next.
image15
Step 3.
Here click on plus icon, it will open new window to create new connection.
image16
Step 4.
Enter the required detail as provided in above image like
  1. Database username, password.
  2. Hostname
  3. Port number
  4. SID or Service name as per requirement
Before clicking OK click on Test Connection and check whether given information’s are correct. If connection is Success! then click on OK.
image17
Step 5.
In this step we should select which operation we want to do on Database.
  1. Call a stored procedure or function – If we select this then we call a selected stored procedure.
  2. Perform as operation on a Table – In this operation we can read, write, update, delete records from a table.
  3. Poll for New or Changed Records in a table – Polling records from table. Polling can be done in asynchronous/synchronous way, for that we should select one check box.
  4. Execute pure SQL – This property will allow us to write a query as per our requirement.
Note : If we select Select check box under Perform an operation on a table then we can’t select records as per our requirement because this will allow us select records as per Primary key. So if we require to select records as per for Ex : first name or last name then better use Execute Pure SQL, here we can write query as per our “where” condition.
Here I am using Insert only operation because I am going to insert data into table. Click Next
image18
Step 6.
Here select a schema from which a particular table should be selected. Click on Query which will schema and it will list of tables under it. Now select a particular table which are listed after querying and click on arrow.

image19
Step 7.
After clicking on arrow table will be moved from left hand side to right. Click OK.
image20
Step 8.
After click OK will see screen like above, click Next.
image26
Step 9.
I don’t have any relationships to be created with other table so its showing like “No Reachable Relationships”. If there two tables selected and there is relationship required then click Create… and create required relationship. Click Next >.
image22
Step 10.
Here it will show column which are present under selected table. Here we select and deselect required and not required fields and Click Next >.
image21
Step 11.
In above screen we select Sequence which is will used to generate Next Primary Key for every record which is going to be inserted. Click on Search, it will give list of Sequences from that select required Sequence. Click Next >.
image24
Step 12.
Click Finish. It will create a Database Adapter in BPEL.
image25

Oracle SOA File/FTP Adapter

Oracle SOA File/FTP Adapter
Oracle SOA File/FTP Adapter
Oracle File/FTP Adapter is one of the service component of the Oracle SOA Suite, Oracle File and FTP Adapter allows BPEL or Mediator process to exchange (i.e read or write) files on local file systems or remote file (i.e FTP or SFTP) system
Integration of FTP Adapter
Drag a FTP Adapter from component palette and drop it in exposed services
Step 1: 
Step1FTP
Click Next
Step 2:
Step2FTP
Enter Service Name and Click Next
Step 3:
Step3FTP
Click Next
Step 4:
Step4FTP
Enter JNDI Name and Click Next
Step 5:
Step5FTP
Select Get File to read file or Select Put File to write the file and Click Next
Step 6:
Step6FTP
Select either physical path and specify the incoming file directory or
Select logical name and specify the directory in config plan
Either Select or deselect delete file after successful retrieval
If required to archive the file before deleting the file, Select Archive processed files and specify either physical path or logical name
Click Next
Step 7:
Step7FTP
Enter the required file Pattern to been read and click Next
Step 8:
Step8FTP
Specify the file polling frequency in seconds
Specify the minimum File Age in seconds
Click Next
Step 9:
Step9FTP
If the file message format translation is not required then select Schema is Opaque
If required click on browse button and find the schema and click OK
Click Next
Step 10:
Step10FTP
Click Finish
Step 11:
setUp FTP Adapter configuration in SOA weblogic domain
  1. Open http://hostname:port/console
Click Deployments   –>  FTPAdapterStep1FTPConfig
2. Go to Configuration  –>  Outbound Connection Pools
Click New to create new FTP Configuration
Step2FTPConfig
3. Select javax.resource.cci.ConnectionFactory
Step03FTPConfig
Click Next
4.Enter the JNDI name and Click Finish
Step4FTPConfig
5.Now click on eis/ftp/read to enter the configuration
Step5FTPConfig
Select either Public key authentication or password authentication and
click Next
6.Enter the host name
Step6FTPConfig
Click Next
7.Enter password  and port number 21 for FTP and 22 for SFTP
Step7FTPConfig
Click Next
8.
Step8FTPConfig
Click Next
9. Enter Server Type either win for windows or unix
Step9FTPConfig
Click Next
10.Enter Username , if your using SFTP make useSftp to true
Step10FTPConfig
Click Save
11. Once Configuration is saved Update FTP Adapter
Step11FTPConfig
Select FtpAdapter and click Update
12. Select Update this application in place with new deployment plan changes
Step12FTPConfig
Click next
13.
Step13FTPConfig
Click Finish
14.Once update is done click Activate Changes
Step14FTPConfig

Wednesday, 12 September 2018

How to move the central Inventory (oraInventory) to another location.

How to move the central Inventory (oraInventory) to another location.


Solution On Unix:

Find the current location of the central inventory (normally $ORACLE_BASE/oraInventory):

For example:

find /home/oracle -name oraInventory -print

 /u01/app/oracle/oraInventory

Open the oraInst.loc file in /var/opt/oracle and check the value of inventory_loc

cat /var/opt/oracle/oraInst.loc

inventory_loc=/u01/app/oracle/oraInventory inst_group=oinstall

Remark: The oraInst.loc file is simply a pointer to the location of the central inventory (oraInventory)

Copy the oraInventory directory to the destination directory

cp -Rp /home/oracle/oraInventory /app/oracle

Edit the oraInst.loc file to point to the new location

For example:

vi /var/opt/oracle/oraInst.loc

inventory_loc=/app/oracle/oraInventory inst_group=dba

Tuesday, 14 August 2018

WebLogic Server is not Releasing the Storage after Log Rotation (Doc ID 2429822.1)

WebLogic Server is not Releasing the Storage after Log Rotation (Doc ID 2429822.1)

APPLIES TO:
Oracle WebLogic Server - Version 12.1.3.0.0 and later
Information in this document applies to any platform.
SYMPTOMS
On WebLogic Server (WLS) 12.1.3, JVM process is not releasing storage after log files are deleted.

You have applied patch 27357612 along with the latest PSU

But lsof command still shows wls log files


lsof /filenet|grep -i deleted
startWebL 99994 weblogic 1w REG 253,6 103399 1710660 /Oracle_Home/domain_name/servers/cpe_server1/logs/xxx_server1.out00177 (deleted)
startWebL 99994 weblogic 2w REG 253,6 103399 1710660 /Oracle_Home/domain_name/servers/servers/cpe_server1/logs/xxx_server1.out00177 (deleted)
java 100053 weblogic 630w REG 253,6 103759 1710856 /Oracle_Home/domain_name/servers/servers/cpe_server1/logs/xxx_server1.out00178 (deleted)



CAUSE
This issue was caused due to an incomplete fix in the Bug 27357612


SOLUTION
1. If already applied, remove patch 27357612

2. Apply patch 27896715