arrow_back

Deploying the Oracle on Bare Metal Solution

Sign in Join
Test and share your knowledge with our community!
done
Get access to over 700 hands-on labs, skill badges, and courses

Deploying the Oracle on Bare Metal Solution

Lab 2 hours universal_currency_alt 5 Credits show_chart Intermediate
info This lab may incorporate AI tools to support your learning.
Test and share your knowledge with our community!
done
Get access to over 700 hands-on labs, skill badges, and courses

Overview

In this lab exercise, you will complete a series of steps that parallel the actions required to deploy and use Google Cloud's Oracle on Bare Metal Solution. Because you are working within a controlled lab environment, several tradeoffs are required to allow a representative end-to-end scenario. These trade-offs are:

  • Because you don't have a physical Bare Metal server to use, the Oracle Database will run on a pre-configured Compute Engine virtual machine with no public internet access. This VM will reside in its own distinct project. This particular project effectively represents the Region Extension component of the Bare Metal Solution.
  • A second project is provided that represents the Google Cloud-side environment. You will join the Google Cloud-side project with the Bare Metal-side project via VPC network peering in the same manner as a real Bare Metal Solution deployment would be joined.
  • You will deploy an Oracle Database 19c instance as a standalone database instance. This is done for simplicity and to show a fully functioning, end-to-end, Oracle on Bare Metal Solution deployment. The installation of this database will be done via a highly customized version of the oracle-toolkit provided by Google Cloud to assist with installation of an Oracle Database on a Bare Metal server. You, as the learner, must provide the installer for this step. Your acceptance of download terms confirms compliance with Oracle's licensing rules even in the case of a training/testing activity.
Note: You will not be able to complete this lab without downloading the Oracle Database 19c installer. Note: The deployment and validation steps in this lab do not necessarily represent a preferred method of installation and configuration. All deployment decisions must be based on your end-state goals and needs.

Here is an architecture diagram of the lab environment for your reference.

Lab architecture diagram

Learning Objectives

In this lab, you will:

  • Configure VPC network peering between projects.
  • Download the Oracle Database 19c installer from the Oracle Technology Network.
  • Install an Oracle Database 19c instance on a Bare Metal server.
  • Verify connectivity to the Oracle Database 19c instance from Google Cloud Vertex AI.

Setup

For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.

  1. Sign in to Qwiklabs using an incognito window.

  2. Note the lab's access time (for example, 1:15:00), and make sure you can finish within that time.
    There is no pause feature. You can restart if needed, but you have to start at the beginning.

  3. When ready, click Start lab.

  4. Note your lab credentials (Username and Password). You will use them to sign in to the Google Cloud Console.

  5. Click Open Google Console.

  6. Click Use another account and copy/paste credentials for this lab into the prompts.
    If you use other credentials, you'll receive errors or incur charges.

  7. Accept the terms and skip the recovery resource page.

Task 1. Configure VPC network peering between projects

For this portion of the lab, you configure VPC network peering between the two pre-deployed projects. This networking configuration will allow the Oracle Database 19c instance to communicate with the entirety of Google Cloud via the peered network. It is important to note that VPC network peering is not possible if the two VPC networks have overlapping IP subnet ranges.

  1. Open a new web browser window (preferably in Incognito mode) and navigate to the Google Cloud Console (console.cloud.google.com). Use the project selector to choose the first project with a leading name of 'qwiklabs-gcp.'

  2. In your web browser, open a second instance of the Google Cloud Console. Use the project selector to choose the second project with a leading name of 'qwiklabs-gcp.'

Note: You may need to open the All tab to see the second project, because the selector menu typically defaults to the Recent tab.
  1. For each project, on the Navigation menu (Navigation menu icon), click Compute Engine > VM instances.
  2. Note which project is hosting the Bastion VM (bms-bastion-host) and which project is hosting the Bare Metal server (bms-rhel-instance). Copy these project IDs to a text file so that you can paste the values in later steps.

