Deploying Oracle Database on Oracle Compute Cloud Service Instances

 

Before You Begin

Purpose

This tutorial shows you how to deploy a single-node Oracle Database and create a general-purpose database on Oracle Compute Cloud Service instances.

The topology of the installation can vary, depending on how many virtual machines (VMs) you provision as part of the installation.

Time to Complete

60 minutes for deployment without Chef

60 minutes for deployment using Chef

Background

Oracle Database is the first database designed for enterprise grid computing, the most flexible and cost-effective way to manage information and applications. Enterprise grid computing creates large pools of industry-standard, modular storage and servers. With this architecture, you can rapidly provision each new system from the pool of components. There’s no need to preallocate resources to accommodate peak workload, because you can easily add or reallocate capacity from the resource pools as needed.

Oracle Compute Cloud Service enables you to rapidly provision VMs on Oracle Cloud with the necessary storage and networking resources, manage and scale the virtual machine topology easily, and migrate your applications to Oracle Cloud.

Chef is a configuration management tool written in Ruby and Erlang. This tutorial uses Chef Server version 12 without any premium features like Chef Manage or Chef Reporting.

This tutorial describes the following deployment scenarios:

  • Deploying Oracle Database 10.2.0.5 on a single Compute Service instance either by using custom scripts or by using Chef
  • Deploying Oracle Database 11.2.0.4 or 12.1.0.2 on a single Compute Service instance by using Chef

What Do You Need?

General Requirements

Requirements for Deploying Oracle Database Without Chef

  • Oracle Compute Cloud Service instances. See the tutorial Creating a Single Instance Using the Oracle Compute Cloud Service Web Console.
  • Operating systems on your Oracle Compute Cloud Service instances:
    • Oracle Database 10.2.0.5: Oracle Linux 5.11
    • Oracle Database 11.2.0.4 and later: Oracle Linux 5.11 or Oracle Linux 6.6
  • Storage volumes attached to the created instance:
    • 30 GB storage volume mounted on the /u01 directory for the Oracle Home
    • 10 GB storage volume mounted on /u02 for the data files
    • 20 GB storage volume mounted on /u03 for the Flash Recovery Area
    • 10 GB storage volume mounted on /u04 for the Redo Logs
  • Scripts, cookbooks, and recipes to install the Chef server and Oracle databases. You can access the scripts, cookbooks, and recipes either from a GitHub repository or from Oracle Technology Network (OTN).

Requirements for Deploying Oracle Database with Chef

  • A minimum of two Oracle Compute Cloud Service instances, one to deploy the Chef server and another to bootstrap the Chef client. See the tutorial Creating Oracle Compute Cloud Service Instances Using an Orchestration.
  • Operating systems on your Oracle Compute Cloud Service instances:
    • Chef server: Oracle Linux 6.6
    • Chef client, Oracle Database 10.2.0.5: Oracle Linux 5.11
    • Chef client, Oracle Database 11.2.0.4 and later: Oracle Linux 5.11 or Oracle Linux 6.6
  • Storage volumes attached to the created instance:
    • 30 GB storage volume mounted on the /u01 directory for the Oracle Home
    • 10 GB storage volume mounted on /u02 for the data files
    • 20 GB storage volume mounted on /u03 for the Flash Recovery Area
    • 10 GB storage volume mounted on /u04 for the Redo Logs
  • Scripts, cookbooks, and recipes to install the Chef server and Oracle databases. You can access the scripts, cookbooks, and recipes either from a GitHub repository or from Oracle Technology Network (OTN).
 

Deploying a Standalone Oracle Database 10.2.0.5

You can deploy a standalone Oracle Database 10.2.0.5 server on Oracle Compute Cloud Service instances by downloading and installing the installer binaries.

 

Performing Preinstallation Tasks

  • Download the Oracle Database 10.2.0.5 installer.
  • Download the latest OPatch patching tool.
  • Download the recommended patch from My Oracle Support.
  • Connect to the Oracle Compute Cloud Service environment by using an SSH.
  • Install the Oracle RDBMS prerequisites.
  • Transfer the downloaded installer and patches to the Oracle Compute Cloud Service instance.
  • Mount the attached storage volumes.

Downloading the Oracle Database 10.2.0.5 Installer

The software is available as a media or FTP request for those customers who own a valid Oracle Database product license for any edition.

  1. Request access to these releases. See Oracle Support Document 1071023.1 (Requesting Physical Shipment or Download URL for Software Media) on My Oracle Support.
  2. On your local machine, create the db directory:
    mkdir /scratch/db
  3. Download the installer to /scratch/db.
  4. Ensure that the following files are downloaded:
    • /scratch/db/B24792-01_1of5.zip
    • /scratch/db/V21262-01.zip

Downloading the OPatch Tool

  1. Open a web browser and go to:

    https://updates.oracle.com/download/6880880.html

  2. Select Oracle 10.2.0.0.0 from the Select a Release list.
  3. Select Linux x86-64 from the Platform or Language list.
  4. Ensure that the path to the downloaded file is /scratch/db/p6880880_102000_Linux-x86-64.zip,and then click Download.

Downloading the Recommended Patch

The patch is available as a compressed file for those customers who have valid My Oracle Support credentials.

  1. In your web browser, go to the home page of the 16619894 patch, and provide your My Oracle Support credentials.
  2. Select Linux x86-64 from the Platform list.
  3. Ensure that the path to the downloaded patch is /scratch/db/p16619894_10205_Linux-x86-64.zip,and click the Download.

Connecting to the Oracle Compute Cloud Service Environment Using SSH

