Get States of all instances from COMPOSITE_INSTANCE and CUBE_INSTANCE Tables in SOA-INFRA Schema

The following 2 SQL queries have been put together to obtain a useful count of all the instance states from Composite instance and Cube instance tables within the SOA-INFRA schema, which is acting as the SOA Dehydration Database for a given WebLogic SOA server.

Note - The queries below are for a given Composite name. Ensure you replace the 'COMPOSITE_NAME' within the WHERE clause with the composite you would like to target. You can also add further WHERE clauses to return results for multiple Composites.

-- QUERY 1 GET ALL INSTANCE STATES FROM CUBE_INSTANCE TABLE
SELECT (CASE
WHEN STATE=0 THEN 'State 0 - STATE INITIATED'
WHEN STATE=1 THEN 'State 1 - OPEN AND RUNNING'
WHEN STATE=2 THEN 'State 2 - OPEN AND SUSPENDED'
WHEN STATE=3 THEN 'State 3 - OPEN AND FAULTED'
WHEN STATE=4 THEN 'State 4 - CLOSED AND PENDING'
WHEN STATE=5 THEN 'State 5 - CLOSED AND COMPLETED'
WHEN STATE=6 THEN 'State 6 - CLOSED AND FAUTED'
WHEN STATE=7 THEN 'State 7 - CLOSED AND CANCELLED'
WHEN STATE=8 THEN 'State 8 - CLOSED AND ABORTED'
WHEN STATE=9 THEN 'State 9 - CLOSED AND STALE'
WHEN STATE=10 THEN 'State 10 - NON-RECOVERABLE'
ELSE STATE || ''
END) AS CUBE_INSTANCE_STATE, COUNT(*) AS NUM_OF_CUBE_INST
FROM CUBE_INSTANCE  CI
WHERE CI.composite_name = 'COMPOSITE_NAME' --REPLACE WITH YOUR COMPOSITE NAME
GROUP BY STATE;


Query 1 sample result - Ran from Oracle SQL Developer

-- QUERY 2 GET ALL INSTANCE STATES FROM COMPOSITE_INSTANCE TABLE
SELECT (CASE
WHEN STATE=0 THEN 'State 0 - RUNNING'
WHEN STATE=1 THEN 'State 1 - COMPLETED'
WHEN STATE=2 THEN 'State 2 - RUNNING WITH FAULTS'
WHEN STATE=3 THEN 'State 3 - COMPLETED WITH FAULTS'
WHEN STATE=4 THEN 'State 4 - RUNNING WITH RECOVERY REQUIRED'
WHEN STATE=5 THEN 'State 5 - COMPLETED WITH RECOVERY REQUIRED'
WHEN STATE=6 THEN 'State 6 - RUNNING WITH FAULTS AND RECOVERY REQUIRED'
WHEN STATE=7 THEN 'State 7 - COMPLETED WITH FAULTS AND RECOVERY REQUIRED'
WHEN STATE=8 THEN 'State 8 - RUNNING WITH SUSPENDED'
WHEN STATE=9 THEN 'State 9 - COMPLETED AND SUSPENDED'
WHEN STATE=10 THEN 'State 10 - RUNNING WITH FAULTS AND SUSPENDED'
WHEN STATE=11 THEN 'State 11 - COMPLETED WITH FAULTS AND SUSPENDED'
WHEN STATE=12 THEN 'State 12 - RUNNING WITH RECOVERY REQUIRED AND SUSPENDED'
WHEN STATE=13 THEN 'State 13 - COMPLETED WITH RECOVERY REQUIRED AND SUSPENDED'
WHEN STATE=14 THEN 'State 14 - RUNNING WITH FAULTS, RECOVERY REQUIRED, AND SUSPENDED'
WHEN STATE=15 THEN 'State 15 - COMPLETED WITH FAULTS, RECOVERY REQUIRED, AND SUSPENDED'
WHEN STATE=16 THEN 'State 16 - RUNNING WITH TERMINATED'
WHEN STATE=17 THEN 'State 17 - COMPLETED WITH TERMINATED'
WHEN STATE=18 THEN 'State 18 - RUNNING WITH FAULTS AND TERMINATED'
WHEN STATE=19 THEN 'State 19 - COMPLETED WITH FAULTS AND TERMINATED'
WHEN STATE=20 THEN 'State 20 - RUNNING WITH RECOVERY AND TERMINATED'
WHEN STATE=21 THEN 'State 21 - COMPLETED WITH RECOVERY REQUIRED AND TERMINATED'
WHEN STATE=22 THEN 'State 22 - RUNNING WITH FAULTS, RECOVERY REQUIRED, AND TERMINATED'
WHEN STATE=23 THEN 'State 23 - COMPLETED WITH FAULTS, RECOVERY REQUIRED AND TERMINATED'
WHEN STATE=24 THEN 'State 24 - RUNNING WITH SUSPENDED AND TERMINATED'
WHEN STATE=25 THEN 'State 25 - COMPLETED WITH SUSPENDED AND TERMINATED'
WHEN STATE=26 THEN 'State 26 - RUNNING WITH FAULTED, SUSPENDED, AND TERMINATED'
WHEN STATE=27 THEN 'State 27 - COMPLETED WITH FAULTS, SUSPENDED, AND TERMINATED'
WHEN STATE=28 THEN 'State 28 - RUNNING WITH RECOVERY REQUIRED, SUSPENDED, AND TERMINATED'
WHEN STATE=29 THEN 'State 29 - COMPLETED WITH RECOVERY REQUIRED, SUSPENDED, AND TERMINATED'
WHEN STATE=30 THEN 'State 30 - RUNNING WITH FAULTED, RECOVERY REQUIRED, SUSPENDED, AND TERMINATED'
WHEN STATE=31 THEN 'State 31 - COMPLETED WITH FAULTED, RECOVERY REQUIRED, SUSPENDED, AND TERMINATED'
WHEN STATE=32 THEN 'State 32 - UNKNOWN'
ELSE STATE || ''
END) AS COMPOSITE_INSTANCE_STATE, COUNT(*) AS NUM_OF_COMP_INST
FROM COMPOSITE_INSTANCE  CI
WHERE CI.SOURCE_NAME = 'COMPOSITE_NAME' --REPLACE WITH YOUR COMPOSITE NAME
GROUP BY STATE;


Query 2 sample result - Ran from Oracle SQL Developer

Here is a useful link that re-iterates the State values and their descriptions for some of the tables within SOA-INFRA: Click here


Web application URLs for Oracle Fusion Middleware stack components

Here is a useful list of the Oracle Fusion Middleware stack Web Applications that are used to manage each stack component:

WebLogic server
- http://hostname:port/console

Enterprise Manager
- http://hostname:port/em

SOA
- http://hostname:port/soa/composer
- http://hostname:port/soa-infra

BPM
- http://hostname:port/integration/worklistapp
- http://hostname:port/bpm/workspace
- http://hostname:port/bpm/composer

WebCenter Portal
- http://hostname:port/webcenter
- Default port - 8888

WebCenter Content
- http://hostname:port/cs
- Default port - 16200

OSB
- http://hostname:port/sbconsole

BAM
- http://hostname:port/OracleBAM *

Database
- http://hostname:port/apex (default port 8080)

* Case sensitive

Ensure you replace the hostname and port number with the correct server details. E.g. For a local WebLogic server with the default port number, URL would be http://localhost:7001/xxx

I may have missed some URLs out, so let me know if I have!


Modify Hosts file for full access to SOA/BPM Domain on Oracle Virtual Machine Image

Use case:

I installed an Oracle Virtual Machine image on Oracle Virtual Box which consisted of the 11g Fusion Middle ware stack (Oracle DB, WebLogic Server, SOA + BPM Suite, OSB, BAM and WebCenter. Link to image)

I ran all the servers and was able to access the running server Middleware application such as WebLogic Console, Enterprise Manager, BPM Workspace etc through my browser on my local machine.

Issue
However, there was an instance where when I deployed a BPM application and launched a Human Task page, I got the following error:


Why does this happen?
This happens because within the BPM Workspace application, you are opening a Human Task page and it tries to directly reference the address through the domain name, rather than through localhost. The servers in the VM are exposed for access via 'localhost', when opening the human task, instead of accessing the page with 'localhost', it tries to reference it with the direct domain name which in this instance is 'soabpm-vm'. This would only accessible if you was accessing it in a browser inside the server.

Solution
So to resolve this issue, we need to add the domain name it references to your system's hosts file. We insert the name of the domain, and map it to localhost. So when the domain name is requested, it automatically routes and resolves it to 'localhost'.

The location of your hosts file will vary depending on your Operating System. Use this link to find out where your hosts file is located and then open it to edit.

My Operating System is Windows 7 and have opened the hosts file for modification:


1. Add another entry to map the name of your domain name to 127.0.0.1, as shown below:




2. Save the hosts file and close the window.

3. Now, try opening your Human task page again and it should have resolved to the correct address: