SQL server master库损坏的解决方案

SQL server 2k master db corruption due to power cutoff, causing sql server cannot start up. In this server, ArcSDE 9 and ArcIMS 9 are associated with Sql Server 2k sp4. and worse, no backup have been created prior to this disaster.
solution:
1. Backup possibly effected dbs, i.e., sde db, and westdc db.
2. run rebuildm.exe to reconstruct the master db. all logins are lost after that operation. sde amd westdc dbs cannot be found in the rebuilt master db.
3. attach the original sde db and westdc db using sa as the db owner.
4. create lost logins, for example, westdc, sde, etc. Fortunately, I have backed up all these information.
5. using enterprise manager, open sde and westdc dbs, isolated users can be found under the users leaf. So we have to assign the appropriate logins to those isolated users. use commands as follow:
USE sde;
GO
sp_change_users_login @Action=’Report’;
GO
USE westdc;
GO
sp_change_users_login @Action=’update_one’, @UserNamePattern=’westdc’, @LoginName=’westdc’;
GO
the first set of commands is used to report the isolated users in database sde. the second set of commands will assign an existing login named westdc to the isolated user westdc.
6. restart the arcsde service, then arcims services. DONE!
Lessons:
We always are required to backup databases in a regular interval.

1 thought on “SQL server master库损坏的解决方案

Leave a Reply

Your email address will not be published.