SQL Server 2005 Database Engine Service Broker HTTP



SQL Server 2005 管理強化功能 Database Engine Service Broker HTTP Access Database Tuning Advisor Indexes with Included Columns Multiple Active Result Sets Try/Catch in T-SQL statements Common Table Expressions Snapshot Isolation Level Partitioning Synonyms Dynamic Management Views Database Failure and Redundancy Fail-over Clustering (up to 8 node) Database Mirroring Database Snapshots Enhanced Multi-instance Support Replication Seamless DDL replication Merge Web Sync Oracle Publication Peer to Peer Transactional replication Database Maintenance Backup and Restore Enhancements Checksum Integrity Checks Dedicated Administrator Connection Dynamic Configuration AWE Highly-available Upgrade Online Index Operations Online Restore Management Tools MDX & XML/A Query Editor Maintenance Plan Designer Source Control Support Profiler access to non-sa SQLCMD Command Line Tool Database Mail Performance Tuning Profiling Analysis Services Exportable Showplan & Deadlocks Profiler Enhancements New Trace Events

SQL Server 2005系統架構 Machine Instance (SQL Server) Transaction Files Database Schema Object Extent Page File Group Data Files

SQL Server 2005資料庫種類 系統資料庫 Master Model Tempdb msdb POS Others SALES 使用者資料庫 Distribution

全新的管理介面 SQL Server Management Studio 單一窗口整合所有系統 SQL Server / Analysis Service / SSIS / SSRS/ SQL Mobile/Notification Services T-SQL / MDX / DMX / XMLA Query Template Explorer快速導引出任何作業指令 Solution Explorer 檢視與儲存全部作業項目 連線、語法 *. ssmssln / *. ssmssqlproj / *. sql 整合早期資料庫的版本 SQL 2000管理作業 支援註冊檔輸出欲輸入功能



服務啟動帳戶須知 本機系統帳戶(local system account) 本機使用者帳戶(local user account) 網域使用者帳戶(Domain user account) 本機服務帳戶(local service account) 網路服務帳戶(Network Service account)



組態管理 具 Configuration Manager 系統管理介面 SQL Server services Server network configuration Client network configuration



管理者專屬連線使用範例 當伺服器連線出現以下錯誤或畫面 HResult 0 x 4 D 4, Level 16, State 1 Shared Memory Provider: Connection was terminated [1236]. Sqlcmd: Error: Microsoft SQL Native Client : Communication link failure. 啟動DAC連線方法 透過 SQLCMD. EXE 透過 SQLWB. EXE

管理者專屬連線使用範例 透過 SQLCMD. EXE command-line 具 C: >SQLCMD -A -S伺服器 C: >SQLCMD -E -Sadmin: 伺服器 透過 SQLWB. EXE SQL Server Management Studio C: >SQLWB -S admin: 伺服器 -E


快照隔離與其他交易比較 隔離等級 Dirty 讀取 非可重覆 讀取 幻像 讀取 同質性 控制 Read uncommitted Yes Yes 悲觀處理 Read committed (locking) No Yes 悲觀處理 Read committed (snapshot) No Yes 樂觀處理 Repeatable read No No Yes 悲觀處理 Snapshot No No No 樂觀處理 Serializable No No No 悲觀處理





資料分割示意圖 每一筆資料是基本分割單位 Database Table Partition Row Partition Scheme Key Partition Function Filegroup 1 Filegroup 2 Filegroup 3

資料分割技術 Partition function 作為資料分割的依據,例如時間、號碼… Partition schema 將不同的Partition放置於不同的檔案群組 2002 -01 -01 Partition # 1 2001 & 早期 2003 -01 -01 2004 -01 -01 2005 -01 -01 2 2002 年度 3 4 5 2003年度 2004年度 2005 & 後續 Partition Schema Filegroup fg_Min Filegroup fg_2002 Filegroup fg_2003 Filegroup fg_2004 Filegroup fg_2005


