Hayden Hudson
Convert Contrab to Oracle Enterprise Manager

This tutorial was written to complement my other blog post Stop revealing your password in your connection strings!, a topic on which I presented at the New England Oracle User Group conference on Nov 8th 2018. In my talk, I suggested that the ultimate solution to the problem of hard-coded clear-text passwords is the Oracle Enterprise Manager Cloud Control (OEM).

Specifically, if the offending process is a cron job that contains a clear-text password, you can simply convert the cron job to an OEM job that offers the same configuration options and more. Besides removing the necessity of clear-text passwords, this conversion has the further benefit that it consolidates your cron jobs into a single, easily searched location for optimal organization.

The below steps are based off of the instructions I found here.

Create credential

It is not mandatory that you set up the credential for your cron job as a ‘named credential’ but it is recommended. Having a ‘named credential’ allows you to set it up once and share it with others without ever sharing the clear-text password.

NOTE: make sure you it up with a ‘Global’ if you intend to use it in a job. You can still test the validity of the credential as show below :


To create a new job, start by navigating to 'Enterprise > Job > Activity':

On the 'Job Activity' page, find the 'Create Job' button :

The 'Create Job' will open a pop with a long list of job types. For the purposes of this tutorial, I searched for 'SQL' and chose the 'SQL Script' job type :


On the 'General' tab, you are asked to identify a name for your job and the target. For the purposes of my example, I picked 'Pluggable Database' in the 'Target Type' drop down and added the appropriate pdb target :


In the 'Parameters' tab, I entered some very simple DML that I want the the job to perform:


In the 'Credentials' tab, I apply the 'named credential' I created earlier but I could have entered a new one here. There are 2 credentials I need to provide here. The 1st one is the credential that was previously hard-coded into the cron job. The 2nd credential is the one necessary to access the SQL*Plus executable:


In the 'Schedule' tab, I specify the frequency at which I want the job to run. This is another perk to converting my cron job to OEM - I no longer need to understand the crontab scheduling syntax:


In the final tab, 'Access', I'm invited to share the administration of my cron job with other named users who are set up in the console. I also have the option to specify that I want the job to trigger notifications:


The below is a what a successful job submission screen looks like:

The below is an example notification email that may elect to receive upon successful completion of your job :

Date : Nov. 4, 2018