Quantcast
Channel: SOA@Oracle SCA, BPEL, BPM & Service Bus
Viewing all 26 articles
Browse latest View live

WLST Script changing logfile location

$
0
0
While I was migrating Forms6i to Forms11g patch set #5, the configuration tool of Forms11g is a bit strict. In the silent install it is not possible to set de locations of the log files. Here is the script that will set new filename locations of all the Managed Servers and Admin Server in the domain. It also set the filename location of all the ODL logging.

fmwlogging.py:
#
# usage:
#
# ${ORACLE_HOME}/common/bin/wlst.sh [domain-name] [admin-server-url] [password]
#

import os
import sys
import traceback
import getopt

loggingEnabled=True
# rotationType="none", "bySize", "byTime"
# logFileSeverity="Trace", "Debug", "Info", "Notice", "Warning"
# rotateLogOnStartup=False, True
rotationType="none"
logFileSeverity="Warning"
rotateLogOnStartup=True

def editMode():
edit()
startEdit()

def editActivate():
save()
activate(block="true")

def updateLog(domain_name, logMB, logType):
print "**** Start updateLog()"

fileName = ""
if logType == "Access":
logMB.setLoggingEnabled(loggingEnabled)
fileName = "/data/logs/" + domain_name + "/" + logMB.getName() + "_access.log"
elif logType == "Server":
fileName = "/data/logs/" + domain_name + "/" + logMB.getName() + ".log"
elif logType == "Datasource":
fileName = "/data/logs/" + domain_name + "/" + logMB.getName() + "_datasource.log"
elif logType == "Domain":
logMB.setLogFileSeverity(logFileSeverity)
fileName = "/data/logs/" + domain_name + "/" + domain_name + ".log"

print "**** " + logType + " " + fileName
logMB.setFileName(fileName)
logMB.setRotationType(rotationType)


logMB.setRotateLogOnStartup(rotateLogOnStartup)

print "**** Finished updateLog()"

def changeLogPath(domain_name):
print "**** Start changeLogPath()"

domainConfig()
editMode()

logMB = getMBean("/Log/" + domain_name)
updateLog(domain_name, logMB, logType="Domain")

editActivate()

servers = cmo.getServers()

editMode()
for server in servers:
serverName = server.getName()

logMB = getMBean("/Servers/" + serverName + "/Log/" + serverName)
updateLog(domain_name, logMB, "Server")

httpLogMB = getMBean("/Servers/" + serverName + "/WebServer/" + serverName + "/WebServerLog/" + serverName)
updateLog(domain_name, httpLogMB, "Access")

DSLogMB = getMBean("/Servers/" + serverName + "/DataSource/" + serverName + "/DataSourceLogFile/" + serverName)
updateLog(domain_name, DSLogMB, "Datasource")

editActivate()
print "**** Finished changeLogPath()"

def usage():
print "Usage"
print "./fmwlogging.py $1"

def parse_input():
print "***** Start parse_input()"

domain_name = sys.argv[1]
admin_server = sys.argv[2]
admin_password = sys.argv[3]

return domain_name, admin_server, admin_password

print "***** Start parse_input()"

# Connectionsettings
def connectToServer(username, password, adminurl):
print "***** Start connectToServer()"

connect(username, password, adminurl)

print "***** Finished connectToServer()"

#Definition to disconnect from a server
def disconnectFromServer():
print "***** Start disconnectFromServer()"

disconnect()

print "***** Finished disconnectFromServer()"
exit()

def changeODLPath(domain_name):
print "***** Start changeODLPath()"

domainConfig()
managedServers=cmo.getServers()

#Get Runtime for our server
for managedServer in managedServers:
sname=managedServer.getName()
path = "/Servers/" + sname
cd(path)

