April 26, 2006 at 11:08 pm
I am having issues with a simple restore operation on one of my servers.
Everytime I do a restore, the following error is raised irrespective of what database backup I use:
Server: Msg 5180, Level 22, State 1, Line 1
Could not open FCB for invalid file ID 2 in database '<database name>'.
Connection Broken
Anyone with a clue as to what the problem is?
April 27, 2006 at 8:31 am
This doesn't sound good but you could have corruption in the database. Check out. Google can provide other hits as well. Good Luck.
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=24&messageid=190516
or
http://database.ittoolbox.com/groups/technical-functional/sql-server-l/449455#
Terry
April 27, 2006 at 7:42 pm
Thanks tosscrosby.
I did read the article from ITtoolbox, though helpful, it did not resolve my problem.
The backup of the databases have been restored successfully on a different server but not on this particular one. It would appear that the issue lies with the system databases (master?)! I'll continue to work on it a bit further...
May 1, 2006 at 12:03 pm
Are the SQL Server editions (7, 2000, 2005) and versions (Service Pack levels) the same on both systems (where the backup came from and where the restore is occuring)?
Are you doing a 'new' restore or are you trying to do a 'chain' restore (ie. differential to a full or transaction logs to a full backup)? If you are trying to restore a 'chain' of backups, maybe you missed one?
-SQLBill
May 1, 2006 at 5:40 pm
I simply perform a normal full backup of a database (doesn't matter which one) with the INIT command. Then created a new database, and perform the restore. The error is raised and the database is left in a LOADING state. Using sp_helpdb simply returns no records.
As I said before, the funny thing is that the restore is OK when performed on a different server, just not on this particular one! I have tried restarting Windows and SQL Server, but without much success. It would be good to know where one can start to troubleshoot the situation - googling hasn't turned up anything so far!
May 2, 2006 at 6:50 am
Paul, if you run sp_configure on both servers, is everything the same (or at least similar)?
Terry
May 2, 2006 at 7:17 am
Hi Terry,
No they are different in a number of config values; but I can't see anything obvious that would help me to resolve the problem!
As a work around to restoring a database, I simply create the database and import the schema for all objects from the database that was backed up.
Did you have anything in mind concerning sp_configure?
May 2, 2006 at 7:44 am
Aha! quote:The error is raised and the database is left in a LOADING state.
A database left in a loading state is 'usually' waiting for more files to be restored. It sounds like this file is being restored using the WITH NORECOVERY option.
When it is showing the LOADING status and you are done restoring files, run this: RESTORE DATABASE dbname WITH RECOVERY.
Your last file to be restored should include WITH RECOVERY.
-SQLBill
May 2, 2006 at 7:52 am
The strange thing is that the database was restored with the RECOVERY option. The database was left in a LOADING state due to the error that was raised...
May 2, 2006 at 12:10 pm
Paul,
You said you created a new database then restored. Try restoring without creating the database first. See "How to restore a database with a new name" in BOL.
Greg
Greg
May 2, 2006 at 7:14 pm
Greg,
Thanks for the tip (I didn't know you could do that!); unfortunately, the problem appears to be system related (what it is I am unsure!). The error after the restore is as follows:
Processed 1784 pages for database 'gaptest', file 'gapbuster_Data' on file 1.
Processed 1 pages for database 'gaptest', file 'gapbuster_Log' on file 1.
Server: Msg 5180, Level 22, State 1, Line 1
Could not open FCB for invalid file ID 2 in database 'gaptest'.
Connection Broken
As stated previously, the restore is successful on a different server.
Paul
May 2, 2006 at 8:16 pm
There is a simple solution :-
Thanks,
- Kunal Gandre
Kunal Gandre
>
Snr. SQL DBA
May 2, 2006 at 11:04 pm
Thanks for your input Kunal.
I am more leaning towards a corruption (of sorts) of the master database myself. Will need some downtime to check the master database, but here is what I did to exclude the database that was backed up from being a suspect:
use master
go
create database testA
on (name=testA_data,filename='E:\SQLData\testA_data.mdf',size=1)
log on (name=testA_log,filename='G:\SQLLog\testA_log.ldf',size=1)
go
backup database testA
to disk = 'E:\testA.bak'
go
restore database testB
from disk = 'E:\testA.bak'
with recovery,
move 'testA_data' to 'E:\SQLData\testB_data.mdf',
move 'testA_log' to 'G:\SQLLog\testB_log.ldf'
go
When the script is executed, the following error is raised:
Processed 80 pages for database 'testB', file 'testA_data' on file 1.
Processed 1 pages for database 'testB', file 'testA_log' on file 1.
Server: Msg 5180, Level 22, State 1, Line 1
Could not open FCB for invalid file ID 2 in database 'testB'.
Connection Broken
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply