CA WA 11.1 SP1 Best Practices and Excellent Examples. Lee Stecklov, Manager, Software Engineering

Size: px
Start display at page:

Download "CA WA 11.1 SP1 Best Practices and Excellent Examples. Lee Stecklov, Manager, Software Engineering"

Transcription

1 CA WA 11.1 SP1 Best Practices and Excellent Examples Lee Stecklov, Manager, Software Engineering

2 Terms of This Presentation This presentation was based on current information and resource allocations as of October 2009 and is subject to change or withdrawal by CA at any time without notice. Notwithstanding anything in this presentation to the contrary, this presentation shall not serve to (i) affect the rights and/or obligations of CA or its licensees under any existing or future written license agreement or services agreement relating to any CA software product; or (ii) amend any product documentation or specifications for any CA software product. The development, release and timing of any features or functionality described in this presentation remain at CA s sole discretion. Notwithstanding anything in this presentation to the contrary, upon the general availability of any future CA product release referenced in this presentation, CA will make such release available (i) for sale to new licensees of such product; and (ii) to existing licensees of such product on a when and if-available basis as part of CA maintenance and support, and in the form of a regularly scheduled major product release. Such releases may be made available to current licensees of such product who are current subscribers to CA maintenance and support on a when and if-available basis. In the event of a conflict between the terms of this paragraph and any other information contained in this presentation, the terms of this paragraph shall govern. 2 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

3 For Informational Purposes Only Certain information in this presentation may outline CA s general product direction. All information in this presentation is for your informational purposes only and may not be incorporated into any contract. CA assumes no responsibility for the accuracy or completeness of the information. To the extent permitted by applicable law, CA provides this document as is without warranty of any kind, including without limitation, any implied warranties or merchantability, fitness for a particular purpose, or non-infringement. In no event will CA be liable for any loss or damage, direct or indirect, from the use of this document, including, without limitation, lost profits, lost investment, business interruption, goodwill, or lost data, even if CA is expressly advised of the possibility of such damages. 3 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

4 Upgrading to 11.1 SP1 > Overview: Install 11.1 SP1 against new database schema on the same system or a new system Convert artifacts and optionally, History tables Enable workload on new server, possibly staged so minimal interruption to Production. R5 R5 Server R11 Agent 4 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

5 Upgrading to 11.1 SP1 > Planning Considerations Professional Services? Exploit the new features of 11.1 SP1 Resource considerations Script adjustments? CLI replaces appcmd and trigger scripts How much down-time can you afford? Stage the migration by pointing agents to the new server as needed Do you need to carry over history? May be helpful for externals and Anticipated End Time Very large history tables take longer to convert 5 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

6 Upgrading to 11.1 SP1 > Overview: STEPS OUTLINE 1. Ensure that the r11.1 SP1 server is installed and configured. 2. Assess the artifacts for migration impact 3. Convert the artifacts on Windows 4. Migrate the converted artifacts to the r11.1 SP1 server 5. Reconfigure agents in the r11.1 SP1 Topology 6. Modify agents to work with the r11.1 SP1 server 7. Start workload processing on the r11.1 SP1 server 6 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

7 Upgrade.. > The Mechanics 1.Install the migration utility artifacts are converted during the installation,./migration.bin -i console 2.Examine conversion results fix errors? 3.Copy converted artifacts to 11.1 Server location 4.Populate the 11.1 SP1 Server by starting 11.1 SP1 R5 Server R5 R11 7 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

8 Upgrade > Quick run through 1.Install the migration utility artifacts are converted during the installation, R5 Server 8 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

9 Upgrade > Quick run through 2. Examine conversion results fix errors? Info: Converting HOUSEKEEPING to C:\\Cybermation\\devex\\Migration\\DBInit.conv\\Application\\HOUSEKEEPING.xml Info: Version set to 11.1 for application HOUSEKEEPING Info: Converting VERIFY to C:\\Cybermation\\devex\\Migration\\DBInit.conv\\Application\\VERIFY.xml Info: Version set to 11.1 for application VERIFYInfo: Finished with 0 errors. R5 Server 9 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

10 Upgrade > Quick run through 3. Copy converted artifacts file tree 4. Populate the target server startup Messages in log: Populating database from file C:\Cybermation\devex\Resources\DBInit\Application\HOUSEKEEPING.xml 10 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

11 Upgrade > Upgrade Considerations License file needs to be updated! Some special character handling changes between releases, i.e., SAP job types may be affected Artifacts that can not be converted or populated to R11.1 SP1 Server are listed in the migration log, console of desktop client, and in the tracelog.txt of the R11.1 server. Ensure no active workload is running on the target when populating For large history table conversions, Modify the MAX_THRESHOLD_MIN parameter as follows: MAX_THRESHOLD_MIN=120 (2 hours) Need to adjust heap R5 Server size of Migration tool if large numbers of applications exist On Windows, edit file "startserver.lax" on the following line (value in bytes): lax.nl.java.option.java.heap.size.max= On Unix, edit file "startserver" on the following line (value in MegaBytes): MAX_HEAP_SIZE= NNN 11 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

12 Networking with NAT > Desktop clients access CAWA server using Network Address Translation Internal Network External Network CA WA Server Gateway Desktop Client Desktop Client 12 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

13 Networking with NAT > Desktop clients access CAWA server using Network Address Translation Internal Network External Network CA WA Server Gateway Desktop Client By default, RMI exports stubs on the IP address of the local host. Set java.rmi.server.hostname=fqdn so external client can connect 13 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

14 Networking Firewall > Which ports need to be opened? Internal Network External Network CA WA Server Desktop Client Firewall OPEN 4 Incoming ports: AGENT 14 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

15 Excellent Examples EG: 15 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

16 Multiple Criteria Run a job on Sunday between 10 th and 16 th day of each month except in February and August. > Different solutions: WOB.runme='false'; if (today('sunday') && today('10th - 16th day of month') &&!today('anyday of feb aug')) WOB.runme='true'; RUN sunday NORUN 1st-9th day of month NORUN 17th-last day of month NORUN anyday of feb aug RUN sunday 10th monthly except anyday of feb aug 16 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

17 Schedule Criteria > 31ST day of month but only in months with 31 days 31ST DAY WITHIN MONTH > 8 th day of month, if Sunday, otherwise run the job on the first Sunday after the 8th > First RUN SUNDAY Friday 8TH after MONTHLY the 3 rd Thursday of the month 3RD THURSDAY OF MONTH PLUS 1 DAY 17 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

18 Running a Job Within a Date Range Run a job every Thursday between August 23, 2009 and November 13, 2009, inclusive. > For the run frequency for the job, you can use a %IF statement: %IF(daysFrom('aug 23, 2009') >= 0 && daysto('nov 13, 2009') >= 0,'thursday') > Solution uses %IF with the daysfrom and daysto built-in functions to check if the current day is within the required date range If it is within the range, the job is selected to run on Thursdays Otherwise, the run frequency defaults to null 18 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

19 Determining Workday Status Need to determine if a day in the past was a workday and schedule a job based on the result. > Use gentime to generate date and time variables for the day in the past > Use gentime to generate date and time variables for the first date plus 0 workdays > Compare two gentime dates If they are equal, the day in the past was a workday 19 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

20 Determining Workday Status > Example: Run job on 2 nd workday of month only if last day of previous month was a workday > Use gentime to generate date and time variables for the last day of the previous month > Use gentime to generate date and time variables based on first gentime plus 0 workdays > If dates are equal, then last day of previous month was a workday WOB.RunABC = null; gentime ld last day of month starting today less 1 month gentime ld0 lddate plus 0 workdays if lddate == ld0date WOB.RunABC='2nd workday of month'; 20 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

21 Controlling a Long-Running Application An Application scheduled at 22:00 each Friday typically runs for a few days. Application should continue to run until 7:00 Monday at which time the remaining jobs should wait until the following Friday at 22:00. > Schedule Event to run the Application at 22:00 Fridays > Use a threshold resource to serve as an on/off switch and control when jobs are able to be submitted In Resource Manager, define threshold resource (e.g. LONGAPPL) When defining the jobs in the Application, specify that each job requires 1 unit of this resource Automatically set the resource to 1 at 22:00 Fridays and set the resource to 0 at 7:00 Mondays 21 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

22 Controlling a Long-Running Application > As long as LONGAPPL is set to 1, jobs are able to run > At 7:00 Monday, LONGAPPL is set to 0 Allows jobs already submitted to continue running but prevents further submission of jobs in the Application When jobs' other dependencies are met, they will go into a RESWAIT state (waiting for resources) > At 22:00 Friday, LONGAPPL is set to 1 Allows the remaining jobs to continue 22 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

23 Controlling a Long-Running Application > Resource can be set in different ways using 1-line JavaScript script Use 2 links within the Application with appropriate submit times to set the resource availability Schedule Event(s) to set the resource to 0 at 7:00 Mondays and set the resource to 1 at 22:00 Fridays. For example: // Set resource to 0 resetresourceproperty('longappl','availability','0') // Set resource to 1 resetresourceproperty('longappl','availability','1') 23 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

24 Using Part of Event Name in Script Path Path to UNIX scripts needs to include 1st 4 characters of the Event name in lower case. > For example: /export/home/prod/batch/jobabc for Event PROD.INVENTORY /export/home/test/batch/jobabc for Event TEST.INVENTORY /export/home/prep/batch/jobabc for Event PREP.INVENTORY > APPL._event is a built-in variable representing Event name (in upper case) > Need to convert APPL._event to lower case and use substring to extract the first 4 characters 24 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

25 Using Part of Event Name in Script Path > Use tolowercase and substring methods of the String class: APPL.event=APPL._event.toLowerCase(); APPL.system=APPL.event.substring(0,4); OR APPL.system=APPL._event.toLowerCase().substring(0,4); > For location of script, use: /export/home/%(appl.system)/batch/jobabc 25 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

26 Application Status Provide notification if Application scheduled at 8 a.m. each day is not complete by 8 a.m. the next day > Use link with "Do not submit before" time of '8am tomorrow' > Send when link completes > Link is CONDITIONAL because it may or may not process > 2 possible results: If all other jobs in Application are complete prior to 8 a.m., link is bypassed and Application completes Otherwise, is sent at 8 a.m. the next day 26 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

27 Cyclic Application Application is scheduled at midnight each day. When all jobs in the Application complete, wait 60 minutes and trigger in the next generation. Last run to start no later than 19:00. > Use link at end of Application with "Delay when eligible" time of 60 > Link executes JavaScript script at run time to check time/date and trigger in next generation if (WOB._RHH < '19' && APPL._SDATE == WOB._RDATE) exectrigger('%appl._event','add'); 27 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

28 Cyclic Jobs A different script needs to run each Sunday for 4 weeks, then the cycle repeats. > Sample schedule: Date Aug 3, 2008 Aug 10, 2008 Aug 17, 2008 Aug 24, 2008 Aug 31, 2008 Script scripta scriptb scriptc scriptd scripta 28 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

29 Cyclic Jobs > Use daysbetween function in a JavaScript script at run time to calculate the number of Sundays from your starting point (i.e. Aug 3, 2009) > Divide this number by 4 and extract the remainder > Set variable for script name based on remainder > Use %scriptname when specifying script's path Weeknum=daysBetween('aug 3,2009','today','Sunday') Rem = Weeknum%4 if (Rem == 0) WOB.scriptname='scriptA'; if (Rem == 1) WOB.scriptname='scriptB'; if (Rem == 2) WOB.scriptname='scriptC'; if (Rem == 3) WOB.scriptname='scriptD'; 29 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

30 Cyclic Jobs > Alternative approach using switch: switch (daysbetween('aug 3,2008','today','Sunday')%4) { case 0: WOB.scriptname='scriptA'; break; case 1: WOB.scriptname='scriptB'; break; case 2: WOB.scriptname='scriptC'; break; case 3: WOB.scriptname='scriptD'; } 30 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

