"Upgrade to SQL 2012" SQL Server MDF up-compatible additional database (unable to open database ' xxxxx ' version 611.) Please upgrade the database to the latest version. )

Source: Internet
Author: User

SQL Server MDF up-compatible additional database (unable to open database ' xxxxx ' version 611. Please upgrade the database to the latest version. )

Recently working with a sqlserver2005 version of MDF file, no log file is now required

Attached to the sqlserver2012, after a search online, the whole process is served, for your reference

Create a database First

Set the database compatibility again (this step can be omitted after the attempt)

Stop the SQL Server service, replace the MDF file that will need the attachment with the MDF that created the data, and delete the corresponding LDF file

Start the SQL Server service again

Execute the following script

Script one:

ALTER DATABASE hunlianjiaoyou SET EMERGENCY
ALTER DATABASE hunlianjiaoyou SET single_user
ALTER DATABASE hunlianjiaoyou REBUILD LOG on (name=hunlianjiaoyou_log, filename= ' C:\Program Files\Microsoft SQL Server\ MSSQL11. Mssqlserver\mssql\data\hunlianjiaoyou_log.ldf ')

There may be a warning "warning: the Log for database ' Hunlianjiaoyou ' has been regenerated. The consistency of the transaction has been lost. The RESTORE chain is broken and the server no longer has the context of the previous log files, so you need to know what they are. You should run DBCC CHECKDB to verify physical consistency. The database has been placed in dbo-only mode. When you are ready to make the database available, you need to reset the database options and remove any extra log files. ”

Re-start the database service

Then execute the following script

Script two:

ALTER DATABASE hunlianjiaoyou SET multi_user
ALTER DATABASE hunlianjiaoyou SET ONLINE

and restart the database service

Done!

Ps:

Execute script Two as soon as you try to execute the script in the process.

Throws an exception: unable to open database ' hunlianjiaoyou ' version 611. Please upgrade the database to the latest version.

Later found only need to finish the script one, restart the service, then execute the script two there is no problem, there will be no scripting compatibility issues

--DBCC CHECKDB (HUNLIANJIAOYOU1, Repair_allow_data_loss)

--Database is emergency mode execute the following statement ALTER DATABASE hunlianjiaoyou SET ONLINE, restore normal mode

"Upgrade to SQL 2012" SQL Server MDF up-compatible additional database (unable to open database ' xxxxx ' version 611.) Please upgrade the database to the latest version. )

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.