rss
SOATUBE
Oracle
Custom Search SOABYTE here

Wednesday, March 15, 2017

Purge AIA Message Resubmission Fault Reference Data

During AIA message re-submission, the tables AIA_ERROR_MONITOR & AIA_ERROR_FLEX_FIELD stores the faulted instances referenced date. After the re-submission, these data can be safely purged.
First the records in child table 'AIA_ERROR_FLEX_FIELD' need to be deleted, followed by records in 'AIA_ERROR_MONITOR' table.

CREATE OR REPLACE PACKAGE XX_AIA_PURGE_ERRORS AS

  /* TODO enter package declarations (types, exceptions, methods etc) here */
  procedure delete_instances ( min_creation_date in timestamp,
                   max_creation_date in timestamp,
                   batch_size in integer default 20000,
                   retention_period in integer default 30
                   );

END XX_AIA_PURGE_ERRORS;
/


CREATE OR REPLACE PACKAGE BODY XX_AIA_PURGE_ERRORS
AS
PROCEDURE delete_instances(
    min_creation_date IN TIMESTAMP,
    max_creation_date IN TIMESTAMP,
    batch_size        IN INTEGER DEFAULT 20000,
    retention_period  IN INTEGER DEFAULT 30 )
IS
  v_total_rows        INTEGER;
  v_min_creation_date TIMESTAMP := NVL(min_creation_date,TO_TIMESTAMP('2000/01/01 01:00:00', 'YYYY/MM/DD HH:MI:SS'));
  v_max_creation_date TIMESTAMP := NVL(max_creation_date,SYSTIMESTAMP);
  v_retention_period  INTEGER   := NVL(retention_period,30);
  v_batch_size        INTEGER   := NVL(batch_size,20000);
  /*
  Parameters:
  min_creation_date    = hardcoded to an old value in the past if no value is passed
  max_creation_date    = set to current datetime if no value is passed
  batch_size           = determines the max no. of records to be deleted in each iteration. Set to 20000 if no value is passed.
  retention_period     = determines the no.of days for which the data must be retained without deleting. Set to 30 days if no value is passed.
  */
BEGIN
  /*
  Capture the total records that needs to be purged in total_rows variable.
  */
  SELECT COUNT(*)
  INTO v_total_rows
  FROM AIA_ERROR_MONITOR
  WHERE rownum <= v_batch_size
  AND REPORTED_DATE_TIME BETWEEN v_min_creation_date AND (v_max_creation_date - (interval '1' DAY * v_retention_period));
  /*
  Loop through multiple batches if the total records to delete exceeds batch_size
  */
  WHILE v_total_rows>0
  LOOP
    /*
    Delete records from AIA_ERROR_FLEX_FIELD table
    */
    DELETE
    FROM aia_error_flex_field
    WHERE parent_oid IN
      (SELECT oid
      FROM AIA_ERROR_MONITOR
      WHERE rownum <= v_batch_size
      AND REPORTED_DATE_TIME BETWEEN v_min_creation_date AND (v_max_creation_date - (interval '1' DAY * v_retention_period))
      );
    /*
    Delete records from AIA_ERROR_MONITOR table
    */
    DELETE
    FROM AIA_ERROR_MONITOR
    WHERE rownum <= v_batch_size
    AND REPORTED_DATE_TIME BETWEEN v_min_creation_date AND (v_max_creation_date - (interval '1' DAY * v_retention_period));
    /*
    Commit transactions
    */
    COMMIT;
    /*
    Capture the total records that needs to be purged in total_rows variable after the delete.
    */
    SELECT COUNT(*)
    INTO v_total_rows
    FROM AIA_ERROR_MONITOR
    WHERE rownum <= v_batch_size
    AND REPORTED_DATE_TIME BETWEEN v_min_creation_date AND (v_max_creation_date - (interval '1' DAY * v_retention_period));
  END LOOP;
END delete_instances;
END XX_AIA_PURGE_ERRORS;

/


Friday, February 19, 2016

Things to know about BRM JCA Adapter configuration












TransactionMode should be set to Local if automatic BPEL Remote Fault detection/action for connection failures is required. 

