Restore a Block Volume

You can restore a block volume that has been previously backed up.

Unmount the Oracle Database File System (DBFS)

Note:

These steps apply only if your DBFS is not mounted on /u01/soacs .

  1. Use the ssh command to connect to the Administration Server VM (as the opc user):

    ssh -i private_key opc@AdminServerVM_IP_address
  2. Enter the following commands:
    sudo fusermount -u /u01/data/dbfs
    sudo fusermount -u /u01/data/dbfs_directio

Unmount the old volume

  1. Use the ssh command to connect to the Administration Server VM (as the opc user):

    ssh -i private_key opc@AdminServerVM_IP_address
  2. Enter the following commands:
    • sudo fdisk -l (Make a note of the /dev/sdc device)
    • df -h (Check that /u01/data is mounted)
    • sudo umount /u01/data
    • df -h (Check that /u01/data is not mounted)

Disable the old volume

For volumes attached with iSCSI as the volume attachment type, you need to disconnect the volume from an instance before you detach the volume.

  1. Log on to your instance's guest OS and unmount the volume.
  2. Sign in to the Oracle Cloud Infrastructure Console.
  3. Open the navigation menu and click Compute. Under Compute, click Instances.
  4. Click the name of the instance to display the Instance Details page.
  5. In the Resources section, click Attached Block Volumes.
  6. At the far right of the row for the block volume that you want to disconnect, click Actions icon and select iSCSI Commands & Information.iSCSI Commands & Information dialog
  7. In the iSCSI Commands & Information dialog, copy the DETACH COMMANDS and execute the commands on your Admin VM. These commands will unmount the volume and disconnect the instance from the volume.

    Note:

    If you see the following error, the unmount was not successful. You need to unmount DBFS mounts from /u01/soacs.

    .sudo iscsiadm -m node -T iqn.2015-12.com.oracleiaas:d7ebe8-4ef7-430d-87cd-8127332bb0fd -p 169.254.2.2:3260 -u
    Logging out of session [sid: 2, target: iqn.2015-12.com.oracleiaas:d7ebe8-4ef7-430d-87cd-8127332bb0fd, portal: 169.254.2.2,3260]
    iscsiadm: Could not logout of [sid: 2, target: iqn.2015-12.com.oracleiaas:d7ebe8-4ef7-430d-87cd-8127332bb0fd, portal: 169.254.2.2,3260].
    iscsiadm: initiator reported error (28 - device or resource in use)
    iscsiadm: Could not logout of all requested sessions

    A successful logout response resembles the following:

    Logging out of session [sid: 2, target: iqn.2015-12.us.oracle.com:c6acda73-90b4-4bbb-9a75-faux09015418, portal: 169.254.0.2,3260]
    Logout of [sid: 2, target: iqn.2015-12.us.oracle.com:c6acda73-90b4-4bbb-9a75-faux09015418, portal: 169.254.0.2,3260] successful.

Detach the old volume from Compute

  1. Open the navigation menu and click Compute. Under Compute, click Instances.
  2. Click the name of the instance to display the Instance Details page.
  3. In the Resources section, click Attached Block Volumes.
  4. At the far right of the row for the block volume that you want to disconnect, click Actions icon and select Detach.Detach Block Volume dialog
  5. In the Detach Block Volume dialog, click Continue Detachment.

Create a new volume from the backup volume

  1. Select the compartment in which the block volume backup you are restoring is saved.
  2. Open the navigation menu and click Storage. Under Block Storage, click Block Volume Backups.
  3. At the far right of the row for the block volume backup you want to restore, click Actions icon and select Create Block Volume.
  4. In the Create Block Volume dialog, enter a name for the block volume and choose the availability domain in which you want to restore it.
  5. Click Create Block Volume.

    The volume is ready to attach once its icon no longer lists it as PROVISIONING in the volume list.

Attach the new volume to the SOA instance

  1. Open the navigation menu and click Compute. Under Compute, click Instances.
  2. Click the name of the instance to which you want to attach the new volume.
  3. In the Resources section, click Attached Block Volumes.
  4. Click Attach Block Volume.Attach Block Volume dialog

  5. In the Attach Block Volume dialog, select iSCSI the volume attachment type.

  6. For ACCESS, select Read/Write or Read Only - SHAREABLE.

  7. In the BLOCK VOLUME COMPARTMENT list, select the compartment.

  8. To select the volume you want to attach to by name, select SELECT VOLUME and then select the volume from the BLOCK VOLUME list.

  9. Click Attach.

Connect to the new volume

Use the Oracle Cloud Infrastructure Console to obtain the iSCSI data you need to connect the volume.

  1. Open the navigation menu and click Compute. Under Compute, click Instances.
  2. Click the name of the instance to display the instance details.
  3. In the Resources section, click Attached Block Volumes.
  4. At the far right of the row for the block volume that you want to attach, click Actions icon and select iSCSI Commands and Information.iSCSI Commands & Information dialog

    The iSCSI Commands and Information dialog displays specific identifying information about your volume and the iSCSI commands you'll need. The commands are ready to use with the appropriate information included.

  5. Use the ssh command to connect to the Administration Server VM (as the opc user):

    ssh -i private_key opc@Admin_VM_Public_IP

  6. Copy and paste the ATTACH COMMANDS into your instance session window to connect the volume and configure iSCI to automatically connect to the authenticated block storage volumes after a reboot.

Mount the new volume

  1. Use the ssh command to connect to the Administration Server VM (as the opc user):

    ssh -i private_key opc@AdminServerVM_IP_address
  2. Enter the following commands:
    • sudo fdisk -l Note that the device is on /dev/sdb
    • df -h Check that /u01/data is not available, then continue.
    • sudo mount /dev/sdb /u01/data
    • df -h Check that /u01/data is mounted
  3. Restart the Administration Server VM from the Oracle Cloud Infrastructure Console to ensure that /u01/data is mounted after restart.

Mount the Oracle Database File System (DBFS)

Note:

These steps apply only if your DBFS is not mounted on /u01/soacs

  1. Use the ssh command to connect to the Administration Server VM (as the opc user):

    ssh -i private_key opc@AdminServerVM_IP_address
  2. Enter the following commands:
    • sudo su - oracle
    • cd /u01/data/domains/DomainName/dbfs
    • ./dbfsMount.sh -o wallet /@ORCL -o direct_io /u01/data/dbfs_directio
    • ./dbfsMount.sh -o wallet /@ORCL -o direct_io /u01/data/dbfs
    • df -h Check that /u01/data/dbfs* are mounted
  3. Restart the VM from the Oracle Cloud Infrastructure console to ensure that /u01/data is mounted after restart. If you see that DBFS is not mounted, then mount DBFS for every restart.

(Optional) Delete the old volume

  1. In the Oracle Cloud Infrastructure Console, click Navigation menu icon in the top left corner. In the navigation menu, under Core Infrastructure, go to Block Storage and click Block Volumes.
  2. At the far right of the row for the block volume backup you want to delete, click Actions icon and select Terminate and confirm when prompted.