SQL Server 2025 新技术系列介绍(第二期)
Clyde Jin
04-23
DBA
92
本系列第一期回顾:SQL Server 2025 通过原生向量数据类型、DiskANN 索引、T-SQL AI 函数和 ONNX 模型本地托管,将 AI 深度集成至数据库内核,实现了从“存储数据”到“理解数据”的范式革命。本期作为系列第二期,我们将目光投向企业级生产环境的另一核心命题——高可用性、混合架构与数据迁移,详细解读 SQL Server 2025 在这些关键领域带来的实质性革新。

一、高可用性与灾难恢复:不止于“可用”,更追求“智慧”

对于承载核心业务的生产系统而言,高可用性(HA)与灾难恢复(DR)是生命线。SQL Server 2025 在这一领域的进化,核心可概括为 “降低复杂度、缩短停机时间、提升自动化水平”

1.1 Always On 可用性组(AG):围绕 DBA 痛点的精准改良

Always On 可用性组是 SQL Server 高可用体系的基石,2025 版本并未对架构进行颠覆,而是精准回应了 DBA 在日常运维中长期积累的痛点。次要副本现支持完整备份和差异备份,而不仅限于仅复制备份(copy_only),这意味着企业可以将备份任务从主副本安全地卸载到辅助副本,从而释放主副本的资源压力,同时仍能维持完整备份链的连续性。

可读辅助副本的生产力也得到实质性提升——查询存储(Query Store)数据现已同步到可读辅助副本,DBA 在任何副本上都能获得统一的性能视图,无需跨节点切换即可完成性能诊断。在配置与管理体验上,更完善的监控工具、更易发现的设置选项以及更友好的用户界面,都降低了 AG 的日常运维门槛。

1.2 包含的可用性组(CAG):元数据自治的高可用单元

如果说传统 AG 简化的是数据库层面的高可用,那么 Contained Availability Group(CAG)则将这一简化扩展到了实例层面。CAG 的设计目标是通过将系统数据库(master、msdb)封装在可用性组内部,实现高可用和灾难恢复的全方位简化。这意味着登录名、作业、凭据以及其他元数据都会在各副本之间自动复制,彻底告别手动同步的运维负担。

从 SQL Server 2025 CU1 开始,CAG 的能力进一步提升:管理员可直接通过 CAG 监听器创建或还原数据库,而无需连接到物理 SQL Server 实例。这一能力通过启用会话上下文键或调用自动化存储过程 sp_sysutility_cag_create_db 即可实现,对限制直接访问 SQL 实例的生产环境尤为实用。

CAG 的核心价值在于:每个 CAG 都拥有独立的 master 和 msdb 副本,使其成为不依赖于物理 SQL 实例的自包含高可用单元。当 AG 发生故障转移时,所有相关元数据都会随之迁移,确保应用无需人工干预即可继续运行;同时,由于操作范围可限定在 AG 上下文内,系统的安全暴露面也得到了有效控制。

1.3 分布式可用性组(DAG)与故障转移优化

SQL Server 2025 对分布式可用性组(DAG)的支持进一步成熟,为跨地域的容灾部署提供了更稳健的基础。在故障转移体验方面,SQL Server 2025 包含了故障恢复过程的性能改进,配合增强的监控能力,显著减少了故障转移期间的停机时间。配合分布式网络名称(DNN)侦听器的使用,故障转移速度进一步提升:由于无需等待网络负载均衡器检测失败事件和变更路由,使用 DNN 时的故障转移时间显著缩短。

1.4 备份与恢复的现代化演进

SQL Server 2025 在备份领域引入了多项重要革新:新增 ZSTD 压缩算法作为备份压缩选项,相比传统压缩算法提供更高的压缩比和更快的压缩速度;S3 兼容对象存储备份全面进入生产可用状态,企业可以直接将数据库备份到 MinIO、Dell ECS、Cloudian 等各类 S3 兼容存储,为备份策略提供了前所未有的灵活性;Azure Blob 不可变存储支持在指定保留期内防止备份被篡改或删除,对金融、医疗等强合规行业至关重要。此外,加速数据库恢复(ADR) 机制在 SQL Server 2025 中得到进一步增强,大幅缩短了崩溃恢复和事务回滚的时间,为高可用性提供了底层支撑。

二、混合架构与云集成:跨越边界的统一数据平台

现代企业的数据基础设施几乎必然跨越本地、云端和边缘。SQL Server 2025 在这一领域的核心命题是:如何让数据在不同环境之间自由流动,同时保持管理的统一性与安全性?