Dual projects view

  1. Open the Cloud Shell. Set the following variables by substituting strings bms-bastion-host-project-id and bms-rhel-instance-project-id with the matching project IDs you recorded in the step prior:
export BASTIONPROJ=bms-bastion-host-project-id export BMSPROJ=bms-rhel-instance-project-id
  1. Execute each of these gcloud commands successively and in order. These commands will configure both sides of the peering connections:
gcloud config set project $BASTIONPROJ gcloud compute networks peerings create bms-peer-bastion --network bms-bastion-net --peer-network bms-db-net --peer-project $BMSPROJ gcloud config set project $BMSPROJ gcloud compute networks peerings create bms-peer-db --network bms-db-net --peer-network bms-bastion-net --peer-project $BASTIONPROJ
  1. Close the Cloud Shell.

  2. Return to the project with the Bastion VM. On the Navigation menu (Navigation menu icon), under Networking, navigate to VPC Network and click VPC network peering. The new peering will show with an Active status (green icon).

  3. In the tab for the project with the Bare Metal server. On the Navigation menu, under Networking, navigate to VPC Network and click VPC network peering. The new peering will show with an Active status (green icon).

Click Check my progress to verify the objective. Configure VPC network peering between projects

Task 2. Download the Oracle Database 19c installer from the Oracle Technology Network

In this task, you place the Oracle Database 19c installer on the Bare Metal server. The method of positioning the installer used in this lab is one of many options available to you. This approach was chosen to keep configuration steps to a minimum. You can prepare the target Oracle environment via any method within the security and access parameters of the Bare Metal Solution.

  1. For the project with the Bastion VM, on the Navigation menu (Navigation menu icon), click Compute Engine > VM instances.
  2. For the instance named bms-bastion-host, in the Connect column, click SSH to open a terminal window.
Note: Do not change the user from the default 'student-xx-xxxaaxxxxxaa' account nor change the directory into which you are connected (the student user's home directory). If you change from the default settings your activity tracking steps later in the lab will fail.

Connect column

  1. Open a new Chrome browser window (preferably in Incognito mode).
  2. To prepare for a later step, open the downloads page for Chrome:
  • For Mac users, press Option + Command + L.
  • For Windows users, press CTRL + J.
  1. On a new tab, browse to Oracle Database Software Downloads
  2. On the Oracle Database 19c downloads page, under 19.3 - Enterprise Edition (also includes Standard Edition 2), download the ZIP file for Linux x86-64.
  3. Accept the terms of the licensing agreement, and continue with the download.
  4. If you are not already logged in, you will be taken to a page to provide your oracle.com credentials. Create an account if you do not have one.
Note: You will not be able to complete this lab without downloading the Oracle Database 19c installer.
  1. When the download begins, immediately return to the downloads tab you opened in Step 4 and click Pause to interrupt the installer download.

Pause Download

  1. Right-click anywhere on the name of the installer download - 'LINUX.X64_193000_db_home.zip'. Then select Inspect from the list of options.

Click Inspect

  1. The Developer window will open on the Elements page focused on the element containing the download link. Find the download URL in the element; it will be in the pattern https://download.oracle.com/otn/linux... . Right-click on the download URL and then select Copy link address from the list of options.

Click Inspect

  1. Close the Developer window by clicking the 'X' in the top right corner.

Click Inspect

  1. Return to the Bastion VM shell and initiate a 'curl' command that will complete the download:
Note: Replace the placeholder text (in double quotes after the 'curl' command; retain the double quotes on each end) with the link you copied in the previous step. The real link contains a unique authorization string allowing you to download the file from a command prompt. Here is an example of a [fictitious URL](https://download.oracle.com/otn/linux/oracle19c/190000/ LINUX.X64_193000_db_home.zip?AuthParam=1234567812_ab123c4d5ef67gh8x9yzyzddgdygu12) Note: The download may take 35-50 minutes. When completed, the Oracle Database 19c installer is on the Bastion VM. curl "URL_FROM_DOWNLOAD_PAGE" --output LINUX.X64_193000_db_home.zip

Download speeds will vary, but in all cases you will see a progress bar similar to the screenshot below indicating the status of the download. The status output provides details such as megabytes received, time left, and other metrics. If you do not see the progress status updating, cancel the curl command by pressing CTRL + C while in the terminal window.

Terminal window showing download status

  1. In the terminal window, issue the same curl command again.

If the progress status does not update, cancel the download in your Chrome download window and initiate a new download. This creates a new authorization URL, so be sure to update the curl command. Follow the steps listed above such as pausing the download, copying, and pasting the URL. Paste the new curl command in the terminal window. Make certain that you have copied the URL from the Oracle Technology Network correctly and paused the browser-based download. You are not allowed to have two or more downloads in progress using the same authorized URL.

  1. Return to the project with the Bare Metal server, and on the Navigation menu, click Compute Engine > VM instances.

  2. Copy the IP address for the Bare Metal server. Click the three vertical dots on the VM detail row. From the sub-menu that appears, select View network details. On the next screen, the internal IP address will appear under Network interface details. Store the IP address in a text file or other easy to access location.

VM instances page

VM instances page

  1. Return to the Bastion VM shell and set the following environment variable, replacing BMS_IP_ADDRESS with the Bare Metal server's IP address:
export BMSIP=BMS_IP_ADDRESS
  1. Issue the following Secure Copy (scp) command to move the installer to the Bare Metal server.
scp -l 28000 LINUX.X64_193000_db_home.zip oracle@$BMSIP:/u01/app/oracle/product/19.3.0/dbhome_1/LINUX.X64_193000_db_home.zip

Type yes when asked whether you want to continue. When prompted for the oracle user's password, type oracle. The secure copy will finish in 15 - 20 minutes. Leave the Bastion VM shell open for additional actions.

Task 3. Install an Oracle Database 19c instance on a Bare Metal server

In this task, you execute a customized "oracle-toolkit" to install and configure an Oracle Database 19c instance on the 'bms-rhel-instance' pre-built virtual machine.

  1. Return to the Bastion VM shell. Issue the following command to remotely log in to the Bare Metal server:
ssh oracle@$BMSIP

Type yes when asked whether you want to continue. When prompted for the oracle user's password, type oracle.

  1. Execute the following command to update all necessary environment variables, which include ORACLE_HOME and ORACLE_SID:
source ~/.bash_profile
  1. Change the active directory to the u01 mount point:
cd /u01
  1. Issue the following Ansible command to run the customized "oracle toolkit" to install an Oracle Database 19c instance. This step may take 20 to 40 minutes to complete:
ansible-playbook --connection=local /u01/oracle-toolkit/playbook/install_19c_database.yml
  1. Verify that the database is running. Log in as the sysdba and then run the following simple query:
sqlplus / as sysdba select to_char(sysdate,'DD-MON-YYYY HH:MI:SS AM') as CURRENT_DATE_AND_TIME_UTC from dual;
  1. Enable the HR user and HR sample schema that come with the Database installation. Execute the following SQL commands separately and in order:
alter session set container = pdborcl; Note: The following command is one single line. The values hr, users, temp, and $ORACLE_HOME/demo/schema/log/ are input parameters for the hr_main.sql script. @?/demo/schema/human_resources/hr_main.sql hr users temp $ORACLE_HOME/demo/schema/log/ connect hr/hr@//localhost:1521/pdborcl select table_name from user_tables;
  1. Close the Bastion VM terminal window.

Task 4. Verify connectivity to the Oracle Database 19c instance from Google Cloud Vertex AI

Now that you have an Oracle Database 19c instance running as if it were in a Region Extension, your next task is to confirm that this database is available to other Google Cloud services. For this task, you connect a Vertex AI notebook to the database. You will configure connectivity, run a simple query against the HR schema, and render a simple scatterplot diagram. The possibilities, however, are almost limitless. You could very easily use the live connection to the Oracle database to create sophisticated machine learning models that train at scale on Google Cloud.

  1. First you must determine the region where your Google Cloud-side custom network resides. Return to the project with the Bastion VM.
  2. On the Navigation menu (Navigation menu icon), under Networking, click VPC Network > VPC Networks. Click bms-bastion-net entry. Make note of the region.
Note: Your region may vary from the image below.

VPC networks page showing the region

  1. On the Navigation menu (Navigation menu icon), under Artificial Intelligence, click Vertex AI > Dashboard.
  2. Click Enable All Recommended APIs. This action will only take a few seconds.
  3. Click Workbench from the left pane.
  4. Click User-Managed Notebooks on the View ribbon.
  5. In the New notebook instance dialog, select the region you verified in Step 2.
  6. Select the first paired zone that appears in the list.
  7. For Environment select Python 3 (with Intel® MKL).
  8. For Network, select bms-bastion-net. If you select any other network, the connection will fail.
  9. For Subnetwork, select bms-bastion-subnet. If you select any other subnetwork, the connection will fail.
  10. Click on the Advanced Options.
  11. Under Environment type or paste the following text in the cell Select a script to run after creation. This script will install the Oracle Instant Client and a required Linux library:
cloud-training/dbmigration/vertexai_config.sh
  1. Click Machine Type from the left pane. Select E2-standard and e2-standard-4 from the list of options.

  2. Scroll to the bottom of the page, click Create. Notebook creation should take 4 to 7 minutes to complete.

  3. Your notebook is ready for use when the Open JupyterLab link appears active (hyperlinked) next to the notebook name. Click the Open JupyterLab link to open your notebook in a new tab. It may take 3 to 5 minutes for the notebook to be fully ready for use.

  4. Prepare the notebook environment to communicate with the Oracle database. Click Terminal in the Other section of the notebook launcher.

  5. At the terminal prompt, issue the following command:

wget https://storage.googleapis.com/cloud-training/dbmigration/VertexAI_BMS.ipynb
  1. Refresh your browser if necessary to ensure that the recently downloaded notebook appears in the list on the left.
  2. Click the VertexAI_BMS.ipynb notebook that appears in the menu on the left side of the notebook UI.
  3. The first step to prepare the notebook is to provide the internal IP address of the Bare Metal server. You can find this value in the project where the Bare Metal server is running on the Compute Engine > VM Instances page. The value appears in the Internal IP column.
  4. In the second cell of the notebook, assign the Bare Metal server's IP address to the dbip variable.
Note: Be sure to leave the outside single quotes.
  1. Move your mouse to the first cell, then press SHIFT+ENTER.
  2. After the installation, restart the kernel by clicking Kernel > Restart kernel > Restart.
  3. To run the remaining cells, click the cell and press SHIFT+ENTER.
Note: The first cell downloads and installs a Python library named Cx_Oracle. Cx_Oracle provides bindings to connect to an Oracle Database from Python tools such as pandas, NumPy, and Matplotlib.
  1. After all steps are complete, in the output of the third cell you will see a small tabular report with employee last names, job IDs, salaries, and years of employment. Below that, in the output of the fourth cell, will appear a simple scatterplot diagram showing salary distribution by tenure. Note: You may safely ignore any warning messages in the notebook cells.

Tabular report and scatterplot diagram

Click Check my progress to verify the objective. Verify connectivity to the Oracle Database 19c instance from Google Cloud Vertex AI

Configuring and running this notebook is a simple exercise; however it still demonstrates the capabilities that are unlocked by running an Oracle Database on the Bare Metal Solution.

Congratulations, you have completed this lab.

End your lab

When you have completed your lab, click End Lab. Google Cloud Skills Boost removes the resources you’ve used and cleans the account for you.

You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.

The number of stars indicates the following:

  • 1 star = Very dissatisfied
  • 2 stars = Dissatisfied
  • 3 stars = Neutral
  • 4 stars = Satisfied
  • 5 stars = Very satisfied

You can close the dialog box if you don't want to provide feedback.

For feedback, suggestions, or corrections, please use the Support tab.

Copyright 2022 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.

This content is not currently available

We will notify you via email when it becomes available

Great!

We will contact you via email if it becomes available