122

Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

  • Upload
    others

  • View
    19

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server
Page 2: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

Session Objective(s):升級規劃

升級工具與技術

升級移轉到SQL Server 2014

Takeaways:升級計畫與升級方式

認識升級移轉工具

各種架構升級方式

SQL Server 內建各種元件與中繼資料(Metadata)移轉升級與注意事項

Session Objectives And Takeaways

Page 3: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

大綱

SQL Server 2014 新功能簡介紹

升級計畫與升級方式

SQL Server 升級之相容性測試

各種架構升級方式的

SQL Server內建各種元件移轉升級與注意事項

SQL Server中繼資料(Metadata)移轉升級與注意事項

Page 4: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server
Page 5: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

鄧立揚 Eddie Teng技術支援副理Support Engineering Assistant Manager

SQL Server 2005升級研討會

Page 6: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

SQL Server 安裝光碟版本

Page 7: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

超過20 cores需安裝SQL Core-based 版本

Page 8: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

SQL Server 2005

• HA – Database Mirroring

• Partitioning Table

• DDL Trigger

• Database SNAPSHOT

• SNAPSHOT Isolation Level

• Dynamic Management

Views (DMV)

• Native manage XML data

• CLR (Common Language

Runtime)

• Permission granularly

SQL Server 2008/R2

• Filestream data type

• Performance Data

Collector

• Audit Event

• Hot Add CPU/Memory

• TDE protection

(Transparent Database

Encryption)

• Data Compression

• Capture Data Change

(CDC)

• Change Tracking

• Resource Governor

• Policy-base

Management

• Database Backup

Compression

• Central Management

Server

• Master Data Service (R2)

• PowerPivot (R2)

SQL Server 2012

• HA – Alwayson

• Online Reindex

• ColumnStore Indexes

• Sequence object support

• Last version supports

OLE DB

SQL Server 2014

• SSD Buffer Pool

Extension

• In-Memory table

• Alwayson Increases

Readable Secondaries

• Hybrid Alwayson HADR

with Azure

Page 9: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

SQL Sever AlwaysOn 架構

SQL AlwaysOn

Virtual IP/Name

SQL Server 1

(Primary DB)

Windows 2012 R2 Failover Cluster

Database Users

Storage1

SQL Server 2

(Secondary DB)

SQL Server 2

(Primary DB)

Storage2

Page 10: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

傳統Cluster與 AlwaysOn比較

Page 11: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

SQL AlwaysOn 混合雲架構

Page 12: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

資料庫壓縮(Compression)

備份壓縮 (Backup Compression) 資料壓縮 (Data Compression)

Page 13: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

SQL2014/2016 In Memory 新技術

快30倍以上的交易速度 多人共同存取時不再拖慢速度

Page 14: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server
Page 15: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server
Page 16: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

張鑫郡 James Chang技術支援經理Support Engineering Manager

SQL Server 2005升級研討會

Page 17: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

Agenda

SQL Server 版本 EOS 時程

擬定升級策略

客戶案例分享

Page 18: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server
Page 19: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

Product Compatibility Level Release Mainstream Extend Support (EOS)

SQL Server 2000 80 11/30/2000 4/8/2008 4/9/2013

SQL Server 200590 1/14/2006

4/12/2011 4/12/2016

SQL Server 2008 100 11/7/2008 7/8/2014 7/9/2019

SQL Server 2008 R2 100 7/20/2010 7/8/2014 7/9/2019

SQL Server 2012 110 5/20/2012 7/11/2017 7/12/2022

SQL Server 2014 120 6/5/2014 7/9/2019 7/9/2024

樂觀預估專案時程

主機移轉: 200 days

應用程式移轉: 300+ days

Page 20: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server
Page 21: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server
Page 22: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

五階段升級計畫

Page 23: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

五階段升級計畫

升級是多階段,反覆驗證/測試的程序

Page 24: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

五階段升級計畫

升級是專案的程序

Page 25: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

五階段升級計畫

Page 26: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server
Page 27: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

設定專案小組

清查環境所有的SQL Server 2005

確認升級目標

評估升級可能性(第一次)

評估原機升級、換機升級、整併、虛擬化、或是遷移至 Azure SQL Database

評估是否加入HA/DR架構、驗證新功能

已知問題鑑識與整理(From Upgrade Advisor 或企業KM…)

Server Level --版本,語言,是否有安裝 協力廠商的物件

