March 8, 2004 at 2:37 pm
I detached a DB named SEM4 that was working well and substituted another test version which attached OK and my testing, etc. went well. I am using SQL Server 7 from VS 6 Enterprise.
Now I cannot re attach the original version. This is critical because it contains quite a bit that is not backed up. Shame on me!
All attempts to attach thru code in the program and thru the Query Analyzer trying both single and multi file attach give the same result: Error -2147212501 in Microsoft SQL-DMO[ODBC SQL State:HY000] Reason: [Microsoft][ODBC SQL Server driver][SQL Server] The LSN [795:169:1] passed to log scan in database 'SEM4' is invalid.
I do not believe the DB is corrupted as I have another copy of the same DB that was "saved" a day prior to this happening and it gives the same result when I try to attach it. (This has worked well in the past and I thought this to be a sufficient back up for my purposes).
I do not even know what the LSN is and I can't find documentation on it.
Can any one help?
Ralph D. Meredith
March 8, 2004 at 2:54 pm
The LSN is a Log Serial Number that basically identifies each individual record in the log. It may have a problem of sorts. If you have a single MDF file and LDF file try the command 'sp_attach_single_file_db' Which will let you attach your database without the log file. (SQL Server will create a new log file) You will lose any info in the log but this may not matter. - Think about this first Were all transactions committed before you detached?
Francis
March 8, 2004 at 3:12 pm
I have tried the single file attach. I have also tried substituting a copy of the .mdf that was "saved" the previous day and got the same results. I would be most happy to ignore the previous log file content, but I have not been able to get this SEM.mdf to attach.
I also tried deleting the SEM4 DB and creating a new one of a similar size and then renaming and substituting. That did not work either.
I am really frustrated at this point. Any ideas?
Ralph D. Meredith
March 8, 2004 at 3:21 pm
Hmmm. Have you tried dropping the SEM4 database (don't create a new one at all) The use the 'sp_attach_single_file_db' to attach only the MDF
Its sounds like a awful problem...
Francis
March 8, 2004 at 3:35 pm
Attempting to drop it resulted in a message that it could not be dropped because it is not in the catalog.
Ralph D. Meredith
April 13, 2004 at 6:56 am
OK, I had the same problem as above. The DB I was moving had its recovery mode set to "simple". I was able to reattach the DB using the 'sp_attach_single_file_db' command; however, I had to delete (rename) the existing log file before a new one could be created.
April 13, 2004 at 7:42 am
I just got it recovered in much the same way.
Thanks
Ralph D. Meredith
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply