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
Solved

Mirror batch of sql databases in one go

Posted on 2013-06-26
7
263 Views
Last Modified: 2013-07-03
Guys

I am creating a new mirror sql server 2008 r2 instance the primary instance has over 100 databases running is there a way to create the mirror with out having to backup then copy the files then restore then create mirror individually for them all.

Any advice is welcome

Regards
0
Comment
Question by:DarrenJackson
7 Comments
 
LVL 22

Assisted Solution

by:Haresh Nikumbh
Haresh Nikumbh earned 50 total points
ID: 39277718
0
 
LVL 23

Assisted Solution

by:Racim BOUDJAKDJI
Racim BOUDJAKDJI earned 400 total points
ID: 39277765
You can automate the process but you will have to backup, copy (or put on a share drive) and restore each database you want to mirror.
0
 

Author Comment

by:DarrenJackson
ID: 39277777
Thanks guys for the input.

takecoffe I will look at this it may be of help.

Racimo I was hoping that I could make use of some utility to speed up the process as it could take me a few days to compete this task

but if it cant be done it cant be done
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 23

Accepted Solution

by:
Racim BOUDJAKDJI earned 400 total points
ID: 39277786
THe below should at least help you get automate the backup copy part

exec master..sp_msforeachdb 'if lower(''?'') not in (''master'', ''msdb'', ''model'', ''tempdb'')
begin
backup database [?] to disk =''C:\?.BAK''
exec xp_cmdshell ''xcopy C:\?.BAK D:\RESTORE_FOLDER''
end'

Open in new window


Not tested but that should help...
0
 

Author Comment

by:DarrenJackson
ID: 39277791
Racimo thanks for this I will check this out as well

Regards
0
 
LVL 26

Assisted Solution

by:Zberteoc
Zberteoc earned 50 total points
ID: 39278068
First, you HAVE to do the backup and restore in mirroring. That is the way how mirroring works, based on primary backups restored on the mirror so the first step has to be done in FULL with NO RECOVERY option on mirror. There is no other way.

To help the process you could create a shared backup location between the 2 server directly accessible from both of them so that at least you can skip the copy part. The shared location could be either on the primary, on secondary or on a "third party" network location.
0
 

Author Comment

by:DarrenJackson
ID: 39296780
Right have tested the above script and with a few tweaks I have got a working model I can use

thanks guys for the help
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL: Get Holding Day Based On Transfer Date And Return Date 13 70
backup and restore 21 29
CDC and AOG on MS SQL 2012 13 23
SQL trigger 5 21
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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

856 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