2.1 Fabric 镜像:无 ETL 的准实时数据同步

Fabric 镜像是 SQL Server 2025 在混合架构领域最具突破性的功能。它允许将本地 SQL Server 数据库近乎实时地镜像到 Microsoft Fabric 的 OneLake 中,让运营数据立即可供 Power BI、Synapse 等分析工具消费,彻底绕开了传统 ETL 管道的复杂性

在 SQL Server 2025 中,Fabric 镜像的核心机制从传统的变更数据捕获(CDC)升级为全新的 Change Feed。相比 CDC 需要在源数据库维护变更表、通过两步过程(日志 → 变更表 → OneLake)完成数据同步,Change Feed 直接高频扫描事务日志并将已提交变更发布到 OneLake,消除了中间的写入步骤。

这一架构升级带来了多维度的收益:降低性能开销——没有变更表需要维护,没有 SQL Agent 作业需要管理,对于繁忙的 OLTP 系统是实质性的改善;更强的 DDL 适应性——检测到表结构变更时自动触发完整重新快照并重新播种,实现了自愈能力,避免镜像因一次部署而中断整个周末;更简洁的权限模型——不再要求 sysadmin 角色进行配置,满足了安全敏感型组织的合规要求。

需要注意的是,Fabric 镜像要求 SQL Server 实例启用 Azure Arc,通过本地数据网关配置安全连接。当前版本在架构演进、大表处理和初始化行为方面仍存在一定限制,生产环境部署前需进行充分评估。

2.2 Azure Arc:混合环境的统一管理平面

如果说 Fabric 镜像解决的是数据流动的问题,那么 Azure Arc 解决的则是混合环境的管理难题。通过 Azure Arc,企业可以将本地 SQL Server 实例扩展到 Azure 管理平面,获得统一的治理、监控和安全体验,无论 SQL Server 运行在 Windows、Linux 还是 Kubernetes 集群上。

SQL Server 2025 显著增强了与 Azure Arc 的集成深度:改进的遥测和修补自动化——除免费库存管理外,还提供自动备份和修补功能;Microsoft Entra ID 身份验证——支持集中式身份管理、多因素认证以及托管标识,简化了混合环境的安全访问控制;即用即付(Pay-As-You-Go)计费模型——为需要灵活许可管理的场景提供了经济高效的选项;最佳做法评估——提供针对混合架构定制的改进建议和扩展评估规则,帮助识别配置偏差和安全风险。在安全管理层面,Azure Arc 与 Microsoft Defender for Cloud 的集成提供了基于智能能力的实时威胁检测和响应。

2.3 托管身份与安全连接

安全是混合架构的基础前提。SQL Server 2025 引入了 Microsoft Entra ID 托管身份验证体系,PolyBase 现支持使用托管身份与 Azure Blob Storage 和 Azure Data Lake Storage 安全通信,实现了无密码的云访问。配合整个 SQL Server 生态向 TLS 1.3 和 TDS 8.0 协议的全面迁移(SQL Agent、链接服务器、复制、Always On 可用性组等组件均已默认启用 TLS 1.3),SQL Server 2025 为混合架构构建了覆盖全面、默认安全的通信保护体系。

三、数据仓库与分析:数据虚拟化的全面增强

3.1 PolyBase 革命:无需安装,原生查询

PolyBase 是 SQL Server 数据虚拟化的核心引擎。SQL Server 2025 对 PolyBase 进行了重大重构:现在可以直接通过 OPENROWSET 或 CREATE EXTERNAL TABLE 查询 Parquet、CSV、Delta 文件以及 Azure Blob、ADLS、S3 等对象存储中的数据,而无需额外安装 PolyBase 查询服务。这项简化的体验极大降低了数据湖查询的入门门槛。

3.2 S3 兼容对象存储全面支持

SQL Server 2025 原生支持 S3 兼容对象存储,采用 REST API 连接器框架,兼容所有支持 S3 框架的存储解决方案(MinIO、Dell ECS、Cloudian、PureStorage 等),无论其部署在本地、云中还是混合环境。这一能力同时服务于数据虚拟化查询和数据库备份两大场景,为企业构建统一的存储层提供了新的可能性。

3.3 Linux 平台功能对齐

对于 Linux 用户,SQL Server 2025 在 CU1 中正式支持 Red Hat Enterprise Linux(RHEL)10 和 Ubuntu 24.04 的生产环境部署。PolyBase 在 Linux 上现已支持 ODBC 数据源,实现了与 Windows 平台的功能对齐。但需注意,SUSE Linux Enterprise Server(SLES)自本版本起不再受支持。

