Monday, September 21, 2015

Set Up Metasolv Gateway Events

PURPOSE


To set up gateway events in Metasolv.

SOLUTION


The gateway events are configured to integrate Metasolv to third party application. Please follow below steps to set the gateway events up.

STEP 1. 


Go to find links in M6 GUI and click gateway event, right click on left pane and click New-> Gateway, create a new gateway 'Test' as below.


STEP 2.


 Right Click on newly created gateway Test and click New-> Gateway Event 'Test Gateway Event' as below.



STEP 3.


Now in the provisioning plan associate the gateway event with the task by selecting the task and adding the gateway events to the task.

1. Select the task in the gateway tab.
2. Now select the gateway event from right pane and add it to the left pane by selecting the arrow button.




STEP 4.


Modify the following files located at “<MSLV_HOME>/<SERVER_NAME>/appserver/gateway”

1. In gateway.ini


For setting up gateway events Integration Server (integration.xml gateway events) and / or the Event Server (CORBA gateway events/gateway binding configured) should be up and running.

In order to do that uncomment the highlighted line by removing semicolon and restart the application server.

[ThreadProcs]
INTEGRATIONSERVER=com.mslv.integration.integrationServer.S3Startup
;EVENTPROC=MetaSolv.eventServer.S3Startup
;EVENT2PROC=MetaSolv.event2Server.Event2ServerStartup
;SYSTEMTASKSERVERPROC=com.mslv.core.api.internal.WM.systemTaskServer.SystemTaskServer
;SIGNALSERVERPROC=com.metasolv.system.StartServer
;INTERNET_SIGNAL_SERVER=MetaSolv.CORBA.WDIINTERNETSERVICES.WDIRoot,MetaSolv.SignalServer.WDIInternetSignalServerRootImpl

2. In integration.xml


Get your gateway event id by running the following query

SELECT gateway_event_id, gateway_event_nm
  FROM asap.gateway_event ge
 WHERE gateway_event_nm = 'Test Gateway Event'


Add the following lines in the handlers section of integration.xml

<handler enabled="true">
<event-id>your gateway event id from above query</event-id>
<class>com.mslv.integration.handlers.DefaultEventHandler</class>
<destination>api</destination>
</handler>

STEP 5.

The message from the Gateway Event first reaches mss.internal.event.queue.

In the WLICONSOLE window opened by
http://MetasolvApplicationServer:AdminServerPort/wliconsole create the event generator to capture the event from mss.internal.event.queue to mss.external.event.queue as below.



Note: While executing the Gateway Events through the Integration server, the messages will flow from from mss.internal.event.queue to mss.external.event.queue through the InternalOutBoundGenerator event generator.

See below number of messages have been read out by above event generator.


Now create another jms event generator to get the event from mss.external.event.queue to the channel of your JPD which is created in the schema folder of your JPD.
In default Rule Channel select the channel of your JPD.

Hope above helps in setting up gateway events for your Metasolv application, please leave your feedback or query

Monday, September 14, 2015

Configure Metasolv Background Processor Server

PURPOSE


To configure Background Processor Server for Metasolv application.

SOLUTION


Please follow below steps to configure Background Processor Server.

STEP 1.


It is recommended that you create a separate user in M6 for configuring background processor.Lets say BPADMIN is the user.

Multiple Backgound Processors can be created seeing the business requirement.



STEP 2.


Update the jmaster.ini file in the Metasolv client directory.

[DBMS_Profiles]
[Application Servers]
J2EEProfiles= 'TEST'

[J2EEProfile TEST]
url=http://M6_Application_Server_IP:Port
database=MetasolvDB SID

[PROFILE PURGEUTIL]
DBMS=O84
Database=Oracle
UserId=
DatabasePassword=
LogPassword=
ServerName=ServerName-->to be given
LogId=
Lock=
Prompt=1
DbParm=DisableBind=0
DelimitIdentifier='No'
CommitOnDisconnect='No?
AutoCommit=0

Note:Background Processor connects to application server IP as mentioned above in jmaster.ini. Background Processor uses JDBC connection using mslvNoneTxDataSource. While creating multiple background processors keep Maximum Capacity and Initial Capacity of the DataSource in consideration. Its recommended to have sufficient Initial Capacity of the DataSource.


STEP 3. 


Go to M6 client directory and run jmanager.exe.

Login with ASAP user to launch jmanager console.




STEP 4. 

In job manager console click on Servers, then go to File--> New

Give in the details for the Background Processor Server.


Server Logical Name= Any name for your background processor
i.e. M6_BACKGROUND_PROCESSOR  etc.

Host Name= Host Name of machine where the background processor to be set up.
i.e. Alok Laptop etc.

Job Worker Exe Path = Path of M6 client directory.
i.e. c:/mss etc.

similarly provide other details.

STEP 5. 


Go to M6 client directory and in order to run Background Processor launch jmaster.exe.

Login with BPADMIN user created above. Here you go with running Background Processor server.


Note: Only one jmaster.exe will be running on one host.

STEP 6. 


In order to avoid STEPS 3-4 use below SQL( Not recommended).

Login to M6 database with ASAP user and RUN below SQL.

Insert into JOB.JOB_SERVER
 (SERVER_LOGICAL_NM, HOST_NM, SERVER_DESC, SERVER_STATUS_IND, MAX_WORKERS_ALLOWED, JOB_MASTER_REFRESH_RATE, REROUTE_JOB_MIN, LAST_MODIFIED_DATE, LAST_MODIFIED_USERID, WORKER_EXE_PATHS, ACTIVE_IND)
 Values
 ('M6_BACKGROUND_PROCESSOR', 'Alok Laptop', 'BackGround Processor', 'R', 60, 60, 15, SYSDATE, 'ASAP', 'c:/mss', 'Y');
COMMIT;


Hope above helps in configuring Background Processor for your Metasolv application, please leave your feedback or query. 

Tuesday, September 8, 2015

Install WebLogic Patch to MetaSolv Solution WebLogic Servers

search for a patch using the Patch Number

  1. Log onto My Oracle Support.
  2. Click on the "Patches & Updates" tab.
  3. Click on "Patch Name or Number".
  4. For the "Patch Name or Number" type in the patch number (for example: 1748XXXX).
  5. Choose the "Platform" and Hit Search.
  6. Click on the Patch Name to bring up the download page.



search for a patch using the Smart Update Patch ID

  1. Log onto My Oracle Support.
  2. Click on the "Patches & Updates" tab.
  3. Click on "Product or Family" (Advanced Search)
  4. For the "Product is" choose Oracle WebLogic Server.
  5. For the "Release is" choose WLS 10.3.
  6. For "Description contains" type in your Smart Update Patch ID (like XXXX).
  7. Hit Search.
  8. Click on the Patch Name to bring up the download page.



Install WebLogic Patch to MetaSolv Solution WebLogic Servers



  1. Extract the contents from the patch zip file downloaded into the ($BEA_HOME/utils/bsu/cache_dir) directory, you will have a jar file and patchcatalog_XXXX.xml.                                                                                                                          
                                                                                                                                                                                                                                           
  2. Copy the files (for example, XXXR.jar) and the patchcatalog_xxx.xml from the zip file to the target machine. You do not need the readme file. 
  3. Run below command for unzip or unzip through other unzip utilities like(winzip, 7zip etc)

./p964XXXX_103100_Generic.zip -d $BEA_HOME/utils/bsu/cache_dir

replace $BEA_HOME/utils/bsu/cache_dir/patch-catalog_XXXX.xml? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: $BEA_HOME/utils/bsu/cache_dir/patch-catalog_XXXX.xml
replace $BEA_HOME/utils/bsu/cache_dir/README.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
  inflating: $BEA_HOME/utils/bsu/cache_dir/README.txt
  inflating: $BEA_HOME/utils/bsu/cache_dir/XXXX.jar

Note: Always copy the patchcatalog_xxx.xml file from the downloaded patch to the cache_dir along with the patch itself. Do NOT rename this file. Run the Smart Update with user use to
run WebLogic Server

Now install the patch using Smart Update either in GUI mode following step '1' or Command Line mode following step '2'.

1. Smart Update in graphical (GUI) mode



  1. Run the <BEA_HOME>/utils/bsu/bsu script (bsu.sh for UNIX, bsu.cmd for Windows). This will start the Smart Update GUI.
  2. Look for the patches you copied in the "Downloaded Patches" section at the bottom.
  3. Select the "Apply" button for each patch you want to apply. This will validate the patch and apply it to the whole installation.




2. Smart Update in Command Line mode



  1. Go to directory as below.

    cd $BEA_HOME/utils/bsu

  2. Run below command.

    ./bsu.sh -prod_dir=<weblogic-home> -patch_download_dir=$BEA_HOME/utils/bsu/cache_dir -patchlist=XXXX  -verbose -install

  3. Install multiple patches.

    ./bsu.sh -prod_dir=<weblogic-home> -patch_download_dir=$BEA_HOME/utils/bsu/cache_dir -patchlist=XXXX, XXXX  -verbose -install

  4. In case you want to remove a patch run below command.

    ./bsu.sh -prod_dir=<weblogic-home> -patchlist=XXXX  -verbose -remove
Note: Here XXXX is the name of the jar file in the patch.

Hope above helps you in installing Metasolv patches on your environment, please leave your feedback or query.

Monday, September 7, 2015

Effective troubleshooting Metasolv JDBC connections on Metasolv Database

Oracle Metasolv solution is hosted on Oracle WebLogic Server and use JDBC data source connection pools to manage database transactions. These JDBC resources connect to the database with an
underlying user ID.
For troubleshooting purpose if someone tries to pull up the connection information from Database(v$session table) it will actually not point to individual application users making connections rather give picture of connections made by these underlying users. MetaSolv M6 uses user IDs are APP_MSLV, APP_API, and APP_INT. In some cases APP_INT which is responsible for WebLogic Integration transactions could be specific to WebLogic domain like in below diagram. Refer the architecture we will discuss as below.

PROBLEM


So the challenge is to identify individual end user connection to monitor database activity done by him/her.As the architecture shown above makes the problem more difficult as compared to single
server architecture because now 1 domain is carrying multiple WebLogic server instances on 1 machine.

Now we will do a deep dive in the issue.


SELECT   machine,
         program,
         username,
         terminal,
         osuser,
         --client_identifier,
         status,
         count(*) 
FROM     v$session
WHERE    username in ('APP_MSLV','APP_INT','APP_API')
GROUP BY machine, program, username, terminal, osuser, status
ORDER BY count(*) desc;


The result of the above query shows that PROGRAM and TERMINAL values of 'JDBC Thin Client' and 'unknown' are quite generic and are of less use. These values does not specifically tell which JDBC DataSource is the PROGRAM and which DOMAIN is shown as terminal.


SOLUTION


1.  Access the WebLogic Server Administration Console

2.  Access the JDBC Data Sources

3.  Select any of the Data Sources

4. Select the Connection Pool tab

5. Enter "v$session.terminal={YOUR SERVER NAME}" and "v$session.program={DATA SOURCE NAME}" in the Properties: field directly below "user" property like the example in the image below.





6. Click Save

7. Repeat steps 3 through 6 for remaining Data Sources

8. Restart the WebLogic server

RESULT


Configuration of connection properties of each DataSource facilitates effective troubleshooting by providing the ability to view the source of each connection.

MetaSolv Solution sets the v$session.client_identifier as a method to instantiate the physical end user's user ID which is used to set LAST_MODIFIED_USERID columns throughout the database. The results below were obtained by editing the query and uncommenting the client_identifier column.  The results show the active APP_MSLV connection is being used by the application's BPADMIN1 user ID. The actual JDBC data source connection pool will remain unknown until the configuration changes outlined in the solution section of this document have been properly applied.





NOTE: The console indicates that the changes have been activated and no restarts are necessary.  However, the connection property values will NOT be visible in the V$SESSION view until the server is restarted.

OTHER IMPORTANT QUERIES


1.

SELECT    v$session.machine as "Machine Name",
          v$session.program as "MetaSolv Solution DataSource",
          v$session.username as "DataSource User",
          v$session.terminal as "WebLogic Server Name",
          v$session.osuser as "OS User of WebLogic Process",
          asap.security_users.description as "MetaSolv Solution User",
          v$session.sid as "Session ID",
          v$session.status as "JDBC Connection Status"
FROM      v$session, asap.security_users
/*
View connection pools used only by GUI. Comment out as necessary.
*/
WHERE     v$session.program in ('mslvNoneTxDataSource','mslvDataSource')
/*
View all connection pools.
*/
-- WHERE     v$session.program in ('mslvNoneTxDataSource',
--                                 'mslvDataSource',
--                                 'mslvProcDataSource',
--                                 'mslvWliDataSource',
--                                 'cgDataSource-nonXA',
--                                 'p13nDataSource',
--                                 'cgDataSource',
--                                 'bpmArchDataSource')
/*
uncomment for only ACTIVE connections
*/
--AND       v$session.status = 'ACTIVE'
AND       upper(asap.security_users.name(+)) = v$session.client_identifier
ORDER BY  v$session.program desc;



