Showing posts with label situation. Show all posts
Showing posts with label situation. Show all posts

Saturday, February 25, 2012

Backup and Restore

Hi everyone
I have this situation with backup and restore.
I have two instances of sql, sql1 and sql2.
Production server is sql1 and test server is sql2.

I created database maintenance plan that makes full backup every night
on tape.

I would like to make some kind of job or to add steps to job that was
created with DMplan which will make restore of backuped database to sql2
server.

How can i do this? How can i read which is the last file backuped on
tape?

Thanks very much
Alex

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!"acko bogicevic" <aconi2002@.yahoo.com> wrote in message
news:40e3cace$0$16501$c397aba@.news.newsgroups.ws.. .
> Hi everyone
> I have this situation with backup and restore.
> I have two instances of sql, sql1 and sql2.
> Production server is sql1 and test server is sql2.
> I created database maintenance plan that makes full backup every night
> on tape.
> I would like to make some kind of job or to add steps to job that was
> created with DMplan which will make restore of backuped database to sql2
> server.
> How can i do this? How can i read which is the last file backuped on
> tape?

You can adapt the following. (note, in this case we backup and restore from
disk.)

create procedure restore_FOO as

declare @.backup_file as varchar(255)

select @.backup_file=physical_device_name from
nell.msdb.dbo.backupmediafamily where media_set_id in (select
max(media_set_id) from nell.msdb.dbo.backupset where database_name='FOO')

restore database FOO from disk=@.backup_file with
move 'FOO_Data' to 'f:\sql_data\FOO_data.mdf',
move 'FOO_Log' to 'e:\SQL_LOGs\FOO_log.ldf',
replace

GO

> Thanks very much
> Alex
>
> *** Sent via Devdex http://www.devdex.com ***
> Don't just participate in USENET...get rewarded for it!|||thanks
alex

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Sunday, February 12, 2012

Backing up/restoring using hard disk or tape

Here is my situation:
I have a 2 node SQL 2000 enterprise cluster for which i need to backup
3 databases. Here is my plan. I've changed the recovery mode to Full
on all 3 databases and have performed complete backups. I've
scheduled a complete backup at midnight and differentials every hour
and t-logs every 15 minutes. As an alternate backup, I am backing up
to tape using Arcserve's SQL agent. The schedule for this is a
complete backup nightly, and differential every 4 hours. What I'm
unclear on is the truncation of t-logs. Do they auto truncate every
time a differential or complete backup is run? I'm worried that the
tape backup (when it runs) may contain some transactions that the SQL
backup to disk does not have and vice versa...is this true? I know
it simple recovery mode, the databases will auto truncate the t-log
after a backup but not sure what will happen or where to find the
setting for full recovery mode. I would assume that SQL would allow me
to create multiple backups of the same databases but I just cant find
out how/where...any help is greatly appreciated as we are deploying a
production server on Aug 31. TIA...
TonyA full/differential backup doesn't truncate the tran log.
Linchi
>--Original Message--
>Here is my situation:
>I have a 2 node SQL 2000 enterprise cluster for which i
need to backup
>3 databases. Here is my plan. I've changed the recovery
mode to Full
>on all 3 databases and have performed complete backups.
I've
>scheduled a complete backup at midnight and differentials
every hour
>and t-logs every 15 minutes. As an alternate backup, I
am backing up
>to tape using Arcserve's SQL agent. The schedule for
this is a
>complete backup nightly, and differential every 4 hours.
What I'm
>unclear on is the truncation of t-logs. Do they auto
truncate every
>time a differential or complete backup is run? I'm
worried that the
>tape backup (when it runs) may contain some transactions
that the SQL
>backup to disk does not have and vice versa...is this
true? I know
>it simple recovery mode, the databases will auto truncate
the t-log
>after a backup but not sure what will happen or where to
find the
>setting for full recovery mode. I would assume that SQL
would allow me
>to create multiple backups of the same databases but I
just cant find
>out how/where...any help is greatly appreciated as we
are deploying a
>production server on Aug 31. TIA...
>Tony
>.
>