Symptoms
Unable to browse website hosted on Plesk. The following is shown instead of content:
Microsoft OLE DB Provider for SQL Server error '80004005'
Warning: Fatal error 9001 occurred at Dec 4 2017 2:41PM. Note the error and time, and contact your system administrator.
/Default.asp, line 67Cannot suspend Plesk reseller:
C:> C:Program Files (x86)ParallelsPleskadminbin>reseller --off resellername
Disable database user failed: mssqlmng failed: The log for database 'example.com_data' is not available. Check the event log for related error messages. Resolve any errors and restart the database.Unable to add database user for the database dbname in Domains > example.com > Databases > User Management > Add Database User:
Error: Connection to the database server has failed: The log for database 'dbname' is not available. Check the event log for related error messages. Resolve any errors and restart the database. (Error code 1)
Unable to export database dump in Domains > example.com > Databases > dbname > Export Dump:
Source: System.Data
Message: ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.
dbbackup.DbBackupException: Unable to backup database 'ARC_PIS' ---> System.Data.SqlClient.SqlException: Warning: Fatal error 9001 occurred at Dec 4 2017 2:41PM. Note the error and time, and contact your system administrator.
BACKUP DATABASE is terminating abnormally.
Cause
Corrupted log file %plesk_dir%DatabasesMSSQLMSSQLXX.MSSQLSERVERXXXXMSSQLDATAdbname.ldf.
Note: XX and XXXX correspond to the SQL Server version.
Resolution
Connect to the server using RDP
Determine SQL Server service name:
C:> sc query | findstr MSSQL | findstr SERVICE_NAME
SERVICE_NAME: MSSQL$MSSQLSERVER2017
SERVICE_NAME: MSSQLFDLauncher$MSSQLSERVER2017
SERVICE_NAME: SQLTELEMETRY$MSSQLSERVER2017Stop SQL service:
C:> net stop MSSQL$MSSQLSERVER2017
Rename log file
%plesk_dir%DatabasesMSSQLMSSQLXX.MSSQLSERVERXXXXMSSQLDATAdbname.ldf:C:> move %plesk_dir%DatabasesMSSQLMSSQLXX.MSSQLSERVERXXXXMSSQLDATAdbname.ldf %plesk_dir%DatabasesMSSQLMSSQLXX.MSSQLSERVERXXXXMSSQLDATAdbname.ldf.bkp
Start SQL Server:
C:> net start MSSQL$MSSQLSERVER2017
Note: In order to find the root cause why the database log file got corrupted, contact Microsoft support.
In case the issue persists, re-enable the database
Connect to the server via RDP
Open Microsoft SQL Server Management Studio and log into affected SQL Server instance as Windows Administrator
Execute the following queries through New Query:
USE master
GO
ALTER DATABASE dbname
SET OFFLINE WITH ROLLBACK IMMEDIATE
GO
USE MASTER
GO
ALTER DATABASE dbname
SET ONLINE
GO