You access the instance from your local machine by using the ssh command in a UNIX command shell or from Windows by using Putty.

  1. Sign in to the My Services application at http://cloud.oracle.com/sign_in. On the My Services Dashboard, click Consoles and select Oracle Compute Cloud Service. On the Oracle Compute Cloud Service Console, click the name of the instance and note down the IP address that appears in the instance details page.
  2. In a command shell, run the ssh utility:
    $> ssh -i path_to_SSH_private_key opc@IP_address_of_instance

    In the preceding command:

    • path_to_SSH_private_key is the path to the SSH private key file that matches the public key used when your instance was created.
    • IP_address_of_instance is the public IP address of the instance in n.n.n.n format.
    • opc is the user account.

      Note: This step works only in Oracle-provided instances. You may have a different user provisioned in your custom instances.

      For example:

      $> ssh -i keys/id_rsa opc@192.0.2.100
  3. If this is the first time that you're connecting to the instance, confirm the RSA key fingerprint of the instance. In response to the prompts in the ssh utility, enter yes, and then enter the passphrase for the SSH key (if you created a passphrase).

Installing the Oracle RDBMS Prerequisites

  1. By using your SSH key, log on to the Oracle Compute Cloud Service instance. See "Connecting to the Oracle Compute Cloud Service Instance Using SSH" in Performing Preinstallation Tasks in this tutorial.
  2. Install the prerequisites by using yum:
    sudo yum install -y oracle-validated
    View Expected Output

Transferring the Downloaded Installer and Patches to the Oracle Compute Cloud Service VM

  1. Create a directory to save the binaries, and then change the owner of the directory to the oracle user:
    sudo su -
    mkdir /scratch
    mkdir /scratch/db
    chmod -R 777 /scratch/db
    sudo chown -R oracle:oinstall /scratch/
  2. On your local machine, copy the downloaded binaries to the Oracle Compute Cloud Service instance:
    scp -i path_to_SSH_private_key /scratch/db/B24792-01_1of5.zip opc@IP_address_of_VM:/scratch/db
    scp -i path_to_SSH_private_key /scratch/db/V21262-01.zip opc@IP_address_of_VM:/scratch/db
    scp -i path_to_SSH_private_key /scratch/db/p6880880_102000_Linux-x86-64.zip opc@IP_address_of_VM:/scratch/db
    scp -i path_to_SSH_private_key /scratch/db/p16619894_10205_Linux-x86-64.zip opc@IP_address_of_VM:/scratch/db

    In the preceding command:

    • path_to_SSH_private_key is the path to the SSH private key file that matches the public key used when your instance was created.
    • opc is the user account.

Mounting the Attached Additional Storage Volumes

  1. On the Oracle Compute Cloud Service instance, create the mount directories:
    mkdir /u01
    mkdir /u02
    mkdir /u03
    mkdir /u04
  2. List the partition tables of the attached storage volumes:
    sudo su -
    fdisk -l
    

    The four storage volumes aren’t partitioned.

    View Expected Output

    In the previous output:

    • /dev/xvda volume is for the operating system.
    • /dev/xvdb volume is for the data files.
    • /dev/xvdc volume is for the Flash Recovery Area.
    • /dev/xvdd volume is for the Oracle Home.
    • /dev/xvde volume is for the Redo Logs.
  3. Partition the /dev/xvdb storage volume:
    fdisk /dev/xvdb
  4. At the prompt, enter o, n, p, 1, press Enter twice, and then enter w in sequence.
  5. Repeat Steps 3 and 4 for the xvdc, xvdd, and xvde volumes.
  6. View the partitioned volumes:
    fdisk -l
    View Expected Output
  7. Create file system for each volume:
    mkfs.ext4 -L DB_DATA /dev/xvdb1
    mkfs.ext4 -L DB_FRA /dev/xvdc1
    mkfs.ext4 -L DB_BITS /dev/xvdd1
    mkfs.ext4 -L DB_REDO /dev/xvde1
  8. Add the mount point entries to /etc/fstab to make mounts persistent between reboots:
    echo "LABEL=DB_BITS /u01 ext4 defaults 0 0" >> /etc/fstab
    echo "LABEL=DB_DATA /u02 ext4 defaults 0 0" >> /etc/fstab
    echo "LABEL=DB_FRA /u03 ext4 defaults 0 0" >> /etc/fstab
    echo "LABEL=DB_REDO /u04 ext4 defaults 0 0" >> /etc/fstab
  9. Mount the file systems:
    mount -a
  10. Verify the mounted file systems:
    df -h
    View Expected Output
 

Installing Oracle Database 10.2.0.5 and Creating a Sample Database

  1. Log on to the Oracle Compute Cloud Service instance by using your SSH key. See "Connecting to the Oracle Compute Cloud Service Instance Using SSH" in Performing Preinstallation Tasks in this tutorial.
  2. Extract the binaries for the Oracle Home and all other relevant patches:
    sudo su - oracle
    cd /scratch/db
    unzip -d /scratch/db/ora10201 /scratch/db/B24792-01_1of5.zip
    unzip -d /scratch/db /scratch/db/V21262-01.zip
    unzip -d /scratch/db/ora10205 /scratch/db/p8202632_10205_Linux-x86-64.zip
    unzip -d /scratch/db /scratch/db/p16619894_10205_Linux-x86-64.zip
    exit
  3. Install the Oracle Home binaries:
    sudo mkdir -p /u01/app
    sudo chown oracle:oinstall /u01/app
    sudo su -
    sudo echo "inventory_loc=/u01/app/oraInventory" >> /etc/oraInst.loc
    sudo echo "inst_group=oinstall" >> /etc/oraInst.loc
    sudo chown oracle:oinstall /etc/oraInst.loc
    sudo chmod 664 /etc/oraInst.loc
    sudo su - oracle
    cd /scratch/db/ora10201/database
    ./runInstaller -ignoreSysPrereqs -silent FROM_LOCATION="/scratch/db/ora10201/database/stage/products.xml" ORACLE_HOME="/u01/app/oracle/product/10.2.0/dbhome_1" ORACLE_HOME_NAME="OraDb10g_home1" TOPLEVEL_COMPONENT='{"oracle.server","10.2.0.1.0"}' INSTALL_TYPE="EE" n_configurationOption=3
    exit
    sudo /u01/app/oracle/product/10.2.0/dbhome_1/root.sh
  4. The root.sh script prompts you to specify the full path of the local bin directory. For the purpose of this tutorial, press Enter.
  5. Patch the Oracle Home to the 10.2.0.5 version:
    sudo su - oracle
    cd /scratch/db/ora10205/Disk1
    ./runInstaller -ignoreSysPrereqs -silent FROM_LOCATION="/scratch/db/ora10205/Disk1/stage/products.xml" ORACLE_HOME="/u01/app/oracle/product/10.2.0/dbhome_1" ORACLE_HOME_NAME="OraDb10g_home1" TOPLEVEL_COMPONENT='{"oracle.patchset.db","10.2.0.5.0"}' DECLINE_SECURITY_UPDATES=TRUE
    exit
    sudo /u01/app/oracle/product/10.2.0/dbhome_1/root.sh 
  6. Install the latest OPatch tool, and apply the corresponding Patch Set Update file. At the opatch command prompt to enter your My Oracle Support credentials, press Enter, and then enter y at the Is the local system ready for patching? command prompt.
    sudo su - oracle
    export ORACLE_HOME=/u01/app/oracle/product/10.2.0/dbhome_1
    cd $ORACLE_HOME
    unzip -o /scratch/db/p6880880_102000_Linux-x86-64.zip
    cd /scratch/db/16619894
    $ORACLE_HOME/OPatch/opatch apply
    exit
  7. Create a sample database as the opc user:
    sudo mkdir -p /u02/app/oracle/oradata
    sudo mkdir -p /u03/app/oracle/fast_recovery_area
    sudo chown oracle:oinstall /u02/app/oracle/oradata
    sudo chown oracle:oinstall /u03/app/oracle/fast_recovery_area
    sudo su - oracle
    export ORACLE_HOME=/u01/app/oracle/product/10.2.0/dbhome_1
    export ORACLE_BASE=/u01/app/oracle
    $ORACLE_HOME/bin/dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname orcl -sid orcl -responseFile NO_VALUE -characterSet AL32UTF8 -memoryPercentage 50 -emConfiguration NONE -datafileDestination /u02/app/oracle/oradata -recoveryAreaDestination /u03/app/oracle/fast_recovery_area
    exit
  8. Create a default listener that will listen on the internal IP address at port 1521:
    sudo su - oracle
    export ORACLE_HOME=/u01/app/oracle/product/10.2.0/dbhome_1
    export ORACLE_BASE=/u01/app/oracle
    $ORACLE_HOME/bin/lsnrctl start
    exit
 

Validating the Database Server Installation

Log on to the database and validate the database instance:

sudo su - oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/dbhome_1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=orcl
$ORACLE_HOME/bin/sqlplus / as sysdba
select * from v$instance;
View Expected Output
 

Deploying a Standalone Oracle Database 10.2.0.5 by Using Chef

You can deploy a single-node Oracle Database 10.2.0.5 server on Oracle Compute Cloud Service instances by using Chef.

 

Performing Preinstallation Tasks

  • Download the Oracle Database 10.2.0.5 installer.
  • Download the latest OPatch patching tool.
  • Download the recommended patch from My Oracle Support.
  • Connect to the Oracle Compute Cloud Service environments by using an SSH.
  • Set up the Chef server.
  • Transfer the downloaded installer and patches to the Oracle Compute Cloud Service instance.
  • Mount the attached storage volumes.

Downloading the Oracle Database 10.2.0.5 Installer

The software is available as a media or FTP request for those customers who own a valid Oracle Database product license for any edition.

  1. Request access to these releases. See Oracle Support Document 1071023.1 (Requesting Physical Shipment or Download URL for Software Media) on My Oracle Support.
  2. On your local UNIX-based or Linux machine, create the db directory:
    mkdir /scratch/db
  3. Download the installer to /scratch/db.
  4. Ensure that the following files are downloaded:
    • /scratch/db/B24792-01_1of5.zip
    • /scratch/db/V21262-01.zip

Downloading the OPatch Tool

  1. Open a web browser and go to:

    https://updates.oracle.com/download/6880880.html

  2. Select Oracle 10.2.0.0.0 from the Select a Release list.
  3. Select Linux x86-64 from the Platform or Language list.
  4. Ensure that the path to the downloaded file is /scratch/db/p6880880_102000_Linux-x86-64.zip,and then click Download.

Downloading the Recommended Patch

The patch is available as a compressed file for those customers who have valid My Oracle Support credentials.

  1. In your web browser, go to the home page of the 16619894 patch, and provide your My Oracle Support credentials.
  2. Select Linux x86-64 from the Platform list.
  3. Ensure that the path to the downloaded patch is /scratch/db/p16619894_10205_Linux-x86-64.zip,and click the Download.

Connecting to the Oracle Compute Cloud Service Environment Using SSH

