Tuesday, March 27, 2012

automating a database restoration

Is there anyway to automate a daily database restoration?
In short i'm looking to transfer a copy of a database from one site's server
to a 2nd sites each day.
Due to bandwidth limitaions on the link between sites, i cannot do this from
enterprise manager.
What i'm looking to do is to backup site #1's server each night, run a
scheduled task to rar up the database ( to reduce it's size) then run a
script to copy it to site #2.
I'm trying to find out if it's possible from within SQL to schedule a
restoration each day from the transfered & unrar'ed backup from site #1.
Any ideas if this is possible
TIA
Fred
1) Log shipping (database on the targer site is read-only)
2) Replicatiion (Snapshot) very easy to perform
3) Write a SP to restore given .BAK file on the target server, make sure
that old db on the target will be deleted first.
"Fred Bloggs" <fredb@.hotmailp.com> wrote in message
news:8805F959-42CF-48FC-85B3-5CB4931D8BD6@.microsoft.com...
> Is there anyway to automate a daily database restoration?
> In short i'm looking to transfer a copy of a database from one site's
> server to a 2nd sites each day.
> Due to bandwidth limitaions on the link between sites, i cannot do this
> from enterprise manager.
> What i'm looking to do is to backup site #1's server each night, run a
> scheduled task to rar up the database ( to reduce it's size) then run a
> script to copy it to site #2.
> I'm trying to find out if it's possible from within SQL to schedule a
> restoration each day from the transfered & unrar'ed backup from site #1.
> Any ideas if this is possible
> TIA
|||You also will use automated task of the operating system to create a shared
resource, and copy the backup from site #1 to Site #2. And then with sql
server create a job to restore a database from site#2
Regards,
"Zarko Jovanovic" wrote:

> Fred Bloggs wrote:
> it is possible. one idea:
> - make a shared folder on site B
> - make an account that will be used to access folder
> - set permissions on a share and on a folder to write
> - make a job on site A to:
> - backup
> - rar (using xp_cmdshell)
> - net use (xp_cmdshell) the share using the account
> - copy to share (xp_cmdshell)
> - net use /delete (xp_cmdshell)
> - make a job on site B to:
> - unRAR (xp_cmdshell)
> - restore
> schedule job on site B to appropriate time so you're sure job on site A
> is finished! or better use waitfor (search for "waitfor" on google) to
> signal job to start
>
sql

No comments:

Post a Comment