四、迁移与升级指南:从评估到投产的完整路径

4.1 告别 DMA:SSMS 22 一体化迁移组件

SQL Server 2025 将升级评估与迁移能力整合进 SSMS 22 的全新 Hybrid & Migration Component,正式取代了已于 2025 年 7 月 16 日停用的 Data Migration Assistant(DMA)。

这一体化工具体现为:升级评估——检测中断性变更、已弃用功能和行为变更,标记 Master Data Services(MDS)和 Data Quality Services(DQS)等已移除组件,并提供默认设置替换和功能替代(如 Fabric 镜像)的修复指导;迁移向导——采用备份-复制-恢复模式迁移数据库,支持传输登录名和并排升级,兼容本地、Azure SQL 和混合部署场景。

4.2 版本兼容性与升级路径

SQL Server 2025 引入新的数据库兼容性级别 170,支持从 100(SQL Server 2008)到 170 的多个级别。就地升级支持从 SQL Server 2014 SP3 及更高版本直接进行,而并排迁移则适用于需要同时变更操作系统或硬件的复杂场景。

在规划升级时,需特别关注已弃用功能清单:机器学习服务器及捆绑的 R/Python/Java 运行时、Distributed Replay、Stretch Database 均已被标记为弃用或移除,SUSE Linux Enterprise Server(SLES)支持也自本版本起终止。

4.3 最佳实践升级流程

综合以上内容,标准升级流程可归纳为五个关键步骤:

步骤 说明
1. 盘点与发现 使用 SSMS 或 Azure Migrate 识别所有 SQL Server 实例及其依赖关系
2. 兼容性评估 运行 SSMS Migration Assessment 识别升级阻塞点和已弃用功能
3. 业务策略决策 根据硬件/操作系统变更需求选择就地升级或并排迁移
4. 目标环境准备 配置 SQL Server 2025 或 Azure SQL 目标,确保适当的性能层级和容量
5. 迁移执行与验证 执行迁移后验证数据库架构、权限和性能,激活 AI 驱动等新功能

需注意,SQL Server 2025 遵循固定生命周期政策,主流支持持续至 2030 年,扩展支持至 2035 年

五、总结与预告

本期作为系列第二期,聚焦了 SQL Server 2025 在企业级生产环境中的三大核心支柱:高可用性与灾难恢复——通过包含的可用性组(CAG)、次要副本备份、ZSTD 压缩等能力,在降低运维复杂度的同时显著缩短停机窗口;混合架构与云集成——Fabric 镜像以 Change Feed 为基石实现准实时数据同步,Azure Arc 提供跨越边界的统一管理平面;数据仓库与分析——PolyBase 简化至无需额外安装,S3 兼容对象存储统一备份与虚拟化场景。

在第三期(也是本系列的收官之作)中,我们将全面展示 SQL Server 2025 在开发者与数据库管理员(DBA)日常工作中的实战应用,涵盖以下主题:

  • 开发者实战:JSON 原生类型、正则表达式(Regex)函数、REST API 集成与 GraphQL 支持、Jaro-Winkler 模糊匹配等新特性的代码级应用
  • DBA 运维实战:AI 驱动的智能查询处理、优化锁定机制、tempdb 资源治理、变更事件流配置与监控
  • 性能调优案例:实际工作负载场景下的性能对比与最佳实践
  • 综合建议:何时升级、何时观望的决策框架,以及从 SQL Server 2022 迁移到 2025 的差异化价值评估

敬请期待!

参考资源


下期预告: SQL Server 2025 新技术系列(第三期,完结篇)——开发者与 DBA 实战指南,从代码到运维的全方位深度解读,敬请关注!

Star
Donate
SQL Server 2025 新技术系列介绍(第一期)
Previous
SQL Server 2025 新技术系列介绍(第三期)
Next

Leave a comment

Registration is not required

Clyde Jin
303 Articles
0 Comments
0 Like
Recent Posts

HiddenMerit Daily · Issue 60