print "***** Changing server: " + sname
lh = listLogHandlers(target=sname)
for l in lh:
lname = l.get("name")
lprops = l.get("properties")
removeprops=[]
for prop in lprops:
if prop.get("name") == "maxFileSize":
removeprops.append("maxFileSize")
elif prop.get("name") == "maxLogSize":
removeprops.append("maxLogSize")

odlfile = "/data/logs/" + domain_name + "/" + sname + "-" + lname + "-diagnostic.log"
configureLogHandler(target=sname, name=lname, path=odlfile,removeProperty=removeprops)

print "***** Finished changeODLPath()"

def main(domain_name, admin_server, admin_password):
print "***** Start main()"

connectToServer("weblogic", admin_password, admin_server)

# do the change the ODL log files on all servers ( Admin, managed)
# changeODLPath(domain_name)

# do the change the standard log files on all servers ( Admin, managed)
changeLogPath(domain_name)

# Calling disconnectFromServer definition with no arguments
disconnectFromServer()

print "***** Finished main()"

try:
print "** start()"

domain_name, admin_server, admin_password = parse_input()
main(domain_name, admin_server, admin_password)

print "** finished()"

except Exception, (e):
print "ERROR: An unexpected error occurred!"
traceback.print_exc()
dumpStack()
print "ERROR: Failed to configure fmw diagnostic logging " + domain_name + "!!"

#EOF


Reference: Weblogic MBean Documentation

Extreme performance boost on OSB11g and CLOB objects

$
0
0
When using the JCA DbAdpater in the Oracle Service Bus (OSB11g) normal operations running fine. Most of us using the DbAdapter for simple DML actions (Select/Insert/Update/Delete).

There is a huge performance degradation when you read LOB objects from the DbAdapter. When reading a CLOB from a table, and this CLOB contains a document of 3MB, we saw that the OSB server consumes 100% CPU for a long time.
This results in time-outs, broken-pipe, connection lostd and all those kind of messages. First of all you look into your own environment to find this issue;
  • Is the server configured correctly
  • Is the network up and running
  • Is the query correct
  • Is the Proxy service programmed in the correct way
I found out that this huge CPU consuming action is a bug (!) that exists from patch set #2 (11.1.1.3). Only for this release a patch was created. The fix was not put into the code of the next patch sets.

To summarize; make sure you have patch for your OSB environement for bug 1294800 (PS2) or 14630697 (PS5)  or ask Oracle Support for a backport for you release.

Review: Oracle SOA Suite 11g Administration Handbook

$
0
0
While Packt Publishing is almost ready to publish their 1000th title. They will celebrate this with an  the event. As the mentioned on their site:

"Packt would like you to join them in celebrating this milestone with a surprise gift. Revisit Packt’s website between the 28th and 30th of September to redeem your gift, or sign up for an account with us now to receive a notification email.

Packt supports many of the Open Source projects covered by its books through a project royalty donation, which has contributed over $400,000 to Open Source projects. As part of the 1000th book celebration Packt is allocating $30,000 to share between projects and authors."

I had the opportunity to review the new administration handbook of the Oracle SOA Suite 11g.


 







Here are my comments on this book.

The book is filling a gap in the Oracle SOA world. This book is really focusing on administration and monitoring of the SOA11g environment. The book is not a summary of the Oracle Manuals with some screen shots based on an example application, but it gives you also different best practises, idea's, and good examples on maintaining your environment.

The chapter on tuning your SOA11g environment is very good! It covers O/S, application server, database and the various component within the SOA Suite.

I missing only a good script in the chapter on maintaining  your SOA instances. The examples are based on the de supplied scripts of Oracle, but those script do not purge all the data.



APEX: Running multiple version on single Weblogic Server

$
0
0
Sometimes you would like to have multiple versions of APEX running on one Weblogic Server, or Weblogic Cluster. For example, you would like to run APEX version 4.0 and version 4.2 along each other.

To configure this is rather simple and straight forward. The trick is to use the various WAR files; apex.war and images.war under a different name and use plan files to manipulate the root and image directories.

The following actions should be carried out:

