如何在服务器的sql server数据库中还原数据库? [英] How to Restore Database in Server's sql server Database?

查看:69
本文介绍了如何在服务器的sql server数据库中还原数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个数据库test1和test2.我从test1获得了备份.现在我想将此备份还原到test2.

I have 2 database test1 and test2. I got the backup from test1. And now i want to restore this backup into test2.

我的test2数据库在共享服务器中.当我执行还原时,它会失败.并填充此错误消息.

My test2 database in shared server. When I am doing restore it's get failed. and populate this error message.

Msg 3110, Level 14, State 1, Line 1
User does not have permission to RESTORE database 'databasename'.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

我为db_backupoperator的用户设置了权限.但它仍未还原数据库.请让我知道我做错了.

i set the permission to the user of db_backupoperator. but it's still not restoring database. Please let me know that what i am doing wrong.

谢谢

推荐答案

您将需要 db_creator 权限才能成功还原数据库.

You will need the db_creator permission in order to successfully restore a database.

来自此MSDN文章:

权限如果正在还原的数据库不存在,则该用户必须具有CREATE DATABASE权限才能执行RESTORE.如果数据库存在,则RESTORE权限默认为sysadmin和dbcreator固定服务器角色以及服务器的所有者(dbo)数据库(对于FROM DATABASE_SNAPSHOT选项,数据库始终存在).RESTORE权限已授予其成员身份的角色信息始终可随时用于服务器.因为固定仅当数据库处于以下状态时才能检查数据库角色成员身份可访问且未损坏,而在使用RESTORE时并非总是如此执行后,db_owner固定数据库角色的成员没有恢复权限.

Permissions If the database being restored does not exist, the user must have CREATE DATABASE permissions to be able to execute RESTORE. If the database exists, RESTORE permissions default to members of the sysadmin and dbcreator fixed server roles and the owner (dbo) of the database (for the FROM DATABASE_SNAPSHOT option, the database always exists). RESTORE permissions are given to roles in which membership information is always readily available to the server. Because fixed database role membership can be checked only when the database is accessible and undamaged, which is not always the case when RESTORE is executed, members of the db_owner fixed database role do not have RESTORE permissions.

这篇关于如何在服务器的sql server数据库中还原数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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