本繁體中文版使用機器翻譯,譯文僅供參考,若與英文版本牴觸,應以英文版本為準。

使用PowerShell Cmdlet複製備份

貢獻者

複製工作流程包括規劃、執行複製作業及監控作業。

您必須準備好PowerShell環境、才能執行PowerShell Cmdlet。

步驟

  1. 使用Open-SmConnection Cmdlet為SnapCenter 指定的使用者啟動與SetsServer的連線工作階段。

    Open-SmConnection  -SMSbaseurl  https://snapctr.demo.netapp.com:8146
  2. 使用Get-SmBackup或Get-SmResource Group Cmdlet列出可複製的備份。

    此範例顯示所有可用備份的相關資訊:

    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

    此範例顯示指定資源群組、其資源及相關原則的相關資訊:

    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
  3. 使用New-SmClone Cmdlet從現有備份啟動複製作業。

    此範例使用所有記錄檔、從指定的備份建立複本:

    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

    此範例會建立複本至指定的Microsoft SQL Server執行個體:

    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"
  4. 使用Get-SmCloneReport Cmdlet檢視複製工作的狀態。

    此範例顯示指定工作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}

您可以執行_Get-Help命令name_來取得可搭配Cmdlet使用之參數及其說明的相關資訊。或者、您也可以參閱 "《軟件指令程式參考指南》SnapCenter"