Results 1 to 9 of 9

Thread: restore database from backup

  1. #1
    Join Date
    Jul 2003
    Posts
    421

    restore database from backup

    Hi all,
    I want to restore My database from backup
    restore database HKData from disk ='H:\HKData.DAT'
    go
    i got error at
    Server: Msg 3154, Level 16, State 1, Line 1
    The backup set holds a backup of a database other than the existing 'HKData' database.
    Server: Msg 3013, Level 16, State 1, Line 1
    RESTORE DATABASE is terminating abnormally.
    ________
    SUBARU JUSTY SPECIFICATIONS
    Last edited by sql; 03-06-2011 at 01:36 AM.

  2. #2
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    restore filelistonly from disk =
    'H:\HKData.DAT' will tell you what database file it has. It might be holding multiple database.


    RESTORE HEADERONLY
    from disk =
    'H:\HKData.DAT' will tell you what database file it has. It might be holding multiple database.


    I never saw somebody use .DAT for backup files. Are you sure it is a backup device or file?

  3. #3
    Join Date
    Jul 2003
    Posts
    421
    Hi Mak,
    restore filelistonly from disk =
    'H:\HKData.DAT'
    I got
    PrimaryDev C:\Microsoft SQL Server\MSSQL\data\contacts_primary.mdf D PRIMARY 419430400 524288000
    secondaryDev C:\Microsoft SQL Server\MSSQL\data\contacts_secondary.ndf D PRIMARY 209715200 35184372080640
    LogDev c:\Microsoft SQL Server\MSSQL\data\contacts_log.ldf L NULL 104857600 35184372080640
    RESTORE HEADERONLY
    from disk =
    'H:\HKData.DAT'
    I got
    NULL Pubs test backup 5 NULL 0 1 2 SERVER-ND3SGP2L\project SERVER-ND3SGP2L HKData 539 2004-10-27 12:26:50.000 1851904 26000000737400001 26000000737600001 26000000737400001 26000000610700002 2004-12-29 14:05:57.000 2004-12-29 14:05:57.000 52 228 1033 196609 80 4608 8 0 194 SERVER-ND3SGP2L 0 {8E076AF5-94EA-4726-A6EE-AE7A30D6A73C} {01C09242-19EC-4B73-AE47-B0A313D18E73} SQL_Latin1_General_CP1_CI_AS
    wha tmistake I make!!
    Thank you
    ________
    Sauber F1.06
    Last edited by sql; 03-06-2011 at 01:37 AM.

  4. #4
    Join Date
    Sep 2002
    Posts
    5,938
    If you like to restore db to one with different name, you can use 'with replace' option in restore statement.

  5. #5
    Join Date
    Jul 2003
    Posts
    421
    I think the problem is when I doing back up My SQL on c driver, now for some security reason, I have to restore anthing On my Pc, I want to move it to D driver, I got problem.
    I try both

    restore database HKData from disk ='H:\HKData.DAT' with replace,
    move "HKData_Data" to "D:\Microsoft SQL Server\MSSQL\Data\HKData_Data.mdf",
    move"HKData_Log" to "D:\Microsoft SQL Server\MSSQL\Data\HKData_Log.ldf"
    go
    and
    restore database HKData from disk='c:\Microsoft SQL Server\MSSQL\data\contacts_primary.mdf ',
    disk='C:\Microsoft SQL Server\MSSQL\data\contacts_secondary.ndf',
    disk='C:\Microsoft SQL Server\MSSQL\data\contacts_log.ldf' with replace
    it did not work.
    Thank you for any help!!
    ________
    Honda RA107 history
    Last edited by sql; 03-06-2011 at 01:37 AM.

  6. #6
    Join Date
    Jul 2003
    Posts
    421
    Hi Mak,
    I think your right, I check by RESTORE HEADERONLY if I got back up type =1, I can restore it, but the problem is most of my database data type have kack type =5, I guess the reason is I replace the backup. what can I do now??
    Thank you
    ________
    Macintosh games
    Last edited by sql; 03-06-2011 at 01:37 AM.

  7. #7
    Join Date
    Sep 2002
    Posts
    5,938
    You can't restore db from .mdf file since it's db data file not db backup file.

  8. #8
    Join Date
    Apr 2005
    Posts
    6
    You can attach the .mdf db file though. No need to restore.

  9. #9
    Join Date
    Sep 2002
    Posts
    5,938
    May not work without .ldf file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •