Hybrid Cloud management is an interestingly hot topic for today’s cloud world, since not all companies want to move everything to the cloud. In this article series, we are looking at the detailed steps for setting up the Oracle Hybrid Cloud via the latest version – Oracle Enterprise Manager Cloud Control 13c installed on premises. Our main intention is to install an Enterprise Manager hybrid cloud agent on our database cloud servers (on the Oracle public cloud) via the hybrid gateway, in the scenario where our company has databases running on premises as well as on the Oracle public cloud, and then to look at hybrid cloud management using Enterprise Manager.
In the previous parts of the article series, we completed the pre-setup steps for the hybrid cloud – such as setting up one of our on-premises Enterprise Manager Oracle Management Service (OMS) agents as the hybrid gateway agent, creating SSH keys for the OMS server, and creating a named credential with SSH key credentials for the hybrid cloud. At the same time, we also created an Oracle Database service (a server with an Oracle database) on the Oracle public cloud.
Next, we completed the installation of the hybrid cloud agent via Oracle Enterprise Manager, which performed a background transfer of the agent software to the destination host. We logged into the on-premises Enterprise Manager console as SYSMAN or a super administrator and drilled down to the Cloud Host home page. On this page, we could see the Enterprise Manager Configuration and performance metrics for the host; these metrics had been uploaded by the hybrid cloud agent. And after the database discovery process was completed, the cloud database appeared in the list of Enterprise Manager database targets, and it can now be monitored and managed just like a normal on-premises database.
We compared Oracle database configurations by selecting Enterprise | Configuration | Comparison and Drift Management from the Enterprise Manager console, and creating a comparison. We selected the on-premises 12c database “ahuprod.sainath.com” and the cloud database AHUTEST. Effectively, we compared the configuration of a local on-premises database with that of a cloud database. This comparison can be done at the server level as well. Oracle Enterprise Manager is also able to enforce the same compliance standards on the Oracle public cloud as well as on premises, which is perfect for a hybrid database setup.
Next, we looked into the cloning of PDBs from on premises to cloud, one of the main features of the hybrid cloud. To proceed with the actual PDB cloning, we made sure the source and destination CDBs were at the latest PSU. We then went through the steps to preserve the Enterprise Manager agent home when patching the cloud database. Next, we started the Clone to Oracle cloud process. This was done via right-clicking on the on-premises PDB “SALES” which is in the ahuprod CDB, and selecting Oracle Database | Cloning | Clone to Oracle Cloud.
The name of the destination PDB on the cloud side was entered as “SALESTST”, since this will be a test pluggable database. We also selected a user name and password for the PDB administrator of the new PDB. Then, we could have clicked on “Clone” to quickly start the procedure, but instead we clicked on the “Advanced” button at the top of the page. This switched to advanced mode, and a multiple page workflow appeared on the same screen.
We clicked on Next. The “Clone to Oracle Cloud: Configuration” page appeared. As per cloud database standards which are based on Oracle Flexible Architecture (OFA) standards, the PDB data files will reside on /u02, in the /u02/app/oracle/oradata/<PDB name> directory. You can also enter storage limits if you wish, such as the maximum PDB size or the maximum shared TEMP tablespace size. The default logging attribute for tablespaces creating with the PDB can also be specified – Logging, No Logging or Filesystem Like Logging.
After this, the Post Processing page appeared. Here we noted the importance of the Advanced mode, since it is possible on this page to select a Data Masking Definition if it has been created for the source database. Masking is seamlessly integrated with Enterprise Manager. This makes sure that confidential data is masked when being cloned from an on-premises production database to a cloud development database.
A simple masking definition had already been created. This definition was named “LatestDataMaskDefinitionHR” (no spaces should be included in the definition name) and was selected at this point. This will mask some of the confidential columns in the Employees table, in the destination Cloud PDB that will be created.
In the Schedule screen that appeared next, we scheduled the job, then reviewed and clicked on Clone. The procedure started to execute. Among the steps in the procedure, we also observed a Secure Copy files step. Note that the “rsync” Unix command was used by the procedure to fast-copy files to the cloud.
The clone to cloud completed successfully in under 16 minutes (depending on the PDB size and the Internet connectivity). When we moved to Targets | Databases, we saw the new SALES Test PDB under the cloud CDB AHUTEST, and then drilled down to the Sales Test PDB Home page.
If we had selected the Masking definition as a part of the cloning workflow, we would need to verify that the employees table data has been masked. We connected to the on-premises ahuprod cdb as sysdba, and selected from the hr.employees table to examine the original unmasked data. Then we checked the same rows in the cloud PDB. We observed that the employee data has been masked successfully, as per the masking definition that was selected during the clone to cloud procedure.
Another point to note is that if the APEX versions on the two databases (on-premises and cloud) do not tally, the plug-in of the PDB to the cloud database during the cloning process may not complete successfully. The PDB on the cloud database may be left open in restricted mode. The solution for this issue was to download the APEX 5.0 version (not the 5.0.1 version) from http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html, and then to apply this APEX version on the on-premises database, before starting the cloning. After this was complete, the on-premises had the correct APEX version.
The cloning from the on-premises PDB to the cloud CDB then proceeded without any issues. However, if the cloud database had reported a new version of APEX higher than 5.0, then we would have needed to follow the procedure as outlined above while using the higher version of APEX and installing it on the ahuprod database.
Cloning from Oracle Cloud
It is also possible to clone PDBs from the cloud back to on-premises. For example, we complete our development on the cloud PDB, and then bring back the PDB to an on-premises CDB for testing purposes.
To do this, we selected the cloud PDB, right-clicked, and selected Oracle Database | Cloning | Clone from Oracle Cloud. This procedure bought the PDB back to the on-premises CDB. This brings up the Clone details page, where we can select the source PDB, and the destination CDB which is on premises. Credentials were specified on either side.
This should complete successfully in the majority of cases, but at times, when a special cloud patch has been applied at the cloud database level by the Oracle Cloud team, that patch is not available to be rolled back by the Datapatch utility at the on-premises PDB level. This will result in the clone procedure failing at the “Apply Datapatch” stage.
In such a case, ignore the step and continue the procedure. The PDB will be cloned but opened in restricted mode. You will then have to resolve the patching issue manually.
Using the RESTful API
The self-service user could use the Enterprise Manager Self Service console for creating databases, and this would also work for schemas or PDBs on demand. But what if a company does not want to use the Enterprise Manager Self Service console? There may be various reasons for this, one example being that the company has created and customized its own orchestration engine outside Enterprise Manager, in a sense its own “private cloud portal” which is able to provision multiple technologies in their private cloud, not just Oracle databases or middleware. Such a portal/orchestration engine can of course be built using Oracle technology – for example, one could use Oracle WebCenter, Oracle SOA Suite and Oracle BPM to build a powerful cloud portal/orchestrator with approvals and business rules included.
The self-service user could request a production database and it would require approval from management, Oracle BPM would route it to the appropriate manager and once approved the database would be provisioned. Or, approvals could be required based on the cost of the database service going beyond a certain limit. Non-Oracle technology, such as databases from other vendors, could be provisioned as well with this orchestrator. Manual services such as performance tuning or data migration could also be included (thus increasing the value of the IT department), and a business catalog created, all outside Enterprise Manager.
From Cloud Management Plug-in 18.104.22.168 onwards, RESTful Web Services-based API support for Database as a Service (DBaaS) has been provided in Enterprise Manager. This support has been steadily enhanced in later versions of the plug-in – such as support for RESTful APIs for Schema as a Service, Snap Clone, and RMAN based cloning in Cloud Management Plug-in 22.214.171.124, next for Pluggable Database as a Service in the 126.96.36.199 version of the plug-in, then for CloneDB in DBaaS in 188.8.131.52 and so on. The RESTful API of Enterprise Manager continues to be enhanced by Oracle.
This RESTful API support is of great importance when orchestration engines are being used. The orchestrator is able to call the RESTful API of Enterprise Manager to do the actual provisioning.
We will continue in the next part of this article series.