When SQL Server restores the database, it prompts that it cannot enable the backup device (the device has an error or the device has been detached). SQL Server cannot enable the backup device.
[Problem description]
When you perform manual backup in system management, the system prompts "the backup device cannot be turned on, E: \ Automatic Backup \ ufidau8xTmp \ UFDATA. BAK '. An error occurs on the device or the device is offline. For more information, see SQL Server error logs. -2147217900"
Click "OK" and a suggestion "1. Check the remaining disk space in the prompt path, or whether the prompt directory exists. 2. Check the prompted system library bundle path d: \ u8soft \ Admin \ server \, consistent with the mdf data file directory (ZT + account set number \ year number, this part is not saved in the system library"
[Cause]
The temporary Backup Directory cannot be written with the "cannot open backup device 'e: \ Automatic Backup \ ufidau8xTmp \ UFDATA. BAK '" command, which should be unauthorized.
[Solution]
Stop the U8TASKSERVICE and delete the directory.
[Note] Back up data before modification;
[Note] If you have any questions, please contact us by email in time.
Solution:
Check that the SQL server on the server is run by a low-Permission user and the bak file is backed up remotely. Therefore, the SQL server running user in the backup directory has no read permission, so copy the bak file to the place where the SQL server running user has the read permission. If you can select this bak file, right-click and add everyone to have the read permission, and then restore the database.
However, the SQL Server database may be running as follows:
Use SQL statements to disconnect all users and roll back all transactions. The specific SQL statements are as follows:
Copy codeThe Code is as follows:
Alter database [DATABASE name]
SET OFFLINE WITH ROLLBACK IMMEDIATE