Basically it is the fact that JCA throws Retriable Exceptions in Local Transactions for NAP_CONNECT_FAILED (and a few others like DM_CONNECT_FAILED, BAD_READ etc.) that results in BPEL detecting it as remote fault, not the BRM error code itself. However for XA, JCA throws mostly XAException which BPEL cannot detect as Remote Fault so it will be always be a binding fault there so JCA should not be deployed in XA mode if BPEL automatic detection of remote fault is relied upon by customers. Oracle JCA adapters also document some limitations by saying fault policy management will not work for outbound JCA adaptors in XA mode and they should use SOA's JCA retry mechanism instead of fault mechanism.
Section2.21.3.2.3 http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/life_cycle.htm#TKADP224) .Fault management in BPEL using Remote Faults to retry will not work with BRM JCA adaptor in XA mode since JCA will throw XA Exceptions that XA Transaction Manager will expect and take action. Moreover XA transaction should not retried via fault mechanism, but rather based XA specific error codes.

FailoverConnectionString should be kept empty or should not contain invalid entries

Whenever a connection fails it tries to reconnect to the other entries in the FailoverConnectionString and when those entries cannot be accessed we get CM_ADDRESS_LOOKUP_FAILED. We should clear the FailoverConnectionString entry completely or just replace localhost and localhost2 with the same host as the one in the connection string. 

BRMConnectionPoolMaxsize= Max Capacity BRMConnectionPoolMinsize = Initial Capacity 

BRMConnectionPoolMaxsize / BRMConnectionPoolMinsize is where we define the pool size, which is the number of connections from JCA to BRM.Initial Capacity / Max Capacity is the managed pool size from application which defines the total Managed connections from Application Server to JCA.The application server uses a configured resource adapter (BRM adapter in this case) to create physical connections to the underlying EIS with the help of Connection Factory instance. If we have (x-1) number of Managed connections and (x) number of Connection Factory instances (Physical connections), we are actually not utilizing all the physical connections. In the same way, if we have (x) Managed connections and (x-1) physical connections, we are possibly affecting the performance of the overall system as each Managed connection utilizes system resource (memory and disk space etc.).So it is recommended to have the (managed) connection pool and Connection Factory instance to have same values, which allows for 100% utilization overall system

OS level timeout properties

Usage of OS level TCP IP parameters (e.g. keepalive parameters) while working with the BRM JCA Adapter. By default, the effectiveness of the keepalive parameter is enabled in JCA Adapter (if the parameters are defined in OS kernel) and does not need any configuration.
 # cat /proc/sys/net/ipv4/tcp_keepalive_time 
 7200 (default) changed to 240 
 # cat /proc/sys/net/ipv4/tcp_keepalive_intvl 
 75 (default) changed to 60 
 # cat /proc/sys/net/ipv4/tcp_keepalive_probes 
 9 (default) unchanged

Wednesday, November 25, 2015

Adding managed servers to domain/cluster and basic tuning via wlst

Place addNodes.properties file,AddManagedServerToDomain.py and runAddManagedServerToDomain.sh inside a folder and execute ./runAddManagedServerToDomain.sh to run the program.Here we are adding 3rd managed server (myhost2:8001) to cluster.
#*****************************************************
# Environment details
#*****************************************************
ADMIN_USERNAME = weblogic
ADMIN_PASSWORD = welcome1
ADMIN_URL = t3://<hostname>:<port>
CLUSTER_NAME = MyCluster

##*****************************************************
##   Set Log Rotation by Time                         *
##*****************************************************
# How to rotate
RotationType = byTime
# When to roate
RotationTime = 00:00
# For how much time
FileTimeSpan = 24

##*****************************************************
##   Max Message Size Configurations                  *
##*****************************************************

MaxMessageSize = 50000000


##*****************************************************
##  Cluster Address                                   *
##*****************************************************

ClusterAddress = myhost1:8001,myhost1:8002,myhost2:8001

##*****************************************************
#   Machine Names to be added                         *
##*****************************************************

MachineNames = MyMachine_3

##*****************************************************
##  Listen Adresses(repeat twice for 2 servers per VM)*
##*****************************************************

ListenAddresses = myhost2

##*****************************************************
##   Listen Ports (8001/8002 for 2 servers per VM)    *
##*****************************************************

ListenPorts = 8001

##*****************************************************
##   ServerNames(to be created)                       *
##*****************************************************

ServerNames = SoaServer_3

##*****************************************************
##   Server Number(to be added)                      *
##*****************************************************

ServerNumbers = 3

##*****************************************************
##   New SAF Agents to be created                     *
##*****************************************************

SAFAgentsNames = OSM_SAFAgent_03



########################################################################################
# Adding Nodes to domain Automation                                                    #
# @Amiya Kumar                                                                         #
# Restart the servers after running this script.                                       #
#Do not change the discription                                                         #
########################################################################################


#Running the script                                                                    #
#Run runaddNodeAutomationWLST.sh                                                        #
########################################################################################

from java.io import FileInputStream
import java.lang
import string
import sys
import os

#read properties file
propInputStream = FileInputStream("addNodes.properties");
configProps = Properties();
configProps.load(propInputStream);

#Connecting to Server
adminusername = configProps.get('ADMIN_USERNAME');
adminpassword = configProps.get('ADMIN_PASSWORD');
adminurl = configProps.get('ADMIN_URL');
clusterName = configProps.get('CLUSTER_NAME');
connect(adminusername, adminpassword, adminurl);
MachineNames = configProps.get('MachineNames');
MachineNameList = String(MachineNames).split(",");
ListenAddresses = configProps.get('ListenAddresses');
ListenAddressList = String(ListenAddresses).split(",");
ServerNames = configProps.get('ServerNames');
ServerNameList = String(ServerNames).split(",");
ServerNumbers = configProps.get('ServerNumbers');
ServerNumberList = String(ServerNumbers).split(",");
ListenPorts = configProps.get('ListenPorts');
ListenPortList = String(ListenPorts).split(","); 

