Clone a IBM Db2 backup
You can use SnapCenter to clone a backup. You can clone from primary or secondary backup.
-
You should have backed up the resources or resource group.
-
You should ensure that the aggregates hosting the volumes should be in the assigned aggregates list of the storage virtual machine (SVM).
-
While creating a clone for Db2 on an alternate host, you must create a n-1 directory structure for the clone mount path same as the original mount path on the other host. The mount path should have 755 execution permission.
-
For pre clone or post clone commands, you should check if the commands exist in the command list available on the plug-in host from the following paths:
-
Default location on the Windows host: C:\Program Files\NetApp\SnapCenter\Snapcenter Plug-in Creator\etc\allowed_commands.config
-
Default location on the Linux host: /opt/NetApp/snapcenter/scc/etc/allowed_commands.config
-
If the commands do not exist in the command list, then the operation will fail. |
-
For information about clone split operation limitations, see ONTAP 9 Logical Storage Management Guide.
-
For ONTAP 9.12.1 and below version, the clones created from the SnapLock Vault Snapshots as part of restore will inherit the SnapLock Vault expiry time. Storage admin should manually cleanup the clones post the SnapLock expiry time.
-
In the left navigation pane, click Resources, and then select the appropriate plug-in from the list.
-
In the Resources page, filter resources from the View drop-down list based on resource type.
The resources are displayed along with information such as type, host, associated resource groups and policies, and status.
-
Select the resource or resource group.
You must select a resource if you select a resource group.
The resource or resource group topology page is displayed.
-
From the Manage Copies view, select Backups either from the primary or secondary (mirrored or vaulted) storage systems.
-
Select the data backup from the table, and then click .
-
In the Location page, perform the following actions:
For this field… Do this… Clone server
Choose a host on which the clone should be created.
Target Clone Instance
Enter the target Db2 clone instance ID to clone from the existing backups.
This is applicable only for ANF storage type resource.
Target Clone Name
Enter the name of the clone.
This is applicable only for Db2 database resource.
NFS Export IP Address
Enter IP addresses or the host names on which the cloned volumes will be exported.
This is applicable only to NFS storage type resource.
Capacity Pool Max. Throughput (MiB/s)
Enter the maximum throughput of a capacity pool.
-
In the Scripts page, perform the following steps:
The scripts are run on the plug-in host. -
Enter the commands for pre clone or post clone that should be run before or after the clone operation, respectively.
-
Pre clone command: delete existing databases with the same name
-
Post clone command: verify a database or start a database.
-
-
Enter the mount command to mount a file system to a host.
Mount command for a volume or qtree on a Linux machine:
Example for NFS:
mount VSERVER_DATA_IP:%VOLUME_NAME_Clone /mnt
-
-
In the Notification page, from the Email preference drop-down list, select the scenarios in which you want to send the emails.
You must also specify the sender and receiver email addresses, and the subject of the email.
-
Review the summary, and then click Finish.
-
Monitor the operation progress by clicking Monitor > Jobs.
After cloning the automatically discovered Db2 resources, the cloned resource is marked as manual resource. Click Refresh resources to recover the cloned Db2 resource. When you delete the clone, the storage and the host also gets cleaned up.
If you do not refresh the resources after the clone operation and attempt to delete the clone, the storage and the host will not be cleaned up. You must delete the entries manually in fstab.
-
Initiate a connection session with the SnapCenter Server for a specified user by using the Open-SmConnection cmdlet.
Open-SmConnection -SMSbaseurl https://snapctr.demo.netapp.com:8146
-
List the backups that can be cloned by using the Get-SmBackup or Get-SmResourceGroup cmdlet.
This example displays information about all available backups:
C:\PS>PS C:\> Get-SmBackup BackupId BackupName BackupTime BackupType -------- ---------- ---------- ---------- 1 Payroll Dataset_vise-f6_08... 8/4/2015 Full Backup 11:02:32 AM 2 Payroll Dataset_vise-f6_08... 8/4/2015 11:23:17 AM
This example displays information about a specified resource group, its resources, and associated policies:
PS C:\> Get-SmResourceGroup -ListResources –ListPolicies Description : CreationTime : 8/4/2015 3:44:05 PM ModificationTime : 8/4/2015 3:44:05 PM EnableEmail : False EmailSMTPServer : EmailFrom : EmailTo : EmailSubject : EnableSysLog : False ProtectionGroupType : Backup EnableAsupOnFailure : False Policies : {FinancePolicy} HostResourceMaping : {} Configuration : SMCoreContracts.SmCloneConfiguration LastBackupStatus : VerificationServer : EmailBody : EmailNotificationPreference : Never VerificationServerInfo : SMCoreContracts.SmVerificationServerInfo SchedulerSQLInstance : CustomText : CustomSnapshotFormat : SearchResources : False ByPassCredential : False IsCustomSnapshot : MaintenanceStatus : Production PluginProtectionGroupTypes : {SMSQL} Name : Payrolldataset Type : Group Id : 1 Host : UserName : Passphrase : Deleted : False Auth : SMCoreContracts.SmAuth IsClone : False CloneLevel : 0 ApplySnapvaultUpdate : False ApplyRetention : False RetentionCount : 0 RetentionDays : 0 ApplySnapMirrorUpdate : False SnapVaultLabel : MirrorVaultUpdateRetryCount : 7 AppPolicies : {} Description : FinancePolicy PreScriptPath : PreScriptArguments : PostScriptPath : PostScriptArguments : ScriptTimeOut : 60000 DateModified : 8/4/2015 3:43:30 PM DateCreated : 8/4/2015 3:43:30 PM Schedule : SMCoreContracts.SmSchedule PolicyType : Backup PluginPolicyType : SMSQL Name : FinancePolicy Type : Id : 1 Host : UserName : Passphrase : Deleted : False Auth : SMCoreContracts.SmAuth IsClone : False CloneLevel : 0 clab-a13-13.sddev.lab.netapp.com DatabaseGUID : SQLInstance : clab-a13-13 DbStatus : AutoClosed DbAccess : eUndefined IsSystemDb : False IsSimpleRecoveryMode : False IsSelectable : True SqlDbFileGroups : {} SqlDbLogFiles : {} AppFileStorageGroups : {} LogDirectory : AgName : Version : VolumeGroupIndex : -1 IsSecondary : False Name : TEST Type : SQL Database Id : clab-a13-13\TEST Host : clab-a13-13.sddev.mycompany.com UserName : Passphrase : Deleted : False Auth : SMCoreContracts.SmAuth IsClone : False
-
Initiate a clone operation from an existing backup by using the New-SmClone cmdlet.
This example creates a clone from a specified backup with all logs:
PS C:\> New-SmClone -BackupName payroll_dataset_vise-f3_08-05-2015_15.28.28.9774 -Resources @{"Host"="vise-f3.sddev.mycompany.com"; "Type"="SQL Database";"Names"="vise-f3\SQLExpress\payroll"} -CloneToInstance vise-f3\sqlexpress -AutoAssignMountPoint -Suffix _clonefrombackup -LogRestoreType All -Policy clonefromprimary_ondemand PS C:> New-SmBackup -ResourceGroupName PayrollDataset -Policy FinancePolicy
This example creates a clone to a specified Microsoft SQL Server instance:
PS C:\> New-SmClone -BackupName "BackupDS1_NY-VM-SC-SQL_12-08-2015_09.00.24.8367" -Resources @{"host"="ny-vm-sc-sql";"Type"="SQL Database"; "Names"="ny-vm-sc-sql\AdventureWorks2012_data"} -AppPluginCode SMSQL -CloneToInstance "ny-vm-sc-sql" -Suffix _CLPOSH -AssignMountPointUnderPath "C:\SCMounts"
-
View the status of the clone job by using the Get-SmCloneReport cmdlet.
This example displays a clone report for the specified job ID:
PS C:\> Get-SmCloneReport -JobId 186 SmCloneId : 1 SmJobId : 186 StartDateTime : 8/3/2015 2:43:02 PM EndDateTime : 8/3/2015 2:44:08 PM Duration : 00:01:06.6760000 Status : Completed ProtectionGroupName : Draper SmProtectionGroupId : 4 PolicyName : OnDemand_Clone SmPolicyId : 4 BackupPolicyName : OnDemand_Full_Log SmBackupPolicyId : 1 CloneHostName : SCSPR0054212005.mycompany.com CloneHostId : 4 CloneName : Draper__clone__08-03-2015_14.43.53 SourceResources : {Don, Betty, Bobby, Sally} ClonedResources : {Don_DRAPER, Betty_DRAPER, Bobby_DRAPER, Sally_DRAPER}
The information regarding the parameters that can be used with the cmdlet and their descriptions can be obtained by running Get-Help command_name. Alternatively, you can also refer to the SnapCenter Software Cmdlet Reference Guide.