Professional Web Applications Themes

cant restore a database - Microsoft SQL / MS SQL Server

I am trying to add backup/restore functionality to my application but cannot get the restore to work. I feel like I have tried everything. Sometimes I wish db's had a "just do it" option, I hate all this kind of crap. This is the SQL I am using... RESTORE DATABASE Shows FROM DISK = 'c:\gs03.bu' with FILE = 1, recovery, replace, MOVE 'Shows' to 'c:\Program Files\Microsoft SQL Server\MSSQL$VSdotNET\Data\Shows.mdi' but cannot get around the error.. Logical file 'Shows' is not part of database 'Shows' Use RESTORE FILELISTONLY to list the logical fiel names I have run the RESTORE FILELISTONLY command and ...

  1. #1

    Default cant restore a database

    I am trying to add backup/restore functionality to my application but
    cannot get the restore to work. I feel like I have tried everything.
    Sometimes I wish db's had a "just do it" option, I hate all this kind
    of crap.

    This is the SQL I am using...

    RESTORE DATABASE Shows FROM DISK = 'c:\gs03.bu' with FILE = 1,
    recovery, replace, MOVE 'Shows' to 'c:\Program Files\Microsoft SQL
    Server\MSSQL$VSdotNET\Data\Shows.mdi'

    but cannot get around the error..

    Logical file 'Shows' is not part of database 'Shows' Use RESTORE
    FILELISTONLY to list the logical fiel names

    I have run the RESTORE FILELISTONLY command and found that the logical
    name is exactly what it should be (Shows). The error makes no sense.

    Why is this giving me so many problems, why is it so difficualt to
    restore overtop of an existing database.

    Thanks in advance,
    martin
    Martin Guest

  2. #2

    Default Re: cant restore a database

    I doubt that filename with that logical name exists.

    Could you post result of:

    restore filelistonly from disk = 'c:\gs03.bu'

    --
    Dean Savovic
    www.teched.hr


    "Martin Searancke" <co.nz> wrote in message news:google.com... 


    Dean Guest

  3. #3

    Default Re: cant restore a database

    Very strange. I did a bit more investigation and the server was
    telling me the truth afterall.

    I was doing the wrong thing to get the results of the restore
    filelistonly command. Somewhere i had found a post saying to use
    "select logical_name from msdb..backupfile" after running the
    'filelistonly' command and was using the result of this as my logical
    name. This gave me 'Shows' as my logical name when in reality it was
    'Shows_data'.

    Thanks for your help,
    Martin


    "Dean Savovic" <hr> wrote in message news:<bfim9i$br8$net4u.hr>... 
    Martin Guest

Similar Threads

  1. InnoDB restore database: VIEW error
    By the_m in forum MySQL
    Replies: 0
    Last Post: June 13th, 08:57 AM
  2. Replies: 15
    Last Post: January 12th, 10:08 AM
  3. Replies: 3
    Last Post: January 11th, 12:12 AM
  4. Physical restore that doesn't require a logical restore
    By Christian Eriksson in forum Informix
    Replies: 6
    Last Post: September 24th, 11:30 AM
  5. Arcserve restore of Oracle database
    By cooljigs in forum Oracle Server
    Replies: 0
    Last Post: June 24th, 05:50 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139