Showing posts with label restore. Show all posts
Showing posts with label restore. Show all posts

Sunday, March 25, 2012

Difference between Backup/Restore & Attach/Detach

Can someone please clarify the difference between Detach / Attach of MDF/LDF
files versus the Backup / Restore of backup to device/file feature? Which
would be ideal for restores of actual databases?
Thank you.Transact-SQL BACKUP/RESTORE is the normal method for database backup and
recovery. Databases can be backed up while online. The backup file size is
usually smaller than the database files since only used pages are backed up.
Also, in the FULL or BULK_LOGGED recovery model, you can reduce potential
data loss by performing transaction log backups.
Detaching a database removes the database from SQL Server while leaving the
physical database files intact. This allows you to rename or move the
physical files and then re-attach. Although one could perform cold backups
using this technique, detach/attach isn't really intended to be used as a
backup/recovery process.
Hope this helps.
Dan Guzman
SQL Server MVP
"KP" <kp@.msn.com> wrote in message
news:%23PtI97whFHA.3300@.TK2MSFTNGP15.phx.gbl...
> Can someone please clarify the difference between Detach / Attach of
> MDF/LDF files versus the Backup / Restore of backup to device/file
> feature? Which would be ideal for restores of actual databases?
> Thank you.
>|||Thanks for the explanation. If I was to restore a WSS or SPS which uses SQL
that exists in one domain and restore to another domain - would the Backup /
Restore be better?
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:u85i3JxhFHA.3316@.TK2MSFTNGP14.phx.gbl...
> Transact-SQL BACKUP/RESTORE is the normal method for database backup and
> recovery. Databases can be backed up while online. The backup file size
> is usually smaller than the database files since only used pages are
> backed up. Also, in the FULL or BULK_LOGGED recovery model, you can reduce
> potential data loss by performing transaction log backups.
> Detaching a database removes the database from SQL Server while leaving
> the physical database files intact. This allows you to rename or move the
> physical files and then re-attach. Although one could perform cold
> backups using this technique, detach/attach isn't really intended to be
> used as a backup/recovery process.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "KP" <kp@.msn.com> wrote in message
> news:%23PtI97whFHA.3300@.TK2MSFTNGP15.phx.gbl...
>|||I usually use backup/restore to move databases between servers. It doesn't
matter if the servers on a different domains.
After you restore to another box, you'll need to make sure you don't have
orphaned users. See sp_change_users_login in the Books Online for
information on how to report/correct the users.
Hope this helps.
Dan Guzman
SQL Server MVP
"KP" <kp@.msn.com> wrote in message
news:eiTM5UxhFHA.3300@.TK2MSFTNGP15.phx.gbl...
> Thanks for the explanation. If I was to restore a WSS or SPS which uses
> SQL that exists in one domain and restore to another domain - would the
> Backup / Restore be better?
>
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:u85i3JxhFHA.3316@.TK2MSFTNGP14.phx.gbl...
>

Difference between Backup/Restore & Attach/Detach

