Monday, 28 October 2013

Databse Query to count the number of instances of a composite



Connect to your infra database and below is the query

select state,
     count(*) Count,
     TO_CHAR(creation_date,'YYYY-MM-DD'),
    trunc(Max(extract(day    from (modify_date-creation_date))*24*60*60 +
              extract(hour   from (modify_date-creation_date))*60*60 +
              extract(minute from (modify_date-creation_date))*60 +
              extract(second from (modify_date-creation_date))),4) MaxTime,
    trunc(Min(extract(day    from (modify_date-creation_date))*24*60*60 +
              extract(hour   from (modify_date-creation_date))*60*60 +
              extract(minute from (modify_date-creation_date))*60 +
              extract(second from (modify_date-creation_date))),4) MinTime,
    trunc(AVG(extract(day    from (modify_date-creation_date))*24*60*60 +
              extract(hour   from (modify_date-creation_date))*60*60 +
              extract(minute from (modify_date-creation_date))*60 +
              extract(second from (modify_date-creation_date))),4) AvgTime,
     composite_name Composite, component_name Process, componenttype
     from cube_instance
     where creation_date >= sysdate -1 and composite_name='COMPOSITENAME'
      group by state, TO_CHAR(creation_date,'YYYY-MM-DD'), composite_name, component_name, componenttype
        order by count(*) desc;


Sysdate - 1 will return you the last 24 hours instances.

To check the transactions

SELECT * FROM CUBE_INSTANCE WHERE creation_date >= sysdate-1 and
    COMPOSITE_NAME='xoxoxo' order by creation_date desc;


Deploy, Undeploy, Start and Stop Composites


locate wlst.sh

/XXX/soa/middleware/oracle_soa/common/bin/wlst.sh

sca_deployComposite( "http://soaserver:port" ,  "location/Filename.jar")

sca_undeployComposite( 'http://soaserver:port' , 'CompositeName(ServiceName)' , 'version' , 'username' , 'Password' )

sca_stopComposite("soa server", "port", "username", "Password" , "CompositeName" , "Composite Version")

sca_startComposite("soa server", "port", "username", "Password" , "CompositeName" , "Composite Version")

No comments:

Post a Comment