Microsoft Sql Server Error 5173
Contents |
Recent PostsRecent Posts Popular TopicsPopular Topics Home Search Members Calendar Who's On Home » SQL Server 7,2000 » Administration » Attach a database sql server log file does not match the primary file error 5173 Attach a database error 5173 Rate Topic Display Mode Topic Options cannot detach a suspect or recovery pending database. it must be repaired or dropped. Author Message JC-170735JC-170735 Posted Wednesday, March 2, 2005 12:46 PM Forum Newbie Group: General Forum Members Last Login: Thursday, April 14,
Attach Database Without Ldf
2005 9:57 AM Points: 2, Visits: 1 We are trying to attach a database from another server. We are running the same service pak as the other server. The files were detachedfrom the other
The Log Cannot Be Rebuilt Because There Were Open Transactions/users When The Database Was Shutdown
server. We have both the .mdf and .ldf files, we can verify the files. However, when we try to attach the file we get the following error:Error 5173: Cannot associate files withdifferent databases.Does anyone know why we would receive this error message or if we need to set some defaults prior to attaching the database?Any help would be appreciated.Thank You! Post #165155 wz700wz700 Posted Wednesday, March 2, 2005 ad hoc updates to system catalogs are not allowed. 3:54 PM Old Hand Group: General Forum Members Last Login: Monday, January 21, 2013 7:08 AM Points: 397, Visits: 17 From knowledge baseSQL Server does not allow you to attach a single file of a database that contains multiple files. The attach looks for all files that belong to the database during the attach and if it cannot find the files with the corresponding GUID, it fails the attach. Similarly, if you create a blank database with the same filenames and filegroups as the original database, replace some of the files, and then attempt to let SQL recover the database upon startup, recovery fails as indicated by the errorlog. Post #165230 Hanlie SteynbergHanlie Steynberg Posted Thursday, April 28, 2005 4:57 AM Forum Newbie Group: General Forum Members Last Login: Monday, December 3, 2007 11:20 PM Points: 1, Visits: 2 Does any one know of a workaround?Thanks Post #178211 Martin MojzisekMartin Mojzisek Posted Thursday, April 28, 2005 10:14 AM SSC-Enthusiastic Group: General Forum Members Last Login: Monday, June 15, 2009 8:17 AM Points: 131, Visits: 35 Are you sure that you have got all data files from the original db? Are you sure that your .mdf and .ldf files come from the sam
by FeedBurner SQLServer-DBA.com Links Recent Posts How can I tell if hyperthreading is on Windows 2012 How to schedule Powershell Script with Task Scheduler Lots of NULL values can cause trouble ALTER INDEX REBUILD clears sys.dm_db_index_usage_stats 7 mistakes DBAs make on CV or resume 5 ways globalisation has impacted IT Is a LOG BACKUP allowed on a SIMPLE RECOVERY database How to turn AUTO_SHRINK off 7 Essential Steps to Recover a Corrupt SQL Server Database DBA vacancy at Travelers - UK based Powered by TypePad One or more files http://www.sqlservercentral.com/Forums/Topic165155-5-1.aspx do not match the primary file of the database – Error 5173 01 March,2013 by Jack Vamvas A SQL Server Instance was shut down suddenly. When the SQL Server recovery a number of databases were in a RECOVERY_PENDING state. The error messages in the SQL Server Error Log were : --An example error message Log file 'F:\MSSQLSERVER\MSSQL$MYINST\Data\db1_log.LDF' does not match the http://www.sqlserver-dba.com/2013/03/one-or-more-files-do-not-match-the-primary-file-of-the-database-error-5173.html primary file. It may be from a different database or the log may have been rebuilt previously. Error: 5173, Severity: 16, State: 1. One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files. If this is an existing database, the file may be corrupted and should be restored from a backup. RECOVERY_PENDING means “Recovery of the file has been postponed. The file was online or did not exist before being changed to RECOVERY_PENDING by a partial restore” Main reasons for database stuck in RECOVERY_PENDING after a sudden shutdown 1) Log is missing 2) Log is corrupt 3) Drive not online Possible actions 1) If the drive is available and online – try a SQL Server restart , as the drive may have been unavailable during restart 2) If the restart doesn’t solve the problem , then RESTORE from a valid BACKUP 3) A Workaround For Error: 5173, Severity: 16, State: 1 try : a) Detach the database b) Delete the LDF file c)
(Русский)ישראל (עברית)المملكة العربية السعودية (العربية)ไทย (ไทย)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語) HomeLibraryLearnDownloadsTroubleshootingCommunityForums Ask a question Quick access Forums home Browse forums users FAQ Search related threads Remove From My Forums Answered by: My Instance not starting https://social.msdn.microsoft.com/Forums/sqlserver/en-US/5bd21193-051a-44c4-a497-7b737f21b13c/my-instance-not-starting-through-configuration-manager?forum=sqldatabaseengine through Configuration manager SQL Server > SQL Server Database Engine Question https://ekasiswanto.wordpress.com/2009/02/13/resolving-sql-error-5173/ 0 Sign in to vote I am not able to start the instance through configuration manager, i am getting below error, i will very appreciate for your help. NOTE: I am able to start the server through below command but i sql server dont what are the thing i have to do after starting the server in minimal configurattion. NET START MSSQL$sql2005 /f /T3608 Below error captured in the application event viewer One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation microsoft sql server with the correct files. If this is an existing database, the file may be corrupted and should be restored from a backup. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. Tuesday, November 15, 2011 3:04 PM Reply | Quote Answers 0 Sign in to vote you are saying you able to connect the server through NET START MSSQL$Instancename /f /T3608 After starting the server through above command, open a new query window, don't open through object explorer, move model database log and data file through below query to new path and physically move the files to the new path and then restart the server it will works. Alter database model modify file (name = model, filename = 'NewPath\model.mdf') go Alter database model modify file (name = model_log, filename = 'NewPath\modellog.ldf') go ~ Nareshkar Pakanati // www.mssqlfix.com // www.nareshkar.com // @mssqlfix Marked as answer by Jr.DBA Wednesday, November 16, 2011 7:58 AM Tuesday, November 15, 2011 3:50 PM Reply | Quot
insight of this error type : The generic form is : Error 5173: Cannot associate files with different databases. There is no format specifier, so all failure in attaching any possibly corrupted database will end up with this message. One of the causes of this error is the mismatch of some ID internally maintained by SQL Server 2000 between the MDF and LDF file. This ID is in the form of GUID and is called binding ID in SQL Server terminology. This kind of checking is good, considering the possibility of associating the MDF with wrong LDF file and vice versa. But sometimes, this error can be a disaster when you absolutely sure that you have already make some necessary steps to verify that it is indeed the right binding between your MDF and LDF file, yet, SQL Server still complains that is different. In this case, you have to resort to manually verifying the internal GUID of your MDF and LDF file, the way SQL Server was doing it. The internal GUID of MDF and LDF file is located at file header page (page 0) in the file header record. The file header record offset location is determine by the one and only slot in row offset array (slot 0), at offset 0x1FFE, word size. Let's have a look of our troubling MDF file to get the row offset value : The slot 0 value : The m_tornBits value : Please beware that the byte at offset 0x1FFF is actually the torn bit, and in detached state, it tends to point to wrong value. So, you should perform some correction of this byte to obtain correct row offset location for the file header record. First, this value is masked with 0xFC with AND operation. This can be done by ubiquitous calculator program with scientific mode : 0x01 AND 01xFC = 0x00 Next the m_tornBits value 0x80102001 is right shifted by 0x1E, again this can be accomplished by calculator (make sure you checked the Inv to perform the Rsh operation, because default operation is Lsh) : 0x80102001 Rsh (right shift) 0x1E = 0x00000002. For those who are curious, the 0x1E value is the v