Can someone please clarify the difference between Detach / Attach of MDF/LDF
files versus the Backup / Restore of backup to device/file feature? Which
would be ideal for restores of actual databases?
Thank you.Transact-SQL BACKUP/RESTORE is the normal method for database backup and
recovery. Databases can be backed up while online. The backup file size is
usually smaller than the database files since only used pages are backed up.
Also, in the FULL or BULK_LOGGED recovery model, you can reduce potential
data loss by performing transaction log backups.
Detaching a database removes the database from SQL Server while leaving the
physical database files intact. This allows you to rename or move the
physical files and then re-attach. Although one could perform cold backups
using this technique, detach/attach isn't really intended to be used as a
backup/recovery process.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"KP" <kp@.msn.com> wrote in message
news:%23PtI97whFHA.3300@.TK2MSFTNGP15.phx.gbl...
> Can someone please clarify the difference between Detach / Attach of
> MDF/LDF files versus the Backup / Restore of backup to device/file
> feature? Which would be ideal for restores of actual databases?
> Thank you.
>|||Thanks for the explanation. If I was to restore a WSS or SPS which uses SQL
that exists in one domain and restore to another domain - would the Backup /
Restore be better?
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:u85i3JxhFHA.3316@.TK2MSFTNGP14.phx.gbl...
> Transact-SQL BACKUP/RESTORE is the normal method for database backup and
> recovery. Databases can be backed up while online. The backup file size
> is usually smaller than the database files since only used pages are
> backed up. Also, in the FULL or BULK_LOGGED recovery model, you can reduce
> potential data loss by performing transaction log backups.
> Detaching a database removes the database from SQL Server while leaving
> the physical database files intact. This allows you to rename or move the
> physical files and then re-attach. Although one could perform cold
> backups using this technique, detach/attach isn't really intended to be
> used as a backup/recovery process.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "KP" <kp@.msn.com> wrote in message
> news:%23PtI97whFHA.3300@.TK2MSFTNGP15.phx.gbl...
>> Can someone please clarify the difference between Detach / Attach of
>> MDF/LDF files versus the Backup / Restore of backup to device/file
>> feature? Which would be ideal for restores of actual databases?
>> Thank you.
>|||I usually use backup/restore to move databases between servers. It doesn't
matter if the servers on a different domains.
After you restore to another box, you'll need to make sure you don't have
orphaned users. See sp_change_users_login in the Books Online for
information on how to report/correct the users.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"KP" <kp@.msn.com> wrote in message
news:eiTM5UxhFHA.3300@.TK2MSFTNGP15.phx.gbl...
> Thanks for the explanation. If I was to restore a WSS or SPS which uses
> SQL that exists in one domain and restore to another domain - would the
> Backup / Restore be better?
>
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:u85i3JxhFHA.3316@.TK2MSFTNGP14.phx.gbl...
>> Transact-SQL BACKUP/RESTORE is the normal method for database backup and
>> recovery. Databases can be backed up while online. The backup file size
>> is usually smaller than the database files since only used pages are
>> backed up. Also, in the FULL or BULK_LOGGED recovery model, you can
>> reduce potential data loss by performing transaction log backups.
>> Detaching a database removes the database from SQL Server while leaving
>> the physical database files intact. This allows you to rename or move
>> the physical files and then re-attach. Although one could perform cold
>> backups using this technique, detach/attach isn't really intended to be
>> used as a backup/recovery process.
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "KP" <kp@.msn.com> wrote in message
>> news:%23PtI97whFHA.3300@.TK2MSFTNGP15.phx.gbl...
>> Can someone please clarify the difference between Detach / Attach of
>> MDF/LDF files versus the Backup / Restore of backup to device/file
>> feature? Which would be ideal for restores of actual databases?
>> Thank you.
>>
>

Difference between Backup/Restore & Attach/Detach

Can someone please clarify the difference between Detach / Attach of MDF/LDF
files versus the Backup / Restore of backup to device/file feature? Which
would be ideal for restores of actual databases?
Thank you.
Transact-SQL BACKUP/RESTORE is the normal method for database backup and
recovery. Databases can be backed up while online. The backup file size is
usually smaller than the database files since only used pages are backed up.
Also, in the FULL or BULK_LOGGED recovery model, you can reduce potential
data loss by performing transaction log backups.
Detaching a database removes the database from SQL Server while leaving the
physical database files intact. This allows you to rename or move the
physical files and then re-attach. Although one could perform cold backups
using this technique, detach/attach isn't really intended to be used as a
backup/recovery process.
Hope this helps.
Dan Guzman
SQL Server MVP
"KP" <kp@.msn.com> wrote in message
news:%23PtI97whFHA.3300@.TK2MSFTNGP15.phx.gbl...
> Can someone please clarify the difference between Detach / Attach of
> MDF/LDF files versus the Backup / Restore of backup to device/file
> feature? Which would be ideal for restores of actual databases?
> Thank you.
>
|||Thanks for the explanation. If I was to restore a WSS or SPS which uses SQL
that exists in one domain and restore to another domain - would the Backup /
Restore be better?
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:u85i3JxhFHA.3316@.TK2MSFTNGP14.phx.gbl...
> Transact-SQL BACKUP/RESTORE is the normal method for database backup and
> recovery. Databases can be backed up while online. The backup file size
> is usually smaller than the database files since only used pages are
> backed up. Also, in the FULL or BULK_LOGGED recovery model, you can reduce
> potential data loss by performing transaction log backups.
> Detaching a database removes the database from SQL Server while leaving
> the physical database files intact. This allows you to rename or move the
> physical files and then re-attach. Although one could perform cold
> backups using this technique, detach/attach isn't really intended to be
> used as a backup/recovery process.
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "KP" <kp@.msn.com> wrote in message
> news:%23PtI97whFHA.3300@.TK2MSFTNGP15.phx.gbl...
>
|||I usually use backup/restore to move databases between servers. It doesn't
matter if the servers on a different domains.
After you restore to another box, you'll need to make sure you don't have
orphaned users. See sp_change_users_login in the Books Online for
information on how to report/correct the users.
Hope this helps.
Dan Guzman
SQL Server MVP
"KP" <kp@.msn.com> wrote in message
news:eiTM5UxhFHA.3300@.TK2MSFTNGP15.phx.gbl...
> Thanks for the explanation. If I was to restore a WSS or SPS which uses
> SQL that exists in one domain and restore to another domain - would the
> Backup / Restore be better?
>
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:u85i3JxhFHA.3316@.TK2MSFTNGP14.phx.gbl...
>
sql

Thursday, March 22, 2012

Difference between Attach / Detach and Backup / Restore

I am new to SQL Server and we are using SQL Server 2005.
We recently upgrade a finance system by consultant. He detaches the
database from the old server (Running SQL Server 2000), copy the mdf file
across and attached in the new SQL Server 2005.
I would like to know is there any benefit for detaching / attaching than
make a backup and restore on the SQL Server 2005 ?
Someone has mentioned that we have to recreate SQL Server Login though the
Database Login exists on the database copied across. Is there any tools /
reference that makes it easy ?
ThanksPeter
It is just faster.
Search on interenet for 'sp_help_revlogin' for SQL Server 2005
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:OZmOrl6wHHA.600@.TK2MSFTNGP05.phx.gbl...
>I am new to SQL Server and we are using SQL Server 2005.
> We recently upgrade a finance system by consultant. He detaches the
> database from the old server (Running SQL Server 2000), copy the mdf file
> across and attached in the new SQL Server 2005.
> I would like to know is there any benefit for detaching / attaching than
> make a backup and restore on the SQL Server 2005 ?
> Someone has mentioned that we have to recreate SQL Server Login though the
> Database Login exists on the database copied across. Is there any tools /
> reference that makes it easy ?
> Thanks
>|||I have explained the step to move the logins as well here:
http://sqlguy.it-craft.dk
As well as links to the stored procedures for both 2000 and 2005
Regards
Rasmus Glibstrup
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:OZmOrl6wHHA.600@.TK2MSFTNGP05.phx.gbl...
>I am new to SQL Server and we are using SQL Server 2005.
> We recently upgrade a finance system by consultant. He detaches the
> database from the old server (Running SQL Server 2000), copy the mdf file
> across and attached in the new SQL Server 2005.
> I would like to know is there any benefit for detaching / attaching than
> make a backup and restore on the SQL Server 2005 ?
> Someone has mentioned that we have to recreate SQL Server Login though the
> Database Login exists on the database copied across. Is there any tools /
> reference that makes it easy ?
> Thanks
>sql

Difference between Attach / Detach and Backup / Restore

I am new to SQL Server and we are using SQL Server 2005.
We recently upgrade a finance system by consultant. He detaches the
database from the old server (Running SQL Server 2000), copy the mdf file
across and attached in the new SQL Server 2005.
I would like to know is there any benefit for detaching / attaching than
make a backup and restore on the SQL Server 2005 ?
Someone has mentioned that we have to recreate SQL Server Login though the
Database Login exists on the database copied across. Is there any tools /
reference that makes it easy ?
ThanksPeter
It is just faster.
Search on interenet for 'sp_help_revlogin' for SQL Server 2005
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:OZmOrl6wHHA.600@.TK2MSFTNGP05.phx.gbl...
>I am new to SQL Server and we are using SQL Server 2005.
> We recently upgrade a finance system by consultant. He detaches the
> database from the old server (Running SQL Server 2000), copy the mdf file
> across and attached in the new SQL Server 2005.
> I would like to know is there any benefit for detaching / attaching than
> make a backup and restore on the SQL Server 2005 ?
> Someone has mentioned that we have to recreate SQL Server Login though the
> Database Login exists on the database copied across. Is there any tools /
> reference that makes it easy ?
> Thanks
>|||I have explained the step to move the logins as well here:
http://sqlguy.it-craft.dk
As well as links to the stored procedures for both 2000 and 2005
Regards
Rasmus Glibstrup
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:OZmOrl6wHHA.600@.TK2MSFTNGP05.phx.gbl...
>I am new to SQL Server and we are using SQL Server 2005.
> We recently upgrade a finance system by consultant. He detaches the
> database from the old server (Running SQL Server 2000), copy the mdf file
> across and attached in the new SQL Server 2005.
> I would like to know is there any benefit for detaching / attaching than
> make a backup and restore on the SQL Server 2005 ?
> Someone has mentioned that we have to recreate SQL Server Login though the
> Database Login exists on the database copied across. Is there any tools /
> reference that makes it easy ?
> Thanks
>

Wednesday, March 7, 2012

Device Activation Error

Dear All,
I have deployed a new SQL server and I have installed SP4, I have tried to
restore my old dbase using restore from device and I choosed the dbase file
name. I got the following error (Device activiation error. The physical name
'old dbase file path' ma be incorrect). Use WITH MOVE to identify a valid
location for the file.
Please helpppp
*********
IT Manager
DeLaval Ltd.
Cairo-Egypt
*********
|--|
|Islam is peace not Terror|
|--|
"Ibrahim Awwad" <ibrahim_awwad(at)hotmail(dot)com(antispam)> wrote in
message news:0AEA8F49-A25F-4DAC-B150-818FC9E94B99@.microsoft.com...
> Dear All,
> I have deployed a new SQL server and I have installed SP4, I have tried to
> restore my old dbase using restore from device and I choosed the dbase
> file
> name. I got the following error (Device activiation error. The physical
> name
> 'old dbase file path' ma be incorrect). Use WITH MOVE to identify a valid
> location for the file.
> Please helpppp
This means that one or more of the files the database is being restored to
already exists. Check the file name. If a file exists there, you might
want to rename it. Or, as the message indicates, use RESTORE ... WITH MOVE.
David
|||Hi David,
The files aren't there and I even tried to renave the dbase and the log file
but it didn't work. USE WITH MOVE it was in the warning message and I can't
find it at all in the restore options.
*********
IT Manager
DeLaval Ltd.
Cairo-Egypt
*********
|--|
|Islam is peace not Terror|
|--|
"David Browne" wrote:

> "Ibrahim Awwad" <ibrahim_awwad(at)hotmail(dot)com(antispam)> wrote in
> message news:0AEA8F49-A25F-4DAC-B150-818FC9E94B99@.microsoft.com...
>
> This means that one or more of the files the database is being restored to
> already exists. Check the file name. If a file exists there, you might
> want to rename it. Or, as the message indicates, use RESTORE ... WITH MOVE.
> David
>
>
|||> USE WITH MOVE it was in the warning message and I can't
> find it at all in the restore options.
Below is a Transact-SQL example of the MOVE option David suggested. The
drives/folders must exist but the file must not.
RESTORE DATABASE MyDatabase
FROM DISK='C:\Backups\MyDatabase.bak'
WITH
MOVE 'MyDatabase' TO 'E:\DataFiles\\MyDatabase.mdf',
MOVE 'MyDatabase_Log' TO 'F:\LogFiles\\MyDatabase_Log.ldf'
You can list the logical file names needed for the MOVE option with RESTORE
FILELISTONLY:
RESTORE FILELISTONLY
FROM DISK='C:\Backups\MyDatabase.bak'
Hope this helps.
Dan Guzman
SQL Server MVP
"Ibrahim Awwad" <ibrahim_awwad(at)hotmail(dot)com(antispam)> wrote in
message news:0B29F43E-C8ED-4B4B-B93E-5F85EE0DBF6A@.microsoft.com...[vbcol=seagreen]
> Hi David,
> The files aren't there and I even tried to renave the dbase and the log
> file
> but it didn't work. USE WITH MOVE it was in the warning message and I
> can't
> find it at all in the restore options.
> --
> *********
> IT Manager
> DeLaval Ltd.
> Cairo-Egypt
> *********
> |--|
> |Islam is peace not Terror|
> |--|
>
> "David Browne" wrote:

