question

SahaSaha-5270 avatar image
0 Votes"
SahaSaha-5270 asked ErlandSommarskog commented

How to restore a database from data and log file

The database is too big and I could not create a .bak file. But I was able to copy datafile and logfile and need to restore that into a different server.

sql-server-general
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You really need to address the issue of being able to back up your database. You should make sure you set the COMPRESS option and have enough space on disk for several versions of the backup. Ideally, you also need a process that moves those backup files off that system to long term storage so you have the ability to restore the system in the event of a disaster.

You also need to make sure you have transaction log backups in place - unless you are okay with restoring to the latest backup and losing a days worth of data.

0 Votes 0 ·

According to this thread, https://docs.microsoft.com/en-us/answers/questions/368216/a-database-with-datafile-size-418-gb-backup-is-run.html, Saha's database is in simple recovery. Which may be OK if it is for dev/test only. Less likely so if it is for production.

0 Votes 0 ·
ErlandSommarskog avatar image
0 Votes"
ErlandSommarskog answered SahaSaha-5270 commented
CREATE DATABASE db ON (FILENAME = '<path>')
LOG ON (FILENAME = '<path>')
FOR ATTACH
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ErlandSommarskog Thank you for quick response, I was able to create the database from mdf and ldf file which has missing data from 2019.

0 Votes 0 ·
PraveenNelge-1499 avatar image
0 Votes"
PraveenNelge-1499 answered

I think you are planning to move your DB from one server location to other.
https://dba.stackexchange.com/questions/52007/how-do-i-move-sql-server-database-files

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.