SQL Server troubleshooting: Difference between revisions

From Yggenyk
Jump to navigation Jump to search
Line 33: Line 33:
==How to resolve the issue of a database that was in Recovery Pending mode==
==How to resolve the issue of a database that was in Recovery Pending mode==
* [http://social.msdn.microsoft.com/Forums/sqlserver/en-US/835dee9b-0993-433f-baf7-a646dfa7f8f7/how-to-resolve-the-issue-of-a-database-that-was-in-recovery-pending-mode?forum=sqldatabaseengine How to resolve the issue of a database that was in Recovery Pending mode]
* [http://social.msdn.microsoft.com/Forums/sqlserver/en-US/835dee9b-0993-433f-baf7-a646dfa7f8f7/how-to-resolve-the-issue-of-a-database-that-was-in-recovery-pending-mode?forum=sqldatabaseengine How to resolve the issue of a database that was in Recovery Pending mode]
Stop SQL Server and remove transaction log file of this DB then restart again where DB should go with suspect mode ….If so you can run the below query


#ALTER DATABASE [DB_Name] SET  SINGLE_USER WITH NO_WAIT
#ALTER DATABASE [DB_Name] SET EMERGENCY;
#DBCC checkdb ([DB_Name], REPAIR_ALLOW_DATA_LOSS  )
#ALTER DATABASE [DB_Name] SET online;
#ALTER DATABASE [DB_Name] SET  Multi_USER WITH NO_WAIT
This solved the problem.


<google>ENGELSK</google>
<google>ENGELSK</google>

Revision as of 15:02, 19 May 2014

Reasons why SQL server installation will fail

A reboot is pending

If something else like a Windows update, ore another program that requires a reboot was installed before SQL server, and scheduled the rest of .dll replacements to happen during next reboot.
Reboot PC before installing SQL server, if it fails, try to reboot again and try once more.

Regional settings not is same as Windows language type

If Regional settings isn't same as Windows language type SQL server will fail to install.
If Windows is (US) the users Regional settings should also be English (US).
The same goes for other regioanl versions of windows.
FIX: If not set regional settings to same as Windows version install SQL server again.
After installing regional settings can be set back.

Username is the same as Computername

Repairing SQL Server database

. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf).

  1. Open the database in SQL Management Server
  2. Find the database under Databases in the Object Explorer
  3. Rightclick the database and select: Tasks - Detatch...
  4. Delete the .ldf file so sequal server can't find it
  5. Select: File - New - Query with Current Connection
  6. Execute query: exec sp_attach_single_file_db 'TRACKMAN', 'C:\<path to database>.mdf'
  7. Rightclick the database and select: Tasks - Detatch...
  8. Rightclick the Databases and select: Attach... and attach the database again

How to resolve the issue of a database that was in Recovery Pending mode

Stop SQL Server and remove transaction log file of this DB then restart again where DB should go with suspect mode ….If so you can run the below query

  1. ALTER DATABASE [DB_Name] SET SINGLE_USER WITH NO_WAIT
  2. ALTER DATABASE [DB_Name] SET EMERGENCY;
  3. DBCC checkdb ([DB_Name], REPAIR_ALLOW_DATA_LOSS )
  4. ALTER DATABASE [DB_Name] SET online;
  5. ALTER DATABASE [DB_Name] SET Multi_USER WITH NO_WAIT

This solved the problem.

<google>ENGELSK</google>

id=siteTree