#Creating Managed servers and related resources
def createManagedServersandResources():
 domainConfig();
 i=0;
 j=0;
 k=0;
 l=0;
 m=0;
 while i<len(MachineNameList) and j<len(ListenAddressList) and k<len(ServerNameList) and l<len(ServerNumberList) and m<len(ListenPortList):
  edit();
  startEdit();
  MachineName = MachineNameList[i]
  ListenAddress = ListenAddressList[j]
  ServerName = ServerNameList[k]
  ServerNumber = ServerNumberList[l]
  ListenPort = ListenPortList[m]
  #####Creating Machine########
  cd('/')
  cmo.createUnixMachine(MachineName)
  cd('/Machines/'+MachineName+'/NodeManager/'+MachineName+'/')
  cmo.setNMType('SSL')
  cmo.setListenAddress(ListenAddress)
  cmo.setListenPort(5556)
  cmo.setDebugEnabled(false)
  ######Creating Managed Server and adding to existing cluster and machine created above######
  cd('/')
  cmo.createServer(ServerName)
  cd('/Servers/'+ServerName+'/')
  cmo.setListenAddress(ListenAddress)
  cmo.setListenPort(int(ListenPort))
  cmo.setCluster(getMBean('/Clusters/'+clusterName+'/'))

  cd('/Servers/'+ServerName+'/SSL/'+ServerName+'/')
  cmo.setExportKeyLifespan(500)
  cmo.setUseServerCerts(false)
  cmo.setSSLRejectionLoggingEnabled(true)
  cmo.setAllowUnencryptedNullCipher(false)
  cmo.setInboundCertificateValidation('BuiltinSSLValidationOnly')
  cmo.setOutboundCertificateValidation('BuiltinSSLValidationOnly')
  cmo.setHostnameVerificationIgnored(true)
  cmo.setHostnameVerifier(None)
  cmo.setTwoWaySSLEnabled(false)
  cmo.setClientCertificateEnforced(false)
  cmo.setJSSEEnabled(false)

  cd('/Servers/'+ServerName+'/')
  cmo.setMachine(getMBean('/Machines/'+MachineName+'/'))

  ######Creating Persistent stores#######
  cd('/')
  cmo.createFileStore('AIADataStore_'+ServerNumber)
  cd('/FileStores/AIADataStore_'+ServerNumber+'/')
  cmo.setDirectory('AIADataStore_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))

  cd('/')
  cmo.createJDBCStore('AIAJDBCDataStore_'+ServerNumber)
  cd('/JDBCStores/AIAJDBCDataStore_'+ServerNumber+'/')
  cmo.setDataSource(getMBean('/SystemResources/AIAJMSDS'))
  cmo.setPrefixName('AIAJDBCDataStore_'+ServerNumber)
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))
  cd('/')
  cmo.createFileStore('BPMJMSFileStore_auto_'+ServerNumber)
  cd('/FileStores/BPMJMSFileStore_auto_'+ServerNumber+'/')
  cmo.setDirectory('BPMJMSFileStore_auto_'+ServerNumber)
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))
  cd('/')
  cmo.createFileStore('SOAJMSFileStore_auto_'+ServerNumber)
  cd('/FileStores/SOAJMSFileStore_auto_'+ServerNumber+'/')
  cmo.setDirectory('SOAJMSFileStore_auto_'+ServerNumber)
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))
  cd('/')
  cmo.createFileStore('UMSJMSFileStore_auto_'+ServerNumber)
  cd('/FileStores/UMSJMSFileStore_auto_'+ServerNumber+'/')
  cmo.setDirectory('UMSJMSFileStore_auto_'+ServerNumber)
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName)) 

  ########Creating JMS Servers########
  cd('/')
  cmo.createJMSServer('AIAJDBCJMSServer_'+ServerNumber)
  cd('/Deployments/AIAJDBCJMSServer_'+ServerNumber+'/')
  cmo.setPersistentStore(getMBean('/JDBCStores/AIAJDBCDataStore_'+ServerNumber))
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))
  cd('/')
  cmo.createJMSServer('AIAJMSServer_'+ServerNumber)
  cd('/Deployments/AIAJMSServer_'+ServerNumber+'/')
  cmo.setPersistentStore(getMBean('/FileStores/AIADataStore_'+ServerNumber))
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))
  cd('/')
  cmo.createJMSServer('BPMJMSServer_auto_'+ServerNumber)
  cd('/Deployments/BPMJMSServer_auto_'+ServerNumber+'/')
  cmo.setPersistentStore(getMBean('/FileStores/BPMJMSFileStore_auto_'+ServerNumber))
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))
  cd('/')
  cmo.createJMSServer('SOAJMSServer_auto_'+ServerNumber)
  cd('/Deployments/SOAJMSServer_auto_'+ServerNumber+'/')
  cmo.setPersistentStore(getMBean('/FileStores/SOAJMSFileStore_auto_'+ServerNumber))
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))
  cd('/')
  cmo.createJMSServer('UMSJMSServer_auto_'+ServerNumber)
  cd('/Deployments/UMSJMSServer_auto_'+ServerNumber+'/')
  cmo.setPersistentStore(getMBean('/FileStores/UMSJMSFileStore_auto_'+ServerNumber))
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))

  ##########Creating BPM Subdeployments###########
  cd('/SystemResources/BPMJMSModule')
  cmo.createSubDeployment('BPMJMSServer_'+ServerNumber)
  cd('/SystemResources/BPMJMSModule/SubDeployments/BPMJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=BPMJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))

  ##########Adding resources to BPMJMSModules########

  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule')
  cmo.createTopic('MeasurementTopic_auto_'+ServerNumber)
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/Topics/MeasurementTopic_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/bpm/MeasurementTopic_auto_'+ServerNumber)
  cmo.setSubDeploymentName('BPMJMSServer_'+ServerNumber)
  cd('/SystemResources/BPMJMSModule/SubDeployments/BPMJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=BPMJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule') 
  cmo.createTopic('PeopleQueryTopic_auto_'+ServerNumber)
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/Topics/PeopleQueryTopic_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/bpm/PeopleQueryTopic_auto_'+ServerNumber)
  cmo.setSubDeploymentName('BPMJMSServer_'+ServerNumber)
  cd('/SystemResources/BPMJMSModule/SubDeployments/BPMJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=BPMJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/Topics/MeasurementTopic_auto_'+ServerNumber+'/Thresholds/MeasurementTopic_auto_'+ServerNumber+'/')
  cmo.setMessagesLow(9223372036854775807)
  cmo.setMessagesHigh(9223372036854775807)
  cmo.setBytesHigh(9223372036854775807)
  cmo.setBytesLow(9223372036854775807)
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/Topics/MeasurementTopic_auto_'+ServerNumber)
  cmo.setMaximumMessageSize(2147483647)
  cmo.setQuota(getMBean('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/Quotas/MeasurementQuota'))
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/DistributedTopics/dist_MeasurementTopic_auto')
  cmo.createDistributedTopicMember('MeasurementTopic_auto_'+ServerNumber)
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/DistributedTopics/dist_MeasurementTopic_auto/DistributedTopicMembers/MeasurementTopic_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/DistributedTopics/dist_PeopleQueryTopic_auto')
  cmo.createDistributedTopicMember('PeopleQueryTopic_auto_'+ServerNumber)
  cd('/JMSSystemResources/BPMJMSModule/JMSResource/BPMJMSModule/DistributedTopics/dist_PeopleQueryTopic_auto/DistributedTopicMembers/PeopleQueryTopic_auto_'+ServerNumber+'/')
  cmo.setWeight(1)

  #########Create SOAJMSModule Subdeployment######
  cd('/SystemResources/SOAJMSModule')
  cmo.createSubDeployment('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))

  ##########Adding resources to SOAJMSModules########
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule')
  cmo.createTopic('B2BBroadcastTopic_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/Topics/B2BBroadcastTopic_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/b2b/B2BBroadcastTopic_auto_'+ServerNumber)
  cmo.setSubDeploymentName('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule')
  cmo.createQueue('B2BEventQueue_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/Queues/B2BEventQueue_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/b2b/B2BEventQueue_auto_'+ServerNumber)
  cmo.setSubDeploymentName('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule')
  cmo.createQueue('B2B_IN_QUEUE_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/Queues/B2B_IN_QUEUE_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/b2b/B2B_IN_QUEUE_auto_'+ServerNumber)
  cmo.setSubDeploymentName('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule')
  cmo.createQueue('B2B_OUT_QUEUE_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/Queues/B2B_OUT_QUEUE_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/b2b/B2B_OUT_QUEUE_auto_'+ServerNumber)
  cmo.setSubDeploymentName('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule')
  cmo.createQueue('EDNQueue_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/Queues/EDNQueue_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/fabric/EDNQueue_auto_'+ServerNumber)
  cmo.setSubDeploymentName('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule')
  cmo.createQueue('NotificationSenderQueue_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/Queues/NotificationSenderQueue_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/Queue/NotificationSenderQueue_auto_'+ServerNumber)
  cmo.setSubDeploymentName('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule')
  cmo.createQueue('TestFwkQueue_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/Queues/TestFwkQueue_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/testfwk/TestFwkQueue_auto_'+ServerNumber)
  cmo.setSubDeploymentName('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule')
  cmo.createTopic('XmlSchemaChangeNotificationTopic_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/Topics/XmlSchemaChangeNotificationTopic_auto_'+ServerNumber+'/')
  cmo.setJNDIName('jms/fabric/XmlSchemaChangeNotificationTopic_auto_'+ServerNumber)
  cmo.setSubDeploymentName('SOAJMSServer_'+ServerNumber)
  cd('/SystemResources/SOAJMSModule/SubDeployments/SOAJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=SOAJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedTopics/dist_B2BBroadcastTopic_auto')
  cmo.createDistributedTopicMember('B2BBroadcastTopic_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedTopics/dist_B2BBroadcastTopic_auto/DistributedTopicMembers/B2BBroadcastTopic_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_B2BEventQueue_auto')
  cmo.createDistributedQueueMember('B2BEventQueue_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_B2BEventQueue_auto/DistributedQueueMembers/B2BEventQueue_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_B2B_IN_QUEUE_auto')
  cmo.createDistributedQueueMember('B2B_IN_QUEUE_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_B2B_IN_QUEUE_auto/DistributedQueueMembers/B2B_IN_QUEUE_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_B2B_OUT_QUEUE_auto')
  cmo.createDistributedQueueMember('B2B_OUT_QUEUE_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_B2B_OUT_QUEUE_auto/DistributedQueueMembers/B2B_OUT_QUEUE_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_EDNQueue_auto')
  cmo.createDistributedQueueMember('EDNQueue_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_EDNQueue_auto/DistributedQueueMembers/EDNQueue_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_NotificationSenderQueue_auto')
  cmo.createDistributedQueueMember('NotificationSenderQueue_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_NotificationSenderQueue_auto/DistributedQueueMembers/NotificationSenderQueue_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_TestFwkQueue_auto')
  cmo.createDistributedQueueMember('TestFwkQueue_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedQueues/dist_TestFwkQueue_auto/DistributedQueueMembers/TestFwkQueue_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedTopics/dist_XmlSchemaChangeNotificationTopic_auto')
  cmo.createDistributedTopicMember('XmlSchemaChangeNotificationTopic_auto_'+ServerNumber)
  cd('/JMSSystemResources/SOAJMSModule/JMSResource/SOAJMSModule/DistributedTopics/dist_XmlSchemaChangeNotificationTopic_auto/DistributedTopicMembers/XmlSchemaChangeNotificationTopic_auto_'+ServerNumber+'/')
  cmo.setWeight(1)

  #########Create SOAJMSModule Subdeployment######
  cd('/SystemResources/UMSJMSSystemResource')
  cmo.createSubDeployment('UMSJMSServer_'+ServerNumber)
  cd('/SystemResources/UMSJMSSystemResource/SubDeployments/UMSJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=UMSJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))

  ##########Adding resources to UMSJMSModules######## 
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource')
  cmo.createQueue('OraSDPM/Queues/OraSDPMAppDefRcvQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/Queues/OraSDPM/Queues/OraSDPMAppDefRcvQ1_auto_'+ServerNumber+'/')
  cmo.setJNDIName('OraSDPM/Queues/OraSDPMAppDefRcvQ1_auto_'+ServerNumber)
  cmo.setSubDeploymentName('UMSJMSServer_'+ServerNumber)
  cd('/SystemResources/UMSJMSSystemResource/SubDeployments/UMSJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=UMSJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource')
  cmo.createQueue('OraSDPM/Queues/OraSDPMDriverDefSndQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/Queues/OraSDPM/Queues/OraSDPMDriverDefSndQ1_auto_'+ServerNumber+'/')
  cmo.setJNDIName('OraSDPM/Queues/OraSDPMDriverDefSndQ1_auto_'+ServerNumber)
  cmo.setSubDeploymentName('UMSJMSServer_'+ServerNumber)
  cd('/SystemResources/UMSJMSSystemResource/SubDeployments/UMSJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=UMSJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource')
  cmo.createQueue('OraSDPM/Queues/OraSDPMEngineCmdQ_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/Queues/OraSDPM/Queues/OraSDPMEngineCmdQ_auto_'+ServerNumber+'/')
  cmo.setJNDIName('OraSDPM/Queues/OraSDPMEngineCmdQ_auto_'+ServerNumber)
  cmo.setSubDeploymentName('UMSJMSServer_'+ServerNumber)
  cd('/SystemResources/UMSJMSSystemResource/SubDeployments/UMSJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=UMSJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource')
  cmo.createQueue('OraSDPM/Queues/OraSDPMEngineRcvQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/Queues/OraSDPM/Queues/OraSDPMEngineRcvQ1_auto_'+ServerNumber+'/')
  cmo.setJNDIName('OraSDPM/Queues/OraSDPMEngineRcvQ1_auto_'+ServerNumber)
  cmo.setSubDeploymentName('UMSJMSServer_'+ServerNumber)
  cd('/SystemResources/UMSJMSSystemResource/SubDeployments/UMSJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=UMSJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource')
  cmo.createQueue('OraSDPM/Queues/OraSDPMEngineSndQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/Queues/OraSDPM/Queues/OraSDPMEngineSndQ1_auto_'+ServerNumber+'/')
  cmo.setJNDIName('OraSDPM/Queues/OraSDPMEngineSndQ1_auto_'+ServerNumber)
  cmo.setSubDeploymentName('UMSJMSServer_'+ServerNumber)
  cd('/SystemResources/UMSJMSSystemResource/SubDeployments/UMSJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=UMSJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource')
  cmo.createQueue('OraSDPM/Queues/OraSDPMWSRcvQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/Queues/OraSDPM/Queues/OraSDPMWSRcvQ1_auto_'+ServerNumber+'/')
  cmo.setJNDIName('OraSDPM/Queues/OraSDPMWSRcvQ1_auto_'+ServerNumber)
  cmo.setSubDeploymentName('UMSJMSServer_'+ServerNumber)
  cd('/SystemResources/UMSJMSSystemResource/SubDeployments/UMSJMSServer_'+ServerNumber+'/')
  set('Targets',jarray.array([ObjectName('com.bea:Name=UMSJMSServer_auto_'+ServerNumber+',Type=JMSServer')], ObjectName))

  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMAppDefRcvQ1_auto')
  cmo.createDistributedQueueMember('OraSDPM/Queues/OraSDPMAppDefRcvQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMAppDefRcvQ1_auto/DistributedQueueMembers/OraSDPM/Queues/OraSDPMAppDefRcvQ1_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMDriverDefSndQ1_auto')
  cmo.createDistributedQueueMember('OraSDPM/Queues/OraSDPMDriverDefSndQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMDriverDefSndQ1_auto/DistributedQueueMembers/OraSDPM/Queues/OraSDPMDriverDefSndQ1_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMEngineCmdQ_auto')
  cmo.createDistributedQueueMember('OraSDPM/Queues/OraSDPMEngineCmdQ_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMEngineCmdQ_auto/DistributedQueueMembers/OraSDPM/Queues/OraSDPMEngineCmdQ_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMEngineRcvQ1_auto')
  cmo.createDistributedQueueMember('OraSDPM/Queues/OraSDPMEngineRcvQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMEngineRcvQ1_auto/DistributedQueueMembers/OraSDPM/Queues/OraSDPMEngineRcvQ1_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMEngineSndQ1_auto')
  cmo.createDistributedQueueMember('OraSDPM/Queues/OraSDPMEngineSndQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMEngineSndQ1_auto/DistributedQueueMembers/OraSDPM/Queues/OraSDPMEngineSndQ1_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMWSRcvQ1_auto')
  cmo.createDistributedQueueMember('OraSDPM/Queues/OraSDPMWSRcvQ1_auto_'+ServerNumber)
  cd('/JMSSystemResources/UMSJMSSystemResource/JMSResource/UMSJMSSystemResource/DistributedQueues/dist_OraSDPM/Queues/OraSDPMWSRcvQ1_auto/DistributedQueueMembers/OraSDPM/Queues/OraSDPMWSRcvQ1_auto_'+ServerNumber+'/')
  cmo.setWeight(1)
  activate()
  i=i+1;
  j=j+1;
  k=k+1;
  l=l+1;
  
#Creating new SAF Agents
def createNewSAFAgents():
 domainConfig();
 SAFAgentsNames = configProps.get('SAFAgentsNames');
 SAFAgentsNameList = String(SAFAgentsNames).split(",");
 i=0;
 j=0;
 k=0;
 while i<len(ServerNumberList) and j<len(SAFAgentsNameList) and k<len(ServerNameList):
  edit();
  startEdit();
  ServerNumber = ServerNumberList[i]
  SAFAgentName = SAFAgentsNameList[j]
  ServerName = ServerNameList[k]
  cd('/')
  cmo.createSAFAgent(SAFAgentName)
  cd('/SAFAgents/'+SAFAgentName+'/')
  cmo.setStore(getMBean('/FileStores/AIADataStore_'+ServerNumber))
  set('Targets',jarray.array([ObjectName('com.bea:Name='+ServerName+',Type=Server')], ObjectName))
  cmo.setServiceType('Sending-only')
  activate();
  i=i+1;
  j=j+1;
  k=k+1;

  
#Setting Cluster Address
def setClusterAddress():
 ClusterAddress = configProps.get('ClusterAddress');
 domainConfig();
 edit();
 startEdit()
 cd('/Clusters/'+clusterName+'/')
 cmo.setClusterAddress(ClusterAddress)
 activate()
domainName=cmo.getName();
serverList = cmo.getServers();
#Setting Log Rotation
def __changeLogRotationConfigProperties():
 domainConfig();
 RotationType = configProps.get('RotationType')
 RotationTime = configProps.get('RotationTime')
 FileTimeSpan = int(configProps.get('FileTimeSpan'))
 i = 0;
 edit();
 while i<len(serverList):
  startEdit();
  serverName = serverList[i].getName();
  cd('/Servers/'+serverName+'/WebServer/'+serverName+'/WebServerLog/'+serverName+'/')
  print 'Changing   '+serverName+' Log Rotation Parameters --> ' 
  cmo.setRotationType(RotationType)
  cmo.setRotateLogOnStartup(true)
  cmo.setRotationTime(RotationTime)
  cmo.setFileTimeSpan(FileTimeSpan)
  cd('/Servers/'+serverName+'/Log/'+serverName+'/')
  cmo.setRotationType(RotationType)
  cmo.setRotationTime(RotationTime)
  cmo.setFileTimeSpan(FileTimeSpan)
  i = i+1;
  activate();

#Setting MaxMessageSize
def __tuneMaxMessageSizeConfigProperties():
 domainConfig();
 MaxMessageSize = int(configProps.get('MaxMessageSize'))
 i = 0;
 edit();
 while i<len(serverList):
  startEdit();
  serverName = serverList[i].getName();
  cd('/Servers/'+serverName+'/')
  print 'Current   '+serverName+' MaxMessageSize Value --> ' 
  print cmo.getMaxMessageSize()
  cmo.setMaxMessageSize(int(MaxMessageSize))
  print 'Final   '+serverName+' MaxMessageSize Value --> '
  print cmo.getMaxMessageSize()
  i = i+1;
  activate();

  
# MAIN

#****************************************************************************

#

# Calling all the Methods here

print(' ————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————')
print ('********************************************* Starting the changes *****************************************************')
print('#########################################################################################################################')
print 'Do you want to add managed servers and related resources'
input = raw_input("Press y to PROCEED or press n to SKIP ===================================================>                          ");
if input == 'y':
 createManagedServersandResources()

print 'Do you want to create new SAF Agents.Do not execute for AABC domains'
input = raw_input("Press y to PROCEED or press n to SKIP ===================================================>                          ");
if input == 'y':
 createNewSAFAgents() 
print 'Do you want to set Cluster Address'
input = raw_input("Press y to PROCEED or press n to SKIP ===================================================>                          ");
if input == 'y':
 setClusterAddress()

print 'Do you want to change Log Rotation Configuration'
input = raw_input("Press y to PROCEED or press n to SKIP ===================================================>                          ");
if input == 'y':
 __changeLogRotationConfigProperties() 
print 'Do you want to tune MaxMessageSizeConfig'
input = raw_input("Press y to PROCEED or press n to SKIP ===================================================>                          ");
if input == 'y':
 __tuneMaxMessageSizeConfigProperties()  

#!/bin/bash

# ************* Setting the Environment ***********************
echo "Setting the Environment"
source /app/oracle/fmw/wlserver_10.3/server/bin/setWLSEnv.sh

echo "Environment has been set....."

# ************* Changing the directory***********************
cd .

echo "Calling the script....."

# ************* Calling the WLST script  *****************
java weblogic.WLST AddManagedServerToDomain.py
 
Blogger Profile