SQL Server - Is there any way to recover a corrupted database without backup?

Daredevil

I am simulating a database corruption for my own practice. What I did was editing the .LDF file and messing it up and when I run SQL server, the database is in "Recovery Pending" mode, meaning it has been corrupted.

Without any backup to be restored or without replacing the backup .LDF file, is there any way I could recover my database?

Note: I am not interested in using any third party tools/software.

Would appreciate any suggestion.

MartinS

Try to use these commands on the master database. It will reset the state of the database so you can work with it. This will put it into SINGLE USER MODE and ROLLBACK pending changes. After repair it will allow MULTIUSER AGAIN.

EXEC sp_resetstatus 'yourDBname';
ALTER DATABASE yourDBname SET EMERGENCY
DBCC checkdb('yourDBname')
ALTER DATABASE yourDBname SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB ('yourDBname', REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE yourDBname SET MULTI_USER

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

any way to recover corrupted mp4?

How to fix a restoring database without the backup file in SQL Server?

Programmatically backup a SQL Server database without it being logged/included in the backup history

Backup sql server database and mail it

Oracle DB - Database backup without any data

Is there any way to generate database scripts from a SQL query in SQL Server?

Is there any possible way to convert PostgreSQL database to MS SQL Server?

Does a SQL Server database need a backup device to backup database?

Restoring SQL Server backup to Azure SQL Database

Is There a way to recover a severely corrupted EXCEL FILE?

Compressed DataBase Backup in SQL Server 2008

SQL Server database backup restore on lower version

Error restoring SQL Server backup to a new database

SQL Server Always on configuration without backup restore

Is there any way to get a MySQL database from a /var backup?

Can we recover a deleted server for Azure SQL Database?

I have a backup of the Wordpress folder but not the SQL database, is it possible for me to recover the website for local use?

Is there any way to recover these .DOC files?

Database persistence without an SQL server

SQL SERVER backup database into .sql file using script or cmd

Is there any possible way to restore database with only merge or insert options instead of deleting or replacing data (SQL Server 2014)

Insert records from one table to another without violating any constraint in SQL Server database

SQL Server - RESTORE database with different name Fails - "The backup set holds a backup of a database other than the existing"

Once a wide variety of spammers have an email address is there any way to recover it without using aggressive spam filtering

How to recover from a corrupted glibc on Ubuntu 20.04 server

How can I backup a remote SQL Server database to a local drive?

Backup a single table with its data from a database in sql server 2008

Azure SQL database backup to local server in weekly automatically

Azure VM with SQL Server database - backup and file recovery