The results below shows the MetaSolv Solution application's user (Job Master Account 1) has an active connection, SID 5357, associated to the mslvNoneTxDataSource JDBC DataSource coming from the Machine 1 WebLogic server hosted on known machine.



2.

SELECT   nvl(asap.security_users.description,'ORACLE PROC')||' ('||SES.sid||')' as "MetaSolv Solution User (SID)",
         MACHINE as "Machine Name",
         PROGRAM as "MetaSolv Solution DataSource",
         TERMINAL as "WebLogic Server Name",
         REPLACE(SQL.SQL_TEXT,CHR(10),'') STMT,
         ltrim(to_char(floor(SES.LAST_CALL_ET/3600), '09')) || ':'
         || ltrim(to_char(floor(mod(SES.LAST_CALL_ET, 3600)/60), '09')) || ':'
         || ltrim(to_char(mod(SES.LAST_CALL_ET, 60), '09')) RUNT
FROM     V$SESSION SES,
         V$SQLtext_with_newlines SQL,
         asap.security_users
WHERE    SES.STATUS = 'ACTIVE'
AND      SES.USERNAME is NOT NULL
AND      SES.SQL_ADDRESS = SQL.ADDRESS
AND      SES.SQL_HASH_VALUE = SQL.HASH_VALUE
AND      upper(asap.security_users.name(+)) = SES.client_identifier
AND      SES.AUDSID <> userenv('SESSIONID')
/*
View connection pools used only by GUI. Comment out as necessary.
*/
AND      SES.program in ('mslvNoneTxDataSource','mslvDataSource')
/*
View all connection pools.
*/
--AND      SES.program in ('mslvNoneTxDataSource',
--                         'mslvDataSource',
--                         'mslvProcDataSource',
--                         'mslvWliDataSource',
--                         'cgDataSource-nonXA',
--                         'p13nDataSource',
--                         'cgDataSource',
--                         'bpmArchDataSource')
ORDER BY runt desc, 1, sql.piece;



The results below shows similar information, but now includes the current SQL statement.




3.

SELECT  v$session.machine as "Machine Name",
        v$session.terminal as "Terminal",
        v$session.client_identifier,
        asap.security_users.description as "MetaSolv Solution User",
        v$session.program as "Program",
        v$session.sid,
        v$session.status as "Status",
        v$lock.type,
        v$lock.id1,
        v$lock.id2,
        decode(v$lock.lmode,
               0, 'None',
               1, 'Null (NULL)',
               2, 'Row-S (SS)',
               3, 'Row-X (SX)',
               4, 'Share (S)',
               5, 'S/Row-X (SSX)',
               6, 'Exclusive (X)',
               v$lock.lmode) as "Locked Mode",
        decode(v$lock.request,
               0, 'None',
               1, 'Null (NULL)',
               2, 'Row-S (SS)',
               3, 'Row-X (SX)',
               4, 'Share (S)',
               5, 'S/Row-X (SSX)',
               6, 'Exclusive (X)',
               v$lock.request) as "Request",
        dba_objects.owner AS "Object Owner",
        dba_objects.object_name AS "Object Name",
        dba_objects.object_type AS "Object Type",
        v$lock.ctime,
        v$lock.block
FROM    v$lock,
        v$session,
        v$locked_object,
        dba_objects,
        asap.security_users
WHERE   v$lock.sid = v$session.sid
AND     v$session.sid = v$locked_object.session_id
AND     v$locked_object.object_id = dba_objects.object_id
AND     upper(asap.security_users.name(+)) = v$session.client_identifier
AND     v$lock.type = 'TX';


The results below shows similar information in a blocking/blocked transaction scenario which include each of their locked objects.  Note that blocking lock was achieved by issuing an UPDATE statement against an ASAP.CUST_ACCT.CUST_ACCT_ID from a SQL Developer session (SID = 2194).



Hope above helps in effective troubleshooting the database connections and Identify/Monitor
JDBC Connections on Metasolv Database, please leave your feedback or query.