1 / 61

挑戰資料庫管理系統 A Challenge to Database Management Systems

挑戰資料庫管理系統 A Challenge to Database Management Systems. 第 4 章 MS SQL Server 2000 簡介. 大綱. 4.1 前言 4.2 MS SQL Server 的管理架構 4.3 MS SQL Server 功能表 4.4 Enterprise Manager 4.5 Query Analyzer. 4.1 前言. 本章將以 MS SQL Server 2000 為例,介紹關連式資料庫管理系統 (RDBMS) 所提供的操作介面和功能 SQL Server 的管理架構

doctor
Télécharger la présentation

挑戰資料庫管理系統 A Challenge to Database Management Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 挑戰資料庫管理系統 A Challenge to Database Management Systems 第4章 MS SQL Server 2000 簡介 挑戰資料庫管理系統

  2. 大綱 • 4.1 前言 • 4.2 MS SQL Server 的管理架構 • 4.3 MS SQL Server 功能表 • 4.4 Enterprise Manager • 4.5 Query Analyzer 挑戰資料庫管理系統

  3. 4.1 前言 • 本章將以MS SQL Server 2000為例,介紹關連式資料庫管理系統(RDBMS)所提供的操作介面和功能 • SQL Server 的管理架構 • SQL Server 功能表 • Enterprise Manager • Query Analyzer 挑戰資料庫管理系統

  4. 4.2 MS SQL Server 的管理架構 • 個人版、標準版、企業版和教育版 • 管理架構 • 單機 • 主從式 • 分散式 • Server (伺服器)端 • 安裝資料庫引擎和伺服器端的資料庫管理工具 • Client(用戶)端 • 則安裝用戶端的資料庫管理工具 • Client端的應用程式可以透過OLE DB、ODBC(Open DataBase Connectivity)、DB-Library和Embedded SQL等方式來存取儲存在Server端的資料庫 挑戰資料庫管理系統

  5. 4.3 MS SQL Server 功能表 • MS SQL Server 功能表 挑戰資料庫管理系統

  6. 4.3 MS SQL Server 功能表 • Enterprise Manager(用戶端管理工具) • 採圖形化的交談式操作介面 • 用來建立和管理資料庫、資料表、檢視表、索引、預存程序、觸發程序等等資料庫物件 • 非常容易使用 • Profile(用戶端管理工具) • 用來監督和分析MS SQL Server的執行效能 • INSERT、UPDATE、DELETE、SELECT、預存程序、資料指標、T-SQL • 也可以用於預存程序或T-SQL程式之追蹤(Trace)和除錯(Debug) 挑戰資料庫管理系統

  7. 4.3 MS SQL Server 功能表 • Query Analyzer(用戶端管理工具) • 也是採用交談式介面 • 編輯SQL指令、T-SQL程式、預存程序、觸發程序 • 檢查指令語法是否正確 • 執行之並隨即顯示執行的結果或訊息 • 用戶端網路公用程式(用戶端管理工具) • 用來設定Client端的通訊網路協定 • 查看「網路程式庫」提供哪些介面函式 挑戰資料庫管理系統

  8. 4.3 MS SQL Server 功能表 • 伺服器網路公用程式(伺服器端管理工具) • 用來設定Server端的通訊網路協定 • 查看「通訊協定網路程式庫」提供哪些介面函式 • 服務管理員(伺服器端管理工具) • 用來啟動、暫停或關閉資料庫伺服器 • 設定IIS中的SQL XML支援(用戶端管理工具) • 這項功能必須與MS IIS伺服器相互搭配 • 透過IIS伺服器的幫助,將SQL指令傳送到資料庫伺服器執行 • 並將執行結果以XML格式傳回Client端的瀏覽器來展現 挑戰資料庫管理系統

  9. 4.3 MS SQL Server 功能表 • 匯入和匯出資料(用戶端管理工具) • 將資料庫裡的資料匯出到ASCII 文字檔、Excel 活頁簿、Assces、或其他SQL Server資料庫、Oracle資料庫 • 將ASCII 文字檔、Excel 活頁簿、Assces、或其他SQL Server資料庫、Oracle資料庫等資料匯入到SQL Server資料庫 • 線上叢書(用戶端管理工具) • MS SQL Server的完整說明文件 • 學習MS SQL Server的葵花寶典 挑戰資料庫管理系統

  10. 4.4 Enterprise Manager • Enterprise Manager是一個全能管理工具 • 建立資料庫物件 • 管理資料庫物件 挑戰資料庫管理系統

  11. 4.4.1 Enterprise Manager的操作環境 • Enterprise Manager的操作環境 挑戰資料庫管理系統

  12. 4.4.2 系統資料庫與使用者資料庫 • 系統資料庫與使用者資料庫 • 系統資料庫 • master、model、msdb、tempdb • 範例資料庫 • Northwind 、 pubs • 使用者資料庫 • BookDB、EnpDB和SaleDB 挑戰資料庫管理系統

  13. 4.4.2 系統資料庫與使用者資料庫 • 系統資料庫 • master • master 資料庫用來記錄系統層級的相關資訊 • 記錄其他資料庫的狀態、檔案位置、每個 Windows 帳戶或群組名稱、每個 SQL Server 登入名稱等等 • master 資料庫也須經常備份 挑戰資料庫管理系統

  14. 4.4.2 系統資料庫與使用者資料庫 • 系統資料庫 • model • 是一個樣板(Templet)資料庫 • 會被複製一份到使用者資料庫 • 系統資料表 • syscolumns、sysindexkeys、syscomments、sysmembers、sysconstraints、sysobjects、sysdepends、syspermissions、sysfilegroups、sysprotects、sysfiles、sysreferences、sysforeignkeys、systypes、sysfulltextcatalogs、sysusers、sysindexes 挑戰資料庫管理系統

  15. 4.4.2 系統資料庫與使用者資料庫 • 系統資料庫 • model • syscolumns:記錄資料行的相關資訊 • sysconstraints:記錄條件約束的相關資訊 • sysindexkeys和sysindexes:記錄索引的相關資訊 • sysforeignkeys:記錄FOREIGN KEY 條件約束的相關資訊 挑戰資料庫管理系統

  16. 4.4.2 系統資料庫與使用者資料庫 • 系統資料庫 • msdb • msdb資料庫用來儲存資料庫做備份(Backup)和還原(Recovery)的相關資訊 • 何時進行備份 • 備份資料要儲存到哪些檔案 • 由誰來執行備份 • tempdb • 暫時儲存一些工作中的資料表和預存程序 • inserted • deleted 挑戰資料庫管理系統

  17. 4.4.2 系統資料庫與使用者資料庫 • master資料庫物件 挑戰資料庫管理系統

  18. 4.4.2 系統資料庫與使用者資料庫 • master資料庫所屬的資料表 挑戰資料庫管理系統

  19. 4.4.2 系統資料庫與使用者資料庫 • master資料庫所屬的檢視表 挑戰資料庫管理系統

  20. 4.4.2 系統資料庫與使用者資料庫 • 【例1】建立EmpDB資料庫 挑戰資料庫管理系統

  21. 4.4.2 系統資料庫與使用者資料庫 • 【例1】建立EmpDB資料庫(續) 挑戰資料庫管理系統

  22. 4.4.2 系統資料庫與使用者資料庫 • 【例1】建立EmpDB資料庫(續) • 方法 1 • 點選樹狀目錄裡的【資料庫】資料夾,再點選新增資料庫鈕( )來新增資料庫 • 方法 2  • 點選樹狀目錄裡的【資料庫】資料夾,按右鍵,選【新增資料庫】 • 方法 3 • 點選樹狀目錄裡的 【資料庫】資料夾,點新增鈕( )來新增資料庫 • 方法 4 • 點選樹狀目錄裡的 【資料庫】資料夾,點選【執行】,選 【新增資料庫】 挑戰資料庫管理系統

  23. 4.4.2 系統資料庫與使用者資料庫 • 【例2】建立EmpDB所屬的資料表 挑戰資料庫管理系統

  24. 4.4.2 系統資料庫與使用者資料庫 • 建立Emp資料表 挑戰資料庫管理系統

  25. 4.4.2 系統資料庫與使用者資料庫 • 建立Emp資料表之建立索引 挑戰資料庫管理系統

  26. 4.4.2 系統資料庫與使用者資料庫 • 【例3】設計資料表- -修改Emp資料表的結構 挑戰資料庫管理系統

  27. 4.4.2 系統資料庫與使用者資料庫 • 【例4】載入資料- -將Execl資料匯入Emp資料表 挑戰資料庫管理系統

  28. 4.4.2 系統資料庫與使用者資料庫 • 輸入資料來源及Excel檔案名稱 挑戰資料庫管理系統

  29. 4.4.2 系統資料庫與使用者資料庫 • 輸入資料目的地 挑戰資料庫管理系統

  30. 4.4.2 系統資料庫與使用者資料庫 • 選擇「複製來源資料庫的資料表和檢視表」 挑戰資料庫管理系統

  31. 4.4.2 系統資料庫與使用者資料庫 • 勾選Emp$並確認目的地是否正確後按【轉換】鈕 挑戰資料庫管理系統

  32. 4.4.2 系統資料庫與使用者資料庫 • 選擇「附加資料列到目的資料表」,按【確定 】 挑戰資料庫管理系統

  33. 4.4.2 系統資料庫與使用者資料庫 • 勾選「立即執行」,按【下一步】 挑戰資料庫管理系統

  34. 4.4.2 系統資料庫與使用者資料庫 • 按【完成】 挑戰資料庫管理系統

  35. 4.4.2 系統資料庫與使用者資料庫 • 【例5】查看Emp資料表內有哪些資料? 挑戰資料庫管理系統

  36. 4.4.2 系統資料庫與使用者資料庫 • 傳回Emp資料表的所有資料列 挑戰資料庫管理系統

  37. 4.4.2 系統資料庫與使用者資料庫 • 刪除A001、A002、A003等三筆資料列 挑戰資料庫管理系統

  38. 第1區 第2區 第3區 第4區 4.4.2 系統資料庫與使用者資料庫 • 做進一步之查詢 (Query By Example) 挑戰資料庫管理系統

  39. 4.4.2 系統資料庫與使用者資料庫 • 【例6】如何繪製EmpDB資料庫的實體關係圖? • 新增資料庫圖表 挑戰資料庫管理系統

  40. 4.4.2 系統資料庫與使用者資料庫 • 【例6】如何繪製EmpDB資料庫的實體關係圖? • 啟動「建立資料庫圖表精靈」 挑戰資料庫管理系統

  41. 4.4.2 系統資料庫與使用者資料庫 • 【例6】如何繪製EmpDB資料庫的實體關係圖? • 挑選Auth、Dept、Emp資料表 挑戰資料庫管理系統

  42. 4.4.2 系統資料庫與使用者資料庫 • 【例6】如何繪製EmpDB資料庫的實體關係圖? • 完成建立資料庫圖表精靈 挑戰資料庫管理系統

  43. 4.4.2 系統資料庫與使用者資料庫 • 【例6】如何繪製EmpDB資料庫的實體關係圖? • 顯示Auth、Dept、Emp資料表三個資料表 挑戰資料庫管理系統

  44. 4.4.2 系統資料庫與使用者資料庫 • 【例6】如何繪製EmpDB資料庫的實體關係圖? • 建立Dept和Emp間的關連性 • 以Dept.Dept_code為主鍵,Emp.Dept_code為外來鍵 挑戰資料庫管理系統

  45. 4.4.2 系統資料庫與使用者資料庫 • 【例6】如何繪製EmpDB資料庫的實體關係圖? • Dept和Emp間以FK_Emp_Dept1建立起關連性 挑戰資料庫管理系統

  46. 4.4.2 系統資料庫與使用者資料庫 • 【例6】如何繪製EmpDB資料庫的實體關係圖? • Auth和Dept間以FK_Auth_Dept1建立起關連性 • 存檔 挑戰資料庫管理系統

  47. 4.4.2 系統資料庫與使用者資料庫 • 【例6】如何繪製EmpDB資料庫的實體關係圖? • 檔名:Emp_Dept_Auth 實體關係圖 挑戰資料庫管理系統

  48. 4.5 Query Analyzer • 登入Query Analyzer 挑戰資料庫管理系統

  49. 4.5 Query Analyzer • Query Analyzer的執行環境 挑戰資料庫管理系統

  50. 4.5 Query Analyzer • 【例1】查詢Emp資料表的資料內容為何? 挑戰資料庫管理系統

More Related