Device Activation Error

Dear All,
I have deployed a new SQL server and I have installed SP4, I have tried to
restore my old dbase using restore from device and I choosed the dbase file
name. I got the following error (Device activiation error. The physical name
'old dbase file path' ma be incorrect). Use WITH MOVE to identify a valid
location for the file.
Please helpppp
--
*********
IT Manager
DeLaval Ltd.
Cairo-Egypt
*********
|--|
|Islam is peace not Terror|
|--|"Ibrahim Awwad" <ibrahim_awwad(at)hotmail(dot)com(antispam)> wrote in
message news:0AEA8F49-A25F-4DAC-B150-818FC9E94B99@.microsoft.com...
> Dear All,
> I have deployed a new SQL server and I have installed SP4, I have tried to
> restore my old dbase using restore from device and I choosed the dbase
> file
> name. I got the following error (Device activiation error. The physical
> name
> 'old dbase file path' ma be incorrect). Use WITH MOVE to identify a valid
> location for the file.
> Please helpppp
This means that one or more of the files the database is being restored to
already exists. Check the file name. If a file exists there, you might
want to rename it. Or, as the message indicates, use RESTORE ... WITH MOVE.
David|||Hi David,
The files aren't there and I even tried to renave the dbase and the log file
but it didn't work. USE WITH MOVE it was in the warning message and I can't
find it at all in the restore options.
--
*********
IT Manager
DeLaval Ltd.
Cairo-Egypt
*********
|--|
|Islam is peace not Terror|
|--|
"David Browne" wrote:
> "Ibrahim Awwad" <ibrahim_awwad(at)hotmail(dot)com(antispam)> wrote in
> message news:0AEA8F49-A25F-4DAC-B150-818FC9E94B99@.microsoft.com...
> > Dear All,
> >
> > I have deployed a new SQL server and I have installed SP4, I have tried to
> > restore my old dbase using restore from device and I choosed the dbase
> > file
> > name. I got the following error (Device activiation error. The physical
> > name
> > 'old dbase file path' ma be incorrect). Use WITH MOVE to identify a valid
> > location for the file.
> >
> > Please helpppp
>
> This means that one or more of the files the database is being restored to
> already exists. Check the file name. If a file exists there, you might
> want to rename it. Or, as the message indicates, use RESTORE ... WITH MOVE.
> David
>
>|||> USE WITH MOVE it was in the warning message and I can't
> find it at all in the restore options.
Below is a Transact-SQL example of the MOVE option David suggested. The
drives/folders must exist but the file must not.
RESTORE DATABASE MyDatabase
FROM DISK='C:\Backups\MyDatabase.bak'
WITH
MOVE 'MyDatabase' TO 'E:\DataFiles\\MyDatabase.mdf',
MOVE 'MyDatabase_Log' TO 'F:\LogFiles\\MyDatabase_Log.ldf'
You can list the logical file names needed for the MOVE option with RESTORE
FILELISTONLY:
RESTORE FILELISTONLY
FROM DISK='C:\Backups\MyDatabase.bak'
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Ibrahim Awwad" <ibrahim_awwad(at)hotmail(dot)com(antispam)> wrote in
message news:0B29F43E-C8ED-4B4B-B93E-5F85EE0DBF6A@.microsoft.com...
> Hi David,
> The files aren't there and I even tried to renave the dbase and the log
> file
> but it didn't work. USE WITH MOVE it was in the warning message and I
> can't
> find it at all in the restore options.
> --
> *********
> IT Manager
> DeLaval Ltd.
> Cairo-Egypt
> *********
> |--|
> |Islam is peace not Terror|
> |--|
>
> "David Browne" wrote:
>> "Ibrahim Awwad" <ibrahim_awwad(at)hotmail(dot)com(antispam)> wrote in
>> message news:0AEA8F49-A25F-4DAC-B150-818FC9E94B99@.microsoft.com...
>> > Dear All,
>> >
>> > I have deployed a new SQL server and I have installed SP4, I have tried
>> > to
>> > restore my old dbase using restore from device and I choosed the dbase
>> > file
>> > name. I got the following error (Device activiation error. The physical
>> > name
>> > 'old dbase file path' ma be incorrect). Use WITH MOVE to identify a
>> > valid
>> > location for the file.
>> >
>> > Please helpppp
>>
>> This means that one or more of the files the database is being restored
>> to
>> already exists. Check the file name. If a file exists there, you might
>> want to rename it. Or, as the message indicates, use RESTORE ... WITH
>> MOVE.
>> David
>>

