Solved

restore sql database-generate restore script from files in folder

Posted on 2013-05-17
7
1,314 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 70

Expert Comment

by:Qlemo
ID: 39182104
0
Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

 

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 70

Accepted Solution

by:
Qlemo earned 500 total points
ID: 39183917
0
 

Author Closing Comment

by:dedri
ID: 39199383
10x
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

687 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