You access the instance from your local machine by using the ssh command in a UNIX command shell or from Windows by using Putty.

  1. Sign in to the My Services application at http://cloud.oracle.com/sign_in. On the My Services Dashboard, click Consoles and select Oracle Compute Cloud Service. On the Oracle Compute Cloud Service Console, click the name of the instance and note down the IP address that appears in the instance details page.
  2. In a command shell, run the ssh utility:
    $> ssh -i path_to_SSH_private_key opc@IP_address_of_instance

    In the preceding command:

    • path_to_SSH_private_key is the path to the SSH private key file that matches the public key used when your instance was created.
    • IP_address_of_instance is the public IP address of the instance in n.n.n.n format.
    • opc is the user account.

      Note: This step works only in Oracle-provided instances. You may have a different user provisioned in your custom instances.

      For example:

      $> ssh -i keys/id_rsa opc@192.0.2.100
  3. If this is the first time that you're connecting to the instance, confirm the RSA key fingerprint of the instance. In response to the prompts in the ssh utility, enter yes, and then enter the passphrase for the SSH key (if you created a passphrase).

Setting Up the Chef Server

If you’re using Chef to deploy Oracle Database 10.2.0.5, then set up the Chef server and clone the GitHub repository. See the tutorial Deploying Chef Server on Oracle Compute Cloud Service Instances.

Transferring the Downloaded Installer and Patches to the Chef Server Instance

On your local machine, copy the downloaded binaries to the Oracle Compute Cloud Service instance that’s running the Chef server:
scp -i path_to_SSH_private_key /scratch/db/B24792-01_1of5.zip opc@IP_address_of_Chef_Server_VM:/var/www/files
scp -i path_to_SSH_private_key /scratch/db/V21262-01.zip opc@IP_address_of_Chef_Server_VM:/var/www/files
scp -i path_to_SSH_private_key /scratch/db/p6880880_102000_Linux-x86-64.zip opc@IP_address_of_Chef_Server_VM:/var/www/files
scp -i path_to_SSH_private_key /scratch/db/p16619894_10205_Linux-x86-64.zip opc@IP_address_of_Chef_Server_VM:/var/www/files

In the preceding command:

  • path_to_SSH_private_key is the path to the SSH private key file that matches the public key used when your instance was created.
  • IP_address_of_Chef_Server_VM is the public IP address of the Chef server instance.
  • opc is the user account.

Mounting the Attached Additional Storage Volumes

  1. Using SSH, log on to the Oracle Compute Cloud Service instance that you designated as the Chef client, and create the mount directories:
    sudo mkdir /u01
    sudo mkdir /u02
    sudo mkdir /u03
    sudo mkdir /u04
  2. List the partition tables of the attached storage volumes:
    sudo su -
    fdisk -l

    The four storage volumes aren’t partitioned.

    View Expected Output

    In the previous output:

    • /dev/xvda volume is for the operating system.
    • /dev/xvdb volume is for the data files.
    • /dev/xvdc volume is for the Flash Recovery Area.
    • /dev/xvdd volume is for the Oracle Home.
    • /dev/xvde volume is for the Redo Logs.
  3. Partition the /dev/xvdb storage volume:
    fdisk /dev/xvdb
  4. At the prompt, enter o, n, p, 1, press Enter twice, and then enter w in sequence.
  5. Repeat Steps 3 and 4 for the xvdc, xvdd, and xvde volumes.
  6. View the partitioned volumes:
    fdisk -l
    View Expected Output
  7. Create file system for each volume:
    mkfs.ext4 -L DB_DATA /dev/xvdb1
    mkfs.ext4 -L DB_FRA /dev/xvdc1
    mkfs.ext4 -L DB_BITS /dev/xvdd1
    mkfs.ext4 -L DB_REDO /dev/xvde1
  8. Add the mount point entries to /etc/fstab to make mounts persistent between reboots:
    echo "LABEL=DB_BITS /u01 ext4 defaults 0 0" >> /etc/fstab
    echo "LABEL=DB_DATA /u02 ext4 defaults 0 0" >> /etc/fstab
    echo "LABEL=DB_FRA /u03 ext4 defaults 0 0" >> /etc/fstab
    echo "LABEL=DB_REDO /u04 ext4 defaults 0 0" >> /etc/fstab
  9. Mount the file systems:
    mount -a
  10. Verify the mounted file systems:
    df -h
    View Expected Output
 