Device Activation Error

Dear All,
I have deployed a new SQL server and I have installed SP4, I have tried to
restore my old dbase using restore from device and I choosed the dbase file
name. I got the following error (Device activiation error. The physical name
'old dbase file path' ma be incorrect). Use WITH MOVE to identify a valid
location for the file.
Please helpppp
--
*********
IT Manager
DeLaval Ltd.
Cairo-Egypt
*********
|--|
|Islam is peace not Terror|
|--|"Ibrahim Awwad" < ibrahim_awwad(at)hotmail(dot)com(antispa
m)> wrote in
message news:0AEA8F49-A25F-4DAC-B150-818FC9E94B99@.microsoft.com...
> Dear All,
> I have deployed a new SQL server and I have installed SP4, I have tried to
> restore my old dbase using restore from device and I choosed the dbase
> file
> name. I got the following error (Device activiation error. The physical
> name
> 'old dbase file path' ma be incorrect). Use WITH MOVE to identify a valid
> location for the file.
> Please helpppp
This means that one or more of the files the database is being restored to
already exists. Check the file name. If a file exists there, you might
want to rename it. Or, as the message indicates, use RESTORE ... WITH MOVE.
David|||Hi David,
The files aren't there and I even tried to renave the dbase and the log file
but it didn't work. USE WITH MOVE it was in the warning message and I can't
find it at all in the restore options.
--
*********
IT Manager
DeLaval Ltd.
Cairo-Egypt
*********
|--|
|Islam is peace not Terror|
|--|
"David Browne" wrote:

> "Ibrahim Awwad" < ibrahim_awwad(at)hotmail(dot)com(antispa
m)> wrote in
> message news:0AEA8F49-A25F-4DAC-B150-818FC9E94B99@.microsoft.com...
>
> This means that one or more of the files the database is being restored to
> already exists. Check the file name. If a file exists there, you might
> want to rename it. Or, as the message indicates, use RESTORE ... WITH MOV
E.
> David
>
>|||> USE WITH MOVE it was in the warning message and I can't
> find it at all in the restore options.
Below is a Transact-SQL example of the MOVE option David suggested. The
drives/folders must exist but the file must not.
RESTORE DATABASE MyDatabase
FROM DISK='C:\Backups\MyDatabase.bak'
WITH
MOVE 'MyDatabase' TO 'E:\DataFiles\\MyDatabase.mdf',
MOVE 'MyDatabase_Log' TO 'F:\LogFiles\\MyDatabase_Log.ldf'
You can list the logical file names needed for the MOVE option with RESTORE
FILELISTONLY:
RESTORE FILELISTONLY
FROM DISK='C:\Backups\MyDatabase.bak'
Hope this helps.
Dan Guzman
SQL Server MVP
"Ibrahim Awwad" < ibrahim_awwad(at)hotmail(dot)com(antispa
m)> wrote in
message news:0B29F43E-C8ED-4B4B-B93E-5F85EE0DBF6A@.microsoft.com...[vbcol=seagreen]
> Hi David,
> The files aren't there and I even tried to renave the dbase and the log
> file
> but it didn't work. USE WITH MOVE it was in the warning message and I
> can't
> find it at all in the restore options.
> --
> *********
> IT Manager
> DeLaval Ltd.
> Cairo-Egypt
> *********
> |--|
> |Islam is peace not Terror|
> |--|
>
> "David Browne" wrote:
>