Database Level –單一或多個資料庫

架構性改變--32 bit 到 64 bit,移到容錯叢集

建立升級前的效能基礎線:Performance Monitor, SQL Profiler, Performance analysis of Logs …..

選擇適當的升級方式

確認軟硬體需求

Page 28: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

五階段升級計畫

Page 29: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

測試標的物選定

擬定測試評估計畫

進行測試系統分析,包含測試方法、測試項目及測試環境

Recovery Plan (回復計畫) 擬定

相容性測試與分析

建置測試環境

Page 30: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

五階段升級計畫

Page 31: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

新發現問題分析與整理

新系統之效能測試

評估升級的可能性(第二次)

無法升級系統處置方案擬定

風險評估計畫

新系統軟硬體規格擬定

擬定上線系統的Check list

Page 32: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

五階段升級計畫

Page 33: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

前置作業檢查與準備

新系統建置

新系統上線切換前之功能測試

新系統上線效能監控

定期專案檢討會議

Page 34: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

五階段升級計畫

Page 35: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

新系統健檢專案

新系統功能調整

新系統效能調整

新系統監控方式擬定

Page 36: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

常見升級需求

Reporting Service (SSRS)

Premier Support 提供客戶最專業的升級服務

Page 37: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

Premier Support升級服務項目

服務內容 服務說明

資料庫升級建置環境評估

1. 確認專案工作環境範圍及架構2. 確認參與工作人員以及時程3. 選定專案服務內要升級的系統4. 檢視應用程式的資料流5. 定義稽核管理項目

資料庫升級測試環境建置1. 安裝標準版的SQL Server (Standalone)

2. 資料庫物件建置與移轉驗證3. 資料庫數量兩個,資料庫大小小於 20 GBs

資料庫升級相容性驗證

1. 收集 Trace 檔案建議與設定程序2. 分析 Trace 資料與報告文件說明3. 教育訓練說明如何收集與分析4. 收集設定與分析資料提供一次性執行5. 不包含 T-SQL程序及 DTS Package 改寫

正式環境 HA&DR

Always-ON 規劃與建置

1. 資料同步機制設計2. 建構 Cluster (客戶請先完成 OS的安裝)

3. 安裝 SQL Server

4. 設定SQL Alwayson

5. 資料庫物件建置與移轉流程驗證6. 資料同步機制驗證

1. 資料讀寫分流規劃與設計討論

Page 38: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

服務內容 服務說明

正式資料庫升級與移轉作業1. 資料庫物件檢查2. 正式資料庫資料移轉3. 上線後第半天 On Site Stand By

資料庫最佳化驗證(Health Check)

1. 資料庫設定最佳化檢查與驗證2. 資料庫營運最佳化建議設定3. 安全性設計與設定建議4. 可於上線後3個月執行

資料庫升級前效能分析1. 升級後效能收集2. 升級後調教Top-3 T-SQL Statements

3. Performance Tuning 1 Day WorkShop

建置文件/專案管理 1. 教育訓練2. 文件的撰寫與交付3. 專案管理與進度會議

Premier Support升級服務項目

Page 39: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server
Page 40: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

系統分類統計

44 套系統

部門 等級 系統數 總計

個金處理部

Tier1 2

12Tier2 8

Tier3 2

法金處理部

Tier1 1

12Tier2 9

Tier3 2

信用卡處理部

Tier1 5

12Tier2 5

Tier3 2

資訊規劃部

Tier2 1

5

Tier3 4

資訊營運部 Tier3 3 3

Page 41: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

目前該行還有許多系統使用 SQL 2005 或之前版本。

大多數的作業系統仍在 Windows Server 2003 (已於2015/7/14 終止產品技術服務 “EOS: End of Support”)

單一系統即採購對應資料庫的軟硬體設備,造成資料庫伺服器過多,增加管理與維護的複雜度。

多數系統資料庫缺乏備援與監控機制,當系統發生問題時,將造成業務系統服務中斷。

盤查之後, 將有5套系統因下列因素不進行此次的升級:

• 應用程式廠商不存在, PACKAGE無法升級• 已規劃納入其他新系統• 此系統之部門暫無編列升級預算

Page 42: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

業務系統擴充性(業務成長?)

臨時性業務促銷活動(硬體承載?)

伺服器硬體屆齡與維修(轉VM?)

微軟技術支援週期到期(問題支援與安全疑慮?)

