Database is still in a restored state after a successful database restore

Source: Internet
Author: User

When restoring a database today, restore the database in SSMs with the following code:

RESTORE DATABASE [TEST] from  DISK = N ' D:\TEST. BAK '  with FILE = 1,
Move N ' TEST ' to n ' C:\Program Files\Microsoft SQL Server\mssql10_50.mssqlserver\mssql\data\test.mdf ',
Move N ' Test_log ' to n ' C:\Program Files\Microsoft SQL Server\mssql10_50.mssqlserver\mssql\data\test_log. LDF ',
NORECOVERY, nounload, REPLACE, STATS = 10

After the restore succeeds, the database column is refreshed, but it finds an arrow on the test database that is still in the "restore" state, waits a few minutes and remains unchanged, and the database is unusable.

So Niang, find the following Web site:

http://bbs.csdn.net/topics/70037968

There are children's shoes have encountered the same problem, reply to have ZJCXC (Jiangjian) Master's reply, encountered this situation, the following code:

--The following statement is executed in the Query Analyzer, note modify the library name
     
Restore log your library name with recovery

After executing the above code, the results are as follows:

RESTORE LOG successfully processed 0 pages and took 3.554 seconds (0.000 mb/sec).

The database can then be used as well.

Although it is not clear what the principle is, but the problem is solved.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.