Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restore Database error 42000

Status
Not open for further replies.

2969

IS-IT--Management
Oct 18, 2001
107
0
0
US
hi

I am trying to restore a SQL database bak-up file and I get an error that Media family not correct error 42000.

What could be the issue?? any ideas are welcome

thx
TA
 
You aren't giving us enough information to help you.

What type of media are you restoring from?

Was this a backup from the same SQL Server that you are restoring to?

How are you doing the restore?

What did you use to create the backup?

-SQLBill

Posting advice: FAQ481-4875
 
1. I am restoring from a .bak file that my customer has sent to me.

2. this .bak file was created on a different server SQL2000 on win2k

3. Restore is being done when I do right click on databases, then All tasks and then Restore Database.

 
In the restore GUI go to the second tab, and uncheck the box that says match media name (or something to that effect). Or do the restore in Query Analyser.

The problem is that your customer named the media when doing the backup, and by default Enterprise Manager requires that the names match.

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(My very old site)
 
i did not find anything that says Match media name. Also how di i restore it using query analyser
 
Use the restore database command.
Code:
restore database {database_name}
from disk='d:\path\to\file.bak'
with MOVE 'data_file_name' to 'd:\mssql\data\file_name_data.mdf',
    MOVE 'log_file_name' to 'd:\mssql\data\file_name_log.ldf'

Look up RESTORE DATABASE in BOL for the full syntax.

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(My very old site)
 
hi,
I used the following command to restore database but I still got the error. Any more ideas or suggestions.

I made sure that the path is correct and the names of the log and mdf files are coorect using Restore FileListonly.

"The media family on device 'F:\sql\Data\Database.Bak' is incorrectly formed. SQL Server cannot process this media family."

RESTORE DATABASE Database1
FROM DISK = 'F:\sql\Data\Database.Bak'
WITH MOVE 'Database_Data' TO 'F:\sql\Data\Database1.mdf',
MOVE 'Database_log' TO 'F:\sql\Data\Database1.ldf'
GO
 
Try to restore the header of the backup.
Code:
restore headeronly from disk='f:\sql\data\database.bak'
You can also try to get the file list.
Code:
restore filelistonly from disk='f:\sql\data\database.bak'

If those don't work the backup is probably corrupt. Have them resend it to you. Have them backup the database using the backup command not the GUI.

Code:
backup database {database} to disk='d:\database.bak'

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(My very old site)
 
another thing that forgot to mention that my customer can restore the database at their end using the same file while I can not.

Does it has something to do with users or access to SQL
 
It shouldn't. What rights to you have on your SQL Server?

If you restore the headeronly you should be able to get the mediafamily name.

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(My very old site)
 
when I follow the follwoing command
(restore headeronly from disk='f:\sql\data\database.bak')

I get all Nulls in the results window of the query analyser and under the Backupname column I get Incomplete entry.

Does this indicates that the Bakup file was bad??
 
certenly sounds like something went wrong with the file. Is your SQL Server patched to the same level or higher than thier SQL Server?

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(My very old site)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top