我在本地机器上创建了一个数据库,然后对表DataLabTables进行了名为tables.bak的备份。

我将备份移动到远程机器,没有该表,并尝试进行恢复,但得到以下错误:

sqlclient . sqlerror:操作系统返回 尝试访问时错误'5(访问被拒绝。)' 'RestoreContainer::ValidateTargetForCreation'在c:\程序 文件\Microsoft SQL Server\MSSQL.1\MSSQL\DataLabTables.mdf `。

如果这是问题所在,我该如何修正我的权利?


当前回答

这可能不是最好的解决方案,但我试图在SQL Server 2005做恢复,但我改为SQL Server 2008,它工作。

其他回答

Another scenario could be the existence of multiple database paths. First, make note of the path where new databases are currently being stored. So if you create a new empty database and then do Tasks/Restore, make sure that the path the restore is trying to use is the same directory that the empty database was created in. Even if the restore path is legal, you will still get the access denied error if it is not the current path you are working with. Very easy to spot when the path is not legal, much harder to spot when the path is legal, but not the current path.

抱歉,因为我不能评论…

我也有同样的问题。在我的情况下,问题与试图恢复在一个旧的sql server文件夹(存在于服务器上)有关。这是由于旧的sql server备份(即sql server 2012备份)在新的sql server (sql server 2014)中恢复。真正的问题与@marc_s的回答没有太大的不同。无论如何,我只是将目标文件夹更改为新的SQL Server DATA文件夹。

备份创建者安装了MSSql版本10,因此当他进行备份时,它还存储了原始文件路径(以便能够在相同的位置恢复它),但我使用的是版本11,因此它无法找到目标目录。 所以我把输出文件的目录改为C:\Program Files\Microsoft SQL Server\MSSQL11。MSSQLSERVER\MSSQL\DATA\,它能够成功地恢复数据库。

我有同样的问题,但我使用sql server 2008 r2,你必须检入选项并验证sql将保存文件.mdf和.ldf的路径,你必须选择你的sql server安装的路径。我用这个解决了我的问题,希望它能帮助到你。

我也有同样的问题。原来我的SQL Server和SQL Server代理服务登录时在网络服务帐户下运行,该帐户没有执行备份恢复的写访问权。

我将这两个服务都更改为以本地系统帐户登录,这就解决了问题。