The continuing journey in the very slow quest to restore everything.
This post is the recovery of the SQL Express database used by the Threat Management Gateway (TMG 2010) firewall. The SQL Server (ISARS) and (MSFW) instances were failing to start with an eventid:9003 message saying “The log scan number passed to log scan in database ‘master’ is not valid”
Essentially it would appear the MASTER database was corrupted, and as per the other servers the backup was also messed up. :sigh:
In this case it seems the fix was really simple:
1. Locate the master database files for each instance: e.g. C:\Program Files\Microsoft SQL Server\MSSQL10.ISARS\MSSQL\Data\master.mdf and mastlog.ldf
2. Rename them just for backup in case (although it probably doesn’t matter as they don’t work anyway)
3. In the MSSQL\Template Data folder, COPY the master.mdf and mastlog.ldf files into the DATA directory
4. Repeat for the SQL instance in the other directory (MSSQL10.MSFW)
So that’s sorts out the initial problem with the SQL Express, now for some cleanup for TMG. when the services start, they try to re-create the TMG database because the link to the existing ones no longer exists and they can’t be “trusted”. So we just rename the old TMG databases and let it create new ones. If you need to access those old databases, just copy them off and mount them on another SQL server instance.
1. Locate MSSQL10.ISARS\MSSQL\DATA\ISA_RS_Db.mdf and ISA_RS_Db_log.ldf and rename them (just add _old or something to the name)
2. Locate MSSQL10.MSFW\MSSQL\DATA\CachePerfCounters.mdf and CachePerfCounters_log.ldf and rename them as well
Now when you start the Firewall Service, it will recreate those database and you should be back in action.