Prev: Changing compatibility
Next: Where to run script to create database including tables and store procedures?
From: Jason Huang on 6 Apr 2010 03:48 Hi, In my SQL Server 2008, I tried to restore some db. I searfed the internet and found some command like Restore MyDB FROM DISK = 'C:\BackUp\.bak' WITH file=1, RECOVERY I am wondering what the 'file = 1 is. Thanks for help. Jason
From: Mark Fitzgerald on 6 Apr 2010 04:07 In this context it is the first backup within the backup file. Unless you use INIT or FORMAT within the BACKUP command any new backups you do will add to the current file (if one exists). To choose between the backups within a file you use the FILE = integer clause. Fitz "Jason Huang" <JasonHuang8888(a)hotmail.com> wrote in message news:ul2QZ2V1KHA.4560(a)TK2MSFTNGP02.phx.gbl... > Hi, > > > In my SQL Server 2008, I tried to restore some db. > I searfed the internet and found some command like > Restore MyDB FROM DISK = 'C:\BackUp\.bak' WITH file=1, RECOVERY > I am wondering what the 'file = 1 is. > Thanks for help. > > > Jason >
From: Jason Huang on 6 Apr 2010 04:41 Thanks. I'm testing using the Win2008 Server + SQL Server, the .bak file is from the old SQL Server 2000 on a Win2003 Server. While the result of executing the simple script RESTORE DATABASE MYDB from DISK = 'C:\BackUp\MYDB.bak' will be Msg 3159, Level 16, State 1, Line 1 The tail of the log for the database "MYDB" has not been backed up. Then I tried the RESTORE DATABASE MYDB from DISK = 'C:\BackUp\MYDB.bak' WITH file=1, Replace it will work. However I'm still thinking if the result will be varied much. "Mark Fitzgerald" <notes_sql(a)hotmail.com> ???????:O1lyFBW1KHA.5828(a)TK2MSFTNGP02.phx.gbl... > In this context it is the first backup within the backup file. Unless you > use INIT or FORMAT within the BACKUP command any new backups you do will > add to the current file (if one exists). To choose between the backups > within a file you use the FILE = integer clause. > > Fitz > > "Jason Huang" <JasonHuang8888(a)hotmail.com> wrote in message > news:ul2QZ2V1KHA.4560(a)TK2MSFTNGP02.phx.gbl... >> Hi, >> >> >> In my SQL Server 2008, I tried to restore some db. >> I searfed the internet and found some command like >> Restore MyDB FROM DISK = 'C:\BackUp\.bak' WITH file=1, RECOVERY >> I am wondering what the 'file = 1 is. >> Thanks for help. >> >> >> Jason >>
From: Mark Fitzgerald on 6 Apr 2010 05:04
The message refers to the file you are overwriting. The database already exists so SQL presumes that the log file contains important entries so must be backed up before being overwritten. The REPLACE clause turns off this behavior and overwrites the database. To backup the tail log before restoring use BACKUP LOG ... WITH NO_RECOVERY. Fitz "Jason Huang" <JasonHuang8888(a)hotmail.com> wrote in message news:OSPSmTW1KHA.364(a)TK2MSFTNGP02.phx.gbl... > Thanks. > I'm testing using the Win2008 Server + SQL Server, the .bak file is from > the old SQL Server 2000 on a Win2003 Server. > While the result of executing the simple script > RESTORE DATABASE MYDB from DISK = 'C:\BackUp\MYDB.bak' will be Msg 3159, > Level 16, State 1, Line 1 The tail of the log for the database "MYDB" has > not been backed up. > Then I tried the > RESTORE DATABASE MYDB from DISK = 'C:\BackUp\MYDB.bak' WITH file=1, > Replace > it will work. > However I'm still thinking if the result will be varied much. > > > > > "Mark Fitzgerald" <notes_sql(a)hotmail.com> > ???????:O1lyFBW1KHA.5828(a)TK2MSFTNGP02.phx.gbl... >> In this context it is the first backup within the backup file. Unless >> you use INIT or FORMAT within the BACKUP command any new backups you do >> will add to the current file (if one exists). To choose between the >> backups within a file you use the FILE = integer clause. >> >> Fitz >> >> "Jason Huang" <JasonHuang8888(a)hotmail.com> wrote in message >> news:ul2QZ2V1KHA.4560(a)TK2MSFTNGP02.phx.gbl... >>> Hi, >>> >>> >>> In my SQL Server 2008, I tried to restore some db. >>> I searfed the internet and found some command like >>> Restore MyDB FROM DISK = 'C:\BackUp\.bak' WITH file=1, RECOVERY >>> I am wondering what the 'file = 1 is. >>> Thanks for help. >>> >>> >>> Jason >>> > > |