SQL server error code 9003 occurs when an invalid log event or sequence is recorded to the log manager for the specific database. This may have originated due to corruption, inconsistency or replication issues among the MDF (primary database) and the LDF (transaction log) files.
The log scan number %S_LSN passed to log scan in database '%.*ls' is not valid.
Since there are no straightforward methods available to rectify the error and to eradicate its aftereffects, the given resolutions can be applied:
Restore from Backup: If the error originates due to replication of data components, try deleting the associated information or contents and then try restoration of the database from the available backup. It is a good practice to backup SQL Server database on regular basis as this helps in complete data restoration in critical situations.
Reinstall SQL Server: Uninstall the existing SQL Server application and try reinstalling the same on the machine. This may help in eliminating the occurrence of error message. Before initiating the un-installation procedure it is recommended to backup all MDF file components including database tables, stored procedures, triggers, indexes, etc. Once the reinstallation task is accomplished, restore all the components back to the database.
DBCC Implementation: After reinstalling the application, run DBCC CHECKDB to check the physical and logical errors as well as inconsistencies (if any) in the specified database components. Check consistency of primary database (MDF) files by using the DBCC CHECKDB command. As an alternate solution, you may try detaching model database; renaming database files and further attaching the same.
Databases affected with SQL server error 9003 may marked as SUSPECT. To identify the database that has undergone SUSPECT mode and to troubleshoot the existing situation, try executing the following procedure:
Note: It is not possible to connect to database when it is in SUSPECT mode so it is mandatory to turn it to EMERGENCY mode.
The above mentioned resolutions might help in withdrawal of SQL error 9003 from the database and bringing it to normal mode when executed in an appropriate manner. On the contrary, any sort of mistake while implementing any of these method(s) might result in loss of information.
If you need to eradicate SQL server errors 9003 from database (MDF and NDF) files, then you can utilize SQL server MDF file recovery that helps recovering databases from SUSPECT mode. In addition, it recovers deleted or lost data files back to the database. The integrity of entire database is maintained and the original structure of all the incorporated attributed remains unchanged while recovery process. The major benefit of the tool is that it allows exporting recovered components to either "SQL Server Database" or "SQL Server Compatible Scripts".