Para solucionar este error, dirigirse a la dirección indicada y borrar los archivos .mdf y .ldf correspondientes, en este caso: PCGN_CLOUD.mdf y PCGN_CLOUD.ldf
Esto ocurre cuando estás instalando LocalDB, y en lugar de dejarte crear la empresa te pide que lo vuelvas a instalar.
SqlLocalDB info
, debe arrojar MSSQLLocalDB
SqlLocalDB v
, y tienes este error La llamada de la API de Windows "RegGetValueW" devolvió el código de error: 0.
,HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL13E.LOCALDB\MSSQLServer\CurrentVersion
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Local DB\Installed Versions
13.0
a 13.1
.SqlLocalDB v
y debes tener una lista de las versiones de LocalDb instaladas.Este error originalmente se ve así
Windows API call RegOpenKeyExW returned error code: 2. Windows system error message is: El sistema no puede encontrar el archivo especificado.
Reported at line: 1035.
Cuando intentas loguearte con SSMS, el error cambia a
LocalDB parent instance version is invalid: MSSQL14E.LOCALDB
Correr esto en Powershell
λ SqlLocalDB delete MSSQLLocalDB
LocalDB instance "MSSQLLocalDB" deleted.
λ SqlLocalDB create MSSQLLocalDB
LocalDB instance "MSSQLLocalDB" created with version 13.1.4001.0.
λ SqlLocalDB start MSSQLLocalDB
LocalDB instance "MSSQLLocalDB" started.
Error relacionado con la red o específico de la instancia mientras se establecía una conexión con el servidor SQL Server. No se encontró el servidor o éste no estaba accesible. Compruebe que el nombre de la instancia es corecto y que SQL Server está configurado para admitir conexiones remotas. (provider.: SQL Network Interface, error: 50 - Se produjo un error de LocalDatabase Runtime. Error ocurred during LocalDB Instance startup: SQL Server processs failed to start.)
Hay otro error que me ocurrió en Windows 11. No alcancé a capturar el texto exacto. Pero si intentas hacer el paso anterior, te va a dar error en el create o start.
Al parecer está relacionado con el tamaño de sectores del disco duro.
Si revisas el log de errores del SQLLocalDb (%localappdata%\Microsoft\Microsoft SQL Server Local DB\Instances\)
, tienes este mensaje
2021-11-05 23:42:47.14 spid9s There have been 256 misaligned log IOs which required falling back to synchronous IO. The current IO is on file C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\master.mdf.
From the Causes section of the article:
During service startup, SQL Server begins the database recovery process to ensure database consistency. Part of this database recovery process involves consistency checks on the underlying filesystem before attempting the activity of opening system and user database files.
On systems running Windows 11, some new storage devices and device drivers will expose a disk sector size greater than the supported 4 KB sector size.
When this occurs, SQL Server will be unable to start due to the unsupported file system as SQL Server currently supports sector storage sizes of 512 bytes and 4 KB.
The Resolutions section of the troubleshooting article states:
Microsoft is currently investigating this problem. Consider one of the following solutions:
I used the following step and it fixed the issue:
You can add a registry key which will cause the behavior of Windows 11 and later to be similar to Windows 10. This will force the sector size to be emulated as 4 KB in size. To add the ForcedPhysicalSectorSizeInBytes registry key, use the Registry Editor, or you can run one of the following commands in Windows command prompt or PowerShell, executed as an administrator.
Start a Command Prompt as Administrator
Add key to the Windows Registry by entering the following in the command prompt:
REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" /v "ForcedPhysicalSectorSizeInBytes" /t REG_MULTI_SZ /d "* 4095" /f
Restart your machine after the registry entry is made.
I had to delete the existing mssqllocaldb and recreate it after restarting my machine. From a Command Prompt as Adminstrator
λ Sqllocaldb delete mssqllocaldb
λ Sqllocaldb create mssqllocaldb -s
Fuente
https://stackoverflow.com/questions/73148657/sqllocaldb-doesnt-start