Monday, March 19, 2012

DB Restore problem

Hello all,

I've been reading this thread http://forums.microsoft.com/msdn/ShowPost.aspx?postid=1494867&siteid=1 because I've been having a similar problem.

I wanted to post a new thread to make sure that people have an opportunity to see it and, hopefully, give me some help.

I have a backup of my production database and want to restore it over my development database (using Enterprise Manager). When I first tried the restoration it worked but the application (Siebel) using the database wouldn't log in. Stupidly, instead of reading the log files for the application I panicked and restored the dev database with an old copy of the dev database. Unfortunately this backup was either not complete or had some other problem because that restore failed.

I then tried running the restore (again from Enterprise Manager) of the dev database with my production backup and began receiving the MOVE FILE error discussed in the abovementioned thread.

So, following the instructions in that thread, I attempted to run the RESTORE FILELISTONLY command from SQL Query analyzer and get this message:

"Could not locate entry in sysdatabases for database 'siebel_prod.' No entry found with that name. Make sure the name is entered correctly."

Can anyone help me with the above issue? This is extremely time critical and I need to get a resolution ASAP.

Thanks in advance.

|||You should not need to include the database name n the RESTORE FILELISTONLY syntax.|||

generally , with the Move option the very common mistake is , you change the logical file name also , ie

Step 1 -- Run the below statement to see the LOGICAL FIle name in the backup set

RESTORE FILELISTONLY FROM DISK = 'D:\yourbackupfile.bak'

RESTORE DATABASE GPx FROM DISK = 'D:\yourbackupfile.bak'

WITH MOVE 'Your_Source_Datbase_Logical_Data_Filename' TO 'D:\TargetDatabae.mdf',

MOVE Your_Source_Datbase_Logical_Log_Filename' TO 'D:\TargetDatabase_log.ldf'

Your_Source_Datbase_Logical_Data_Filename' -- THis should be the source database (not the target) logical filename which can get by RESTORE FILELISTONLY

Your_Source_Datbase_Logical_Log_Filename' -- THis should be the source database logical filename

when you restore a database with move option , your source and target database will have same logical name. This you need to change ALTER DATABASE statemetn after restoration

Madhu

|||

You wrote this:

"RESTORE DATABASE GPx FROM DISK = 'D:\yourbackupfile.bak'"

What is "GPx"?

I'm assuming it is the name of the database to be restored. Right?

|||

i just cut paste from my enviornment man... yes its database name

Madhu

|||

>>

RESTORE DATABASE GPx FROM DISK = 'D:\yourbackupfile.bak'

WITH MOVE 'Your_Source_Datbase_Logical_Data_Filename' TO 'D:\TargetDatabae.mdf',

MOVE Your_Source_Datbase_Logical_Log_Filename' TO 'D:\TargetDatabase_log.ldf'

Your_Source_Datbase_Logical_Data_Filename' -- THis should be the source database (not the target) logical filename which can get by RESTORE FILELISTONLY

Your_Source_Datbase_Logical_Log_Filename' -- THis should be the source database logical filename

<<

I just got around to trying to do this. When I do it tells me that my target database doesn't exist and terminates. So I created a new instance of the database, ran it again and it tells me the target database exists and to use the "WITH REPLACE" command. I then changed the command to:

RESTORE DATABASE GPx FROM DISK = 'D:\yourbackupfile.bak'

WITH REPLACE 'Your_Source_Datbase_Logical_Data_Filename' TO 'D:\TargetDatabae.mdf',

MOVE Your_Source_Datbase_Logical_Log_Filename' TO 'D:\TargetDatabase_log.ldf'

And it tells me that 'REPLACE' is an unrecognized restore option. WTF? This shouldn't be that hard.

|||You're not far off Steve, just a slight syntax issue:

RESTORE DATABASE GPx FROM DISK = 'D:\yourbackupfile.bak'

WITH MOVE 'Your_Source_Datbase_Logical_Data_Filename' TO 'D:\TargetDatabae.mdf',

MOVE Your_Source_Datbase_Logical_Log_Filename' TO 'D:\TargetDatabase_log.ldf',

REPLACE,

STATS = 5


I often add in the STATS keyword too, just to show the progress of the RESTORE. For a full list of commands and examples can be found in Books Online.

HTH!
|||Thanks for your response. I'd already figured it out, but I appreciate your effort.

No comments:

Post a Comment