資料分割實際範例-分割函數,根據年度分成七組 使用透過 $partition. 函數(欄位) CREATE PARTITION FUNCTION annual_range (DATETIME) as RANGE RIGHT –指明邊界值屬於右邊 for values ( -- Partition 1 -- 1999 and earlier '2000 -01 -01', -- Partition 2 -- 2000 '2001 -01 -01', -- Partition 3 -- 2001 '2002 -01 -01', -- Partition 4 -- 2002 '2003 -01 -01', -- Partition 5 -- 2003 '2004 -01 -01', -- Partition 6 -- 2004 '2005 -01 -01' -- Partition 7 -- 2005 );









物件執行權限強化 SQL 2000 檢查執行權限 User 3 檢查查詢權限 User 3 User 2. Proc 1 User 1. T 1 User 1. Proc 1 User 1. T 1 檢查執行權限 User 3 不檢查權限 User 3 SQL 2005 ‘Execute AS X ’ User 3 User 2. Proc 1 檢查執行權限 User 3 User 1. T 1 檢查查詢權限 ‘X’. 不是檢查 User 3




憑證管理 建立憑證 CREATE CERTIFICATE cert. Key. Ex --建立的憑證名稱 ENCRYPTION BY PASSWORD = 'P@ssw 0 rd' --憑證加密的密碼 WITH SUBJECT = 'Credit Card Certificate', --憑證主旨 START_DATE ='2006/01/01', --憑證生效的日期 EXPIRY_DATE = '2006/12/31'; --憑證到期的日期 備份憑證 BACKUP CERTIFICATE cert. Key 77 TO FILE='C: cert. Key 77. cer'







線上還原機制示意圖 Log Backups Database Primary Backup 一直可以存取 Primary Filegroup A Backup Filegroup A 檔案群組 Filegroup B Backup Filegroup B 檔案群組 Filegroup C 檔案群組 還原 還原資料庫 交易記錄檔 檔案群組 C 備份 分頁錯誤 Filegroup C Backup

線上還原實際範例 資料庫有三個檔案群組 Primary Sales. Person Sales. Territory Filegroup A Sales. Order. Header Sales. Order. Detail Filegroup B Transaction. History. Archive 讀取群組B 發生分頁錯誤





資料庫鏡像同步示意圖 1 Commit 5 Acknowledge 4 Acknowledge 2 Transmit to Mirror 2 Write to 3 Local Log DB Secondary Database Server Committed in Log 3 Write to Remote Log DB








整合Integration Services的運作方式 Alerts & escalation CRM semi-structured data Text mining components Data mining components Custom source Merges Standard sources Data cleansing components Mobile data Warehouse Legacy data: binary files Application database SQL Server Integration Services Reports • 使用Integration Services可以在作業過程將需要資料庫處理的部分,直接處理完畢 • 所有的作業包括文字採礦、彙總、合併、資料比對等都可以整合在同一個服務中 • 分離增加資料庫與ETL 具的作業範圍,強化資料庫的高可用度 • 直接透過Integration Services進行問題的警示與回報


展示SQL Server Business Intelligence Development Studio 開發第一個Integration Services 封裝

開發佈署流程 開發作業 環境SQL Server Business Intelligence Development Studio 功能 Design、Debug、Deploy • Design Package • Add Configurations Bi Studio • Add Miscellaneous files • Set Project Deployment properties • Build • Copy/Move Deployment folderfiles User 佈署作業 Create. Deployment. Utility=True 複製或移動到所要的目的區 執行安裝精靈 其他方式 在Mgt. Studio中進行載入 • Choose Destination (SQL / File System) • Modify protection level • Choose location of supporting files • Change configurations Installation Wizard / SSIS • Execute 執行作業 直接在開發環境進行執行 在Mgt. Studio管理介面 使用Utility DTEXEC、DTEXECUI 設定排程 透過SQL Server Agent 設定 • Execute SSIS packages User • Create desired agent jobs SQL Agent

開發佈署 具 安裝精靈 程式:dts. Install. exe 檔案:Manifest 佈屬作業 Business Intelligence Deployment Development Studio SSIS Import & Export Wizard 檔案封裝 封裝管理作業 程式:dtutil. exe 功能:複製、刪除、驗證… MSDB 資料庫封裝 封裝執行監控作業 封裝轉入與輸出作業 執行作業 封裝執行作業 程式: dtexec. exe SSIS Service 程式: dtexecui. exe SQL 2005 管理介面



