Add-SmPolicy
Creates a new backup policy.
Syntax
Add-SmPolicy [-PolicyName] <String> [-PolicyType] <SmPolicyType> [-PluginPolicyType] <PluginCode> [-Description] <String>
Detailed Description
Creates a new backup policy. A policy is a set of rules governing backup jobs. A Policy includes backup type, verification schedules, and pre-script and post-script arguments.
Parameters
| Name | Description | Required? | Pipeline Input | Default Value |
|---|---|---|---|---|
PolicyName |
Specifies the name of the policy you are adding. |
true |
true (ByPropertyName) |
|
PolicyType |
Specifies the policy type. Valid value is Backup. |
true |
true (ByPropertyName) |
|
PluginPolicyType |
Specifies the type of plug-in. You need to specify a plug-in type because policies are settings that are specific to one type of plug-in. For example, if you want to create a policy for resources contained in a SnapCenter Plug-in for Microsoft SQL Server dataset, the plug-in types are SCSQL and SCO.Available plug-in policy types include SCSQL, SCO, SCU, HANA, SCW, SCE. |
true |
true (ByPropertyName) |
|
Description |
Provides an optional description of the policy you are adding. |
false |
true (ByPropertyName) |
|
UtmType |
Type of up to the minute (UTM) retention settings to apply to log backups. Possible values are days and count. |
false |
true (ByPropertyName) |
|
UtmCount |
Up to the minute (UTM) retention by count. |
false |
true (ByPropertyName) |
|
UtmDays |
Up to the minute (UTM) retention by days. |
false |
true (ByPropertyName) |
|
SqlBackupType |
SQL backup type. Possible values are LogBackup, FullBackup and FullBackupAndLogBackup. |
true |
true (ByPropertyName) |
|
DatabasesPerGroup |
Maximum number of databases in a group. This is applicable only for full backup. |
false |
true (ByPropertyName) |
|
CopyOnlyBackup |
Determines whether the full backup is a copy only backup. |
false |
true (ByPropertyName) |
|
AGBackupType |
Availability Group backup type. Possible values are UsePreferredBackupReplica and UseSpecifiedBackupReplica. |
false |
true (ByPropertyName) |
|
AGBackupReplicaType |
Availability Group backup replica type. Possible values are Primary, Secondary and All. |
false |
true (ByPropertyName) |
|
AGBackupPriorityMinimum |
Availability Group backup minimum priority. |
false |
true (ByPropertyName) |
|
AGBackupPriorityMaximum |
Availability Group backup maximum priority. |
false |
true (ByPropertyName) |
|
CreateLogFolderSnapshot |
Creates a Log folder Snapshot copy. |
false |
true (ByPropertyName) |
|
EnableLogFolderSnapshotRetention |
Enables log folder Snapshot copy retention. |
false |
true (ByPropertyName) |
|
DeleteLogFolderSnapshotInExcess |
false |
true (ByPropertyName) |
||
DeleteLogFolderSnapshotOlderThan |
Deletes log folder Snapshot copies that are older than the specified number of days. |
false |
true (ByPropertyName) |
|
VerifyLogBackup |
Enables log backup verification after backup. |
false |
true (ByPropertyName) |
|
DBCC_NOINDEX |
DBCC options NOINDEX. |
false |
false |
|
DBCC_ALL_ERRORMSGS |
DBCC options ALL_ERRORMSGS. |
false |
true (ByPropertyName) |
|
DBCC_NO_INFOMSGS |
DBCC options NO_INFOMSGS. |
false |
true (ByPropertyName) |
|
DBCC_TABLOCK |
DBCC options TABLOCK. |
false |
true (ByPropertyName) |
|
DBCC_PHYSICALONLY |
DBCC options PHYSICALONLY. |
false |
true (ByPropertyName) |
|
UpdateSnapMirrorAfterbackup |
Update SnapMirror copy after backup. This option is not applicable for SAP HANA policy of File-Based Backup type. |
false |
true (ByPropertyName) |
|
UpdateSnapVaultAfterbackup |
Update SnapVault copy after backup. This option is not applicable for SAP HANA policy of File-Based Backup type. |
false |
true (ByPropertyName) |
|
MirrorVaultUpdateRetryCount |
Number of retries to ensure SnapMirror or SnapVault update is triggered. |
false |
true (ByPropertyName) |
|
SnapVaultLabel |
Label for SnapVault. |
false |
true (ByPropertyName) |
|
AllowSavedStateBackup |
Allow saved state backup. |
false |
true (ByPropertyName) |
|
DeleteBackupInExcess |
Delete backup in excess of specified days, it is applicable to only SnapCenter Plug-in for VMware vSphere, if it is used with other plug-ins it will be ignored. |
false |
true (ByPropertyName) |
|
DeleteBackupOlderThan |
Delete backups older than specified days, it is applicable to only SnapCenter Plug-in for VMware vSphere, if it is used with other plug-ins it will be ignored. |
false |
true (ByPropertyName) |
|
PreScriptCommandVerification |
Specifies the path of the prescript that should be run before the backup operation. |
false |
true (ByPropertyName) |
|
PreScriptArgumentsVerification |
Specifies the prescript arguments. |
false |
true (ByPropertyName) |
|
PostScriptCommandVerification |
Specifies the path of the postscript that should be run after the backup operation. |
false |
true (ByPropertyName) |
|
PostScriptArgumentsVerification |
false |
true (ByPropertyName) |
||
ScriptTimeOutVerification |
false |
true (ByPropertyName) |
||
ScheduleType |
The schedule type. Possible values are None, Hourly, Weekly, Daily, and Monthly. |
false |
true (ByPropertyName) |
|
RetentionSettings |
Specifies in a hashtable the retention settings for the policy. |
false |
true (ByPropertyName) |
|
PreScriptCommand |
Prescript file UNC path with proper privileges for scripts accessibility, (‘\\\\server\\share\path\\file’ for Universal Naming Convention (UNC) names). |
false |
true (ByPropertyName) |
|
PreScriptArguments |
Specifies the prescript arguments. |
false |
true (ByPropertyName) |
|
PostScriptCommand |
Postscript file UNC path with proper privileges for scripts accessibility, (‘\\\\server\\share\path\\file’ for Universal Naming Convention (UNC) names). |
false |
true (ByPropertyName) |
|
PostScriptArguments |
Specifies postscript arguments. |
false |
true (ByPropertyName) |
|
ScriptTimeOut |
Specifies script timeout value in seconds. |
false |
true (ByPropertyName) |
|
VerificationScheduleType |
false |
true (ByPropertyName) |
||
DeleteCloneOnScheduleExpiry |
Removes a clone during the last run of a scheduled job.If this parameter is not set, then the last run of a schedule also runs a clone life cycle and creates a cloned database.This parameter does not apply to jobs that are not scheduled or to one time job schedules. |
false |
true (ByPropertyName) |
|
BackupPolicyName |
Specifies the backup policy name. |
true |
true (ByPropertyName) |
|
CloneType |
Specifies the clone type. Possible values are Primary and Secondary. |
false |
true (ByPropertyName) |
|
VerifyOnSecondary |
Specifies whether to verify on secondary or not. |
false |
false |
|
NumOfBackups |
Number of backups to be verified. |
false |
false |
|
PluginParams |
false |
true (ByPropertyName) |
||
DominoChangeInfoPath |
false |
true (ByPropertyName) |
||
DominoDatabaseType |
false |
true (ByPropertyName) |
||
DominoIniPath |
false |
true (ByPropertyName) |
||
DominoRestoreFilePath |
false |
true (ByPropertyName) |
||
DominoRestoreTime |
false |
true (ByPropertyName) |
||
Lotus |
false |
true (ByPropertyName) |
||
NotesExecDirectory |
false |
true (ByPropertyName) |
||
DominoDisableReplication |
false |
true (ByPropertyName) |
||
DominoIgnoreCorruptedDB |
false |
true (ByPropertyName) |
||
DBMCliCmd |
false |
true (ByPropertyName) |
||
HandleLogWriter |
false |
true (ByPropertyName) |
||
MaxDBBGServerPrefix |
false |
true (ByPropertyName) |
||
MaxDBUpdateHistLog |
false |
true (ByPropertyName) |
||
SQLCliCmd |
false |
true (ByPropertyName) |
||
XUserEnable |
false |
true (ByPropertyName) |
||
DB2Cmd |
false |
true (ByPropertyName) |
||
SybaseISQLCmd |
false |
true (ByPropertyName) |
||
SybaseManifest |
false |
true (ByPropertyName) |
||
SybaseManifestDelete |
false |
true (ByPropertyName) |
||
SybaseManifestFormat |
false |
true (ByPropertyName) |
||
SybaseTranDump |
false |
true (ByPropertyName) |
||
SybaseTranDumpCompress |
false |
true (ByPropertyName) |
||
SybaseTranDumpFormat |
false |
true (ByPropertyName) |
||
BackupType |
This is a SAP HANA database specific parameter. Specifies the type of SAP HANA backup. The possible values are FileBasedBackup and SnapshotBasedBackup. |
true |
true (ByPropertyName) |
|
OracleBackupType |
Specifies the Oracle backup type. Backup types include Online, Offline mount, and Offline shutdown. |
true |
true (ByPropertyName) |
|
OracleBackupScope |
This option is only valid when the backup type is Online. Backup scope values are Full, Data, and Log. |
true |
true (ByPropertyName) |
|
OracleSkipPDBSaveState |
Enables you to skip PDB save state. This parameter is only available when you select Offline shutdown backup type. Values are True or False. |
false |
true (ByPropertyName) |
|
DeleteAllArchiveLogs |
Prunes (deletes) all archive logs after Full or Log backups. |
false |
true (ByPropertyName) |
|
DeleteArchiveLogsOlderThan |
Prunes (deletes) archive logs older than a specified number of days. This parameter supports the use decimals to enable you to specify a fraction of a day. For example, 2.5 represents 2 days and 12 hours, and 0.04 represents 1 hour. |
false |
true (ByPropertyName) |
|
DeleteArchiveLogFromAllDestination |
This parameter enables pruning of archive logs on a specified destination. If the value is True, archive logs are pruned on all destinations. If the option is False, archive logs are pruned only on backed up destinations. |
false |
true (ByPropertyName) |
|
DeleteArchiveLogBackupInExcess |
Deletes archive log backup in excess of the specified backup count. |
false |
true (ByPropertyName) |
|
DeleteAchiveLogBackupOlderThan |
Deletes archive log backups that are older than the specified number of days. This parameter supports the use decimals to enable you to specify a fraction of a day. For example, 2.5 represents 2 days and 12 hours, and 0.04 represents 1 hour. |
false |
true (ByPropertyName) |
|
CatalogBackupWithOracleRMAN |
Specifies that you want to catalog backup using Oracle Recovery Manager (RMAN). |
false |
true (ByPropertyName) |
|
ScwBackupType |
The SnapCenter Plug-in for Windows backup type. Values are ApplicationConsistent, FilesystemConsistent and CrashConsistent. |
true |
true (ByPropertyName) |
|
SceBackupType |
true |
true (ByPropertyName) |
||
UtmCounts |
false |
true (ByPropertyName) |
||
BackupTruncatedTransactionLog |
false |
true (ByPropertyName) |
||
BackupActiveCopies |
false |
true (ByPropertyName) |
||
BackupCopiesOnServer |
false |
true (ByPropertyName) |
Examples
Example 1: Creating a new hourly policy with scheduler type as SQL
Add-SmPolicy -PolicyName TESTPolicy - PluginPolicyType SCSQL -PolicyType Backup -SqlBackupType FullBackup -ScheduleType Hourly -Verbose –SchedulerType SQL
This example syntax creates a new hourly policy with the SQL scheduler type.
Example 2: Creating an Oracle policy that prunes all archive logs on all destinations, and deletes archive log backups in excess of 5
Add-SmPolicy -PolicyName 1 -PolicyType Backup -PluginPolicyType SCO -OracleBackupType ONLINE -OracleBackupScope FULL -DeleteAllArchiveLogs $true -DeleteArchiveLogFromAllDestination $true -DeleteArchiveLogBackupInExcess 5
This example syntax creates an Oracle policy that prunes all archive logs on all destinations, and deletes archive log backups in excess of 5.
ApplySnapvaultUpdate: False
ApplyRetention : False
RetentionCount :
RetentionDays :
ApplySnapMirrorUpdate : False
SnapVaultLabel :
MirrorVaultUpdateRetryCount : 3
AppPolicies : {}
Description :
PreScriptPath :
PreScriptArguments :
PostScriptPath :
PostScriptArguments :
ScriptTimeOut : 60000
DateModified: 10/5/2015 2:17:57 PM
DateCreated : 10/5/2015 2:17:57 PM
Schedule: SMCoreContracts.SmSchedule
PolicyType : Backup
PluginPolicyType: SCO
Name: 1
Type:
Id : 99
Host:
UserName:
Passphrase :
Deleted : False
Auth: SMCoreContracts.SmAuth
IsClone : False
CloneLevel : 0
Hosts : {}
SmOracleBackupType : ONLINE
SmOracleBackupScope: FULL
SmOraclePDBSaveState : True
PruneArchiveLog: True
PruneArchiveLogType: AllLogs
PruneArchiveLogOlderThanDays :
PruneArchiveLogDestinationType : AllDestinations
DeleteArchiveLogBackup : True
ArchiveLogBackupRetentionType : CountBase
DeleteArchiveLogBackupCounts : 5
DeleteArchiveLogBackupDays :
Name :
Type :
Id :
Host :
UserName :
Passphrase :
Deleted: False
Auth : SMCoreContracts.SmAuth
IsClone: False
CloneLevel : 0
Hosts : {}
Example 3: Creating a policy for custom plugin DB2 with daily schedule type
Add-SMPolicy -PolicyName 'DB2_DAILY_POLICY' -PolicyType 'Backup' -PluginPolicyType DB2-retentionsettings @{"BackupType"="DATA";"ScheduleType"="DAILY";"RetentionCount"='3'} -description 'DB2 daily schedule policy' -scheduletype 'DAILY'
This example syntax creates a daily scheduled policy for custom plug-in DB2 with retention count 3
ApplyRetention : True
ApplySnapMirrorUpdate : False
ApplySnapvaultUpdate: False
MirrorVaultUpdateRetryCount : 3
RetentionCount : 3
RetentionDays : 0
SnapVaultLabel :
AppPolicies : {}
DateCreated : 8/22/2016 9:37:43 AM
DateModified: 8/22/2016 9:37:43 AM
Description : DB2 daily schedule policy
PluginPolicyType: DB2
PolicyType : Backup
PostScriptArguments :
PostScriptPath :
PreScriptArguments :
PreScriptPath :
Schedules : {}
Schedule: SMCoreContracts.SmSchedule
ScriptTimeOut : 60
Name: DB2_DAILY_POLICY
Type:
Id : 18
Host:
UserName:
Passphrase :
Deleted : False
Auth: SMCoreContracts.SmAuth
IsClone : False
CloneLevel : 0
Hosts : {}
TaskName :
Hosts : {}
StartTime :
DaysoftheMonth:
MonthsofTheYear :
DaysInterval : 0
DaysOfTheWeek :
AllowDefaults : False
ReplaceJobIfExist : False
UserName :
Password :
SchedulerType : Daily
RepeatTask_Every_Hour :
IntervalDuration :
EndTime :
LocalScheduler:
AppType :
AuthMode :
SchedulerSQLInstance : SMCoreContracts.SmObject
MonthlyFrequency :
ScheduleID: 0
PolicyId : 18
PluginName : DB2
PluginParams : SMCoreContracts.SmKeyValueCollection
SmSCBackupType : DataBackup
Name :
Type :
Id :
Host :
UserName :
Passphrase :
Deleted: False
Auth : SMCoreContracts.SmAuth
IsClone: False
CloneLevel : 0
Hosts : {}
Example 4: Creating a new Windows backup policy
Add-SmPolicy -PolicyName scw_policy -PolicyType Backup -PluginPolicyType SCW -ScwBackupType CrashConsistent
This example syntax creates a new Windows backup policy.
ApplySnapvaultUpdate : False
ApplyRetention : False
RetentionCount :
RetentionDays:
ApplySnapMirrorUpdate: False
SnapVaultLabel :
MirrorVaultUpdateRetryCount : 3
AppPolicies : {}
Description :
PreScriptPath:
PreScriptArguments :
PostScriptPath :
PostScriptArguments :
ScriptTimeOut: 60
DateModified : 5/18/2016 6:36:24 PM
DateCreated : 5/18/2016 6:36:24 PM
Schedule : SMCoreContracts.SmSchedule
PolicyType : Backup
PluginPolicyType : SDW
Name : scw_policy
Type :
Id : 1
Host :
UserName :
Passphrase :
Deleted : False
Auth : SMCoreContracts.SmAuth
IsClone : False
CloneLevel : 0
Hosts: {}
ScwBackupType : CrashConsistent
Name :
Type :
Id:
Host :
UserName :
Passphrase:
Deleted : False
Auth : SMCoreContracts.SmAuth
IsClone : False
CloneLevel: 0
Hosts : {}
Example 5: Creating a new backup policy for SnapCenter Plugin for SAP HANA backup of type FileBasedBackup
Add-SmPolicy -PolicyName newpol123 -PolicyType Backup -PluginPolicyType hana -BackupType FileBasedBackup
This example syntax creates a new backup policy for SnapCenter Plug-in for SAP HANA with FileBasedBackup as the backup type.
ApplyRetention : True
ApplySnapMirrorUpdate : False
ApplySnapvaultUpdate: False
MirrorVaultUpdateRetryCount : 0
RetentionCount : 7
RetentionDays : 0
SnapVaultLabel :
AppPolicies : {}
DateCreated : 3/23/2017 10:14:31 PM
DateModified: 3/23/2017 10:14:31 PM
Description :
PluginPolicyType: hana
PolicyType : Backup
PostScriptArguments :
PostScriptPath :
PreScriptArguments :
PreScriptPath :
Schedules : {}
Schedule: SMCoreContracts.SmSchedule
ScriptTimeOut : 60
Name: newpol123
Type:
Id : 39
Host:
UserName:
Passphrase :
Deleted : False
Auth: SMCoreContracts.SmAuth
IsClone : False
CloneLevel : 0
Hosts : {}
StorageName :
ResourceGroupNames :
PolicyNames :
Key : 0
NsmObjectID : 0
Retention Settings
BackupType : DATA
SchedulerType : None
RetentionCount : 7
RetentionDays : 0
VerificationEnabled : False
NodeName:
PolicyId : 39
PluginName : hana
PluginParams : SMCoreContracts.SmKeyValueCollection
SmSCBackupType : FileBasedBackup
Name :
Type :
Id :
Host :
UserName :
Passphrase :
Deleted: False
Auth : SMCoreContracts.SmAuth
IsClone: False
CloneLevel : 0
Hosts : {}
StorageName:
ResourceGroupNames :
PolicyNames:
Key: 0
NsmObjectID: 0
Example 6: Creating a new backup policy for SnapCenter Plugin for SAP HANA backup of type SnapshotBasedBackup
Add-SmPolicy -PolicyName hana_snapshotbased -PolicyType Backup -PluginPolicyType hana -BackupType SnapShotBasedBackup
This example syntax creates a new backup policy for SnapCenter Plug-in for SAP HANA with SnapshotBasedBackup as the backup type.
ApplyRetention : True
ApplySnapMirrorUpdate : False
ApplySnapvaultUpdate: False
MirrorVaultUpdateRetryCount : 3
RetentionCount : 7
RetentionDays : 0
SnapVaultLabel :
AppPolicies : {}
DateCreated : 3/23/2017 10:17:30 PM
DateModified: 3/23/2017 10:17:30 PM
Description :
PluginPolicyType: hana
PolicyType : Backup
PostScriptArguments :
PostScriptPath :
PreScriptArguments :
PreScriptPath :
Schedules : {}
Schedule: SMCoreContracts.SmSchedule
ScriptTimeOut : 60
Name: hana_snapshotbased
Type:
Id : 41
Host:
UserName:
Passphrase :
Deleted : False
Auth: SMCoreContracts.SmAuth
IsClone : False
CloneLevel : 0
Hosts : {}
StorageName :
ResourceGroupNames :
PolicyNames :
Key : 0
NsmObjectID : 0
Retention Settings
BackupType : DATA
SchedulerType : None
RetentionCount : 7
RetentionDays : 0
VerificationEnabled : False
NodeName:
PolicyId : 41
PluginName : hana
PluginParams : SMCoreContracts.SmKeyValueCollection
SmSCBackupType : DataBackup
Name :
Type :
Id :
Host :
UserName :
Passphrase :
Deleted: False
Auth : SMCoreContracts.SmAuth
IsClone: False
CloneLevel : 0
Hosts : {}
StorageName:
ResourceGroupNames :
PolicyNames:
Key: 0
NsmObjectID: 0
Example 7: Adding a policy with a retention based on number of days
Add-SMPolicy -PolicyName 'DB2_DAILY_POLICY' -PolicyType 'Backup' -PluginPolicyType DB2-
retentionsettings @{"BackupType"="DATA";"ScheduleType"="DAILY";"RetentionDays"='3'} -
description 'DB2 daily schedule policy' -scheduletype 'DAILY'