make sure you have different WAR files of the APEX application in a single directory on your Admin server:

$ cd /data/deploy
$ ls -1
apex.4.0.war
apex.4.2.war
images.4.0.war
images.4.2.war


Create a plan directory to store your plan-files to overule the WEB properties

$ mkdir -p /data/user_projects/domains/APEX/plan/apex
$ ls -1
plan-images.4.0.xml
plan-images.4.2.xml
plan.4.0.xml
plan.4.2.xml


Make sure you have these files in this directory. Here is an example of the APEX plan-images file, to create your own plan file:

plan-images.4.2.xml
<?xml version='1.0' encoding='UTF-8'?> 
<deployment-plan xmlns="http://xmlns.oracle.com/weblogic/deployment-plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd" global-variables="false">
 
<application-name>apex.war


  <variable-definition>
     
<variable>
         
<name>apex-images-root</name>
         
<value>apex-images-42</value>
     
</variable>
 
</variable-definition>

 
<module-override>

   
<module-name>images.4.2.war</module-name>
   
<module-type>war</module-type>

   
<module-descriptor external="false">
     
<root-element>weblogic-web-app</root-element>
     
<uri>WEB-INF/weblogic.xml</uri>

     
<variable-assignment>
       
<name>apex-images-root</name>
       
<xpath>/weblogic-web-app/context-root</xpath>
     
</variable-assignment>

   
</module-descriptor>
 
</module-override>

 
<config-root>/data/tmp/apex</config-root> </deployment-plan>

Here is an example of the APEX plan file:

plan.4.2.xml 
<?xml version='1.0' encoding='UTF-8'?> 
<deployment-plan xmlns="http://xmlns.oracle.com/weblogic/deployment-plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd" global-variables="false">
 
<application-name>apex.4.2.war</application-name>

 
<variable-definition>
     
<variable>
         
<name>apex-root</name>
         
<value>apex-42</value>
     
</variable>
     
<variable>
         
<name>apex-config</name>
         
<value>/data/configuration/4.2</value>
     
</variable>
 
</variable-definition>

 
<module-override>
   
<module-name>apex.4.2.war</module-name>
   
<module-type>war</module-type>

   
<module-descriptor external="false">
     
<root-element>weblogic-web-app</root-element>
     
<uri>WEB-INF/weblogic.xml</uri>

     
<variable-assignment>
       
<name>apex-root</name>
       
<xpath>/weblogic-web-app/context-root</xpath>
     
</variable-assignment>

   
</module-descriptor>

   
<module-descriptor external="false">
     
<root-element>web-app</root-element>
     
<uri>WEB-INF/web.xml</uri>

     
<variable-assignment>
        
<name>apex-config</name>
        
<xpath>/web-app/context-param/[param-name="config.dir"]/param-value</xpath>
        
<operation>add

      </variable-assignment>

   
</module-descriptor>
 
</module-override>

 
<config-root>/data/tmp/apex</config-root></deployment-plan>

Now comes the deployment part, which is straight forward as a normal application.
  • Logon to Adminconsole
  • Lock & Edit to open session
  • Deploy images.4.0.war with plan file plan-images.4.0.xml
  • Deploy images.4.2.war with plan file plan-images.4.2.xml
  • Deploy apex.4.0.war with plan file plan.4.0.xml
  • Deploy apex.4.2.war with plan file plan.4.2.xml
  • Activate changes
  • Start running the images applications for all requests
  • Start running the apex applications for all requests
While we have overuled the default images direcotry from '/i' into '/apex-images-42' or '/apex-images-40', we should run some SQL scripts to update the APEX data. The following SQL code should be execute on the database for the specific APEX version

declare
    l_stmt varchar2(4000);
begin
    l_stmt := 'create or replace package wwv_flow_image_prefix
is
    g_image_prefix       constant varchar2(255) := ''/
apex-images-42/'';
end wwv_flow_image_prefix;';

    execute immediate l_stmt;
