可以使用Azure ARM SqlManagementClient从时间点还原创建新数据库吗? [英] Possible to create new Database from Point In Time Restore using Azure ARMs SqlManagementClient?

查看:101
本文介绍了可以使用Azure ARM SqlManagementClient从时间点还原创建新数据库吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

专门寻找一种方法来执行时间点还原到新数据库,保留原始数据库; 使用托管API而不是REST API或模板 .

Specifically looking for a way to perform point in time restore to a new Database, preserve the original database; using Managed API instead of REST API or Templates.

我到目前为止的代码:

    public async Task CreateDatabaseFromRestorePointAsync(
       string resourceGroupName, string serverName, 
       string databaseName, DateTime time) {

        using (SqlManagementClient sqlMgmtClient = GetSqlManagementClient())
        {
            DatabaseInner myDb = await sqlMgmtClient.Databases.GetAsync(
               resourceGroupName, serverName, databaseName);            

            var newDb = new DatabaseInner
            {
                Location = myDb.Location,
                CreateMode = CreateMode.PointInTimeRestore,
                // RestorePointInTime = time; 
                Edition = "Basic",
                SourceDatabaseId = myDb.Id                   
            };

            var result = await sqlMgmtClient.Databases.CreateOrUpdateAsync(
               resourceGroupName, serverName, "BackUpRestoreTestDb", newDb);               

            // Throws "The point in time was not specified for restoring live database...'"
        }
    }

发现以下内容:

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