How to query for a DB based domain to view applications that were deployed before or after a particular date or in a given date range.

How to query for a DB based domain to view applications that were deployed before or after a particular date or in a given date range.

book

Article ID: KB0089922

calendar_today

Updated On:

Products Versions
TIBCO Administrator -
Not Applicable -

Description

Resolution:

You can obtain this information from the database. Administrator uses a numeric value while saving the timestamp to the database, something similar to the TIBCO ActiveMatrix BusinessWorks (BW) timestamp function. It can be converted to date using a Java/ TIBCO ActiveMatrix BusinessWorks (BW) client (a BW client making use of the timestamp function) or directly by using a database query. This conversion gives more accurate results in Java than DB.

Both approaches are given below:

1). Using Database Query:

In this example, we show how to obtain the information from an Oracle Database. Similar logic can be used for other supported databases. Modify the query accordingly. 

SELECT DC.MNAME AS APP_NAME,
DR.MNAME AS DEPLOYMENT_NUMBER, DR.MUSERNAME AS DEPLOYED_BY,
TO_DATE('1-Jan-1970 00:00:00','dd-mon-yyyy hh24:mi:ss') + (DR.MLASTMODIFIED/(60*60*24*1000)) AS DEPLOYMENT_DATE,
DECODE(DC.MLASTDEPLOYMENTSTATUS,'7', 'Synchronized','11','Deployable, services require deployment' ) AS CURRENT_DEPLOYMENT_STATUS,
TO_DATE('1-Jan-1970 00:00:00','dd-mon-yyyy hh24:mi:ss') + (DC.MLASTMODIFIED/(60*60*24*1000)) AS LASTMODIFIED_DATE
FROM ADDEPLOYMENTCONFIGURATION DC, ADDEPLOYMENTREVISION DR
WHERE DC.MENTITYSTOREPARENT=DR.MENTITYSTOREPARENT
AND DC.MNAME NOT IN ('TIBCOServers')
-- AND DR.MLASTMODIFIED BETWEEN ((TRUNC(TO_DATE('01092012','DDMMYYYY')) - TO_DATE('01011970','DDMMYYYY')) *60*60*24*1000) AND ((TRUNC(TO_DATE('05042014','DDMMYYYY')) - TO_DATE('01011970','DDMMYYYY')) *60*60*24*1000)
-- AND DR.MLASTMODIFIED >= ((TRUNC(TO_DATE('21092012','DDMMYYYY')) - TO_DATE('01011970','DDMMYYYY')) *(60*60*24*1000))
-- AND DC.MNAME='RC_DB1-Sample' --Format => <DomainName>-<AppName>

ORDER BY DC.MNAME, DR.MNAME;


You can uncomment the required DR.MLASTMODIFIED condition from the  where  clause either to get applications deployed in a date range or to get when an application deployed after a particular date.

2). Using Java/BW client:

Refer to the attached file "TIBCO ActiveMatrix BusinessWorks (BW) project (DeploymentQuery.zip)." The Project Details are given below:

Setup:

    No special setup is required to run this example. However, update the following resources per your environment: 

     1). DB Connection: Make sure that the DB URL, username/password are set correctly. You can use the domain DB user here.
     2). Global Variable: Modify ReportLocation Global Variable accordingly.
       
Description:
   

    There are mainly two sections:

    1). A sample TIBCO ActiveMatrix BusinessWorks service and client providing application details that were deployed in a given date range.
    2). A process generating an HTML report providing application details for a given date range.
           
Expected Results:
   

    1). For TIBCO ActiveMatrix BusinessWorks service, you should see information corresponding to the date range that is given in the input request.
    2). When running the HTML Report > GenerateReport process, it should generate an HTML report. Refer to the attached file "Sample HTML Report Output.jpg" for sample output. 


NOTE: This solution is supported "AS-IS". Meaning we are showing how this can be implemented. You can use this as a reference and implement your own. Please try it on your lower environment before using it on your production.

Issue/Introduction

How to query for a DB based domain to view applications that were deployed before or after a particular date or in a given date range.

Attachments

How to query for a DB based domain to view applications that were deployed before or after a particular date or in a given date range. get_app
How to query for a DB based domain to view applications that were deployed before or after a particular date or in a given date range. get_app