Solved

restore sql database-generate restore script from files in folder

Posted on 2013-05-17
7
1,073 Views
Last Modified: 2013-05-27
Very often I have a request to restore sql server databases from production to out test environment for a couple of out DB servers.  Every DB servers are having around 10-15 databases on it.
Format of the backups are : DB1_backup_201305151900.bak.
When I have a request  I restore this dbs from tape to one folder on the disk, and after that I have to manually restore them. It's really a hard work and I need to automate this somehow.
If it is possible to generate a restore script from the files in directory?
The problem that need to be solved also is that db file location in production are located in drive D: and E: and on test environment only on disk E:
0
Comment
Question by:dedri
  • 3
  • 2
7 Comments
 
LVL 25

Expert Comment

by:jogos
ID: 39175178
0
 

Author Comment

by:dedri
ID: 39176981
hi, anything that does not involve powershell. My SQL servers are sql server 2005 and windows 2003
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 39182104
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:dedri
ID: 39183720
Hi Qlemo, 10x for your reply.
I've already checked this article. The problem with this script is  that it is only for one database, and I am having 10-15 databases in the folder. Also it does not provide the option to move database( on my production server databases are located on the D:\- data files  and E:\ - log files), and on test servers they are all on one drive D:\
0
 
LVL 68

Accepted Solution

by:
Qlemo earned 500 total points
ID: 39183917
0
 

Author Closing Comment

by:dedri
ID: 39199383
10x
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now