Cloning VMware vSphere Virtualized Databases

Oracle

Audience
Public
Technology Integrations
Oracle
Source Type
Documentation

For virtualized workloads, proper cloning strategies are essential to maintain performance and resource efficiency. This subsection outlines how to adapt snapshot and cloning practices to VMware environments, covering everything from VMware vSphere Virtual Volumes (vVols) to raw device mapping configurations.

VMware vSphere Virtual Volumes (vVols)

  1. Confirm you have a vVol created on the source database server. In the example shown in Figure 16, the cbora1 host does not have any vVols assigned to it; the first step is:

    • Edit the virtual machine settings and select Add new hard disk.

    • The new volume size is 79GB.

    • Under the location table, select the vVol datastore to create the vVol on. In the example shown in Figure 16, we use RedDotX-VVOL.

    • Click OK to create the vVol.

      An example showing that the cbora1 host does not have any vVols assigned to it

  2. The new vVol will be automatically added to the FlashArray using the Everpure plugin. Confirm this with the following:

    1. Select the Volumes tab in the FlashArray user interface.

    2. Under Volume Groups, type the name of the host: cbora1.

    3. The interface displays the new Volume group, called vvol-cbora1-3a6ce8e5-vg.

  3. When you select the volume group, the user interface will show you the vVols inside the volume group. In this example, the main volume we want is the 79GB volume we created when we added the new disk to the virtual machine.

    The user interface displays the new volume group

  4. Confirm the host operating system can see and mount the volumes for Oracle Database, the host can now see the 79GB disk named sdd, and we can see that /dev/sdd1 is mounted on /u02.
    [root@cbora1 ~]#
    [root@cbora1 ~]# lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    sdd 8:48 0 79G 0 disk
    └─sdd1 8:49 0 79G 0 part /u02
    sdb 8:16 0 80G 0 disk
    └─sdb1 8:17 0 80G 0 part
    sr0 11:0 1 4.4G 0 rom /run/media/oracle/OL-7.7 Server.x86_64
    sdc 8:32 0 50G 0 disk
    └─sdc1 8:33 0 50G 0 part
    sda 8:0 0 100G 0 disk
    ├─sda2 8:2 0 99G 0 part
    │ ├─ol-swap 252:1 0 9G 0 lvm [SWAP]
    │ ├─ol-home 252:2 0 40G 0 lvm /home
    │ └─ol-root 252:0 0 50G 0 lvm /
    └─sda1 8:1 0 976M 0 part /boot
    [root@cbora1 ~]#
    [root@cbora1 ~]# df -h
    Filesystem Size Used Avail Use% Mounted on
    devtmpfs 7.7G 0 7.7G 0% /dev
    tmpfs 7.8G 637M 7.1G 9% /dev/shm
    tmpfs 7.8G 98M 7.7G 2% /run
    tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
    /dev/mapper/ol-root 50G 35G 16G 69% /
    /dev/mapper/ol-home 40G 7.3G 33G 19% /home
    /dev/sda1 973M 338M 636M 35% /boot
    tmpfs 1.6G 32K 1.6G 1% /run/user/54321
    /dev/sdd1 79G 14G 66G 17% /u02
    /dev/sr0 4.5G 4.5G 0 100% /run/media/oracle/OL-7.7 Server.x86_64
    Oracle Profile
    ORACLE_SID=orafs
    ORACLE_BASE=/u02/app/oracle
    DB_UNIQUE_NAME=orafs
    ORACLE_HOME=$ORACLE_BASE/product/19c/dbhome_1
    PATH=$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/bin
    export PS1='`/usr/bin/whoami`@${HOSTNAME}:${PWD} [${ORACLE_SID}]> '
    export PATH ORACLE_SID ORACLE_BASE ORACLE_HOME DB_UNIQUE_NAME
  5. Log in to SQL and create a new test table on the source host:
    create table table1 as select * from dba_objects;
    
    oracle@cbora1.localdomain:/home/oracle [orcl]> sqlplus / as sysdba
    SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jan 29 21:51:42 2025
    Version 19.5.0.0.0
    Copyright (c) 1982, 2019, Oracle. All rights reserved.
    Connected to:
    Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
    Version 19.3.0.0.0
    SQL>create table table1 as select * from dba_objects;
    Table created.
    SQL>select count(*) from table1;
     COUNT(*)
     —-------
     72373
  6. Next, clone the vVol by creating a protection-group snapshot and using the snapshot to create a new volume. In this example, we will use the snapshot with the suffix snap3 to create the clone volume and attach it to host cbora2.

    This example shows the snapshot with the suffix snap3 attached to host cbora2.

  7. Select the virtual machine; in this case, cbora2. If you select vVols, you see no vVols are attached; using the VMware plugin makes it easy to import the snapshot from the FlashArray:

    • Select import diskhen search for the virtual machine that the source vVols are on; in this example, cbora1.

    • Expand the hard disk to get a listing of the recent snapshots; in this example, hard disk 4.

    • Select the snapshot from the suffix snap3, and then import the clone.

      Selecting the correct snapshot and importing the clone

  8. The new volume import displays as a vVol.

    The new volume import displays as a vVol.

  9. As shown in Figure 20, the new clone disk /dev/sde appears with the XFS file system, which has been mounted on /u02.
    [root@cbora2 ~]# lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    sdd 8:48 0 80G 0 disk
    └─sdd1 8:49 0 80G 0 part
    sdb 8:16 0 80G 0 disk
    └─sdb1 8:17 0 80G 0 part
    sr0 11:0 1 4.4G 0 rom
    sde 8:64 0 79G 0 disk
    └─sde1 8:65 0 79G 0 part /u02
    sdc 8:32 0 50G 0 disk
    └─sdc1 8:33 0 50G 0 part
    sda 8:0 0 100G 0 disk
    ├─sda2 8:2 0 99G 0 part
    │ ├─ol-swap 252:1 0 9G 0 lvm [SWAP]
    │ ├─ol-home 252:2 0 40G 0 lvm /home
    │ └─ol-root 252:0 0 50G 0 lvm /
    └─sda1 8:1 0 976M 0 part /boot
    [root@cbora2 ~]#
    [root@cbora2 ~]# df -h
    Filesystem Size Used Avail Use% Mounted on
    devtmpfs 7.7G 0 7.7G 0% /dev
    tmpfs 7.7G 637M 7.1G 9% /dev/shm
    tmpfs 7.7G 106M 7.6G 2% /run
    tmpfs 7.7G 0 7.7G 0% /sys/fs/cgroup
    /dev/mapper/ol-root 50G 35G 16G 70% /
    /dev/mapper/ol-home 40G 11G 30G 26% /home
    /dev/sda1 973M 440M 534M 46% /boot
    tmpfs 1.6G 12K 1.6G 1% /run/user/42
    tmpfs 1.6G 0 1.6G 0% /run/user/54321
    /dev/sde1 79G 14G 66G 17% /u02
  10. Make sure the correct Oracle profile is set to point to the correct Oracle system identifier and Oracle home.
    Oracle Profile
    ORACLE_SID=orafs
    ORACLE_BASE=/u02/app/oracle
    DB_UNIQUE_NAME=orafs
    ORACLE_HOME=$ORACLE_BASE/product/19c/dbhome_1
    PATH=$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/bin
    export PS1='`/usr/bin/whoami`@${HOSTNAME}:${PWD} [${ORACLE_SID}]> '
    export PATH ORACLE_SID ORACLE_BASE ORACLE_HOME DB_UNIQUE_NAME
    SQL> select name from v$database;
    NAME
    —---
    ORAFS
    SQL> select count(*) from table1;
     COUNT(*)
    ----------
     7237