Error 3234 Sql Server
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us
Logical File Is Not Part Of Database Sql Server
Learn more about Stack Overflow the company Business Learn more about hiring developers or restore filelistonly example posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow
Restore Filelist Is Terminating Abnormally.
Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error - Logical file is not part of database. restore with move Use RESTORE FILELISTONLY to list the logical file names up vote 12 down vote favorite 2 I made a script to restore .bak or backup files. It works for some databases, but not for one. How do I make it work for any type of .bak file ? This is in sql server 2008. The error message is - Msg 3234, Level 16, State 1, Line 1 exclusive access could not be obtained because the database is in use Logical file 'Northwind_Data' is not part of database 'Northwind'. Use RESTORE FILELISTONLY to list the logical file names. Msg 3013, Level 16, State 1, Line 1 RESTORE DATABASE is terminating abnormally. Script - IF DB_ID('Northwind') IS NULL BEGIN RESTORE DATABASE [Northwind] FILE = N'Northwind_Data' FROM DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\Backup\Northwind.bak' WITH FILE = 1, MOVE N'Northwind_Data' TO N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\DATA\Northwind.mdf', MOVE N'Northwind_Log' TO N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\DATA\Northwind_0.LDF', NOUNLOAD, STATS = 10 END sql sql-server sql-server-2008 share|improve this question asked Mar 7 '14 at 9:10 Steam 1,94693983 Here was suggested to use free Database Restore software: stackoverflow.com/questions/1360529/… –tazo todua Jul 23 '14 at 14:01 add a comment| 3 Answers 3 active oldest votes up vote 20 down vote Please run below sql and check logical names RESTORE FILELISTONLY FROM DISK = 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\Backup\Northwind.bak' And then replace logical name shown by RESTORE FILELISTONLY in script below --If database already exists do not restore IF DB_ID('Northwind') IS NULL BEGIN RESTORE DATABASE [Northwind] FILE = N'Northwind_Data' FROM DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\Backup\Northwind.bak' WITH FILE = 1, NOUNLOAD, STATS = 10, MOVE N'YOUR logical name of data file as shown by RESTORE FILELISTONLY command' TO N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS20
log in tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the
Restore Database
workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Database Administrators Questions Tags Users Badges Unanswered Ask Question _ Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in http://stackoverflow.com/questions/22245808/error-logical-file-is-not-part-of-database-use-restore-filelistonly-to-list-t the community. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Backup of database X on SQL Server 2008 on server A - restore to SQL Server 2012 database Y on server B up vote 3 down http://dba.stackexchange.com/questions/68165/backup-of-database-x-on-sql-server-2008-on-server-a-restore-to-sql-server-2012 vote favorite 1 I want to copy a SQL Server 2008 database to SQL Server 2012 with a different database name. Took a backup of 'production' and copied it to the SQL Server 2012 machine. Created a new SQL Server 2012 database with a 'test' name. Tried to restore the .bak file but SQL Server says 'test' is busy What is the correct way top do this? Basically getting a snapshot of a production 2008 database into a test 2012 environment. Thanks Bob sql-server sql-server-2012 backup restore share|improve this question edited Jun 14 '14 at 8:58 marc_s 5,41632743 asked Jun 12 '14 at 18:56 Bob Clegg 161 add a comment| 2 Answers 2 active oldest votes up vote 5 down vote Don't create the database on server B before restoring. Just restore it. It doesn't have to exist first in order to do that. This should work whether the database already exists or not (so perhaps you should consider using a better name than 'test'), just open a new query window: USE master; GO RESTORE DATABASE test FROM DISK =
up Recent PostsRecent Posts Popular TopicsPopular Topics Home Search Members Calendar Who's http://www.sqlservercentral.com/Forums/Topic1549072-391-1.aspx On Home » SQL Server 2008 » SQL Server 2008 - General http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=40841 » Error - Logical file is not part of database.... Error - Logical file is not part of database. Use RESTORE FILELISTONLY to list the logical file names Rate Topic Display Mode Topic Options Author Message blasto_maxblasto_max Posted Sunday, March 9, 2014 12:55 PM SSC-Enthusiastic Group: sql server General Forum Members Last Login: Thursday, May 15, 2014 8:51 PM Points: 183, Visits: 480 I made a script to restore .bak or backup files. It works for some databases, but not for one. How do I make it work for any type of .bak file ? This is in sql server 2008. The error message is -Msg error 3234 sql 3234, Level 16, State 1, Line 1Logical file 'Northwind_Data' is not part of database 'Northwind'. Use RESTORE FILELISTONLY to list the logical file names.Msg 3013, Level 16, State 1, Line 1RESTORE DATABASE is terminating abnormally.Script -IF DB_ID('Northwind') IS NULLBEGINRESTORE DATABASE [Northwind]FILE = N'Northwind_Data'FROM DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\Backup\Northwind.bak'WITH FILE = 1,MOVE N'Northwind_Data'TO N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\DATA\Northwind.mdf',MOVE N'Northwind_Log' TO N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\DATA\Northwind_0.LDF',NOUNLOAD, STATS = 10END Post #1549072 HanShiHanShi Posted Monday, March 10, 2014 6:37 AM SSCrazy Group: General Forum Members Last Login: Friday, October 7, 2016 1:43 PM Points: 2,868, Visits: 3,351 At first glance I think you've added an extra line that doesn't belong there:IF DB_ID('Northwind') IS NULLBEGINRESTORE DATABASE [Northwind]FILE = N'Northwind_Data' -- this line needs to be removedFROM DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\Backup\Northwind.bak'WITH FILE = 1,MOVE N'Northwind_Data'TO N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\DATA\Northwind.mdf',MOVE N'Northwind_Log'TO N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SS2008\MSSQL\DATA\Northwind_0.LDF',NOUNLOAD, STATS = 10END ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! ** Post #1549205 « Prev Topic | Next Topic » Permissions You cannot post new topic
SQL Server experts to answer whatever question you can come up with. Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums. SQL Server Forums Profile | ActiveTopics | Members | Search | ForumFAQ Register Now and get your question answered! Username: Password: Save Password Forgot your Password? All Forums SQL Server 2000 Forums Import/Export (DTS) and Replication (2000) Restoring .BAK file to a different server? Reply to Topic Printer Friendly Next Page Author Topic Page: 1 2 of 2 arlene Starting Member 12 Posts Posted-10/04/2004: 14:10:23 Hello all,I have a database on a hosted server in which the administartormade a backup copy of my database and put it in my root FTP folderso I could download it.I need to restore it to my own server but have no option to pointto the .bak file using the restore wizard. (since it was never on this server yet ??) Can someone tell me how I can use the .bak file to copy the database to my new server?Thanks in advance,Arlene tkizer Almighty SQL Goddess USA 38200 Posts Posted-10/04/2004: 14:15:01 RESTORE DATABASE DBNameFROM DISK = 'C:\Backup.BAK'WITH REPLACE, MOVE 'DBName_Data' TO 'C:\MSSQL\DATA\DBName_Data.MDF',MOVE 'DBName_Log' TO 'C:\MSSQL\DATA\DBName_Log.LDF'So IOW, use RESTORE DATABASE in Query Analyzer. To do it inside Enterprise Manager, select from device on the first screen.Tara arlene Starting Member 12 Posts Posted-10/04/2004: 14:47:39 I get the following error:Server: Msg 3101, Level 16, State 1, Line 1Exclusive access could not be obtained because the database is in use.Server: Msg 3013, Level 16, State 1, Line 1RESTORE DATABASE is terminating abnormally.How can I put the DB in user only mode? Is this what I need to do?Thanks tkizer Almighty SQL Goddess USA 38200 Posts Posted-10/04/2004: 15:37:24 You need to disconnect whoever is connected to it. You can issue a KILL under the spid. Do a sp_who in Query Analyzer to see who is c