MSSQL DB Browser not coming up - sql-server

I have couple of database on SQL server which were working fine. Now I am no longer able to explore those. What can be the reason?
Also i am getting below error while trying to turn database on
"File activation failure. The physical file name "D:\Microsoft SQL Server\MSSQL10_50.MSSQLSER\DATA\DB_NAME_log.ldf" may be incorrect.
The log cannot be rebuilt because there were open transactions/users when the database was shutdown, no checkpoint occurred to the database, or the database was read-only. This error could occur if the transaction log file was manually deleted or lost due to a hardware or environment failure."

Related

Recover a corrupted database/tables

Our customer faces an issue with a corrupted database caused by a 3rd party software. Unfortunatelly they found out too late and no longer have a valid backup to return to. Fixing views etc. is easy but there are couple tables that are unaccessible and contain important data.
When trying to select data from corrupted tables I receive this error:
SQL Server detected a logical consistency-based I/O error: incorrect
pageid (expected 1:7733; actual 114:7667823). It occurred during a
read of page (1:7733) in database ID 5 at offset 0x00000003c6a000 in
file 'C:\Program Files\Microsoft SQL
Server\MSSQL10_50.SQL2008\MSSQL\DATA\aspe_bad1.MDF'. 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.
Running DBCC CHECKDB gives this error
Check terminated. A failure was detected while collecting facts. Possibly tempdb out of space or a
system table is inconsistent. Check previous errors.
Running DBCC CHECKTABLE gives the same error as select does.
When running DBCC PAGE I get Metadata: ObjectId = 0, meaning:
If you see the ObjectId is 0, that means there was no metadata found.
This could be because:
The table that the page was part of has been deleted since the page corruption was logged
The system catalogs are corrupt in some way
The page is corrupt and so incorrect values were used to look up the metadata
Checking SQL Server Logs contains only 1 different error and that is:
SQL Server detected a logical consistency-based I/O error: unable to
decrypt page due to missing DEK. Itoccurred during a read of page
(1:7727) in database ID 5 at offset 0x00000003c5e000 in file
'C:\Program Files\Microsoft SQL
Server\MSSQL10_50.SQL2008\MSSQL\DATA\aspe_bad1.MDF'. 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.
Honestly I'm at my wits end. Can anyone help me fix this issue? Is it even possible to repair to at least some extent?
Thanks,
Z

The transient database snapshot for database XXXXX (database ID 8) has been marked suspect due to an IO operation failure

I am having OLA hallengren job for the DBCC checks
When the job runs as per the schedule iam getting below error
The transient database snapshot for database XXXXX (database ID 8) has been marked suspect due to an IO operation failure.
In the error log log i can see below errors
The operating system returned error 665(The requested operation could not be completed due to a file system limitation) to SQL Server during a write at offset 0x00002fc8f40000 in file 'L:\MSSQL10_50.PSPAC01\MSSQL\DATA\XXXXX.ndf:MSSQL_DBCC10'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level 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.
The operating system returned error 665(The requested operation could not be completed due to a file system limitation) to SQL Server during a write at offset 0x00006a63e28000 in file 'R:\MSSQL10_50.PSPAC01\MSSQL\DATA\XXXXX.ndf:MSSQL_DBCC10'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level 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.
NOTE: But when i manually run the same job it is running fine
I have checked the DEFRAGMENTAION for both the drives but output is stating that "no need to do the defragmentation"
How can this issue be fixed, below is the link for the image

Database Recovery Pending - SQL Server 2014

My server is shutting down because the electrical. And when I opened my database in SSMS, database is recovery pending.
I checked my ERROR LOG, the message are :
4 transactions rolled forward in database 'POSDW' (14:0). This is an
informational message only. No user action is required.
restoreHkDatabase: DbId 14, Msg 41313, Level 16, State 1, The C
compiler encountered a failure. The exit code was 2.
[ERROR] Database ID: [14] 'POSDW'. Failed to load XTP checkpoint.
Error code: 0x82000009.
(d:\sql12_main_t\sql\ntdbms\hekaton\sqlhost\sqlmin\hkhostdb.cpp : 3126
- 'RecoverHkDatabase') Error: 41313, Severity: 16, State: 1.
I already tried to take offline but when I bring online I get error.
Can you guys help me.
Thanks
It looks like corruption. You can try one of the following options:
Restore from existing backup
Try enter the database into emergency mode and run DBCC CHECKDB. according to the results you can see if you can restore the pages from existing backup (in some cases) or run DBCC CHECKDB .
If you have functional replica of the data take the data from there.
Hope this helps.
You were able to move the database files while they were in "Recovery Pending" mode because that status means SQL couldn't open the database files for some reason. It also means it couldn't lock the files as well.
Setting a database to "offline" is similar because it unlocks the underlying files (that's why you can move database files while it's offline).
I'm pretty sure that if you'd try setting all these databases to "online" you'd get the error message you talk about or something similar.
ALTER DATABASE MyDB SET ONLINE
You can use the above statement to try and activate databases that are "offline" or are in "Recovery Pending" mode. If there's some kind of problem, SQL Server will let you know at that moment.
You can also read this thread: How to fix Recovery Pending State in SQL Server Database?

SQL server Database back Up Failed - write failure on backup device

I am getting below error while taking DB back up. This error occurred after 55% of complete database backup process. Please provide solution to resolve this issue.
BackupIoRequest::ReportIoError: write failure on backup device '\networkpath\MYDB.BAK'. Operating system error 1(Incorrect function.).
using below script for DB back up:-
BACKUP DATABASE PolarisPROD TO DISK = '\\networkpath\MYDB.BAK' WITH INIT

Sql server 2005 torn page,error 424

My Dell pc failed;it was blue screen.I fixed that problem by formatting and reinstalling OS and other software that i have been using.Then I recoved my db designed using sqlserver 2005 and other files using recovery tools ;Easy Recovery 6.0.
The problem is : When I try to attach the recovered file(lpdb.mdf),It can not attached.The operation fails with the following message :
TITLE: Microsoft SQL Server Management Studio
Attach database failed for Server 'SAPC'. (Microsoft.SqlServer.Smo)
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
SQL Server detected a logical consistency-based I/O error: torn page (expected signature: 0x55555555; actual signature: 0x4c093c91). It occurred during a read of page (0:0) in database ID 0 at offset 0000000000000000 in file 'F:\Recovered\lpdb_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. (Microsoft SQL Server, Error: 824)
Is there any who can help me?
I thank you!
Dejene.
Edit
By gbn from other closed question:
Hi mrdanny,
I tried the way you suggested me. The problem is unresolved.
Error is reported : Message 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.
Is there an alternative solution that i should try? I am going to redesign the database.Please save my time!
Have you a good backup?
Given it says page (0:0), then I refer you to point 1
Use emergency mode and hope for the best. Paul Randall wrote DBCC CHECKDB...
The torn page is in the log file, so rename the log file and use the sp_attch_single_file_db procedure to attach the mdf and generate a new transaction log file.

Resources