'database' is compressed but does not reside in a read-only database or filegroup
As stated here, SQL Server databases are not supported on compressed volumes.
In this case, Windows had recommended compression to make more room on their hard drive, so they did just that.
The fix was:
- Go to 'C:Program FilesMicrosoft SQL ServerMSSQL14.SQLEXPRESSMSSQL' ('MSSQL14.SQLEXPRESS' might be different, depending on your SQL Server Version).
- Right click the 'DATA' folder (i.e. the folder that contains .mdf files)
- Choose 'Properties'
- Click the 'Advanced' button
- Uncheck the 'Compress contents to save disk space' checkbox
- Click 'Ok'.
找到bak文件,所在的文件夹。右键查看文件夹的属性,然后在高级里面取消compress
我遇到的问题,最后发现是restore的files tab里面的restore as这一列有问题。是sql server默认的路径,把这个路径换成自己的路径就可以了。
默认指向了C:Program FilesMicrosoft SQL ServerMSSQL12.SQL2014MSSQLDATA路径,这个路径的文件夹属性里面确实设置勾选了Compress contents to save disk space