ASP.NET 2.0与SQL Express 2005在迁移到Windows 2003时发生数据库为只读的错误

ASP.NET 2.0与SQL Express 2005共同开发的网站,在XP下一切正常,当在迁移到Windows 2003时发生数据库为只读的错误,而且问题提示有三种以上情况,更改权限设置无效,在网上查了一下,原来是数据库的权限存在BUG,解决方法如下:

 

Failed to update database "C:/WEBSITES/DEPUTY/APP_DATA/ASPNETDB.MDF" because the database is read-only.

Try this:

1. Detach aspnetdb database from SQLEXPRESS using sseutil.exe utility.
2. Remove *.mdf and *.ldf files from App_Data application directory
3. Grant Read/Write access on App_Data to working process identity (ASPNET for IIS5.X or NETWORK SERVICE for IIS6)
4. Copy *.mdf, *.ldf files back into App_Data folder
5. Run application, refresh if any connection related error received

This bug is announced and fixed in later build of SSE. You can see full description here.

 

Try the following steps to get your MDFs working again:

1. Delete the MDF/LDF files from the App_Data directory of the website under inetpub/wwwroot.
2. Download and install the SSEUTIL command line tool from:
     http://www.microsoft.com/downloads/details.aspx?FamilyID=FA87E828-173F-472E-A85C-27ED01CF6B02&displaylang=en
3. Using sseutil, issue a command that looks something like: sseutil -child "NT AUTHORITY/NETWORK SERVICE" -detach D:/ . You will need to change the account name and the detach path to match your machine settings. If on IIS5/5.1, then ASPNET will be the correct user account. Also, you can determine the detach path pretty easily by issuing sseutil -list to see where the problematic MDFs are currently attached. The "D:/" in the sample command line is just the first few characters that sseutil uses to auto-detach all databases that begin with "D:/". Change the path as neeeded for your machine.
4. Set the ACLs on App_Data directory under inetpub/wwwroot to grant R/W to the appropriate process account - NETWORK SERVICE on WS03 or ASPNET on IIS5/5.1.
5. Re-copy the MDF/LDF files from the directory where the file-based website exists back into App_Data under inetpub/wwwroot. After the copy occurs, check that the MDF/LDF files have now inherited the new ACLs.
6. Re-run the application (ignore any connection errors that might occur - just hit refresh in the browser).

We are working on a fix in SSE that will eliminate the manual reconfiguration for RTM.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值