Notitie
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen u aan te melden of de directory te wijzigen.
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen de mappen te wijzigen.
Azure CLI wordt gebruikt voor het maken en beheren van Azure-resources vanaf de opdrachtregel of door middel van scripts. This documentation details how to manage a backed-up SAP HANA database on Azure VM - all using Azure CLI. You can also perform these steps using the Azure portal.
Gebruik Azure Cloud Shell voor het uitvoeren van CLI-opdrachten.
By the end of this tutorial, you'll be able to:
- Back-up- en hersteltaken bewaken
- Protect new databases added to an SAP HANA instance
- Change the policy
- Beveiliging stoppen
- Beveiliging hervatten
Als u Een back-up maken van een SAP HANA-database in Azure met behulp van CLI hebt gebruikt om een back-up te maken van uw SAP HANA-database, gebruikt u de volgende resources:
- een resourcegroep met de naam saphanaResourceGroup;
- a vault named saphanaVault
- protected container named VMAppContainer;Compute;saphanaResourceGroup;saphanaVM
- backed-up database/item named saphanadatabase;hxe;hxe
- resources in the westus2 region
Azure CLI makes it easy to manage an SAP HANA database running on an Azure VM that's backed-up using Azure Backup. This tutorial details each of the management operations.
Opmerking
See the SAP HANA backup support matrix to know more about the supported configurations and scenarios.
Back-up- en hersteltaken bewaken
To monitor completed or currently running jobs (backup or restore), use the az backup job list cmdlet. Met CLI kunt u ook een actieve taak onderbreken of wachten totdat een taak is voltooid.
az backup job list --resource-group saphanaResourceGroup \
--vault-name saphanaVault \
--output table
De uitvoer ziet er ongeveer als volgt uit:
Name Operation Status Item Name Start Time UTC
------------------------------------ --------------- --------- ---------- -------------------
e0f15dae-7cac-4475-a833-f52c50e5b6c3 ConfigureBackup Completed hxe 2019-12-03T03:09:210831+00:00
ccdb4dce-8b15-47c5-8c46-b0985352238f Backup (Full) Completed hxe [hxehost] 2019-12-01T10:30:58.867489+00:00
4980af91-1090-49a6-ab96-13bc905a5282 Backup (Differential) Completed hxe [hxehost] 2019-12-01T10:36:00.563909+00:00
F7c68818-039f-4a0f-8d73-e0747e68a813 Restore (Log) Completed hxe [hxehost] 2019-12-03T05:44:51.081607+00:00
Beleid wijzigen
To change the policy underlying the SAP HANA backup configuration, use the az backup policy set cmdlet. The name parameter in this cmdlet refers to the backup item whose policy we want to change. For this tutorial, we'll be replacing the policy of our SAP HANA database saphanadatabase;hxe;hxe with a new policy newsaphanaPolicy. New policies can be created using the az backup policy create cmdlet.
az backup item set policy --resource-group saphanaResourceGroup \
--vault-name saphanaVault \
--container-name VMAppContainer;Compute;saphanaResourceGroup;saphanaVM \
--policy-name newsaphanaPolicy \
--name saphanadatabase;hxe;hxe \
De uitvoer moet er als volgt uitzien:
Name Resource Group
------------------------------------- --------------
cb110094-9b15-4c55-ad45-6899200eb8dd SAPHANA
Create incremental backup policy
To create an incremental backup policy, execute the az backup policy create command with the following parameters:
- --backup-management-type – Azure Workload
- --workload-type - SAPHana
- --name – Name of the policy
- --policy - JSON file with appropriate details for schedule and retention
- --resource-group - Resource group of the vault
- --vault-name – Name of the vault
Voorbeeld:
az backup policy create --resource-group saphanaResourceGroup --vault-name saphanaVault --name sappolicy --backup-management-type AzureWorkload --policy sappolicy.json --workload-type SAPHana
Sample JSON (sappolicy.json):
"eTag": null,
"id": "/Subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/saphanaResourceGroup/providers/Microsoft.RecoveryServices/vaults/saphanaVault/backupPolicies/sappolicy",
"location": null,
"name": "sappolicy",
"properties": {
"backupManagementType": "AzureWorkload",
"makePolicyConsistent": null,
"protectedItemsCount": 0,
"settings": {
"isCompression": false,
"issqlcompression": false,
"timeZone": "UTC"
},
"subProtectionPolicy": [
{
"policyType": "Full",
"retentionPolicy": {
"dailySchedule": null,
"monthlySchedule": {
"retentionDuration": {
"count": 60,
"durationType": "Months"
},
"retentionScheduleDaily": null,
"retentionScheduleFormatType": "Weekly",
"retentionScheduleWeekly": {
"daysOfTheWeek": [
"Sunday"
],
"weeksOfTheMonth": [
"First"
]
},
"retentionTimes": [
"2021-01-19T00:30:00+00:00"
]
},
"retentionPolicyType": "LongTermRetentionPolicy",
"weeklySchedule": {
"daysOfTheWeek": [
"Sunday"
],
"retentionDuration": {
"count": 104,
"durationType": "Weeks"
},
"retentionTimes": [
"2021-01-19T00:30:00+00:00"
]
},
"yearlySchedule": {
"monthsOfYear": [
"January"
],
"retentionDuration": {
"count": 10,
"durationType": "Years"
},
"retentionScheduleDaily": null,
"retentionScheduleFormatType": "Weekly",
"retentionScheduleWeekly": {
"daysOfTheWeek": [
"Sunday"
],
"weeksOfTheMonth": [
"First"
]
},
"retentionTimes": [
"2021-01-19T00:30:00+00:00"
]
}
},
"schedulePolicy": {
"schedulePolicyType": "SimpleSchedulePolicy",
"scheduleRunDays": [
"Sunday"
],
"scheduleRunFrequency": "Weekly",
"scheduleRunTimes": [
"2021-01-19T00:30:00+00:00"
],
"scheduleWeeklyFrequency": 0
}
},
{
"policyType": "Incremental",
"retentionPolicy": {
"retentionDuration": {
"count": 30,
"durationType": "Days"
},
"retentionPolicyType": "SimpleRetentionPolicy"
},
"schedulePolicy": {
"schedulePolicyType": "SimpleSchedulePolicy",
"scheduleRunDays": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"scheduleRunFrequency": "Weekly",
"scheduleRunTimes": [
"2017-03-07T02:00:00+00:00"
],
"scheduleWeeklyFrequency": 0
}
},
{
"policyType": "Log",
"retentionPolicy": {
"retentionDuration": {
"count": 15,
"durationType": "Days"
},
"retentionPolicyType": "SimpleRetentionPolicy"
},
"schedulePolicy": {
"scheduleFrequencyInMins": 120,
"schedulePolicyType": "LogSchedulePolicy"
}
}
],
"workLoadType": "SAPHanaDatabase"
},
"resourceGroup": "saphanaResourceGroup",
"tags": null,
"type": "Microsoft.RecoveryServices/vaults/backupPolicies"
}
Once the policy is created successfully, the output of the command will display the policy JSON that you passed as a parameter while executing the command.
You can modify the following section of the policy to specify the desired backup frequency and retention for incremental backups.
Voorbeeld:
{
"policyType": "Incremental",
"retentionPolicy": {
"retentionDuration": {
"count": 30,
"durationType": "Days"
},
"retentionPolicyType": "SimpleRetentionPolicy"
},
"schedulePolicy": {
"schedulePolicyType": "SimpleSchedulePolicy",
"scheduleRunDays": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
],
"scheduleRunFrequency": "Weekly",
"scheduleRunTimes": [
"2017-03-07T02:00:00+00:00"
],
"scheduleWeeklyFrequency": 0
}
}
Voorbeeld:
If you want to have incremental backups only on Saturday and retain them for 60 days, make the following changes in the policy:
- Update retentionDuration count to 60 days
- Specify only Saturday as ScheduleRunDays
{
"policyType": "Incremental",
"retentionPolicy": {
"retentionDuration": {
"count": 60,
"durationType": "Days"
},
"retentionPolicyType": "SimpleRetentionPolicy"
},
"schedulePolicy": {
"schedulePolicyType": "SimpleSchedulePolicy",
"scheduleRunDays": [
"Saturday"
],
"scheduleRunFrequency": "Weekly",
"scheduleRunTimes": [
"2017-03-07T02:00:00+00:00"
],
"scheduleWeeklyFrequency": 0
}
}
Protect new databases added to an SAP HANA instance
Registering an SAP HANA instance with a Recovery Services vault automatically discovers all the databases on this instance.
However, in cases when new databases are added to the SAP HANA instance later, use the az backup protectable-item initialize cmdlet. This cmdlet discovers the new databases added.
az backup protectable-item initialize --resource-group saphanaResourceGroup \
--vault-name saphanaVault \
--container-name VMAppContainer;Compute;saphanaResourceGroup;saphanaVM \
--workload-type SAPHANA
Then use the az backup protectable-item list cmdlet to list all the databases that have been discovered on your SAP HANA instance. Deze lijst sluit echter de databases uit waarop de back-up al is geconfigureerd. Once the database to be backed-up is discovered, refer to Enable backup on SAP HANA database.
az backup protectable-item list --resource-group saphanaResourceGroup \
--vault-name saphanaVault \
--workload-type SAPHANA \
--output table
The new database that you want to back up will show up in this list, which will look as follows:
Name Protectable Item Type ParentName ServerName IsProtected
--------------------------- ---------------------- ------------ ----------- ------------
saphanasystem;hxe SAPHanaSystem HXE hxehost NotProtected
saphanadatabase;hxe;systemdb SAPHanaDatabase HXE hxehost NotProtected
saphanadatabase;hxe;newhxe SAPHanaDatabase HXE hxehost NotProtected
Stop protection for an SAP HANA database
You can stop protecting an SAP HANA database in a couple of ways:
- Alle toekomstige back-uptaken stoppen en alle herstelpunten verwijderen.
- Alle toekomstige back-uptaken stoppen en de herstelpunten intact laten.
Houd rekening met het volgende als u ervoor kiest de herstelpunten intact te laten:
- All recovery points will remain intact forever, and all pruning will stop at stop protection with retain data.
- Er worden kosten in rekening gebracht voor het beveiligde exemplaar en de verbruikte opslag.
- Als u een gegevensbron verwijdert zonder back-ups te stoppen, mislukken nieuwe back-ups.
Let's look at each of the ways to stop protection in more detail.
Bescherming stoppen met gegevensbehoud
To stop protection with retain data, use the az backup protection disable cmdlet.
az backup protection disable --resource-group saphanaResourceGroup \
--vault-name saphanaVault \
--container-name VMAppContainer;Compute;saphanaResourceGroup;saphanaVM \
--item-name saphanadatabase;hxe;hxe \
--workload-type SAPHANA \
--output table
De uitvoer moet er als volgt uitzien:
Name ResourceGroup
------------------------------------ ---------------
g0f15dae-7cac-4475-d833-f52c50e5b6c3 saphanaResourceGroup
To check the status of this operation, use the az backup job show cmdlet.
Beveiliging stoppen zonder gegevens te behouden
To stop protection without retain data, use the az backup protection disable cmdlet.
az backup protection disable --resource-group saphanaResourceGroup \
--vault-name saphanaVault \
--container-name VMAppContainer;Compute;saphanaResourceGroup;saphanaVM \
--item-name saphanadatabase;hxe;hxe \
--workload-type SAPHANA \
--delete-backup-data true \
--output table
De uitvoer moet er als volgt uitzien:
Name ResourceGroup
------------------------------------ ---------------
g0f15dae-7cac-4475-d833-f52c50e5b6c3 saphanaResourceGroup
To check the status of this operation, use the az backup job show cmdlet.
Beveiliging hervatten
When you stop protection for the SAP HANA database with retain data, you can later resume protection. Als u de back-upgegevens niet behoudt, kunt u de beveiliging niet hervatten.
To resume protection, use the az backup protection resume cmdlet.
az backup protection resume --resource-group saphanaResourceGroup \
--vault-name saphanaVault \
--container-name VMAppContainer;Compute;saphanaResourceGroup;saphanaVM \
--policy-name saphanaPolicy \
--output table
De uitvoer moet er als volgt uitzien:
Name ResourceGroup
------------------------------------ ---------------
b2a7f108-1020-4529-870f-6c4c43e2bb9e saphanaResourceGroup
To check the status of this operation, use the az backup job show cmdlet.
Volgende stappen
To learn how to back up an SAP HANA database running on Azure VM using the Azure portal, refer to Backup SAP HANA databases on Azure VMs
To learn how to manage a backed-up SAP HANA database running on Azure VM using the Azure portal, refer to Manage Backed up SAP HANA databases on Azure VM