How many times have you had maintenance or a release complete and everyone is sure that everything’s been put back the way it should have been, all t’s crossed, all i’s dotted and then you release it to the customers only to find out that NOPE, something was forgotten in the moving parts of technology? As the Database Administrator, you can do a bit of CYA and not be the one who has to say-
Having the ability to compare targets is a powerful feature in Enterprise Manager 13c, (and 12c, don’t feel left out there…:)) The comparison feature is the first of three options that encompass Configuration Management-
Building Comparison Baselines
Upon entering Configuration Management in EM13c, you will be offered the option to create a one-time comparison, or use a pre-existing comparison as your base. You can access the Configuration Management utility via the Enterprise drop down in EM13c Cloud Control:
For our example today and due to the small environment I possess in my test environment, we’re going to compare two database targets. The Configuration Management utility is fantastic at comparing targets to see if changes have occurred and I recommend collecting “baseline” templates to have available for this purpose, but know that the tool is an option to perform other comparisons, such as:
- investigating a change in a target.
- researching drift or consistency
Maintenance Use Case
For our example today, we’re going to be working on a CDB, then as the “Lead DBA”, we’ll discover that changes that weren’t reverted as part of our maintenance with the Configuration Management Comparison tool.
We first need to set up the comparison “baseline”, so to do this, I’m going to make a copy of the default template, Database Instance Template. It’s just good practice to make copies and leave the locked templates, in case there are times where we find there are areas we need to watch for changes in any environment that may not have been turned on by default.
Once you enter the main dashboard, click on the bottom icon on the left, which when highlighted, will show you is for Templates.
Scroll down till you see Database Instance Template, highlight it and click on Create Like at the top menu. You will need to name your new copy of the original template. For mine, I’ve named it CDB_Compare:
Click OK and you now will be brought to the template with all it’s comparison values displayed. If there are any areas that you want to compare for immediately, check that area and make sure that there is a check mark in the box for that change. For our example, let’s say that we have a process in this CDB that when quarterly maintenance is complete, the pluggable database must be brought back up, but sometimes it’s a step that the DBAs forget to complete. By default, the configuration template is checking for this, but if it didn’t, I would place the check mark in the appropriate box and save the template before proceeding.
Now that I have my template ready, I can use it to do a comparison. On the far left, click on the top icon, (of a bar graph) that will take you to the Overview page or the One Time Comparison Results, both of which will offer you an opportunity to create the baseline of the CDB that you want to compare against.
Click on Create Comparison and fill in the following information:
Click on Submit and as expected, no differences are found, (we just compared the environment against itself using the new CDB_Compare template, that checks everything out) but we now have our baseline.
Perform Maintenance and Compare
Our maintenance has been completed, now our database is ready to be released to the users, but we want to verify that the changes performed should have been performed and no steps were missed that would hinder it from being ready for production use.
We perform another comparison, this time against our baseline and choose to only show differences-
Per the report, the databsae is in read only and if we log in via SQLPlus, we can quickly verify that this:
SQL> select name, open_mode from v$database; NAME OPEN_MODE --------- -------------------- CDBKELLY READ WRITE SQL> select name, open_mode from v$pdbs; NAME OPEN_MODE ------------------------------ ---------- PDB$SEED READ ONLY PDBKELLYN MOUNTED PDBK_CL1 READ ONLY
So instead of mistakenly releasing the database back to the users, we can run the following and know we’ve verified that we are safe to:
ALTER PLUGGABLE DATABASE PDBKELLYN OPEN;
Well, that’ll save us from having to explain how that was missed…Whew!