end;
/

update wwv_flows
       set flow_image_prefix = '/apex-images-42/'
     where flow_image_prefix = '/i/';

commit;

begin
    wwv_flow_page_cache_api.purge_all;
end;
/

commit;

begin
    dbms_utility.compile_schema(schema => 'APEX_040200', compile_all => FALSE);
end;
/


Now you are able to run multiple APEX applications from onw Weblogic Server/Cluster:

http://:/apex-42
http://:/apex-40


Oracle Fusion Middleware patchset 7, the release notes

$
0
0
As of April 2013, patchset 6 is out for the whole Oracle Fusion Middleware stack. It is always hard to find the release notes on the Oracle Website. To many clicks. Here are the releae notes of Weblogic, SOA Suite, Service Bus, AIA and JDeveloper. Note thate PS6 refers to version 11.1.1.7

Release Notes:
Here is an overview on the new features:

https://soacommunity.wordpress.com/2013/05/14/oracle-service-integration-soa-products-whats-new-in-11-1-1-7-ps6/?goback=.gde_3608174_member_240800548

Changing SOA properties via WLST

$
0
0


Hereby a script to change some properties for SOA Suite. These are some generic settings such as:
  • soa-infra
  • AuditLevelGlobalTxMaxRetry
  • DisableCompositeSensors
  • DisableSpringSESensors
  • mediator
  • AuditLevel
  • bpel
  • AuditLevel
  • SyncMaxWaitTime
  • Recovery Schedule Config
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import javax.management.Attribute;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import javax.management.Query;
import javax.management.QueryExp;
import javax.management.openmbean.CompositeDataSupport;
import javax.management.openmbean.OpenDataException;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;

connect('weblogic', 'Welcome1', 't3://myhost:7001')
domainRuntime()

#
# soa-infra
#
SOAInfraConfigobj = ObjectName('oracle.as.soainfra.config:Location=MS1,name=soa-infra,type=SoaInfraConfig,Application=soa-infra')

# Off, Production and Development
SOAattribute = Attribute('AuditLevel', 'Production')
mbs.setAttribute(SOAInfraConfigobj, SOAattribute)

print '*** soa-infra: set AuditLevel', mbs.getAttribute(SOAInfraConfigobj, 'AuditLevel')

SOAattribute = Attribute('GlobalTxMaxRetry', 0)
mbs.setAttribute(SOAInfraConfigobj, SOAattribute)
print '*** soa-infra: set GlobalTxMaxRetry', mbs.getAttribute(SOAInfraConfigobj, 'GlobalTxMaxRetry')

SOAattribute = Attribute('DisableCompositeSensors', true)
mbs.setAttribute(SOAInfraConfigobj, SOAattribute)
print '*** soa-infra: set DisableCompositeSensors', mbs.getAttribute(SOAInfraConfigobj, 'DisableCompositeSensors')

SOAattribute = Attribute('DisableSpringSESensors', true)
mbs.setAttribute(SOAInfraConfigobj, SOAattribute)
print '*** soa-infra: set DisableSpringSESensors', mbs.getAttribute(SOAInfraConfigobj, 'DisableSpringSESensors')

#
# Mediator
#
SOAInfraConfigobj = ObjectName('oracle.as.soainfra.config:Location=MS1,name=mediator,type=MediatorConfig,Application=soa-infra')

SOAattribute = Attribute('AuditLevel', 'Inherit')
mbs.setAttribute(SOAInfraConfigobj, SOAattribute)
print '*** mediator: set AuditLevel', mbs.getAttribute(SOAInfraConfigobj, 'AuditLevel')

#
# BPEL
#

SOAInfraConfigobj = ObjectName('oracle.as.soainfra.config:Location=MS1,name=bpel,type=BPELConfig,Application=soa-infra')

SOAattribute = Attribute('SyncMaxWaitTime', 120)
mbs.setAttribute(SOAInfraConfigobj, SOAattribute)

