还原删除的 Azure Database for MariaDB 服务器Restore a deleted Azure Database for MariaDB server

删除服务器后,数据库服务器备份最多可在服务中保留五天。When a server is deleted, the database server backup can be retained up to five days in the service. 只能从服务器最初所在的 Azure 订阅访问和还原数据库备份。The database backup can be accessed and restored only from the Azure subscription where the server originally resided. 按照以下建议步骤可在删除服务器后 5 天内恢复删除的 MariaDB 服务器资源。The following recommended steps can be followed to recover a deleted MariaDB server resource within 5 days from the time of server deletion. 仅当服务器的备份仍可用且未从系统中删除时,建议的步骤才适用。The recommended steps will work only if the backup for the server is still available and not deleted from the system.

先决条件Pre-requisites

若要还原已删除的 Azure Database for MariaDB 服务器,需要以下信息:To restore a deleted Azure Database for MariaDB server, you need following:

  • 托管原始服务器的 Azure 订阅名称Azure Subscription name hosting the original server
  • 之前创建服务器的位置Location where the server was created

还原步骤Steps to restore

  1. 在 Azure 门户中,从“监视”页转到活动日志Go to the Activity Log from Monitor blade in Azure portal.

  2. 在活动日志中,单击“添加筛选器”(如图所示),并设置以下筛选器In Activity Log, click on Add filter as shown and set following filters for the

    • 订阅 = 托管已删除服务器的订阅Subscription = Your Subscription hosting the deleted server
    • 资源类型 = Azure Database for MariaDB 服务器 (Microsoft.DBForMariaDB/servers)Resource Type = Azure Database for MariaDB servers (Microsoft.DBForMariaDB/servers)
    • 操作 = 删除 MariaDB 服务器 (Microsoft.DBForMariaDB/servers/delete)Operation = Delete MariaDB Server (Microsoft.DBForMariaDB/servers/delete)

    为删除 MySQL 服务器操作筛选出的活动日志Activity log filtered for delete MariaDB server operation

  3. 双击“删除 MySQL 服务器”事件,然后单击“JSON”选项卡,并记下 JSON 输出中的“resourceId”和“submissionTimestamp”属性。Double Click on the Delete MariaDB Server event and click on the JSON tab and note the "resourceId" and "submissionTimestamp" attributes in JSON output. resourceId 的格式如下:/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TargetResourceGroup/providers/Microsoft.DBForMariaDB/servers/deletedserver。The resourceId is in the following format: /subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TargetResourceGroup/providers/Microsoft.DBForMariaDB/servers/deletedserver.

  4. 使用 REST APIUse REST API.

  5. 以下是请求正文部分:The following is Request Body section:

    {
        "location": "Dropped Server Location",  
        "properties": 
            {
                "restorePointInTime": "submissionTimestamp - 15 minutes",
                "createMode": "PointInTimeRestore",
                "sourceServerId": "resourceId"
            }
    }
    
  6. 替换上述请求正文中的以下值:Replace the following values in the above request body:

    • “Dropped Server Location”,替换为最初创建已删除的服务器的 Azure 区域"Dropped server Location" with the Azure region where the deleted server was originally created
    • “submissionTimestamp”和“resourceId”,替换为在步骤 3 中获取的值。"submissionTimestamp", and "resourceId" with the values captured in Step 3.
    • 对于“restorePointInTime”,请指定将“submissionTimestamp”减去 15 分钟后得到的值,以确保命令不出错。For "restorePointInTime", specify a value of "submissionTimestamp" minus 15 minutes to ensure the command does not error out.
  7. 如果看到响应代码 201 或 202,则表示已成功提交还原请求。If you see Response Code 201 or 202, the restore request is successfully submitted.

  8. 服务器创建可能需要一些时间,具体取决于原始服务器上预配的数据库大小和计算资源。The server creation can take time depending on the database size and compute resources provisioned on the original server. 通过在活动日志中筛选以下信息可监视还原状态The restore status can be monitored from Activity log by filtering for

    • 订阅 = 你的订阅Subscription = Your Subscription
    • 资源类型 = Azure Database for MariaDB 服务器 (Microsoft.DBForMariaDB/servers)Resource Type = Azure Database for MariaDB servers (Microsoft.DBForMariaDB/servers)
    • 操作 = 更新 MariaDB 服务器创建Operation = Update MariaDB Server Create

后续步骤Next steps

  • 如果在五天内尝试还原服务器,但在准确执行前述步骤后仍收到错误,请开启帮助支持事件。If you are trying to restore a server within five days, and still receive an error after accurately following the steps discussed earlier, open a support incident for assistance. 如果在五天后尝试还原已删除的服务器,则会因为找不到备份文件而出错。If you are trying to restore a deleted server after five days, an error is expected since the backup file cannot be found. 在这种情况下,请勿开启支持票证。Do not open a support ticket in this scenario. 如果已从系统中删除备份,则支持团队也无法提供任何帮助。The support team cannot provide any assistance if the backup is deleted from the system.
  • 为防止意外删除服务器,强烈建议使用资源锁To prevent accidental deletion of servers, we highly recommend using Resource Locks.