Tuesday, February 14, 2012

Determining restore sequence

Hi,
I have a lot of files in a directory. Each one have exactly one SQL Backup
Set. There are full, differential and transaction-log backup files...
How can I know what files (diffs and tlogs) should be restored (and in what
order) considering a individual full backup file (to get a the most recent
state)?
I am trying to use DatabaseBackupLSN and LastLSN. And I am having special
problems with the transaction-log backups (where to restore or not after a
specific differential).
Can anyone help me?
Thanks,
Rafael PivatoThe easiest way is to go by the time/date stamp in the
file name, which you should be using. Or by the file
dates.
Now, you need a full, and then after that, you can do the
differential after the full, and the transaction logs
after that. Or the full and all the tran logs after that.
You should keep a document somewhere that details these
things.
>--Original Message--
>Hi,
>
>I have a lot of files in a directory. Each one have
exactly one SQL Backup
>Set. There are full, differential and transaction-log
backup files...
>
>How can I know what files (diffs and tlogs) should be
restored (and in what
>order) considering a individual full backup file (to get
a the most recent
>state)?
>
>I am trying to use DatabaseBackupLSN and LastLSN. And I
am having special
>problems with the transaction-log backups (where to
restore or not after a
>specific differential).
>
>
>Can anyone help me?
>Thanks,
>Rafael Pivato
>
>
>.
>|||Hi,
Allways try to create transaction log backup file names
with the combination of TX_date_time.bak.
Thanks
Hari
"Allan Hirt" <allanh@.nospamavanade.com> wrote in message
news:02f201c3cc0e$650a5410$a101280a@.phx.gbl...
> The easiest way is to go by the time/date stamp in the
> file name, which you should be using. Or by the file
> dates.
> Now, you need a full, and then after that, you can do the
> differential after the full, and the transaction logs
> after that. Or the full and all the tran logs after that.
> You should keep a document somewhere that details these
> things.
> >--Original Message--
> >Hi,
> >
> >
> >
> >I have a lot of files in a directory. Each one have
> exactly one SQL Backup
> >Set. There are full, differential and transaction-log
> backup files...
> >
> >
> >
> >How can I know what files (diffs and tlogs) should be
> restored (and in what
> >order) considering a individual full backup file (to get
> a the most recent
> >state)?
> >
> >
> >
> >I am trying to use DatabaseBackupLSN and LastLSN. And I
> am having special
> >problems with the transaction-log backups (where to
> restore or not after a
> >specific differential).
> >
> >
> >
> >
> >
> >Can anyone help me?
> >
> >Thanks,
> >
> >Rafael Pivato
> >
> >
> >
> >
> >.
> >|||Read the file names into a temp table, ordered by its last modify date/time.
Loop through the temp table to examine each file with 'RESTORE HEADERONLY.'
This will tell you, among other things, the backup type of the backup file
or whether it is even a backup file. Keep only the latest full database
backup file, toss away any differential backup files older than the lastest
full database backup, and toss away any tran log backup files older than the
latest differential backup or the latest full database backup if there is no
differential backup.
Construct the RESTORE script in the following order:
1. Construct the database RESTORE statement by running RESTORE FILELISTONLY.
2. Construct the differential RESTORE statement by running RESTORE
FILELISTONLY on the differential backup file.
3. Construct the log RESTORE statements by running RESTORE FILELISTONLY on
each of the log backup files in the chronological order.
--
Linchi Shea
linchi_shea@.NOSPAMml.com
"Rafael Pivato" <for@.get.it> wrote in message
news:%23Sm0yx%23yDHA.2116@.TK2MSFTNGP11.phx.gbl...
> Hi,
>
> I have a lot of files in a directory. Each one have exactly one SQL Backup
> Set. There are full, differential and transaction-log backup files...
>
> How can I know what files (diffs and tlogs) should be restored (and in
what
> order) considering a individual full backup file (to get a the most recent
> state)?
>
> I am trying to use DatabaseBackupLSN and LastLSN. And I am having special
> problems with the transaction-log backups (where to restore or not after a
> specific differential).
>
>
> Can anyone help me?
> Thanks,
> Rafael Pivato
>
>