This article covers backup procedures that must be used for different types of data including:
- OS and software on the cluster nodes
- Database files
- Files on ACFS, if used
Backing up OS and software on the cluster nodes
It is strongly recommended to back up the OS disk (boot) and software disk (lvmdisk1) of all cluster nodes after the initial cluster configuration and before and after applying any changes, such as patch installation or security settings changes. Taking disk snapshots is the recommended method for backing up the disks.
Note: Stopping the VM is not mandatory for creating snapshots. Snapshots can be created from disks even while they are attached to running instances.
To create a backup of a cluster node VM
In Google Cloud Console => VM Instances. Click the name of the VM that has the disk you intend to back up attached.
Go to the Storage section:
1. To back up the OS disk (boot):
- In the Boot Disk section, click the Name of the boot disk.
- Click CREATE SNAPSHOT.
- Provide the required details (Name, Type, Location) and click CREATE.
2. To back up the software disk (lvmdisk1):
- In the Additional Disks section, click the Name of the lvmdisk1 disk.
- Click CREATE SNAPSHOT.
- Provide the required details (Name, Type, Location) and click CREATE.
Restoring root or software disk of a cluster node
Root volume of a VM is a disk that has the OS installed on it. Device name of the root disk is boot.
Software volume of a VM is a disk where Oracle software binaries are installed (contains the /u01 directory). Device name of the software disk is lvmdisk1.
The root volume or the software volume may need to be restored in case the volume fails, has file system corruption, or has logical corruption.
To restore root disk (boot) or software disk (lvmdisk1):
- identify the snapshots for the affected disk in Google Cloud console Storage=>Snapshots
- identify the relevant snapshot for the affected disk.
- click on the snapshot and choose CREATE DISK
- ensure you select the correct Zone where you want the disk to be located. This should match the Region and Zone of the affected VM
- specify the disk name and ensure the Disk type and Size matches the values for the affected disk
- click on CREATE
- Stop the affected instance:
- if the OS is running then stop the instance gracefully using
flashgrid-node poweroff
command. - if the OS is not running then stop the instance using Google Cloud console or CLI
- if the OS is running then stop the instance gracefully using
-
EDIT the VM and replace the affected disk
- For OS disk:
- click on DETACH BOOT DISK
- click on CONFIGURE BOOT DISK, go to EXISTING DISKS tab and select the disk previously created from snapshot
- click on SHOW ADVANCED CONFIGURATION and specify
boot
as custom device name and save changes - click SAVE to apply the changes made to the VM configuration
- For software disk:
- edit existing disk (<mycluster-uniqid-node_name>-lvmdisk1), select the disk previously created from snapshot, specify
lvmdisk1
as custom device name and save changes - click SAVE to apply the changes made to the VM configuration
- edit existing disk (<mycluster-uniqid-node_name>-lvmdisk1), select the disk previously created from snapshot, specify
- For OS disk:
- Start the VM
Backing up database files
Standard RMAN procedures should be used for backing up and restoring database files.
Configuring a disk attached to one of the database node VMs for database backup
- This option allows higher performance of the backups and does not consume network bandwidth
- The disk must be formatted with a local file system, such as XFS
- Disk snapshots can be used for exporting backup data to external locations (Make sure that RMAN backup is complete before you make snapshot of the backup disk.)
- Create disk.
gcloud compute disks create mycluster-uniqid-localbkp --size 40 --type pd-ssd
- Attach it to the VM.
gcloud compute instances attach-disk mycluster-uniqid-rac1 --disk=mycluster-uniqid-rac1-localbkp --device-name=localbkp
- Format the disk.
mkfs.xfs /dev/localbkp
- Create mount point with the appropriate permissions
mkdir /localbkp
chown oracle:oinstall /localbkp
chmod 755 /localbkp
- Mount the filesystem
mount -o discard,defaults /dev/localbkp /localbkp
If you want the filesystem automatically mounted after reboot, then
echo UUID=`sudo blkid -s UUID -o value /dev/localbkp` /localbkp xfs defaults,nofail 0 2 | sudo tee -a /etc/fstab
Backing up Grid Infrastructure configuration files
Please follow Backup Best Practices: Grid Infrastructure Configuration
Backing up files on ACFS
For backing up and restoring files on ACFS use the same tools and procedures that you would normally use for file-level backup and restore.