31 Handling Scheduled and Ad hoc Jobs Some jobs in an Application are scheduled on the first and last Monday of each month and then on an ad hoc basis. Need an easy way to request the extra jobs. > EXTRA.JOB1, EXTRA.JOB2, EXTRA.JOB3 are scheduled and on-request 31 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

32 Handling Scheduled and Ad hoc Jobs > Use a JavaScript script at Event Trigger Time that sets a Run frequency variable for the extra jobs to either true or false based on the date > When extra jobs need to run, simply change the date > Allows the user to update the script in advance instead of waiting until the actual day the extra jobs are required WOB.runme='false'; if (today('first Monday of month') today('last Monday of month')) WOB.runme='true'; // Change date for adhoc requests if (today('oct 20, 2008')) WOB.runme='true'; 32 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

33 Extracting Variable-length String Job qualifiers consist of database name plus 'OFL'. Length of database name varies. Need to extract database name to pass as argument to scripts. > Qualifiers look like this: D23OFL, A099OFL, A9OFL, etc. > Since length of database name varies, unable to use static substring function > Use JavaScript script at run time for each job to replace OFL with empty string > Use %WOB.Database_Name as argument WOB.Database_Name=WOB._qualifier.replace("OFL",""); 33 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

34 Checking Exit Code An Application is scheduled for 10 a.m. on the last workday of each month. The first job can end with an exit code of 0, 1, or 2. Different actions are required based on this exit code. Setup_Job = 0 = 1 = 2 Next_Job Complete Appl. + Trigger for next workday Complete Appl. 34 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

35 Checking Exit Code > Set up first job, Setup_Job, to release each of the possible successors based on an exit code > Use links with run-time JavaScript scripts to take the necessary actions Complete Application and Retrigger: execcommand('all', '%(APPL._name).%(APPL._gen)','ACTION COMPLETE') exectrigger('%espevent','10am today plus 1 workday','add') Complete Application: execcommand('all','%(appl._name).%appl._gen','action COMPLETE') 35 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

36 Cancelling a Long-Running Job If a particular job runs longer than 60 minutes on Fridays or 30 minutes on other days then automatically cancel the job. > When you define the job: Use %IF in the "Overdue if execution time exceeds" field to specify the maximum execution times 36 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

37 Cancelling a Long-Running Job > Identify Alert to be triggered if job becomes Overdue > Define Alert and use JavaScript script to cancel job execcommand('%wob._name','%(appl._name).%appl._gen','action KILL') 37 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

38 Cancelling an Application Application scheduled at 9AM. File Trigger waits for file to be created. UNIX job is then released to process the file. If the file has not been received by 3PM, complete the Application. > File Trigger waits for file to be created > Link2 uses Do Not Submit Before 3PM Executes a JavaScript script to complete the entire application > If file created before 3PM: Link1 completes Link2 so that Application is not completed while UNIX job is executing UNIX job is then released to process file 38 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

39 Using Generic Scripts > A common practice is to use one job to complete another For example, use Link1 to complete Link2 > One technique is to use a tag to specify the name of the job being completed and then use a generic script For example, define Link1 with a tag of Link2 execcommand('%wob._tag','%(appl._name).%appl._gen','action COMPLETE') > May want to create JavaScripts in the repository to perform common functions, such as GlobalCompleteApplication and GlobalCompleteJob > Allow all users access to Global* scripts 39 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

40 Controlling Concurrent Access Need to limit the number of jobs accessing a particular system. > 5 connections allowed to the ABC system > If more than 5 jobs try to access system at same time, the jobs fail and need to be restarted job11 job24 job35 job19 job48 ABC WAIT job13 40 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

41 Controlling Concurrent Access > Define renewable resource called ABC with Max and Avail counts of 5 > Each job that requires access should be defined with resource requirement of 1 unit of ABC > If 5 jobs are using the resource then the other jobs needing the resource go into RESWAIT state > Optionally, you can prioritize some of the jobs 41 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

42 Q & A 42 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA

43 Thank You 43 October CA Workload Automation (DE) Best Practices & Excellent Examples Copyright 2009 CA