February 9, 2018 at 2:25 am
Hi,
I get from client base in .mdf and .ldf
I try to restore this base in my SQL but I have error...
Someone can help me, how can I correct restore this base?
My knowledge SQL is small and I need help.
Error:
Msg 1802, Level 16, State 7, Line 3
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
Msg 824, Level 24, State 6, Line 3
SQL Server detected a logical consistency-based I/O error: torn page (expected signature: 0xffffffff; actual signature: 0xf8ae914f). It occurred during a read of page (0:0) in database ID 0 at offset 0000000000000000 in file 'B:\Odzyskane\pse_base_log.ldf'. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
February 9, 2018 at 2:35 am
Did you do what it suggested in the error message? Did your client gracefully shut down SQL Server or detach the database before sending you the files? Do you have the option to ask your client to back up the database and send you the .BAK file?
John
February 9, 2018 at 2:40 am
My client can't give me database in .bak beacouse he was attacked and have encrypted all files... He restore only this files from 02.01.2018
Marcin
February 9, 2018 at 3:25 am
John Mitchell-245523 - Friday, February 9, 2018 2:35 AMDid you do what it suggested in the error message?
I try use this, but SQL [Could not find stored procedure 'sp_dboption']
use master
declare @databasename varchar(255)
set @databasename='MyDatabase.mdf'
exec sp_dboption @databasename, N'single', N'true'
dbcc checkdb(@databasename,REPAIR_ALLOW_DATA_LOSS)
dbcc checkdb(@databasename,REPAIR_REBUILD)
exec sp_dboption @databasename, N'single', N'false'
February 9, 2018 at 3:40 am
Where did you get that code?!
Actually, if you can't even restore the database, you've nothing to run a DBCC check against. Is the client saying that they've never backed up the database in the past, or if they have, that all their backup files were destroyed in what I assume was a ransomware attack? If that's the case, the best you can do may be to advise your client to make sure that backups are moved off site as early and as frequently as possible.
John
February 9, 2018 at 3:50 am
Here I get this code: https://www.datanumen.com/sql-recovery/articles/dbcc-checkdb.htm
Yes, client never backed up the database, and yes all files was destroyed by a ransomware attack.
So it is not possible to repair this database?
February 9, 2018 at 4:03 am
Not sure when that was published, but I suspect it's very out of date. sp_dboption is deprecated: you should use ALTER DATABASE these days.
I'm not looking over your shoulder, so I can't see what you see, but I suspect that the database is indeed not recoverable. How are you attempting to attach the database and at what point do you get the error?
John
February 9, 2018 at 4:11 am
I use this instructions https://docs.microsoft.com/en-us/sql/relational-databases/databases/attach-a-database
When I click extract(query) or when I use function attach database I see this:
===================================
Attach database failed for Server '.\SQL'. (Microsoft.SqlServer.Smo)
------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=14.0.17213.0+((SSMS_Rel).171128-2020)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Attach+database+Server&LinkId=20476
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Smo.Server.AttachDatabase(String name, StringCollection files)
at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabaseData.PrimaryFile.Attach()
at Microsoft.SqlServer.Management.SqlManagerUI.AttachDatabase.SendDataToServer()
===================================
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType, Boolean retry)
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType, Boolean retry)
at Microsoft.SqlServer.Management.Smo.ExecutionManager.ExecuteNonQuery(StringCollection queries, Boolean retry)
at Microsoft.SqlServer.Management.Smo.Server.AttachDatabaseWorker(String name, StringCollection files, String owner, AttachOptions attachOptions)
at Microsoft.SqlServer.Management.Smo.Server.AttachDatabase(String name, StringCollection files)
===================================
SQL Server detected a logical consistency-based I/O error: torn page (expected signature: 0xffffffff; actual signature: 0xf8ae914f). It occurred during a read of page (0:0) in database ID 0 at offset 0000000000000000 in file 'B:\Odzyskane\pse_base_log.ldf'. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors. (.Net SqlClient Data Provider)
------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=824&LinkId=20476
------------------------------
Server Name: .\SQL
Error Number: 824
Severity: 24
State: 6
Line Number: 1
------------------------------
Program Location:
at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType, Boolean retry)
February 9, 2018 at 4:17 am
OK, if you can't even attach the database, that limits your options severely. The only thing I can think of is to pay lots of money to a company that specialises in data recovery and see whether they can get it back for you. Maybe someone who knows more about corruption than I do will chip in with some advice.
John
February 9, 2018 at 5:27 am
Yup, I'll chip in with advice:
Ask the client to hunt and see if he has any backups from before he got hit with a ransomware attack, because that file is not attachable. I suspect it too is encrypted and hence unreadable.
Or pay the ransom and hope he gets the key.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 9, 2018 at 9:39 am
I noticed the error message shows problem in log file, rather than data file. If it's not encrypted, but a log corruption, you can try ATTACH_REBUILD_LOG.
GASQL.com - Focus on Database and Cloud
February 19, 2018 at 10:01 pm
This was removed by the editor as SPAM
February 21, 2018 at 9:37 pm
This was removed by the editor as SPAM
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply