I have SQL2014 version database on my Windows12 server. I want to add the databases in SQL2014 to SQL 2022 on my Windows2016 server using the Log Shipping method. Since the versions are different, I think I had to select No Recovery Mode instead of Standby Mode in the "Restore Transaction Log" section. I also selected No recovery mode, but I could not access the database added from SQL 2022 on my Windows 2016 server. How can I access SQL2014 databases from SQL2022 database with Log Shipping?
2 Answers
If you want to ship logs to a higher version and have them readable, you can do this by having multiple instances (or multiple copies of the database), and rotating through them. You simply move the cheese - e.g. always point the next reader (though app config, or DNS, or synonyms, or views, or many other mechanisms) at the "current" copy of the tables.
- Restore with recovery to copy A. Point readers at copy A.
- Restore with recovery to copy B. Point readers at copy B.
- ... keep doing that until you get to as many copies as you need ...
- Kick any straggling users out of copy A. Go to step 1.
I walk through this in much more detail here:
Feels like you'd be better off just upgrading the source, though. Why are you holding onto SQL Server 2014 and Windows Server 2012? Updating the source to match would make this scenario easier. But if you are on Enterprise Edition it would also allow for a much more optimal solution - put both servers in the same cluster, set up an availability group, and use one node as read-only secondary.
If you are log shipping to a newer version of SQL Server there would be no way to read from the databases. The STANDBY option won't work. You would need to restore with RECOVERY to read from them - which will prevent any further log restores.
Usually log shipping is done to a newer version of SQL Server as part of a migration process to minimize downtime. If you are doing it for HA/DR purposes, log shipping to a newer version is not recommended as you wouldn't be able to go back to the old primary (Not without upgrading it to the newer version). If you just want a copy to read from - keeping the versions the same is mandatory.
STANDBY
instead ofNORECOVERY