Deploying Oracle Database 10.2.0.5

  1. Ensure that the Oracle Compute Cloud Service instances are created. See the tutorial Creating Oracle Compute Cloud Service Instances Using an Orchestration.
  2. Use SSH to connect to the Chef server instance. See "Connecting to the Oracle Compute Cloud Service Instance Using SSH" in Performing Preinstallation Steps in this tutorial.
  3. Prepare the environment. See the following sections in the tutorial Deploying Chef Server on Oracle Compute Cloud Service Instances:
    • "Installing the git Client" (Install it on your Oracle Compute Cloud Service instance where the Chef server should run.)
    • "Configuring a Passwordless SSH Connection”
    • "Setting Up the Chef Server" (step 2, clone the GitHub repository)
      Alternatively, you can download the scripts that are required to set up the Chef server from the following link:
      http://www.oracle.com/technetwork/topics/cloud/whatsnew/compute-cloud-service-2760092.html
    • "Setting Up the Chef Server" (step 5, install the Chef server)
  4. Check out the Oracle Database recipe from the GitHub repository:
    cd ~/compute-cloud-service-demos/
    git checkout chef-oracle-database

    The command checks out all cookbooks, roles and environments required to deploy Oracle Database 10.2.0.5.

    Alternatively, you can download the scripts that are required to set up the Oracle Database 10.2.0.5 from the following link:

    http://www.oracle.com/technetwork/topics/cloud/whatsnew/compute-cloud-service-2760092.html

    Unpack the scripts to the compute-cloud-service-demos folder:

    tar -xvzf chef-oracle-database-compute-cloud-service-demos.tgz -C <path to the compute-cloud-service-demos folder>
  5. Open the src/chef-repo/cookbooks/oracle-database/attributes/default.rb file in an editor.
  6. For the csi and email attributes, enter your valid Customer Support Identifier (CSI) and email address:
    default['oracle']['csi'] = '<Customer CSI>'
    default['oracle']['email']  = '<Customer Email>'

    You can modify the other attributes based on your requirements.

  7. 9. Verify that the following attribute values match the installer and patch file names, and then save and close the file:
    default['oracle']['db_installer_zip'] = 'B24792-01_1of5.zip'
    default['oracle']['patch_installer_zip'] = 'V21262-01.zip'
    default['oracle']['patch_installer_inner_zip'] = 'p8202632_10205_Linux-x86-64.zip'
    default['oracle']['opatch_installer_zip'] = 'p6880880_102000_Linux-x86-64.zip'
    default['oracle']['psu_installer_zip'] = 'p16619894_10205_Linux-x86-64.zip'
  8. Upload the checked-out cookbooks, roles, and environments to the Chef server:
    mkdir ../chef-repo/
    cp -rp src/chef-repo/* ../chef-repo/
    knife cookbook upload -a
    knife upload /roles
    knife upload /environments
  9. Verify that you updated the permissions on your Chef client instance and that you bootstrapped the instance. See "Bootstrapping the Chef Clients" and "Updating Node Permissions" in the tutorial Deploying Chef Server on Oracle Compute Cloud Service Instances.
  10. Add run-list items to the client. (Run-list is an ordered list of roles or recipes or both that is run in the exact defined order.)
    knife node run_list add target.instance.dns.name 'role[oracle_database_10205]'

    In the previous example, target.instance.dns.name is the domain name system (DNS) name of the Oracle Compute Cloud Service instance (running the Chef client, and that you've bootstrapped) where Oracle Database 10.2.0.5 will be deployed.

    View Expected Output
  11. Deploy Oracle Database 10.2.0.5 on the bootstrapped client instance:
    knife ssh -x opc 'role:oracle_database_10205' 'sudo chef-client'

    After the Oracle Database 10.2.0.5 deployment is completed, the following message is displayed:

    Chef Client finished, <x/y> resources updated in <n> seconds
 

Validating the Database Server Installation

Log on to the database and validate the database instance:

sudo su - oracle
. oraenv
ORACLE_SID = [oracle] ? orcl 
The Oracle base has been set to /u01/app/oracle 
$> sqlplus / as sysdba
SQL> select * from v$instance;
View Expected Output
 

Deploying a Standalone Oracle Database 11.2.0.4 by Using Chef

You can deploy a single-node Oracle Database 11.2.0.4 server on Oracle Compute Cloud Service instances by using Chef.

 

Performing Preinstallation Tasks

  • Download the Oracle Database 11.2.0.4 installer and the patch files from My Oracle Support.
  • Download the latest OPatch patching tool from My Oracle Support.
  • Connect to the Oracle Compute Cloud Service environments by using an SSH.
  • Set up the Chef server.
  • Transfer the downloaded installer and patches to the Oracle Compute Cloud Service instance.
  • Mount the attached storage volumes.

Downloading the Oracle Database 11.2.0.4 Installer and Patch Files

  1. On your local UNIX-based or Linux machine, create the db directory:
    mkdir /scratch/db
  2. Open a web browser and download the following files from My Oracle Support to /scratch/db by providing your My Oracle Support credentials.

Downloading the OPatch Tool

  1. Open a web browser and go to:

    https://updates.oracle.com/download/6880880.html

  2. Select Oracle 11.2.0.0.0 from the Select a Release list.
  3. Select Linux x86-64 from the Platform or Language list.
  4. Ensure that the path to the downloaded file is /scratch/db/p6880880_112000_Linux-x86-64.zip,and then click Download.

Connecting to the Oracle Compute Cloud Service Environment Using SSH

You access the instance from your local machine by using the ssh command in a UNIX command shell or from Windows by using Putty.

  1. Sign in to the My Services application at http://cloud.oracle.com/sign_in. On the My Services Dashboard, click Consoles and select Oracle Compute Cloud Service. On the Oracle Compute Cloud Service Console, click the name of the instance and note down the IP address that appears in the instance details page.
  2. In a command shell, run the ssh utility:
    $> ssh -i path_to_SSH_private_key opc@IP_address_of_instance

    In the preceding command:

    • path_to_SSH_private_key is the path to the SSH private key file that matches the public key used when your instance was created.
    • IP_address_of_instance is the public IP address of the instance in n.n.n.n format.
    • opc is the user account.

      Note: This step works only in Oracle-provided instances. You may have a different user provisioned in your custom instances.

      For example:

      $> ssh -i keys/id_rsa opc@192.0.2.100
  3. If this is the first time that you're connecting to the instance, confirm the RSA key fingerprint of the instance. In response to the prompts in the ssh utility, enter yes, and then enter the passphrase for the SSH key (if you created a passphrase).

Setting Up the Chef Server

If you’re using Chef to deploy Oracle Database 11.2.0.4, then set up the Chef server and clone the GitHub repository. See the tutorial Deploying Chef Server on Oracle Compute Cloud Service Instances.

Transferring the Downloaded Installer and Patches to the Chef Server Instance

On your local machine, copy the downloaded binaries to the Oracle Compute Cloud Service instance that’s running the Chef server:

scp -i path_to_SSH_private_key /scratch/db/p13390677_112040_Linux-x86-64_1of7.zip opc@IP_address_of_Chef_Server_instance:/var/www/files
scp -i path_to_SSH_private_key /scratch/db/p13390677_112040_Linux-x86-64_2of7.zip opc@IP_address_of_Chef_Server_instance:/var/www/files
scp -i path_to_SSH_private_key /scratch/db/p20299013_112040_Linux-x86-64.zip opc@IP_address_of_Chef_Server_instance:/var/www/files
scp -i path_to_SSH_private_key /scratch/db/p20406239_112040_Linux-x86-64.zip opc@IP_address_of_Chef_Server_instance:/var/www/files
scp -i path_to_SSH_private_key /scratch/db/p6880880_112000_Linux-x86-64.zip opc@IP_address_of_Chef_Server_instance:/var/www/files

In the preceding command:

  • path_to_SSH_private_key is the path to the SSH private key file that matches the public key used when your instance was created.
  • IP_address_of_Chef_Server_VM is the public IP address of the Chef server instance.
  • opc is the user account.

Mounting the Attached Additional Storage Volumes

  1. Using SSH, log on to the Oracle Compute Cloud Service instance that you designated as the Chef client, and create the mount directories:
    sudo mkdir /u01
    sudo mkdir /u02
    sudo mkdir /u03
    sudo mkdir /u04
  2. List the partition tables of the attached storage volumes:
    sudo su -
    fdisk -l  

    The four storage volumes aren’t partitioned.

    View Expected Output

    In the previous output:

    • /dev/xvda volume is for the operating system.
    • /dev/xvdb volume is for the data files.
    • /dev/xvdc volume is for the Flash Recovery Area.
    • /dev/xvdd volume is for the Oracle Home.
    • /dev/xvde volume is for the Redo Logs.
  3. Partition the /dev/xvdb storage volume:
    fdisk /dev/xvdb
  4. At the prompt, enter o, n, p, 1, press Enter twice, and then enter w in sequence.
  5. Repeat Steps 3 and 4 for the xvdc, xvdd, and xvde volumes.
  6. View the partitioned volumes:
    fdisk -l
    View Expected Output
  7. Create file system for each volume:
    mkfs.ext4 -L DB_DATA /dev/xvdb1
    mkfs.ext4 -L DB_FRA /dev/xvdc1
    mkfs.ext4 -L DB_BITS /dev/xvdd1
    mkfs.ext4 -L DB_REDO /dev/xvde1
  8. Add the mount point entries to /etc/fstab to make mounts persistent between reboots:
    echo "LABEL=DB_BITS /u01 ext4 defaults 0 0" >> /etc/fstab
    echo "LABEL=DB_DATA /u02 ext4 defaults 0 0" >> /etc/fstab
    echo "LABEL=DB_FRA /u03 ext4 defaults 0 0" >> /etc/fstab
    echo "LABEL=DB_REDO /u04 ext4 defaults 0 0" >> /etc/fstab
  9. Mount the file systems:
    mount -a
  10. Verify the mounted file systems:
    df -h
    View Expected Output
 

Deploying Oracle Database 11.2.0.4

  1. Ensure that the Oracle Compute Cloud Service instances are created. See the tutorial Creating Oracle Compute Cloud Service Instances Using an Orchestration.
  2. Use SSH to connect to the Chef server instance. See "Connecting to the Oracle Compute Cloud Service Instance Using SSH" in Performing Preinstallation Steps in this tutorial.
  3. Prepare the environment. See the following sections in the tutorial Deploying Chef Server on Oracle Compute Cloud Service Instances:
    • "Installing the git Client" (Install it on your Oracle Compute Cloud Service instance where the Chef server should run.)
    • "Configuring a Passwordless SSH Connection”
    • "Setting Up the Chef Server" (step 2, clone the GitHub repository)
      Alternatively, you can download the scripts that are required to set up the Chef server from the following link:
      http://www.oracle.com/technetwork/topics/cloud/whatsnew/compute-cloud-service-2760092.html
    • "Setting Up the Chef Server" (step 5, install the Chef server)
  4. Check out the Oracle Database recipe from the GitHub repository:
    cd ~/compute-cloud-service-demos/
    git checkout chef-oracle-database

    The command checks out all cookbooks, roles and environments required to deploy Oracle Database 11.2.0.4.

    Alternatively, you can download the scripts that are required to set up the Oracle Database 11.2.0.4 from the following link:
    http://www.oracle.com/technetwork/topics/cloud/whatsnew/compute-cloud-service-2760092.html
    Unpack the scripts to the compute-cloud-service-demos folder:

    tar -xvzf chef-oracle-database-compute-cloud-service-demos.tgz -C <path to the compute-cloud-service-demos folder>
  5. Open the src/chef-repo/cookbooks/oracle-database/attributes/default.rb file in an editor.
  6. For the csi and email attributes, enter your valid Customer Support Identifier (CSI) and email address:
    default['oracle']['csi'] = '<Customer CSI>'
    default['oracle']['email']  = '<Customer Email>'

    You can modify the other attributes based on your requirements.

  7. Verify that the attribute values match the installer and patch file names, and then save and close the file.
  8. Upload the checked-out cookbooks, roles, and environments to the Chef server:
    mkdir ../chef-repo/
    cp -rp src/chef-repo/* ../chef-repo/
    knife cookbook upload -a
    knife upload /roles
    knife upload /environments
  9. Verify that you updated the permissions on your Chef client instance and that you bootstrapped the instance. See "Bootstrapping the Chef Clients" and "Updating Node Permissions" in the tutorial Deploying Chef Server on Oracle Compute Cloud Service Instances.
  10. Add run-list items to the client. (Run-list is an ordered list of roles or recipes or both that is run in the exact defined order.)
    knife node run_list add target.instance.dns.name 'role[oracle_database_11204]'

    In the previous example, target.instance.dns.name is the domain name system (DNS) name of the Oracle Compute Cloud Service instance (running the Chef client, and that you've bootstrapped) where Oracle Database 11.2.0.4 will be deployed.

    View Expected Output
  11. Deploy Oracle Database 11.2.0.4 on the bootstrapped client instance:
    knife ssh -x opc 'role:oracle_database_11204' 'sudo chef-client'

    After the Oracle Database 11.2.0.4 deployment is completed, the following message is displayed:

    Chef Client finished, <x/y> resources updated in <n> seconds
 

Validating the Database Server Installation

Log on to the database and validate the database instance:

sudo su - oracle
. oraenv
ORACLE_SID = [oracle] ? orcl 
The Oracle base has been set to /u01/app/oracle 
$> sqlplus / as sysdba
SQL> select * from v$instance;
View Expected Output
 

Deploying a Standalone Oracle Database 12.1.0.2 by Using Chef

You can deploy a single-node Oracle Database 12.1.0.2 server on Oracle Compute Cloud Service instances by using Chef.

 

Performing Preinstallation Tasks

  • Download the Oracle Database 12.1.0.2 installer and the patch files from My Oracle Support.
  • Download the latest OPatch patching tool from My Oracle Support.
  • Connect to the Oracle Compute Cloud Service environments by using an SSH.
  • Set up the Chef server.
  • Transfer the downloaded installer and patches to the Oracle Compute Cloud Service instance.
  • Mount the attached storage volumes.

Downloading the Oracle Database 12.1.0.2 Installer and Patch Files

  1. On your local UNIX-based or Linux machine, create the db directory:
    mkdir /scratch/db
  2. Open a web browser and download the following files from My Oracle Support to /scratch/db by providing your My Oracle Support credentials.

Downloading the OPatch Tool

  1. Open a web browser and go to:

    https://updates.oracle.com/download/6880880.html

  2. Select Oracle 12.1.0.1.0 from the Select a Release list.
  3. Select Linux x86-64 from the Platform or Language list.
  4. Ensure that the path to the downloaded file is /scratch/db/p6880880_121010_Linux-x86-64.zip,and then click Download.

Connecting to the Oracle Compute Cloud Service Environment Using SSH

You access the instance from your local machine by using the ssh command in a UNIX command shell or from Windows by using Putty.

  1. Sign in to the My Services application at http://cloud.oracle.com/sign_in. On the My Services Dashboard, click Consoles and select Oracle Compute Cloud Service. On the Oracle Compute Cloud Service Console, click the name of the instance and note down the IP address that appears in the instance details page.
  2. In a command shell, run the ssh utility:
    $> ssh -i path_to_SSH_private_key opc@IP_address_of_instance

    In the preceding command:

    • path_to_SSH_private_key is the path to the SSH private key file that matches the public key used when your instance was created.
    • IP_address_of_instance is the public IP address of the instance in n.n.n.n format.
    • opc is the user account.

      Note: This step works only in Oracle-provided instances. You may have a different user provisioned in your custom instances.

      For example:

      $> ssh -i keys/id_rsa opc@192.0.2.100
  3. If this is the first time that you're connecting to the instance, confirm the RSA key fingerprint of the instance. In response to the prompts in the ssh utility, enter yes, and then enter the passphrase for the SSH key (if you created a passphrase).

Setting Up the Chef Server

If you’re using Chef to deploy Oracle Database 12.1.0.2, then set up the Chef server and clone the GitHub repository. See the tutorial Deploying Chef Server on Oracle Compute Cloud Service Instances.

Transferring the Downloaded Installer and Patches to the Chef Server Instance

On your local machine, copy the downloaded binaries to the Oracle Compute Cloud Service instance that’s running the Chef server:

scp -i path_to_SSH_private_key /scratch/db/p17694377_121020_Linux-x86-64_1of8.zip opc@IP_address_of_Chef_Server_instance:/var/www/files
scp -i path_to_SSH_private_key /scratch/db/p17694377_121020_Linux-x86-64_2of8.zip opc@IP_address_of_Chef_Server_instance:/var/www/files
scp -i path_to_SSH_private_key /scratch/db/p17694377_121020_Linux-x86-64_3of8.zip opc@IP_address_of_Chef_Server_instance:/var/www/files
scp -i path_to_SSH_private_key /scratch/db/p20834538_121020_Linux-x86-64.zip opc@IP_address_of_Chef_Server_instance:/var/www/files
scp -i path_to_SSH_private_key /scratch/db/p6880880_121010_Linux-x86-64.zip opc@IP_address_of_Chef_Server_instance:/var/www/files

In the preceding command:

  • path_to_SSH_private_key is the path to the SSH private key file that matches the public key used when your instance was created.
  • IP_address_of_Chef_Server_VM is the public IP address of the Chef server instance.
  • opc is the user account.

Mounting the Attached Additional Storage Volumes

  1. Using SSH, log on to the Oracle Compute Cloud Service instance that you designated as the Chef client, and create the mount directories:
    sudo mkdir /u01
    sudo mkdir /u02
    sudo mkdir /u03
    sudo mkdir /u04
  2. List the partition tables of the attached storage volumes:
    sudo su -
    fdisk -l         

    The four storage volumes aren’t partitioned.

    View Expected Output

    In the previous output:

    • /dev/xvda volume is for the operating system.
    • /dev/xvdb volume is for the data files.
    • /dev/xvdc volume is for the Flash Recovery Area.
    • /dev/xvdd volume is for the Oracle Home.
    • /dev/xvde volume is for the Redo Logs.
  3. Partition the /dev/xvdb storage volume:
    fdisk /dev/xvdb
  4. At the prompt, enter o, n, p, 1, press Enter twice, and then enter w in sequence.
  5. Repeat Steps 3 and 4 for the xvdc, xvdd, and xvde volumes.
  6. View the partitioned volumes:
    fdisk -l
    View Expected Output
  7. Create file system for each volume:
    mkfs.ext4 -L DB_DATA /dev/xvdb1
    mkfs.ext4 -L DB_FRA /dev/xvdc1
    mkfs.ext4 -L DB_BITS /dev/xvdd1
    mkfs.ext4 -L DB_REDO /dev/xvde1
  8. Add the mount point entries to /etc/fstab to make mounts persistent between reboots:
    echo "LABEL=DB_BITS /u01 ext4 defaults 0 0" >> /etc/fstab
    echo "LABEL=DB_DATA /u02 ext4 defaults 0 0" >> /etc/fstab
    echo "LABEL=DB_FRA /u03 ext4 defaults 0 0" >> /etc/fstab
    echo "LABEL=DB_REDO /u04 ext4 defaults 0 0" >> /etc/fstab
  9. Mount the file systems:
    mount -a
  10. Verify the mounted file systems:
    df -h
    View Expected Output
 

Deploying Oracle Database 12.1.0.2

  1. Ensure that the Oracle Compute Cloud Service instances are created. See the tutorial Creating Oracle Compute Cloud Service Instances Using an Orchestration.
  2. Use SSH to connect to the Chef server instance. See "Connecting to the Oracle Compute Cloud Service Instance Using SSH" in Performing Preinstallation Steps in this tutorial.
  3. Prepare the environment. See the following sections in the tutorial Deploying Chef Server on Oracle Compute Cloud Service Instances:
    • "Installing the git Client" (Install it on your Oracle Compute Cloud Service instance where the Chef server should run.)
    • "Configuring a Passwordless SSH Connection”
    • "Setting Up the Chef Server" (step 2, clone the GitHub repository)
      Alternatively, you can download the scripts that are required to set up the Chef server from the following link:
      http://www.oracle.com/technetwork/topics/cloud/whatsnew/compute-cloud-service-2760092.html
    • "Setting Up the Chef Server" (step 5, install the Chef server)
  4. Check out the Oracle Database recipe from the GitHub repository:
    cd ~/compute-cloud-service-demos/
    git checkout chef-oracle-database

    The command checks out all cookbooks, roles and environments required to deploy Oracle Database 12.1.0.2.

    Alternatively, you can download the scripts that are required to set up the Oracle Database 12.1.0.2 from the following link:
    http://www.oracle.com/technetwork/topics/cloud/whatsnew/compute-cloud-service-2760092.html
    Unpack the scripts to the compute-cloud-service-demos folder:

    tar -xvzf chef-oracle-database-compute-cloud-service-demos.tgz -C <path to the compute-cloud-service-demos folder>
  5. Open the src/chef-repo/cookbooks/oracle-database/attributes/default.rb file in an editor.
  6. For the csi and email attributes, enter your valid Customer Support Identifier (CSI) and email address:
    default['oracle']['csi'] = '<Customer CSI>'
    default['oracle']['email']  = '<Customer Email>'

    You can modify the other attributes based on your requirements.

  7. Verify that the attribute values match the installer and patch file names, and then save and close the file.
  8. Upload the checked-out cookbooks, roles, and environments to the Chef server:
    mkdir ../chef-repo/
    cp -rp src/chef-repo/* ../chef-repo/
    knife cookbook upload -a
    knife upload /roles
    knife upload /environments
  9. Verify that you updated the permissions on your Chef client instance and that you bootstrapped the instance. See "Bootstrapping the Chef Clients" and "Updating Node Permissions" in the tutorial Deploying Chef Server on Oracle Compute Cloud Service Instances.
  10. Add run-list items to the client. (Run-list is an ordered list of roles or recipes or both that is run in the exact defined order.)
    knife node run_list add target.instance.dns.name 'role[oracle_database_12102]'

    In the previous example, target.instance.dns.name is the domain name system (DNS) name of the Oracle Compute Cloud Service instance (running the Chef client, and that you've bootstrapped) where Oracle Database 12.1.0.2 will be deployed.

    View Expected Output
  11. Deploy Oracle Database 12.1.0.2 on the bootstrapped client instance:
    knife ssh -x opc 'role:oracle_database_12102' 'sudo chef-client'

    After the Oracle Database 12.1.0.2 deployment is completed, the following message is displayed:

    Chef Client finished, <x/y> resources updated in <n> seconds
 

Validating Database Server Installation

Log on to the database and validate the database instance:

sudo su - oracle
. oraenv
ORACLE_SID = [oracle] ? orcl 
The Oracle base has been set to /u01/app/oracle 
$> sqlplus / as sysdba
SQL> select * from v$instance;
View Expected Output
 

Want to Learn More?

 

Credits

  • Lead Curriculum Developer: Anirban Ghosh
  • Other Contributors: Roland Koenn, Edward Huang, Irina Mok