展示安裝精靈與SSIS Import & Export Wizard的使用

全新Control flow與Data flow觀念 SQL Server 2000 Control flow與Data flow混合在一起 SQL Server 2005 Control flow與Data flow分開處理 Control flow 類似早期 作與流程 新增Containers 物件 含有資料庫維護 作 自動含有流程指標 成功 、 失敗 、 完成 AND 、 OR邏輯判斷設定

全新Control flow與Data flow觀念 SQL Server 2005 Data flow分成 Data Flow Sources Data Flow Transformations Data Flow Destinations 取代以往資料庫處理作業 彙總: Aggregate 分類: Multicast 取樣: Row Sampling 排序: Sort 合併: Union All / Merge 樞紐: Pivot / Unpivot




Control Flow Task 重大強化 Execute Process Task 支援輸入、輸出變數、錯誤結果輸出 File System Task 目錄、檔案管理功能(移動、複製、刪除…) File Transfer Protocol Task 支援 收、發檔案與目錄管理功能 支援 FTP passive mode Script Task 使用. NET 語法,有Intelli. Sense 自動提示功能 Send Mail Task SMTP 取代 MAPI

展示Container 搭配 Send Email & FTP 傳送資料 & Script Task 作


資料轉換的 具-BCP (Bulk Copy Program) 位置 C: Program FilesMicrosoft SQL Server80ToolsBinnbcp. exe 方法 使用方式: bcp {dbtable | query} {in | out | queryout | format} datafile [-m maxerrors] [-f formatfile] [-e errfile] [-F firstrow] [-L lastrow] [-b batchsize] [-n native type] [-c character type] [-w wide character type] [-N keep non-text native] [-V file format version] [-q quoted identifier] [-C code page specifier] [-t field terminator] [-r row terminator] [-i inputfile] [-o outfile] [-a packetsize] [-S server name] [-U username] [-P password] [-T trusted connection] [-v version] [-R regional enable] [-k keep null values] [-E keep identity values] [-h "load hints"]






利用T-SQL發送第一個電子郵件 使用Management Studio開啟新增查詢 使用msdb中的sp_send_dbmail




直接升級 SQL Server 7. 0/2000 Instance: W 2003 CHT SQL Server 2005 Instance: W 2003 CHT 升級安裝

一對一移轉 SQL Server 2005 Instance: W 2003 CHT SQL Server 7. 0/2000 Instance: W 2 KCHT Compare & Migration Verify Verified!

直接升級與移轉的比較 作業前 作業後 SQL Server 2005 SQL Server 7. 0/2000 直接升級 一對一移轉 直接升級 SQL Server 7. 0/2000 移轉 SQL Server 2005



適用哪些項目 可以升級資料庫版本 SQL Server 7. 0 (加上最新的Service Pack) SQL Server 2000 (加上最新的Service Pack) 可以升級的元件 資料庫整體 代理程式, 全文檢索, 系統 具…等等. 分析服務 報表服務 通知服務 資料轉換服務 版本 Desktop、 Workgroup、 Personal、 Standard Developer、 Enterprise、MSDE (Desktop Engine) 作業平台 32 -bit & 64 -bit (IA 64 and x 64) 支援語系 All SQL Server 7. 0 and SQL Server 2000 released languages

升級前置計畫--環境準備 符合 SQL Server 2005 最低硬體與軟體需求 處理器 : Pentium 3 + , 550 MHz + 記憶體 : 256 MB + , 512 MB recommended 作業系統 : Windows 2000 with SP 4 or later Windows Server 2003 Windows XP Professional with SP 1 or later 注意應用程式 資料庫版本(Enterprise ) 跨語系升級(English Any localized version,反之不可 ) 平台(Windows 2000 Windows 2003) 驅動程式(如JDBC for SQL Server 2005) 執行 Upgrade Advisor 進行評估作業



升級前置計畫--安裝Upgrade Advisor 安裝需求環境. Net framework version 2. 0 安裝完成路徑 C: Program FilesMicrosoft SQL Server 2005 Upgrade AdvisorSQLUpgrade. Advisor. exe





This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY. © 2004 Microsoft Corporation. All rights reserved.
- Slides: 100