Results 1 to 15 of 15

Thread: Restore

  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Unanswered: Restore

    Hi guys I know this is a Noob and silly question but I am trying to do a restore
    and I am trying to do this corredtly. is this ok??
    Code:
    USE master
    GO
    
    RESTORE DATABASE <SoftWareTesterdb>
    	FROM  DISK = N'<D:\Database\MSSQL\MSSQL.1\MSSQL\Backup\NonProductionDiff.bak' 
    WITH  
    	FILE = 1,  
    	NOUNLOAD,  
    	REPLACE,
    	STATS = 10
    GO

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Remove the < from the path to the file.

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Have you tried filelistonly to look at the dump first?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  4. #4
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    Hi all I'm just practicing restoring. I deleted a table from the Adventureworks Database. Here is the statement I used. Any Advice

    RESTORE DATABASE [AdventureWorks] FROM DISK = N'E:\TestBackup\NonProdFull' WITH FILE = 1, REPLACE, NOUNLOAD, STATS = 10
    GO

    here is message I got, hope I did this correctly
    10 percent processed.
    20 percent processed.
    30 percent processed.
    40 percent processed.
    50 percent processed.
    60 percent processed.
    70 percent processed.
    80 percent processed.
    90 percent processed.
    100 percent processed.
    Processed 21432 pages for database 'AdventureWorks', file 'AdventureWorks_Data' on file 1.
    Processed 2 pages for database 'AdventureWorks', file 'AdventureWorks_Log' on file 1.
    RESTORE DATABASE successfully processed 21434 pages in 3.416 seconds (51.400 MB/sec).

  5. #5
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    The results look correct to me. Is your table back?

  6. #6
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    it sure is I just wanted to make sure that is the correct restore process

  7. #7
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    I have another question when I did a restore from Differential I got this error message
    Code:
    RESTORE LOG [AdventureWorks] FROM  DISK = N'E:\TestBackup\NonProdDiff' WITH FILE = 1, REPLACE, NOUNLOAD, STATS = 10
    GO
    Msg 3117, Level 16, State 4, Line 1
    The log or differential backup cannot be restored because no files are ready to rollforward.
    Msg 3013, Level 16, State 1, Line 1
    RESTORE LOG is terminating abnormally.

  8. #8
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Did you restore the full backup before with NORECOVERY?

  9. #9
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    No I didnt restore with the NORECOVERY

    sorry I reread what you posted and that was all wrong LOL
    Last edited by desireemm; 07-08-09 at 18:49.

  10. #10
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    ok did a restore with NoRecovery and here is the message I got, looks like the log is too recent to apply to the database.

    10 percent processed.
    20 percent processed.
    30 percent processed.
    40 percent processed.
    50 percent processed.
    60 percent processed.
    70 percent processed.
    80 percent processed.
    90 percent processed.
    100 percent processed.
    Processed 21432 pages for database 'AdventureWorks', file 'AdventureWorks_Data' on file 1.
    Processed 2 pages for database 'AdventureWorks', file 'AdventureWorks_Log' on file 1.
    RESTORE DATABASE successfully processed 21434 pages in 3.333 seconds (52.680 MB/sec).
    Msg 4305, Level 16, State 1, Line 3
    The log in this backup set begins at LSN 57000000030400034, which is too recent to apply to the database. An earlier log backup that includes LSN 57000000028000001 can be restored.
    Msg 3013, Level 16, State 1, Line 3
    RESTORE LOG is terminating abnormally.

  11. #11
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    I think you are missing a t-log back between the time of the database backup and the time of the t-log you tried to apply.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  12. #12
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    thank you thrasy

  13. #13
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    I Tried doing a restore yesterday and today and this is the error message I got

    TITLE: Microsoft SQL Server Management Studio
    ------------------------------

    Restore failed for Server 'GCSQLTEST'. (Microsoft.SqlServer.Smo)

    For help, click: Source&#58; ID&#58; &#40; &#41; - Events And Errors Message Center&#58; Message Details

    ------------------------------
    ADDITIONAL INFORMATION:

    System.Data.SqlClient.SqlError: Exclusive access could not be obtained because the database is in use. (Microsoft.SqlServer.Smo)

    For help, click: http://go.microsoft.com/fwlink?ProdN...0&LinkId=20476

    ------------------------------
    BUTTONS:

    OK
    ------------------------------

  14. #14
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    sorry i posted twice my mistake
    Last edited by desireemm; 07-10-09 at 13:23.

  15. #15
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    When you do a restore, you need to kick everyone out of that database, or else they will hold a lock on that database. What I do, is set the database to RESTRICTED_USER, before a restore, just to make sure that no non-admin user can get in. You can also set the database OFFLINE, if you have some applications that for reasons beyond your control are running as administrators. Remember to use the WITH ROLLBACK IMMEDIATE option, as well. Otherwise, you have to wait for the users to politely finish up.

Posting Permissions

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