Afternoon folks! I received a text from a customer of mine asking whether I had any documentation to create jobs in EM12c. To be specific, the job in question could have been setup via crontab or windows jobs but since I had recommended consolidation of newer jobs in EM12c, this was a good question. The easiest route was to refer the customer to Oracle Documentation, but I have a few hours to kill and thought it would make a good post.
The job in question, is a veridata compare job. You could just as easily, replace that job with . I’d like to show you how to set it up.
First, let’s make sure that our script actually works. For those who are not familiar with Veridata, it is Oracle’s solution to data comparison when replication is in use. The Veridata suite contains a Command Line Interface (CLI) called vericom that can be used to perform minimal activities on the jobs and compare pairs configured within it. I should have probably written another post on configuring jobs, but I’ll leave that for another day.
My innocent script is located in the $VERIDATA_HOME directory.
[oracle@as-sandbox-n1 scripts]$ pwd
[oracle@as-sandbox-n1 scripts]$ ls -lhtr
-rwxrwxrwx 1 oracle oinstall 68 Nov 8 12:43 vericom_run_job.sh
[oracle@as-sandbox-n1 scripts]$ cat vericom_run_job.sh
/u01/app/oracle/product/220.127.116.11/veridata/vericom.sh -j BLUE_YELLOW
A sample execution of the script looks like:
JAVA_OPTS: -Xmx1024m -Djava.awt.headless=true
Oracle GoldenGate Veridata Command Line Interface - Version 18.104.22.168 OGGVDT_22.214.171.124.0_PLATFORMS_121108.1625
Job BLUE_YELLOW started
Run ID: (1027,0,0)
Number of Compare Pairs: 3
Number of Compare Pairs With Errors: 3
Number of Compare Pairs With OOS: 0
Number of Compare Pairs With No OOS: 0
Number of Compare Pairs Cancelled: 0
Job Report Filename: /u01/app/oracle/product/126.96.36.199/veridata/shared/data/rpt/BLUE_YELLOW/00001027/BLUE_YELLOW.rpt
Run ID: (1027,0,0)
Job Completion Status: IN SYNC
That was the easy part 🙂
1. Now, let’s log into EM12c and navigate to the Jobs home page.
2. Since we need to create a job and the default option under “Create Library Job” is set to “OS Command”, click on Go.
3. From here, you can give the job a name and description, and add a target where it will run.
4. In the parameters tab, enter the absolute path of the script. You have the option of embedding the script within the job itself by choosing a different “Command Type”.
5. I already have a Preferred Named Credential Set configured for this host, so the defaults as left. Alternatively, you could pick one of the other two options as well, but it all depends on your configuration.
6. The insane schedule is merely to illustrate a point. You can pick your own.
7. I generally do not make alterations to the Access tab, however, you may want to delegate ownership and access to other users. Click on “Save to Library”.
8. And that’s it!
9. I waited a few minutes before checking for the jobs activity.
10. Cool, the first one completed successfully. You can drill down to the log of the execution.
I’ve only scratched the surface of the job system in EM12c. There are several other options while creating jobs (see screenshot below). One of the most interesting for me are the multi-task jobs which I hope to write an article on eventually.
For the moment, I hope you enjoyed the article and found it useful.
[…] Anjum: https://maazanjum.com/2013/12/30/create-a-simple-job-for-a-host-target-in-em12c/ Kellyn Pot’vin: […]
After reading the above article, i tried defining a job (in place of a crontab job) for multiple servers but whenever i do it, the ‘Add Target’ takes an entry for all the 4 targets as 4 different hosts and the shell script works only for the server where the script is placed.
Can you please let me know the steps involved in defining the above requirement for 4 different targets?
Do we have to place the Shell Script in all the different 4 targets/servers or just put the shell script in the EM12c Server to make it work for all the 4 targets.
I just saw this comment. It all depends on the type of script you’re running. What does your script do actually?
Great article . I have a very specific example where the shell script needs oracle SID as parameters as input and uses those SID to build text files which are compared later to see if something changed from last time . Please let me know if the JOBS solution allows the SIDs as input parameters so in that case I do not have to change the code (at all) or if it has to be changed then it would be minimal (like replacing $1 variable with something else).
Thanks for the feedback. So, with jobs you can direct them to specific targets. I’m not aware of any “input” parameters you can dynamically pass to an existing script that won’t involve a reworking the script.
Is there a way to schedule the job in OEM to execute “monthly during the last weekend of the month” ?.
Well, not exactly. From what I could tell, you can only do it for the last day of the month from the direct options available – which makes the most sense. How would you know which day of the week from that month? It’s a moving target.
Alternatively, you could schedule a “yearly” reoccurrence, and pick the day of the month you want the job to run.
Thanks for this post. Unfortunately the contents in the screen shots are Invisible – resolution, too small.