📊 HiddenMerit Daily · Issue 60 Focus on Database Frontiers, Practical Insights for DBAs July 22, 2026 | 5 Selected Global Breaking News 01|Oracle Releases Largest Quarterly Patch in History: 1,449 Patches Fix 1,235 CVEs, 261 Critical On July 21, Oracle released its July 2026 Critical Patch Update (CPU), setting a record for the largest single patch release in the company’s history. This CPU contains 1,449 security patches fixing 1,235 independent CVEs across 32 Oracle product families, of which 261 patches are rated Critical. Patch Distribution by Product Family: Product Family Patches Remotely Exploitable Without Authentication Oracle E‑Business Suite 410 45 Oracle Fusion Middleware 355 219 Oracle Communications 168 122 Oracle MySQL 54 9 Oracle Database Server 15 6 Context for This Patch: Oracle had already issued an urgent “Prepare Now” warning a week earlier, emphasising that AI is fundamentally lowering the barrier to discovering and exploiting vulnerabilities – frontier AI models can analyse software changes, reverse‑engineer security patches, and develop attack paths at unprecedented speed. Oracle has collaborated with state‑of‑the‑art models from Anthropic and OpenAI to proactively identify and fix potential security vulnerabilities. Oracle strongly recommends that customers immediately test and deploy this update in their monthly patch cycles. […]

HiddenMerit Daily · Issue 59

📊 HiddenMerit Daily · Issue 59 Focus on Database Frontiers, Practical Insights for DBAs July 21, 2026 | 5 Selected Global Breaking News 01|Oracle Issues Urgent Warning: July 21 Release Update to Fix Large Number of High‑Risk Vulnerabilities, Immediate Deployment Recommended On July 13, Oracle issued an urgent security warning, strongly recommending that all customers running supported Oracle Database versions (including Oracle Database 19c and Oracle AI Database 26ai) immediately test and deploy the Release Update (RU) after its release on July 21. Background: New frontier AI models are significantly lowering the barrier to discovering and exploiting software vulnerabilities – these models can identify weaknesses, analyse software changes, reverse‑engineer security patches, and develop potential attack paths at unprecedented speed and scale. AI models are also becoming increasingly adept at combining multiple weaknesses across the application and data stack into complex attacks, even when individual weaknesses do not themselves pose a serious risk. As a result, protecting systems solely at the network or application layer is no longer sufficient; enterprises must protect the entire technology stack. Fixes Included in This RU: Oracle has collaborated with state‑of‑the‑art models from Anthropic and OpenAI to proactively identify and fix potential security vulnerabilities. The upcoming […]

HiddenMerit Daily · Issue 58

📊 HiddenMerit Daily · Issue 58 Focus on Database Frontiers, Practical Insights for DBAs July 20, 2026 | 5 Selected Global Breaking News 01|CAICT: Domestic Databases Enter Core System “Deep Water,” AI‑Native Leads New Industry Landscape On July 9, at the 2026 Trustworthy Database Development Conference, CAICT released the “Database Development Research Report (2026).” The report notes that domestic databases have basically completed peripheral system replacement and have officially entered the critical business system breakthrough phase. Key Data: The global database market reached $131.6 billion in 2025 (approximately RMB 894.09 billion). The Chinese database market reached $9.49 billion in 2025 (approximately RMB 64.48 billion), and is expected to reach RMB 97.974 billion by 2028, with a CAGR of 13.06%. The number of domestic database vendors has shrunk from a peak of 167 to 94, with a clear head‑concentration effect and an intensifying “Matthew effect.” AI‑Native Becomes the Main Theme: The report points out that database technology is accelerating its evolution toward the AI‑native direction, and the global database industry is entering a new phase of landscape restructuring. The role of databases is upgrading from “underlying support systems” to “core engines enabling intelligent decision‑making and business innovation.” AI agents are becoming […]

HiddenMerit Daily · Issue 56

📊 HiddenMerit Daily · Issue 56 Focus on Database Frontiers, Practical Insights for DBAs July 6, 2026 | 5 Selected Global Breaking News 01|Kingware Releases Manufacturing Scenario Database Evolution White Paper: SQL Server Replacement Enters “Deep Water” On July 5, CETC Kingware published a technical article titled “Database Evolution in Manufacturing Scenarios: How Kingware Replaces SQL Server,” pointing out that the data surge on industrial shop floors has exceeded the processing capacity of single‑node systems. Traditional database architectures that rely on vertical scaling are facing unprecedented performance challenges. Over the next 1‑3 years, manufacturing enterprises will no longer face only the “choice of replacement,” but must answer the strategic question: “How do we build an autonomous data foundation in the context of de‑IOE?” Three Paradigm Shifts: Hybrid Workloads Become the Norm: The IT architecture of modern factories is shifting from separated OLTP and OLAP to HTAP mode. The same data system must simultaneously handle tens of thousands of device instruction writes per second and minute‑level production report analysis. Distributed Architecture Becomes a Hard Requirement: When a single table exceeds 100 million rows with daily increments exceeding 1 million rows, the index maintenance cost of traditional single‑node databases rises exponentially. Autonomous […]
生成中...
扫描二维码
扫描二维码