How to recover sql server base deleted from object explorer?

0

There is some way to recover a deleted database from the sql server object explorer

    
asked by Danitza Ayala 04.10.2016 в 00:03
source

1 answer

1

Assuming you do not have a replication / failover environment, your basic options are these:

Reuse data files

By deleting the database using MSSQL Management Studio, datafiles are also removed from the system. If you can recover them intact, create the database by attaching the same original files, executing a script similar to this:

USE [master]
GO

CREATE DATABASE [MiBase] ON
( FILENAME = N'D:\Mi\Ruta\De\Datos\MiBase.mdf' ),
( FILENAME = N'D:\Mi\Ruta\De\Datos\MiBase.ldf' )
 FOR ATTACH
GO

This is the best solution because you will not lose data.

Recover from a backup

Backup copies are essential in any production system. If you have a complete + incremental backup scheme, you can reduce the loss of information to minutes, and if not, with full backups, depending on the size of the data, it is usual to have a backup in the last 12 to 24 hours. It's not ideal, but it's better than nothing.

    
answered by 04.10.2016 в 00:45