人員技術交接與傳承(新知學習?)

Page 43: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

落實法

規檢核

強化

資安

增加系

統穩定

提高系

統效能

Page 44: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

Windows Active

Directory

DC

1DC

2SQL Server 2014

AlwaysOn

同步模式

非同步模式

Primary Secondary

SQL Server

2000

SQL Server

2008R2

DB Staging Server

& SSIS Server

Migration To

SQL Server

2014

Migration

Application

Server

資料庫目前架構

資料庫移轉後架構

資料庫移轉中繼環境Secondary

(ReadOnly)

Application

Server

(ReadOnly)

Page 45: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

Windows Active

Directory

DC

1DC

2

SQL Server 2014

AlwaysOn

SQL Server

2000 Cluster

SQL Server

2008R2

Migration To

SQL Server

2014

Migration

Application

Server

資料庫目前架構

資料庫移轉後架構

資料庫移轉中繼環境

VM2

VM1

VM2

VM1

VM2

VM1

Site 2

Site 1

AG

1

同步模式

AG

2 非同

步模

非同

步模

同步模式

Page 46: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server
Page 47: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server
Page 48: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

陳建廷 Brad Chen技術支援副理Support Engineering Assistant Manager

SQL Server 2005升級研討會

Page 49: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 可分析SQL 2005/2008/2008R2的Instance上的SQL Server元件• Database Engine (資料庫相容性層級不可以低於90)

• Analysis Services

• Reporting Services

• Integration Services

• 可分析SQL Profiler trace檔或SQL檔。

• 支援遠端分析但若要分析Reporting service則必須安裝在SQL 2005 Report Server主機上。

SQL Server 2014 Upgrade Advisor – 介紹

Page 50: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 下載安裝• SQL安裝程式的安裝中心 或 微軟官方下載網站SQL 2014 Feature Pack下載

(SQLUA.msi 檔)

SQL Server 2014 Upgrade Advisor – 下載

Page 51: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 系統需求: Win 2008 SP2, Win 7 SP1, and Win 2008 R2 SP1

• 軟體需求:

• Windows Installer 4.5• http://go.microsoft.com/fwlink/?LinkId=49112

• .NET Framework 4

SQL 2014安裝光碟\redist\DotNetFrameworks\dotNetFx40_Full_x86_x64.exe

or

http://go.microsoft.com/fwlink/?LinkId=48882

SQL Server 2014 Upgrade Advisor – 安裝

Page 52: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 遠端分析-主機需先安裝以下軟體需求• .NET Framework 4

SQL 2014安裝光碟\redist\DotNetFrameworks\dotNetFx40_Full_x86_x64.exe

• SQL Server 2014 Transaction-SQL ScriptDom

從微軟官方下載網站SQL Server 2014 Feature Pack下載

SQL Server 2014 Upgrade Advisor – 安裝問題

Page 53: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• Upgrade Advisor 分析精靈

• Upgrade Advisor 報表檢視器

SQL Server 2014 Upgrade Advisor-使用

Page 54: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

1. 檢閱 安裝 SQL Server 2014 的硬體和軟體需求。

2. 備份資料和系統設定。

3. 執行 Upgrade Advisor。(PS.Upgrade Advisor 不會修改資料或變更電腦的設定)

4. 檢閱 Upgrade Advisor 報表中識別的問題。

5. 解決讓您無法升級至 SQL Server 2014 的任何封鎖問題。

6. 解決任何其他升級前問題。

7. 執行 Upgrade Advisor 來確認所有已知問題都已經解決。

8. 執行 SQL Server 2014 安裝程式。

9. 解決任何升級後和移轉問題。

升級程序

Page 55: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 輸入伺服器名稱,按下[偵測]

• 然後,勾選要分析的元件。

目標SQL Server元件偵測

Page 56: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 偵測目標的SQL元件,使用Windows驗證,必須有目標主機的本機管理員權限。

目標SQL Server元件偵測-issue

Page 57: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 勾選需要分析的SQL Server元件

• 選擇驗證方式

選擇需要分析的SQL Server元件

Page 58: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

The interesting events to collect are

• SQL:StmtStarting

• SQL:BatchCompleted

• SQL:BatchStarting

• SP:Starting

• RPC:Starting

• RPC:Completed

• SP:StmtStarting

The only columns which are relevant to UA are

• DatabaseName

• SPID

• TextData

選擇資料庫與SQL Profiler trace與SQL檔

Page 59: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 必須在Report Server上執行Upgrade Advisor

選擇Reporting Service instance

Page 60: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

選擇Analysis Service instance

Page 61: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 選擇儲存在msdb裡面的封裝或是檔案路徑的封裝,一次只能分析一個位置

選擇SSIS封裝位置

Page 62: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

確認Upgrade Advisor設定

Page 63: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• Upgrade Advisor 分析精靈會在 My Documents\SQL Server Upgrade Advisor\110\Reports 目錄中建立報表並針對您所分析的每個伺服器建立子目錄。

• 這些報表檔案是遵循特定命名慣例的 XML 檔案。當您啟動 Upgrade Advisor 報表檢視器時,就會顯示預設目錄中的報表檔案。如果您將報表檔案複製到這個資料夾中,它們必須遵守命名慣例,否則報表檢視器將不會自動顯示它們。

Upgrade Advisor報表檔案

Page 64: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

Upgrade Advisor報表-Integration Service

Page 65: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• Database Engine Upgrade Issues

• https://msdn.microsoft.com/en-us/library/ee240650(v=sql.120).aspx

Upgrade Advisor報表-SQL Server

Page 66: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 在報表檢視器中,顯示您想要匯出的報表。

• 若要篩選報表,請從 [篩選依據] 方塊中選取值。

• 按一下 [匯出報表]。

• 在 [匯出報表檔案] 對話方塊中,輸入檔案名稱、選擇目的地,然後按一下 [確定]。此檔案會以CSV (逗號分隔值) 格式儲存。

如何:匯出報表

Page 67: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

解決升級問題https://msdn.microsoft.com/zh-tw/library/ee210473(v=sql.120).aspx

• 最新升級問題

• Database Engine 升級問題

• 全文檢索搜尋升級問題

• 複寫升級問題

• Reporting Services 升級問題 (Upgrade Advisor)

• SQL Server Agent 升級問題

解決升級問題

Page 68: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

舊版 SQL Server 中有少數組態或設定會使您無法升級至 SQL Server 2014。如果安裝程式在您安裝 SQL Server 2014 時偵測到這些問題,它會停止升級程序並要求您執行 Upgrade Advisor 並修正任何封鎖的問題。

• 卸離資料庫識別碼 32767

• 重新命名符合固定伺服器角色名稱的登入

• 重新命名使用者 sys

• 使用 sp_rename 重新命名重複的索引名稱

妨礙升級的問題

Page 69: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 執行 Upgrade Advisor (命令提示字元)

https://msdn.microsoft.com/zh-TW/library/ee240643(v=sql.120).aspx

• 您可以使用 UpgradeAdvisorWizardCmd 公用程式,從命令提示字元執行 Upgrade Advisor。您可以選擇以 XML 格式或含有逗號分隔值的檔案來接收結果。

執行 Upgrade Advisor (命令提示字元)

Page 70: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server
Page 71: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server
Page 72: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• Upgrating Both Windows and SQL Server

• Upgrating Multiple Instance

• Upgrating Very Large Databases

• Upgrating High Availability Servers

評估現有環境與架構

Page 73: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 目前不是Windows 2008 R2 SP1,建議side by side移轉到另一台主機。

• 目前是Windows 2008 R2 SP1,若要就地升級(in-place upgrade),則SQL 2005必須是SP4。

Upgrating Both Windows and SQL Server

Page 74: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• multiple instances of SQL Server 2005/2008/2008 R2/2012 on a standalone or clustered server

• 所有Instance一次升級或是分次升級。

Upgrating Multiple Instance

Page 75: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 資料庫檔案搬移時間

• 就地升級(in-place upgrade)減少搬移時間

• 使用同樣大小的資料庫,進行移轉測試

• 利用HA技術 (Log shipping)

Upgrating Very Large Databases

Page 76: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• Consolidation整併• 減少伺服器硬體數量

• 類型

單一實體主機,單一執行個體,多個資料庫

單一實體主機,多個執行個體

單一實體主機,多個虛擬主機

• SQL Server Consolidation Guidancehttps://technet.microsoft.com/en-us/library/ee819082(v=sql.100).aspx

• High Availability高可用性• AlwaysOn Availability Groups

• Failover Cluster

• SQL Server Replication

• Log Shipping

評估未來架構 Decision Tree

Page 77: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

