Automic Workload Automation

Expand all | Collapse all

What Table in Automic DB contains a JSCH(Schedule) Calendar details

Anon Anon

Anon AnonNov 07, 2017 03:44 AM

  • 1.  What Table in Automic DB contains a JSCH(Schedule) Calendar details

    Posted Nov 03, 2017 08:40 AM
    Hi,
    On V12 can someone help me find the table within the UC4 database that contains the Calendar setting for a particular JSCH Object.

    I have the Object Area Diagram for the JSCH object from V11.2 but I can't clearly see the table that contains this info.


    n8euj0aecsmb.pnghttps://us.v-cdn.net/5019921/uploads/editor/tr/n8euj0aecsmb.png" width="1346">


    I can pull all the Keywords we use for a particular Calendar but I need to know which Schedule tasks this keywords are being used in .

    select a. oh_name, b.okb_name, b.okb_validto 
    from uc4.oh a, uc4.okb b
    where a.oh_idnr = b.okb_oh_idnr
    and a.oh_name = 'GLOBAL.XSJ_CALENDAR'


    Thanks,
    John.


  • 2.  What Table in Automic DB contains a JSCH(Schedule) Calendar details

    Posted Nov 03, 2017 11:13 AM
    Here is a SQL I like to use to dump our schedules into Excel that might help you with your analysis?

    select oh_name           as SCHEDULE
          , jpp_object       as OBJECT
          , JPP_ErlstStTime  as STARTTIME
          , jppc_calekeyname as CALENDAR
       from uc4.dbo.oh
          inner join uc4.dbo.jpp 
             on oh_idnr = jpp_oh_idnr
          left outer join uc4.dbo.jppc 
             on jppc_jpp_lnr = jpp_lnr and jppc_oh_idnr = oh_idnr
      where oh_otype = 'JSCH' 
      order by 1,2,3,4;


  • 3.  What Table in Automic DB contains a JSCH(Schedule) Calendar details

    Posted Nov 03, 2017 12:02 PM
    petwir
    Thank for that.
    What I'm actually trying to do here is create a Script that will kick off a Notification us when one of the active Keywords expires.
    For that I need to connect to the OKB table I believe as this has the VALID TO field I need.
    Nearly there I think....



  • 4.  What Table in Automic DB contains a JSCH(Schedule) Calendar details



  • 5.  What Table in Automic DB contains a JSCH(Schedule) Calendar details

    Posted Nov 03, 2017 12:21 PM
    It looks like John tested CALE_WARN_NOTIFICATION a year ago;

    https://community.automic.com/discussion/comment/28162#Comment_28162

    From reading the old thread, it sounds like it doesn't always behave the way one might like it to.

    In our case, we know when our critical keywords are going to expire and we have our staff set up reminders to deal with it in a timely fashion.


  • 6.  What Table in Automic DB contains a JSCH(Schedule) Calendar details

    Posted Nov 03, 2017 01:33 PM
    :o :o WOW! I'm embarrassed my memory is so bad that I didn't remember creating the previous article.

    Too much Guinness in the intervening period


  • 7.  What Table in Automic DB contains a JSCH(Schedule) Calendar details

    Posted Nov 06, 2017 07:34 AM
    FrankMuffke
    Ok, I have added these entries in my UC_CLIENT_SETTINGS and created a static keyword in my calendar that expires on 23rd Nov.
    2f2iis8kshtu.pnghttps://us.v-cdn.net/5019921/uploads/editor/a9/2f2iis8kshtu.png" width="498">

    Is there a log that I can see when this VARA get's execute that will show me this check and results?


  • 8.  What Table in Automic DB contains a JSCH(Schedule) Calendar details

    Posted Nov 06, 2017 07:41 AM
    JohnO'Mullane
    I am afraid no, you will see it in the WP logs, when it got checked & executed.
    ..but I am not 100% sure...


  • 9.  What Table in Automic DB contains a JSCH(Schedule) Calendar details

    Posted Nov 07, 2017 03:30 AM
    FrankMuffke
    My test worked success fully. Thanks for your help.

    I think the reason it didn't work previously was because I had used CALE_WARN_CALL_OPERATOR instead of CALE_WARN_NOTIFICATION


  • 10.  What Table in Automic DB contains a JSCH(Schedule) Calendar details

    Posted Nov 07, 2017 03:42 AM
    petwir

    Just on your query above...
    Although I now have the CALE_WARN_NOTIFICATION working, I will still need to identify which objects are using this Keyword. 

    This is where your query comes in handy for JSCH objects.

    Are you using any Calendar Keywords within your EVNT objects?

    I'll attempt to write a similar query to catch those.


  • 11.  What Table in Automic DB contains a JSCH(Schedule) Calendar details

    Posted Nov 07, 2017 03:44 AM
    Great!


  • 12.  What Table in Automic DB contains a JSCH(Schedule) Calendar details

    Posted Nov 07, 2017 11:20 AM
    My query was only designed to report JSCH schedules.


  • 13.  RE: What Table in Automic DB contains a JSCH(Schedule) Calendar details
    Best Answer

    Posted Oct 03, 2019 01:33 PM
    we made this a little more complex because we often have user requesting information about how their programs are scheduled.
    Query pulls data related to potential period objects being used together with schedules and also data related to workflows and schedules being actually active/inactive at header level.
    Of course, you should change a few things like the schema name, client number and possibly workflow name

    Hope this helps

    SELECT zz.JPP_OBJECT WORKFLOW,
           zz.SCHEDULE,
           zz.START_TIME,
           zz.Exceptions,
           zz.DAYS,
           zz.WF_STATUS_IN_SCHD,
           DECODE (xx.PERIOD, NULL, 'No period', xx.PERIOD) PERIOD,
           DECODE (pp.oh_inactive,  1, 'Inactive',  0, 'Active') WF_Active,
           zz.Schd_Status
      FROM (  SELECT aa.jpp_oh_idnr,
                     aa.jpp_object,
                     bb.oh_name Schedule,
                     REGEXP_REPLACE (
                        LISTAGG (SUBSTR (aa.jpp_erlststtime, 3), ', ')
                           WITHIN GROUP (ORDER BY aa.jpp_lnr DESC),
                        '([^, ]*)(, \1)+($|, )',
                        '\1\3')
                        Start_Time,
                     DECODE (aa.jpp_cctype,
                             3, 'Does not run on below days',
                             2, 'Runs on below days',
                             aa.jpp_cctype)
                        Exceptions,
                     NVL (
                        REGEXP_REPLACE (
                           LISTAGG (ee.calendar, ', ')
                              WITHIN GROUP (ORDER BY ee.JPPC_JPP_LNR DESC),
                           '([^, ]*)(, \1)+($|, )',
                           '\1\3'),
                        'DAYS')
                        DAYS,
                     DECODE (bb.oh_inactive,
                             '0', 'Active',
                             '1', 'Inactive',
                             bb.oh_inactive)
                        Schd_Status,
                     DECODE (aa.jpp_active,
                             '1', 'Active',
                             '0', 'Inactive',
                             aa.jpp_active)
                        WF_Status_in_Schd
                FROM uc4db.OH bb,
                     uc4db.OSA cc,
                     uc4db.JPP aa
                     LEFT JOIN
                     (SELECT jppc_calekeyname  AS calendar,
                             jppc_oh_idnr,
                             jppc_jpp_lnr
                        FROM uc4db.jppc) ee
                        ON     ee.jppc_oh_idnr = aa.jpp_oh_idnr
                           AND ee.jppc_jpp_lnr = aa.jpp_lnr
               WHERE     aa.jpp_oh_idnr = bb.oh_idnr
                     AND cc.OSA_OH_IDNR = bb.OH_IDNR
                     AND bb.oh_client = 9012                                             -- set client where you do the search
                     AND jpp_object like 'JOBP.RMT_%'                                    -- set workflow name
            GROUP BY aa.jpp_oh_idnr,
                     aa.jpp_object,
                     bb.oh_name,
                     bb.oh_inactive,
                     aa.jpp_active,
                     aa.jpp_cctype
            ORDER BY aa.jpp_object) zz
           LEFT JOIN (SELECT oh_name, oca_value AS PERIOD
                        FROM uc4db.oh, uc4db.oca
                       WHERE OH_idnr = oca_oh_idnr AND oh_client = 9012) xx             -- set client where you do the search
              ON zz.JPP_OBJECT = xx.oh_name
           JOIN uc4db.oh pp ON zz.JPP_OBJECT = pp.oh_name
     WHERE pp.oh_client = 9012;                                                         -- set client where you do the search​