TR-4996: Oracle SI Deployment and Protection in VCF with vVols
Allen Cao, Niyaz Mohamed, NetApp
The solution provides an overview and details for Oracle deployment and protection in VMware Cloud Foundation (VCF) with vSphere Virtual Volumes (vVols) as primary database storage and Oracle database in a single instance (SI) configuration..
Purpose
VMware vSphere Virtual Volumes (vVols) is a SAN/NAS management and integration framework that exposes virtual disks as native storage objects and enables array-based operations at the virtual disk level. In other words, vVols make SAN/NAS devices VM-aware and unlocks the ability to leverage array-based data services with a VM-centric approach at the granularity of a single virtual disk. vVols allows customers to leverage the unique capabilities of their current storage investments and transition without disruption to a simpler and more efficient operational model optimized for virtual environments that work across all storage types.
This documentation demonstrates the deployment and protection of an Oracle single instance database in a VMware Cloud Foundation environment with vVols as primary database storage in a NetApp ONTAP storage cluster. Oracle database is configured as if it is deployed in local file systems on a local storage system. This technical report focuses on steps in creating vVols in VCF for Oracle deployment. We also demonstrate how to use the NetApp SnapCenter UI tool to backup, restore, and clone an Oracle database for dev/test or other use cases for storage-efficient database operation in VCF.
This solution addresses the following use cases:
-
Oracle SI database deployment in VCF with vVols datastore on NetApp ONTAP AFF as primary database storage
-
Oracle database backup and restore in VCF with vVols datastore using NetApp SnapCenter UI tool
-
Oracle database clone for dev/test or other use cases in VCF with vVols datastore using NetApp SnapCenter UI tool
Audience
This solution is intended for the following people:
-
A DBA who would like to deploy Oracle in VCF with vVols datastore on NetApp ONTAP AFF as primary database storage
-
A database solution architect who would like to test Oracle workloads in VCF with vVols datastore on NetApp ONTAP AFF storage
-
A storage administrator who would like to deploy and manage an Oracle database deployed to VCF with vVols datastore on NetApp ONTAP AFF storage
-
An application owner who would like to stand up an Oracle database in VCF with vVol datastore
Solution test and validation environment
The testing and validation of this solution was performed in a lab environment with VCF with vVols datastore on NetApp ONTAP AFF storage that might not match the final deployment environment. For more information, see the section Key factors for deployment consideration.
Architecture
Hardware and software components
Hardware |
||
NetApp ONTAP AFF A300 |
Version 9.14.1P4 |
DS224 shelf with 24 NVMe disks, total capacity 35.2 TiB |
VMware VSphere cluster |
Version 8.02 |
12 CPU(s) x Intel® Xeon® Gold 5218 CPU @ 2.30GHz, 8 nodes (4 management and 4 workload domains) |
Software |
||
RedHat Linux |
RHEL-8.6, 4.18.0-372.9.1.el8.x86_64 kernel |
Hosting Oracle DB servers, deployed RedHat subscription for testing |
Windows Server |
2022 Standard, 10.0.20348 Build 20348 |
Hosting SnapCenter server |
Centos Linux |
CentOS Linux release 8.5.2111 |
Hosting Ansible controller |
Oracle Database |
Version 19.18 |
Applied RU patch p34765931_190000_Linux-x86-64.zip |
Oracle OPatch |
Version 12.2.0.1.36 |
Latest patch p6880880_190000_Linux-x86-64.zip |
SnapCenter Server |
Version 6.0 |
Workgroup deployment |
SnapCenter Plug-in for VMware vSphere |
Version 6.0 |
Deployed as an ova VM to vSphere cluster |
ONTAP tool for VMware vSphere |
Version 9.13 |
Deployed as an ova VM to vSphere cluster |
Open JDK |
Version java-11-openjdk-11.0.23.0.9-3.el8.x86_64 |
SnapCenter plugin requirement on DB VMs |
Oracle database configuration in VCF
Server |
Database |
DB Storage |
ora_01 |
NTAP1(NTAP1_pdb1,NTAP1_pdb2,NTAP1_pdb3) |
vVols datastores on NetApp ONTAP AFF A300 |
ora_02 |
NTAP2(NTAP2_pdb1,NTAP2_pdb2,NTAP2_pdb3), NTAP1CLN |
vVols datastores on NetApp ONTAP AFF A300 |
Key factors for deployment consideration
-
Protocol for vVols to ONTAP cluster connectivity. NFS or iSCSI are good choices. The performance levels are equivalent. In this solution demonstration, we used NFS as a storage protocol for vVols connectivity to the underlined ONTAP storage cluster. If VCF infrastructure supports, FC/FCoE, NVMe/FC protocols are also supported for vVols datastores on NetApp ONTAP.
-
Oracle storage layout on vVols datastores. In our tests and validations, we deployed three vVols datastores for Oracle binary, Oracle data, and Oracle log files. It's good practice to separate different types of Oracle files into their datastore so that database backup, recovery, or clone can be easily managed and executed. Create dedicate vVols for large databases and share vVols for smaller databases or databases with similar QoS profile.
-
Credential for ONTAP storage authentication. Only use ONTAP cluster-level credentials for the ONTAP storage cluster authentication, including SnapCenter connectivity to the ONTAP storage cluster or ONTAP tool connectivity to the ONTAP storage cluster.
-
Provision storage from vVols datastore to database VM. Add only one disk at a time to the database VM from the vVols datastore. Adding Multiple disks from vVols datastores at the same time is not supported at this time.
-
Database protection. NetApp provides a SnapCenter software suite for database backup, restore, and cloning with a user-friendly UI interface. NetApp recommends implementing such a management tool to achieve fast (under a minute) SnapShot backup, quick (minutes) database restore, and database clone.
Solution deployment
The following sections provide step-by-step procedures for Oracle 19c deployment in VCF with vVols datastores on NetApp ONTAP storage in an Oracle single instance configuration.
Prerequisites for deployment
Details
Deployment requires the following prerequisites.
-
A VMware VCF has been setup. For information or instruction on how to create a VCF, please refer to VMware documentation VMware Cloud Foundation Documentation.
-
Provision three Linux VMs, two VMs for Oracle database and one VM for Ansible controller within VCF workload domain. Provision one Windows server VM for running NetApp SnapCenter server. For information on setting up Ansible controller for automated Oracle database deployment, referring to following resources Getting Started with NetApp solution automation.
-
SnapCenter plugin version 6.0 for VMware vSphere has been deployed in VCF. Refer to following resources for the plugin deployment: SnapCenter Plug-in for VMware vSphere documentation.
-
ONTAP tool for VMware vSphere has been deployed in VCF. Refer to following resources for the ONTAP tool for VMware vSphere deployment: ONTAP tools for VMware vSphere documentation
Ensure that you have allocated at least 50G in Oracle VM root volume in order to have sufficient space to stage Oracle installation files. |
Create storage capability profile
Details
First, create a custom storage capability profile for the underlined ONTAP storage that is hosting the vVols datastore.
-
From vSphere client shortcuts, open NetApp ONTAP tool. Ensure that ONTAP storage cluster has been added to
Storage Systems
as part of ONTAP tool deployment.
-
Click on
Storage capability profile
to add a custom profile for Oracle. Name the profile and add a brief description. -
Choose storage controller category: performance, capacity, or hybrid.
-
Select the protocol.
-
Define a QoS policy if desired.
-
Additional storage attributes for the profile. Be sure that the encryption is enabled on the NetApp controller if you want to have the encryption capability or it may cause issues when applying the profile.
-
Review the summary and finish the storage capability profile creation.
Create and configure vVols datastore
Details
With the prerequisites completed, login to the VCF as an admin user via vSphere client, navigating to workload domain. Do not use built-in VMware storage option to create vVols. Instead, use NetApp ONTAP tool to create vVols. Following demonstrates the procedures to create and configure vVols.
-
The vVols creation workflow can be triggered either from ONTAP tool interface or from VCF workload domain cluster.
-
Filling in general information for datastore including provisioning destination, type, name, and protocol.
-
Select the custom storage capability profile created from previous step, the
Storage system
, andStorage VM
, where vVols are to be created. -
Choose
Create new volumes
, fill in the volume name and size and click onADD
thenNEXT
to move to the summary page.You could add more than one volume to a vVols datastore or span a vVols datastore volumes across ONTAP controller nodes for performance. -
Click
Finish
to create vVols datastore for Oracle binary. -
Repeat the same procedures to create vVols datastore for Oracle data and log.
Notice that when an Oracle database is cloned, an additional vVols for Data is added to the vVols list. |
Create VM storage policy based on storage capability profile
Details
Before provisioning storage from vVols datastore to database VM, add a VM storage policy based on storage capability profile created from previous step. Following are the procedures.
-
From vSphere client menus, open
Policies and Profiles
and highlightVM Storage Policies
. ClickCreate
to openVM Storage Policies
workflow. -
Name the VM storage policy.
-
In
Datastore specific rules
, checkEnable rules for "NetAPP.clustered.Data.ONTAP.VP.vvol" storage
-
For NetApp.clustered.Data.ONTAP.VP.vvol rules
Placement
, select the custom storage capacity profile created from the previous step. -
For NetApp.clustered.Data.ONTAP.VP.vvol rules
Replication
, chooseDisabled
if vVols are not replicated. -
Storage compatibility page displays the compatible vVols datastores in VCF environment.
-
Review and finish to create the VM Storage Policy.
-
Validate the VM Storage Policy just created.
Allocate disks to DB VM from vVols datastores and configure DB storage
Details
From vSphere client, add three disks from the vVols datastores to database VM by editing VM settings. Then, login to VM to format and mount the disks to mount points /u01, /u02, and /u03. The following demonstrates the exact steps and tasks.
-
Add a disk to VM for Oracle binary storage.
-
Add a disk to VM for Oracle data storage.
-
Add a disk to VM for Oracle log storage.
-
From VM
Edit Settings
,Advanced Parameters
, add Attributedisk.enableuuid
with ValueTRUE
. The VM needs to be down to add the advanced parameter. Setting this option enables SnapCenter to precisely identify the vVol in your environment. -
Now, restart the VM. Login to VM as an admin user via ssh to review the newly added disk drives.
[admin@ora_01 ~]$ sudo fdisk -l Disk /dev/sdb: 50 GiB, 53687091200 bytes, 104857600 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/sdc: 100 GiB, 107374182400 bytes, 209715200 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/sdd: 100 GiB, 107374182400 bytes, 209715200 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes . . .
-
Partition the drives as a primary and single partition by simply accepting the default choices.
sudo fdisk /dev/sdb
sudo fdisk /dev/sdc
sudo fdisk /dev/sdd
-
Format the partitioned disks as xfs file systems.
sudo mkfs.xfs /dev/sdb1
sudo mkfs.xfs /dev/sdc1
sudo mkfs.xfs /dev/sdd1
-
Mount the drives to mount point /u01, /u02, and /u03.
sudo mount -t xfs /dev/sdb1 /u01
sudo mount -t xfs /dev/sdc1 /u02
sudo mount -t xfs /dev/sdd1 /u03
[admin@ora_01 ~]$ df -h Filesystem Size Used Avail Use% Mounted on devtmpfs 7.7G 0 7.7G 0% /dev tmpfs 7.8G 0 7.8G 0% /dev/shm tmpfs 7.8G 782M 7.0G 10% /run tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup /dev/mapper/rhel-root 44G 19G 26G 43% / /dev/sda1 1014M 258M 757M 26% /boot tmpfs 1.6G 12K 1.6G 1% /run/user/42 tmpfs 1.6G 4.0K 1.6G 1% /run/user/1000 /dev/sdb1 50G 390M 50G 1% /u01 /dev/sdc1 100G 746M 100G 1% /u02 /dev/sdd1 100G 746M 100G 1% /u03
-
Add mount points to /etc/fstab so that disk drives will be mounted when VM reboots.
sudo vi /etc/fstab
[oracle@ora_01 ~]$ cat /etc/fstab # # /etc/fstab # Created by anaconda on Wed Oct 18 19:43:31 2023 # # Accessible filesystems, by reference, are maintained under '/dev/disk/'. # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info. # # After editing this file, run 'systemctl daemon-reload' to update systemd # units generated from this file. # /dev/mapper/rhel-root / xfs defaults 0 0 UUID=aff942c4-b224-4b62-807d-6a5c22f7b623 /boot xfs defaults 0 0 /dev/mapper/rhel-swap none swap defaults 0 0 /root/swapfile swap swap defaults 0 0 /dev/sdb1 /u01 xfs defaults 0 0 /dev/sdc1 /u02 xfs defaults 0 0 /dev/sdd1 /u03 xfs defaults 0 0
Oracle database deployment in VCF
Details
It's recommended to leverage NetApp automation toolkit to deploy Oracle in VCF with vVols. For detailed reference on executing Oracle automated deployment on xfs file systems, refer to TR-4992: Simplified, Automated Oracle Deployment on NetApp C-Series with NFS. Although the TR-4992 covers automated Oracle deployment on the NetApp C-Series with NFS, it's identical to Oracle deployment in VCF with vVols if bypassing NFS file systems mounting to database VM. We would simply skip that with specific tags. Following are step by step procedures.
-
Login to Ansible controller VM as admin user via ssh and clone a copy of automation toolkit for Oracle on NFS.
git clone https://bitbucket.ngage.netapp.com/scm/ns-bb/na_oracle_deploy_nfs.git
-
Stage the following Oracle installation files in /tmp/archive folder on database VM. The folder should allow all user access with 777 permission.
LINUX.X64_193000_db_home.zip p34765931_190000_Linux-x86-64.zip p6880880_190000_Linux-x86-64.zip
-
Configure deployment target file - hosts, global variables file - vars/vars.yml, and local DB VM variables file - host_vars/host_name.yml according to instructions in this section of TR-4992: Parameter files configuration. Comment out nfs_lif variable from local DB VM variable file.
-
Set up ssh keyless authentication between Ansible controller and database VMs, which requires to generate a ssh key pair and copy the public key to database VMs admin user root directory .ssh folder authorized_keys file.
ssh-keygen
-
From Ansible controller, cloned automation toolkit home directory /home/admin/na_oracle_deploy_nf, execute prerequisites playbook.
ansible-playbook -i hosts 1-ansible_requirements.yml
-
Execute Linux configuration playbook.
ansible-playbook -i hosts 2-linux_config.yml -u admin -e @vars/vars.yml
-
Execute Oracle deployment playbook.
ansible-playbook -i hosts 4-oracle_config.yml -u admin -e @vars/vars.yml --skip-tags "ora_mount_points,enable_dnfs_client"
-
Optionally, all above playbooks can be executed from a single playbook run as well.
ansible-playbook -i hosts 0-all_playbook.yml -u admin -e @vars/vars.yml --skip-tags "ora_mount_points,enable_dnfs_client"
-
Login to EM express to to validate Oracle after successful playbook execution.
-
Optionally, execute destroy playbook to remove database from DB VM.
ansible-playbook -i hosts 5-destroy.yml -u admin -e @vars/vars.yml
Oracle backup, restore, and clone in VCF with SnapCenter
SnapCenter Setup
Details
SnapCenter version 6 has many feature enhancements over version 5, including support for VMware vVols datastore. SnapCenter relies on a host-side plug-in on a database VM to perform application-aware data protection management activities. For detailed information on NetApp SnapCenter plug-in for Oracle, refer to this documentation What can you do with the Plug-in for Oracle Database. The following provides high-level steps to set up SnapCenter version 6 for Oracle database backup, recovery, and clone in VCF.
-
Download the version 6 of SnapCenter software from NetApp support site: NetApp Support Downloads.
-
Login to the SnapCenter hosting Windows VM as administrator. Install prerequisites for SnapCenter 6.0.
-
As administrator, install latest java JDK from Get Java for desktop applications.
If Windows server is deployed in a domain environment, add a domain user to SnapCenter server local administrators group and run SnapCenter installation with the domain user. -
Login to SnapCenter UI via HTTPS port 8846 as installation user to configure SnapCenter for Oracle.
-
Review
Get Started
menu to get up to speed on SnapCenter if you are a new user. -
Update
Hypervisor Settings
in global settings. -
Add ONTAP storage cluster to
Storage Systems
with cluster management IP and authenticated via cluster admin user ID.
-
Add database VM and vSphere plugin VM
Credential
for SnapCenter access to DB VM and vSphere plugin VM. The credential should have sudo privilege on the Linux VMs. You may create different credentials for different management user IDs for the VMs. -
Add Oracle database VM in VCF to
Hosts
with DB VM credential created in previous step.
-
Similarly, add NetApp VMware plugin VM to
Hosts
with vSphere plugin VM credential created in previous step.
-
Finally, after Oracle database is discovered on DB VM, back to
Settings
-Policies
to create Oracle database backup policies. Ideally, create a separate archive log backup policy to allow more frequent backup interval to minimize data loss in the event of a failure.
Ensure that the SnapCenter server name can be resolved to the IP address from the DB VM and vSphere plugin VM. Equally, the DB VM name and vSphere plugin VM name can be resolved to the IP address from the SnapCenter server. |
Database backup
Details
SnapCenter leverages ONTAP volume snapshot for much quicker database backup, restore, or clone compared with traditional RMAN based methodology. The snapshots are application-consistent as the database is put in Oracle backup mode before a snapshot.
-
From the
Resources
tab, any databases on the VM are auto-discovered after the VM is added to SnapCenter. Initially, the database status shows asNot protected
. -
Click on database to start a workflow to enable protection for the database.
-
Apply backup policy, setup scheduling if needed.
-
Setup backup job notification if required.
-
Review the summary and finish to enable database protection.
-
On-demand backup job can be triggered by click on
Back up Now
.
-
The backup job can be monitored at the
Monitor
tab by clicking on the running job. -
Click on database to review the backup sets completed for each database.
Database restore/recovery
Details
SnapCenter provides a number of restore and recovery options for Oracle databases from snapshot backup. In this example, we demonstrate to restore from a older snapshot backup, then roll forward the database to the last available log.
-
First, run a snapshot backup. Then, create a test table and insert a row into table to validate that recovered database from snapshot image before test table creation regains the test table.
[oracle@ora_01 ~]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jul 17 10:20:10 2024 Version 19.18.0.0.0 Copyright (c) 1982, 2022, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.18.0.0.0 SQL> sho pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 NTAP1_PDB1 READ WRITE NO 4 NTAP1_PDB2 READ WRITE NO 5 NTAP1_PDB3 READ WRITE NO SQL> alter session set container=ntap1_pdb1; SQL> select * from test; no rows selected SQL> insert into test values (1, sysdate, 'test oracle backup/restore/clone on VMware Cloud Foundation vVols'); 1 row created. SQL> commit; Commit complete. SQL> select * from test; ID ---------- DT --------------------------------------------------------------------------- EVENT -------------------------------------------------------------------------------- 1 18-JUL-24 11.15.03.000000 AM test oracle backup/restore/clone on VMware Cloud Foundation vVols SQL>
-
From SnapCenter
Resources
tab, open the database NTAP1 backup topology page. Highlight the snapshot data backup set before the creation of test table. Click onRestore
to launch restore-recover workflow. -
Choose restore scope.
-
Choose recovery scope to
All Logs
. -
Specify any optional pre-scripts to run.
-
Specify any optional after-script to run.
-
Send a job report if desired.
-
Review the summary and click on
Finish
to launch the restoration and recovery. -
From
Monitor
tab, open the job to review the details. -
From DB VM ora_01, validate that a successful restore/recovery of database rolled forward to its most recent state and recovered the test table.
[oracle@ora_01 ~]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jul 18 11:42:58 2024 Version 19.18.0.0.0 Copyright (c) 1982, 2022, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.18.0.0.0 SQL> select name, open_mode from v$database; NAME OPEN_MODE --------- -------------------- NTAP1 READ WRITE SQL> alter session set container=ntap1_pdb1; Session altered. SQL> select * from test; ID ---------- DT --------------------------------------------------------------------------- EVENT -------------------------------------------------------------------------------- 1 18-JUL-24 11.15.03.000000 AM test oracle backup/restore/clone on VMware Cloud Foundation vVols SQL>
Database clone
Details
In this example, the most recent backup sets is used to clone a database on the DB VM ora_02 in a different software installation and ORACLE_HOME in VCF.
-
Again, open the database NTAP1 backup list. Select the most recent data backup set, click on
Clone
button to launch database clone workflow. -
Name the clone database SID.
-
Select ora_02 in VCF as the target database clone host. Identical Oracle database software should have been installed and configured on the host.
-
Select the proper ORACLE_HOME, user and group on the target host. Keep credential at default.
-
You may change clone database parameters to meet configuration or resources requirements for the clone database.
-
Choose recovery scope.
Until Cancel
recovers the clone up to last available log file in the backup set. -
Review the summary and launch the clone job.
-
Monitor the clone job execution from
Monitor
tab. -
Cloned database is immediately registered in SnapCenter.
-
From DB VM ora_02, validate the cloned database and query the test table.
[oracle@ora_02 ~]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jul 18 12:06:48 2024 Version 19.18.0.0.0 Copyright (c) 1982, 2022, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production Version 19.18.0.0.0 SQL> select name, open_mode, log_mode from v$database; NAME OPEN_MODE LOG_MODE --------- -------------------- ------------ NTAP1CLN READ WRITE ARCHIVELOG SQL> select instance_name, host_name from v$instance; INSTANCE_NAME ---------------- HOST_NAME ---------------------------------------------------------------- NTAP1CLN ora_02 SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 NTAP1_PDB1 READ WRITE NO 4 NTAP1_PDB2 READ WRITE NO 5 NTAP1_PDB3 READ WRITE NO SQL> alter session set container=ntap1_pdb1 2 ; Session altered. SQL> select * from test; ID ---------- DT --------------------------------------------------------------------------- EVENT -------------------------------------------------------------------------------- 1 18-JUL-24 11.15.03.000000 AM test oracle backup/restore/clone on VMware Cloud Foundation vVols SQL>
This completes the demonstration of SnapCenter backup, restore, and clone of Oracle database in VCF.
Where to find additional information
To learn more about the information described in this document, review the following documents and/or websites: