Whilst waiting for a new version of Cloud Control, which will hopefully include my job scheduler enhancement requests, I decided to see if I could solve my problem using the command line interface (EMCLI). That spawned this very basic article.
I was initially really excited by the EMCLI, planning to pretty much replace my job creation with EMCLI scripts, but there seem to be a bunch of discrepancies with the EMCLI compared to the regular Cloud Control interface. Now I admit I’m a newbie at this, but here’s what I’ve seen so far.
The built in help is fine, sometimes prompting you with other commands to get more information, but sometimes it leaves quite important stuff out. For example, when you do a “describe_job_type” for the job type “RMANScript”, it does not include the possible schedule information, so it appears you can only schedule one-off jobs. A little digging and you find the scheduling is possible, and seems to work OK. It’s a little annoying this isn’t included in the property file template though.
It would seem like the easiest way to figure out how to schedule a job using EMCLI would be to create a DB backup job manually, the use the “describe_job” verb to figure out what the job properties are. The problem is, you can’t describe a job with the job type of “Backup”.
C:\emcli>emcli describe_job -name=test_db_backup
job type [Backup] not supported in EMCLI.
But wait a minute. When you create a DB backup from EMCLI it is created with the job type of “RMANScript”, which works with “describe_job” just fine. So why do the two methods for creating a job to do the same thing use a different job type? Even if that were sensible for some reason, why does the job type of “Backup” not work with the “describe_job” verb?
My next issue was I can create and delete a one-off job using “create_job” and “delete_job” respectively, but as soon as I create a scheduled job with a repeating schedule, the “delete_job” verb seems to be useless, because as long as there is a scheduled run in the future, you get the following message.
C:\emcli>emcli delete_job -name=test_db_backup
Error: Cannot delete a job with active executions. Before deletion, the job status must be one of STOPPED,COMPLETED,ABORTED, or FAILED.
Remember, this is not a running job, just a job that is scheduled to run in the future. If you try to delete the job from the Cloud Control interface it works fine…
As I said before, I’m a total newbie at this EMCLI stuff, so it may be my (lack of) understanding that is wrong, but there seems to be a number of inconsistencies that make it really annoying. I’m raising enhancement requests as I find these issues, so hopefully things will be resolved in future releases, or the responses will explain why my issues are due to be being a dumb-ass. 🙂
Moaning aside, I think the EMCLI stuff has got a lot of potential. Personally, I would like to script a lot of the configuration, giving the option of clean installs of new versions as well as upgrades.