Can MS SQL transaction log shipping cross-database version?

Source: Internet
Author: User
Tags microsoft sql server microsoft sql server 2005 sql 2008

SQL Server's thing log shipping (log shipping) feature, which I believe many people have used or are applying, is a very powerful feature provided by MS SQL and typically requires a primary database server (Primary/production db Server) and the secondary database server (standby server) to complete this configuration, by default, the version of the primary and secondary databases should be consistent, so what if the two database versions are inconsistent? Can I also do log shipping configuration?

Then the database version inconsistency is divided into two cases:

1: Similar to MS SQL 2005-SP4 with MS SQL 2005 SP3-bit version difference

2: Completely different versions, such as MS SQL Server 2005 and MS SQL Server 2008.

Maybe someone is going to spit the groove, why to make a different version of it, this is not a job to do? This situation is really long story, the problem of history ..... Wait, how do you tell me to throw up the groove? Well, let's not dwell on these trivial things, and now go back to the question above.

As for the first situation, can do log shipping, there is no problem, I did two such cases, are configured successfully, and work well.

Case 1 of the environment:

Database server

Version information

Primary database server

Microsoft SQL Server 2005-9.00.5000.00 (Intel X86) Dec 10:56:29 Copyright (c) 1988-2005 Microsoft Corporatio n Standard Edition on Windows NT 5.2 (Build 3790:service Pack 2)

Secondary database server

Microsoft SQL Server 2005-9.00.5000.00 (X64) Dec 10:38:40 Copyright (c) 1988-2005 Microsoft Corporation Sta Ndard Edition (64-bit) on Windows NT 5.2 (Build 3790:service Pack 2)

Case 2 of the environment:

Database server

Version information

Primary database server

Microsoft SQL Server 2005-9.00.4000.00 (Intel X86) Dec 10:56:29 Copyright (c) 1988-2005 Microsoft Corporatio n Standard Edition on Windows NT 5.2 (Build 3790:service Pack 2)

Secondary database server

Microsoft SQL Server 2005-9.00.5000.00 (X64) Dec 10:38:40 Copyright (c) 1988-2005 Microsoft Corporation Sta Ndard Edition (64-bit) on Windows NT 5.2 (Build 3790:service Pack 2)

In the case of the second version, there are several different situations to be subdivided:

1: The primary database server is SQL Server 2008, the secondary database server is SQL Server 2005, and for this scenario, it is completely unworkable because your backup on SQL Server 2008 cannot be restored on the lower version of SQL Server 2005 (of course The lower version is the same, and so on, and so on, Primary server is SQL-STD and secondary server is SQL R2 STD This is not the case.

2: The primary database server is SQL Server 2005, the secondary database server is SQL Server 2008R2, and in this case, when you select Standby mode for log shipping deployment, you will get an error:

Related error message: System.Data.SqlClient.SqlError:This Backup cannot be restored using with STANDBY because a database upgrade is nee Ded. Reissue the RESTORE without with STANDBY. (MICROSOFT.SQLSERVER.SMO)

So you can only choose no Recovery mode option, as for this is a little chicken. The following explanation is very clear about the reason for the error above (see Resources below):

Each version of SQL Server has a database version number; For SQL 8, SQL 2005:9 and SQL 2008:10. When a database backup this came from a lower SQL Server version is restored, SQL Server would run an upgrade process to BR ing that older database version up to the database version supported by the new instance.  This is the run automatically as part of the SQL Server ' s recovery process. The recovery process itself is certain operations, need to happen to ensure the database was in a consistent state for User access (Roll-forwards and roll-backs etc).

Placing a database in ' Standby/read only ' mode instructs SQL Server to recover the database through each restore, but also C Reate a special standby file that contains information which would allow this recovery to be undone when it's time to do a Dditional transaction logs restores.

However unfortunately, once a database has been upgraded it cannot is undone. The "Standby/read only" option when restoring a database of a older version SQL Server FAI LS with

MSG 3180, Level A, State 1, line 1
This backup cannot was restored using with STANDBY because a database upgrade is needed. Reissue the RESTORE without with STANDBY.
MSG 3013, Level A, State 1, line 1
RESTORE DATABASE is terminating abnormally.

This error message essentially says your cannot bring an older database version online in "Standby/read only" mode.
But the can restore transaction logs and log shipping from the older database version to a newer database version  Keep the database offline. This was because the recovery (and upgrade process) for the database was deferred until the point to do actually bring the  Database online. This means your can log ship from an older version of SQL Server to a newer version until the point you bring that database Online for user access.

Translation is as follows (limited level, for reference only):

Each version of the SQL Server database has a corresponding version number; for example, SQL 2000 is 8,sql 2005 is 9,sql2008:10. When the database recovers a backup from a lower version of SQL Server, SQL Server performs an upgrade process that upgrades the old database version to the version supported by the new instance. This process is part of the automatic operation of SQL Server during the recovery process. The recovery process itself requires certain operations to occur in order to ensure that the database is in a consistent state of rolling forward, rolling back, and so on.

Placing the database in "standby/read-only" mode will not only instruct SQL Server to restore operations after each restore, but also create a special standby file when it does other transaction log recovery, containing information about when the recovery was revoked.

Unfortunately, once the database has been upgraded, it cannot be undone. That's why if you try to use the "standby/Read Only" option, the old version of SQL Server database recovery fails

MSG 3180, Level A, State 1, line 1

This backup cannot was restored using with STANDBY because a database upgrade is needed. Reissue the RESTORE without with STANDBY.
MSG 3013, Level A, State 1, line 1
RESTORE DATABASE is terminating abnormally.

This error message essentially says that you cannot set an old database version to be online in "standby/Read Only" mode.
But you can restore the transaction log and log shipping from an old database version to a new database version when you keep the database offline. This is because the recovery for the database (during the upgrade process) is postponed until the point where you did bring the database online. This means that you can log on to a new version until you have access to an online database from an older version of the SQL Server user.

Resources:

[Http://connect.microsoft.com/SQLServer/feedback/details/362706/restore-of-2005-database-with-standby-doesnt-work]

[http://www.askthedbas.com/ask-the-dbas/2010/08/ Warm-standby-on-sql-server-2008-with-log-shipping-from-sql-server-2005.html]

[Http://community.spiceworks.com/topic/316934-mirroring-and-log-shipping-with-different-sql-versions]

[Http://technet.microsoft.com/zh-cn/library/bb895393 (v=sql.105). aspx]

Can MS SQL transaction log shipping cross-database 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.