SQL Cluster, DB Mirror與AlwaysOn比較

Shared Disk Array

Windows 2008 R2 Failover Cluster

SQL Server

(Active Node)

SQL Virtual

Name

SQL Cluster SQL AlwaysOn

SQL1 SQL2

MyDB1

MyDB2

MyDB1

MyDB2

Database Mirroring

Page 78: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server
Page 79: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• Windows EOS• Windows 2003 EOS

• Windows 2008 SP2,將來SQL 2014 lifecycle支援期間,Windows 2008也會EOS

• 原來的硬體可能不符合需求

• 建議使用新主機,搭配Windows 2012 R2,採用side-by-side並行移轉。

• Fallback Plan。

升級SQL容錯移轉叢集Failover cluster instance

Page 80: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

Upgrading Failover Cluster Instance

PassiveActive

2-node cluster

Windows 2008 with Service Pack 2 or Windows 2008 R2 SP1

SQL Server 2005 SP4

Page 81: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

原機升級 Upgrading Failover Cluster Instance –Prerequisites

PassiveActive

Step 1:

a) Install prerequisites and upgrade

shared features

b) Reboot, if prompted

Step 3:

a) Install prerequisites and

upgrade shared features

b) Reboot, if prompted

SQL Instance Manual Failover

Step 2:

a) Fail over to the upgrade node

Page 82: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

原機升級 failover Clustering Upgrade – Finishing

ActivePassive

Step 6:

Upgrade to SQL Server

2014 on active node

Step 4:

Upgrade to SQL Server

2014 on passive node

Step 5: Setup performs

the failover

downtime = failover time +

database upgrade script

execution time

SQL Server 2014SQL Server 2014

Active

4

Removed from

Cluster Group

Possible

Owners

Page 83: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

原機升級 Database Mirroring• Rolling upgrades supported 輪流升級

• Mirror version must be equal or higher than Principal

• At least one manual failover required

• 暫時先Remove witness

1. Upgrade Mirror First

2. Wait for Low Activity Window

3. ALTER Mode to SYNCHRONOUS

4. Failover to Mirror: (New

Principal)

5. ALTER Mode to ASYNCHRONOU

S

6. UPGRADE New Mirror Instance

Asynchronous Mirroring: Steps 1, 6

Synchronous Mirroring: Steps 1, 4, 6

Page 84: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

原機升級 Cluster Upgrade with Mirroring

PassiveActive

Mirroring Server

Step 1: Upgrade

mirrored instanceStep 2: Manual Failover each

database to mirroring partner

Mirroring

suspended

SQL Server 2014

SQL Server ClusterPrincipal Server

Mirroring

resumed

Step 3:

Step 4: Manually failover to the

database mirroring partner for each

database

SQL Server 2014

Page 85: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

Upgrading Log Shipping

• Role change (容錯移轉)• Downtime is shortened. (減少Downtime)

• Not generally recommended as more complex. (程序較複雜)

• No role change (不進行容錯移轉)• Easier

• High-level steps移轉步驟• Upgrade the instance hosting the secondary database (升級次要伺服器)

• Manually restore all transaction logs created while upgrading from primary to secondary

(正常來說,次要伺服器升級完成後,copy and restore job會繼續上次未處理的log backup)

• Make final transaction log backup on primary, and then restore

• Upgrade instance containing the primarydatabase (升級主要伺服器)

Page 86: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

原機升級-Upgrading Replication

• An in-place upgrade is preferred

• Typical upgrade flow: Distributor, Publisher, Subscriber

• Mixed versions are supported, but:

• 散發者(Distributor)必須等於或高於發行者(Publisher)

• 訂閱者(Subscribers) for transactional replication可高於或低於發行者

• 訂閱者(Subscribers) for merge replication 不可低於發行者

Page 87: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 發行資料庫(Published DB)與訂閱資料庫(Subscription DB)

• 還原資料庫到另一台SQL Server,不保留複寫設定

• 重新設定複寫• 啟用散發或指定散發者>新增發行集>新增訂閱

並行移轉-Replication Database

Page 88: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

Troubleshooting Tips

• Log files are created at • %ProgramFiles%\Microsoft SQL Server\120\Setup Bootstrap\Log

Note: For SQL Server 2008, use 100 instead of 110

• First, look at Summary.txt

• Next, look at detail.txt log and search for “Error:”

• If Setup does not seem to launch at all, view sqlsetup.log at %temp%

• MSI log files, search for “Value 3”

Page 89: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server
Page 90: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• Backup and Restore

• Detach and Attach

Database Engine-移轉使用者資料庫

Page 91: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

Analysis Service – upgrading SSAS

Upgrading from 2005 to 2014

•就地升級(in-place) or 並行移轉(side-by-side)兩種

方法都可以。

Page 92: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 只支援Migration from SQL 2000 Analysis service DB

• SQL 2012已停止的功能

並行移轉-Analysis Service Migration Wizard

Page 93: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• Interactively using SSMS卸離與附加/備份與還原

• Programmatically using AMO (C#)Move an Analysis Services Database

https://msdn.microsoft.com/en-us/library/cc280670(v=sql.120).aspx

• By script using XMLAMove an Analysis Services Database

https://msdn.microsoft.com/en-us/library/cc280670(v=sql.120).aspx

並行移轉-Analysis Services Database

Page 94: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• Set the Compatibility Level of a Multidimensional Database (Analysis Services)

• https://msdn.microsoft.com/en-us/library/gg471593(v=sql.120).aspx

Analysis Service Databases Compatibility Level

Setting Description

1050

This value is not visible in script or tools, but it corresponds

to databases created in SQL Server 2005, SQL Server 2008,

or SQL Server 2008 R2. Any database that does not have

CompatibilityLevel explicitly set is implicitly running at the

1050 level.

1100

This is the default value for new databases that you create in

SQL Server 2012 or SQL Server 2014. choose alternative

string storage for partitions and dimensions.

Page 95: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 就地升級(in-place upgrade)• 但不支援upgrade a Native Mode report server to a SharePoint mode

• 若要搬移Report items,可參考以下文件Sample Reporting Services rs.exe Script to Migrate Content between Report Servers

https://msdn.microsoft.com/en-us/library/dn531017(v=sql.120).aspx

• Pre-Upgrade Back up your symmetric key.

Back up your report server databases and configuration files.

Back up any customizations to existing Reporting Services virtual directories in IIS.

• 移轉(Migrate)• 以下文件有完整步驟(包含ReportServer資料庫的搬移)

Migrate a Reporting Services Installation (Native Mode)

https://msdn.microsoft.com/en-us/library/ms143724(v=sql.120).aspx

Reporting Services

Page 96: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 就地升級(in-place upgrade)同時升級 Integration Services 和 Database Engine

若只升級 Integration Services,則無法將封裝儲存在SQL 2005 Database Engine。

不會移除 SQL Server 2005 Integration Services (SSIS) 或 SQL Server 2008 Integration Services (SSIS) 服務。

不會將現有的 SSIS封裝移轉至 SQL 2014 所使用的新封裝格式。

舊版與新版dtexec程式同時存在。

SQL Server 系統管理員必須執行 DCOM 組態工具 (Dcomcnfg.exe),授與特定使用者 Integration Services 服務的存取權限。

Integration Services-升級SSIS服務

Page 97: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 檢查msdb.dbo.sysssispackages的packageformat 資料行中的值,以識別封裝版本格式。

• 將專案轉換為專案部署模型時升級封裝• 將專案部署至 Integration Services 伺服器

• https://msdn.microsoft.com/zh-TW/library/hh231102(v=sql.120).aspx

• 使用SSMS,匯入SSIS封裝

• 使用SSDT,升級所有封裝或加入現有的SSIS封裝

Integration Services-升級SSIS封裝

SQL Version Packageformat

SQL 2005 2

SQL 2008 3

Page 98: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 使用SSMS,匯入SSIS封裝

• 使用SSDT,加入現有的SSIS封裝

• SSIS Package Upgrade Wizard• run the SSISUpgrade.exe file from the C:\Program Files\Microsoft SQL

Server\120\DTS\Binn folder.

Integration Services-並行移轉

Page 99: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

SSIS Package Upgrade Wizard

Page 100: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server
Page 101: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server
Page 102: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 伺服器組態設定1. 預設停用的功能

Ad hoc distributed Queries

Database Mail XPs

xp_cmdshel

2. 檢查與比對新舊SQL Sever組態設定

• Protocols for MSSQLSERVER以下通訊協助預設停用

Named pipes

伺服器組態設定與 SQL Server通訊協定

Page 103: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 預設DB_CHAINING與TRUSTWORTHY資料庫選項停用

• DB_CHAINING• 伺服器層級

• 安全性因素不建議啟用

• 資料庫層級• 查詢目前使用者資料庫的設定

• 建議針對需要的使用者資料庫才啟用

• 卸離與附加資料庫,會將此設定改為OFF停用

• 例如: Lync Server的資料庫( rtc, rtcdyn…等)

• TRUSTWORTHY• 資料庫層級

跨資料庫查詢 (Cross-Database Queries)

Page 104: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 正常的狀況下,執行Restore的身分帳戶會成為新的資料庫的擁有者(Database Owner)

資料庫擁有權 (Database Ownership)

Page 105: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 加密金鑰的搬移• copy of master key

• re-create the service master key encryption

• 參考文件• Encryption Hierarchy

• https://msdn.microsoft.com/en-us/library/ms189586(v=sql.120).aspx

• Set Up an Encrypted Mirror Database• https://msdn.microsoft.com/en-us/library/ms188292(v=sql.120).aspx

• Create Identical Symmetric Keys on Two Servers• https://msdn.microsoft.com/en-us/library/ms366281(v=sql.120).aspx

• OPEN MASTER KEY (Transact-SQL) and ALTER MASTER KEY (Transact-SQL).

加密的資料 (Encrypted Data)

Page 106: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 擴充預存程序• 未來版本將不支援擴充預存程序,建議改用SQL CLR

• 查詢方法

• SQL CLR• 查詢方法

擴充預存程序Extended Stored Procedures與SQL CLR

exec sp_MSforeachdb

' use [?]

if (select count(*) from

sys.assembly_files )>1

begin

print ":CRL= " +DB_NAME()

end'

Page 107: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 查詢

• 移轉• Script Logins (新的SID)

• EXEC sp_help_revlogin (使用原始SID)• How to transfer logins and passwords between instances of SQL Server

• https://support.microsoft.com/en-us/kb/918992

• 執行 EXEC sp_help_revlogin;產生CREATE LOGINS的SQL語法

Transfer SQL Server Logins 登入帳戶

Page 108: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 查詢認證

• SELECT * FROM master.sys.credentials;

• 產生SQL Script

• SELECT 'CREATE CREDENTIAL ' + NAME + ' WITH IDENTITY = ''' + credential_identity + ''', SECRET = ''<your Password>'';‘ FROM sys.credentials;

Transfer Credentials 認證

Page 109: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 查詢• SELECT * FROM msdb.dbo.sysjobs;

• SELECT * FROM msdb.dbo.sysproxies;

• SELECT * FROM msdb.dbo.sysalerts;

• SELECT * FROM msdb.dbo.sysoperators;

• 產生SQL Script• 直接在物件上案右鍵,選擇編寫作業的指令碼

• 注意: 可能因為特殊的字元會造成script在新主機create失敗

Transfer Jobs/Alerts/Operators/Proxies

Page 110: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 適用使用物件管理詳細資料視窗,一次選取大量物件,然後產生script

如何大量選取Jobs/Alerts/Operators/Proxies並產生SQL Script

Page 111: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 查詢• Get List of Linked Servers and associated logins

• https://gallery.technet.microsoft.com/scriptcenter/Get-List-of-Linked-Server-d6c95d9c

Transfer Linked Servers 連結的伺服器

Page 112: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 產生SQL Script• Script Linked server並重新輸入密碼

• 其他注意事項• 安裝Third-party Provider (例如Oracle

Provider)• EXEC master.dbo.xp_enum_oledb_providers;

• SQL 2014 not support Linked server to SQL 2000 workaround• 安裝並使用SQL Server Native Client 10.0

• 或使用ODBC DSN

Transfer Linked Servers 連結的伺服器

Page 113: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• Full-Text Engine • Properties are set on the Full-Text Engine by sp_fulltext_service.

• 透過FULLTEXTSERVICEPROPERTY查詢

• Database• 查詢

• 移轉• 使用Backup and Restore或Detach and Attach

• 移轉與升級考量與步驟Upgrade Full-Text Search

• https://msdn.microsoft.com/en-us/library/ms142490(v=sql.120).aspx

Full-Text Engine for SQL Server Properties

Page 114: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• Stored procedures marked for automatic execution are executed every time SQL Server starts

• Automatic Execution of Stored Procedures

• https://technet.microsoft.com/en-us/library/ms191129(v=sql.105).aspx

Startup Procedures 啟動程序

Page 115: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• Server-scoped DDL triggers

• Database-scoped DDL triggers• 每個資料庫裡面的sys.triggers檢視

• 例如 查詢定義在Database上的DDL Trigger

Triggers觸發程序(at Server Level伺服器層級)

Page 116: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 使用Database Mail script template• 檢視>範本瀏覽器>Database Mail>開啟Simple Database Mail Configuration

Database Mail

Page 117: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• 查詢

• 檢視相容性差異ALTER DATABASE Compatibility Level (Transact-SQL)

https://msdn.microsoft.com/en-us/library/bb510680.aspx

• 變更相容性層級

資料庫相容性層級

Value Description

120 SQL Server 2014

110 SQL Server 2012

100 SQL Server 2008 and SQL Server 2008 R2

90 SQL Server 2005

80 SQL Server 2000

Page 118: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• After upgrading to SQL Server 2014, always run sp_updatestats in the upgraded databases to ensure optimal use of improved statistics features in SQL Server 2014.

• USE master

• GO

• EXEC sp_MSforeachdb @command1="print '?' EXEC [?].dbo.sp_updatestats"

• GO

更新統計資訊

Page 119: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

報告和更正目錄檢視中不準確的頁面和資料列計數。

最佳作法• 請勿例行性地執行 DBCC UPDATEUSAGE。 DBCC

UPDATEUSAGE 可能需要一些時間才能在大型資料表或資料庫上執行,因此,除非您懷疑 sp_spaceused 所傳回的值不正確,否則不應僅使用它。

• 只有在資料庫進行頻繁的資料定義語言 (DDL) 修改 (如CREATE、ALTER 或 DROP 陳述式) 時,才考慮例行地執行DBCC UPDATEUSAGE (例如,每週)。

DBCC UPDATEUSAGE

Page 120: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

• SQL Server 2014 Upgrade Technical Guide http://download.microsoft.com/download/7/1/5/715BDFA7-51B6-4D7B-AF17-61E78C7E538F/SQL_Server_2014_Upgrade_technical_guide.pdf

• 使用 Upgrade Advisor 來準備升級https://msdn.microsoft.com/zh-tw/library/ms144256(v=sql.120).aspx

• Manage Metadata When Making a Database Available on Another Server Instance (SQL Server)

https://msdn.microsoft.com/en-us/library/ms187580(v=sql.120).aspx

參考文件

Page 121: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server

關聯式儲存體選項 優點 其他考量因素

公司內部部署 SQL Server

此選項適用於任何種類 (從交易系統到資料倉儲) 的應用程式。

• 因為軟硬體皆由您所管理,所以您幾乎能自由操控各項功能與規模調整功能。

• 若要從 SQL Server 2005 升級,這是最相似的環境。

因為您必須購買、維護及管理您所擁有的硬體與軟體,所以此選項的初期投資最高,管理時間也最長。

裝載於 Azure 虛擬機器上的 SQL

Server

您若希望享有下列便利,可考慮此選項。• 移轉到託管環境的優點。• 控制作業環境。• 使用熟悉 SQL Server 功能集。

• 您可以快速從虛擬機器的映像庫快速進行部署。

• 您可以使用完整的 SQL Server

功能集。• 您可以節省在伺服器軟硬體上

的投資。 您只需按每小時的使用量付費。

• 您必須設定及管理 SQL Server

與作業系統軟體。

裝載 Azure SQL Database 的資料庫服務若您需要價格較低、維護工作較少的解決方案,可以考慮此選項。此選項特別適合不需要時時保有相同容量的應用程式,或需要提供外部存取的應用程式。

• 無須維護硬體• 無須維護作業系統• 您可以快速部署及相應增加。• 您只需按每小時的使用量付費。• 服務的費用不只有儲存體而已,

還包括高可用性及自動化備份。

• Azure SQL Database 所缺少的一些 SQL Server 功能並不適用於託管的雲端環境。 如需詳細資訊,請參閱 Azure SQL

Database Transact-SQL 資訊。• 相較於 SQL Server 的 524 PB,

Azure SQL Database 的資料庫大小上限為 1 TB。

Page 122: Session Objective(s)download.microsoft.com/download/5/9/E/59E3DFD2-ABD0-49B4... · 2018-10-13 · Session Objective(s): 升級規劃 升級工具與技術 升級移轉到SQL Server