求助:杯具从sql server 移机开始
首先,我有四个软件需要登录,然后读写SQL server 上的数据库Central_DB数据。上个月我将我的sql server 2005,平台是windows xp移到另外一个服务器 sqlserver 2005, 平台是windows server 2003.
移机的方式是将Central_DB(我需要的唯一数据库)备份然后恢复到新服务器。
由于新的服务器没有原先和数据库一样的用户名,我就将这些帐号创建。然后杯具了。
运行程序 WWU ,用和以前一样的帐号user1登录,出现错误信息“Cannot open database "Central_DB" requested by the login. The login failed.”
查看数据库LOG:
2011-02-10 16:18:11.19 spid12s SQL Server has encountered 10 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2011-02-10 16:18:11.19 spid12s SQL Server has encountered 10 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2011-02-10 16:18:11.20 spid12s SQL Server has encountered 10 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2011-02-10 16:18:48.34 spid52 Starting up database 'Central_DB'.
2011-02-10 16:18:48.61 Logon Error: 18456, Severity: 14, State: 16.
2011-02-10 16:18:48.61 Logon Login failed for user 'user2'. [CLIENT: 101.241.201.1] 《---这里很诡异,我明明登录的是user1,数据库记录的是user2
2011-02-10 16:21:50.35 spid52 Starting up database 'Central_DB'.
由于user2是另一个程序(register)用来登录Central_DB的,运行那个程序用user2登录,出错。
然后我想到孤立账户的问题,有可能现在user1的sid被user2用了,我就执行 EXEC sp_change_users_login 'Report';
果然有user2, 然后我执行 sp_change_users_login 'update_one', 'user2','user2'; 然后user2能登录,register程序也能运行。
然后回头再运行wwu,用user1登录, 出现错误信息“login failed”。
最后我想创建一个新的服务器账户对应一个新的数据库账户user3。用user3登录还是错误信息“login failed”。
这时查看sql server LOG 记录:
2011-02-10 16:44:43.57 spid12s SQL Server has encountered 4 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2011-02-10 16:44:43.58 spid12s SQL Server has encountered 4 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2011-02-10 16:44:43.58 spid12s SQL Server has encountered 4 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due to some database maintenance or reconfigure operations.
2011-02-10 16:44:43.99 spid51 Starting up database 'Central_DB'.
请高手指导如何做下一步?万分感谢。