December 5, 2005 at 1:10 pm
Hi,
I have a database that I backup each day as a scheduled job the syntax is as follows:
BACKUP DATABASE [master] TO DISK = N'D:\SQL Data Files\RSMS\Backups\Master.bak' WITH INIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT
BACKUP DATABASE [msdb] TO DISK = N'D:\SQL Data Files\RSMS\Backups\msdb.bak' WITH INIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT
BACKUP DATABASE [model] TO DISK = N'D:\SQL Data Files\RSMS\Backups\model.bak' WITH INIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT
BACKUP DATABASE [rsms] TO DISK = N'D:\SQL Data Files\RSMS\Backups\RSMS.bak' WITH INIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT
BACKUP LOG [RSMS] TO DISK = N'D:\SQL Data Files\RSMS\Backups\RSMS.TRN' WITH INIT
Databases are in Recovery mode:
Master: Full
Model: Full
MSDB: Simple
RSMS: Full
Then later on that night, the IS department does a online tape backup of the drives.
I created a test system and want to restore my databases. I keep coming up with errors. It says I need to "Move" the files, but then I try to attach and it gives me an invalid database file? What is the proper way to do this?
Thanks,
Brian
December 5, 2005 at 1:36 pm
So you aren't doing the restore on the original system?
Did you copy the tape backup to the same drive location as on the original server (to N'D:\SQL Data Files\RSMS\Backups)? If not, you need to do so. Or use the MOVE option in your restore command. Refer to the BOL for how to use MOVE with RESTORE DATABASE.
-SQLBill
December 5, 2005 at 1:40 pm
A with Move error usually means that the database restore is trying to put the data and log file in the same location as the server that it was backed up from. For example, on one server we store our data files on the root of E:\ on another server they are stored at d:\data\. If I try to restore a backup from the first server to the second it will try to put the files at E:\. If that location does not exist then I will get an error telling me to use the with move clause. The syntax I use is as follows:
RESTORE DATABASE [dbname] FROM DISK = 'path to backup file'
WITH FILE = 1, NOUNLOAD , STATS = 10, RECOVERY , REPLACE ,
MOVE 'nameofdatafile' TO 'new physical location of the data file',
MOVE 'nameoflogfile' TO 'new physical location of the log file'
December 5, 2005 at 1:55 pm
sqlbill,
No I am trying to restore on a test system. You referred to "BOL", what is "BOL"?
ramses2nd,
I will try that. And I should restore each file like that, with the exception of the log file "restore log". and I should do that last?
Thanks,
Brian
December 5, 2005 at 2:02 pm
Hi,
when I run this scrip I get the error that is included..
RESTORE DATABASE [RSMS] FROM DISK = 'C:\Temp\RS_Server Backups\rsms.bak'
WITH FILE = 1, NOUNLOAD , STATS = 10, RECOVERY , REPLACE ,
MOVE 'RSC_DATA' TO 'D:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\',
MOVE 'RSC_LOG' TO 'D:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\'
Server: Msg 3176, Level 16, State 1, Line 1
File 'D:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\' is claimed by 'Rsc_Log'(2) and 'Rsc_Data'(1). The WITH MOVE clause can be used to relocate one or more files.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
Any Help?
December 5, 2005 at 2:41 pm
Never Mind.. I got it.. forgot the file name on the move...
December 6, 2005 at 10:14 am
One point that was missed ... it concerns recovery ...
Databases are in Recovery mode:
Modification of recovery modes for the system databases is not recommended nor supported. The one exception is the model database. However changing the recovery mode of the master database is definitely a no-no.
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
December 6, 2005 at 11:19 am
I certaintly agree with Rudy. Most of my user databases are in full recovery so I have model set to full however I would strongly recommend that you do not put master or msdb in full recovery.
December 6, 2005 at 11:23 am
Can you explain to me why it is not recommended? I hope to understand this, so if you have a few more minutes
December 6, 2005 at 11:42 am
Modification of recovery modes for the system databases is not recommended nor supported.
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
December 6, 2005 at 6:53 pm
Master is the "heart" of your SQL installation It's hard enough to restore a backup of it - I can only imagine the flaming hoops you would have to jump through to restore additional transaction log backups of it
December 7, 2005 at 1:54 pm
BOL is the Books on Line. The SQL Server Help files.
-SQLBill
December 7, 2005 at 2:36 pm
So, if the Master is the Heart of the database, then, my database is not completly restored, untill I restore it? Does not body restore the master, or do they just have scripts to recreate the tasks and sercurity login's?
Brian
December 7, 2005 at 3:06 pm
No. The heart is the only organ non-transplantable in this analogy. Restoration of a user database is like receiving a new kidney, again in this analogy.
RegardsRudy KomacsarSenior Database Administrator"Ave Caesar! - Morituri te salutamus."
December 8, 2005 at 4:55 am
hahaha
Sorry, meant to say it was like the central part of your SQL Server installation. It itself is essentially another database on SQL, but it must always be there and stores all of your logins, system settings and lists of your other SQL Server databases..
Viewing 15 posts - 1 through 15 (of 21 total)
You must be logged in to reply to this topic. Login to reply