print '*** bpel: set SyncMaxWaitTime', mbs.getAttribute(SOAInfraConfigobj, 'SyncMaxWaitTime')

# AuditLevel
#   off: 0
#   inherit: 1
#   minimal: 2
#   production: 3
#   development: 4
#   onerror: 5

SOAattribute = Attribute('AuditLevel', 'production')
mbs.setAttribute(SOAInfraConfigobj, SOAattribute)
print '*** bpel: set AuditLevel', mbs.getAttribute(SOAInfraConfigobj, 'AuditLevel')

#javax.management.ObjectName
SOAInfraConfigobj = ObjectName('oracle.as.soainfra.config:Location=mwpton-MS1,name=bpel,type=BPELConfig,Application=soa-infra')

#javax.management.openmbean.CompositeDataSupport
rec_config_obj  = mbs.getAttribute(SOAInfraConfigobj, 'RecoveryConfig')

rec_keySet = rec_config_obj.getCompositeType().keySet()
rec_keys = rec_keySet.toArray()
rec_keyitems = [ rec_key for rec_key in rec_keys ]

#javax.management.openmbean.CompositeDataSupport
rec_cluster_obj = rec_config_obj.get('ClusterConfig')
rec_recurrr_obj = rec_config_obj.get('RecurringScheduleConfig')
rec_startup_obj = rec_config_obj.get('StartupScheduleConfig')

#
# StartupScheduleConfig
#
cnt = 0

# java.util.Collections.UnmodifiableSet
keySet = rec_startup_obj.getCompositeType().keySet()

# array
keys = keySet.toArray()

# list
keyitems = [ key for key in keys ]

# array
values = rec_startup_obj.getAll(keyitems)

for key in keys:
  if key == 'maxMessageRaiseSize':
    values[cnt] = 0
    print '*** bpel: set RecurringScheduleConfig:maxMessageRaiseSize ' + key + ' to value ' + str(values[cnt])
  cnt = cnt + 1

#javax.management.openmbean.CompositeDataSupport
new_rec_startup_obj = CompositeDataSupport(rec_startup_obj.getCompositeType(), keyitems, values)

#
# RecurringScheduleConfig
#
cnt = 0

keySet = rec_recurrr_obj.getCompositeType().keySet()
keys = keySet.toArray()
keyitems = [ key for key in keys ]
values = rec_recurrr_obj.getAll(keyitems)

for key in keys:
  if key == 'maxMessageRaiseSize':
    values[cnt] = 0
    print '*** bpel: set RecurringScheduleConfig:maxMessageRaiseSize ' + key + ' to value ' + str(values[cnt])
  if key == 'startWindowTime':
    values[cnt] = "00:00"
    print '*** bpel: set RecurringScheduleConfig:startWindowTime ' + key + ' to value ' + str(values[cnt])
  if key == 'stopWindowTime':
    values[cnt] = "00:00"
    print '*** bpel: set RecurringScheduleConfig:stopWindowTime ' + key + ' to value ' + str(values[cnt])
  cnt = cnt + 1

#javax.management.openmbean.CompositeDataSupport
new_rec_recurrr_obj = CompositeDataSupport(rec_recurrr_obj.getCompositeType(), keyitems, values)

pyMap = { "ClusterConfig":rec_cluster_obj, "RecurringScheduleConfig":new_rec_recurrr_obj, "StartupScheduleConfig":new_rec_startup_obj }
javaMap = java.util.HashMap()
for k in pyMap.keys():
  javaMap[k] = pyMap[k]

new_rec_config_obj = CompositeDataSupport(rec_config_obj.getCompositeType(), javaMap)

#javax.management.Attribute
SOAattribute = Attribute('RecoveryConfig', new_rec_config_obj)

mbs.setAttribute(SOAInfraConfigobj, SOAattribute)
Viewing all 26 articles
Browse latest View live