版本注意事項 IBM(R) DB2(R) Universal Database 版本注意事項 版本 7 -- FixPak 5 (C) Copyright International Business Machines Corporation 2000, 2001. All rights reserved. Note to U.S. government Users -- Documentation related ... ------------------------------------------------------------------------ 目錄 * 目錄 * 前言 ------------------------------------------------------------------------ 請先讀我 * FixPak 5 重點 * 產品注意事項 o 2.1 DB2 for Solaris 版本 7 所支援的 CPU o 2.2 Red Flag Linux 的中文語言環境修正程式 o 2.3 日文和簡體中文 Linux 環境之 DB2 for Linux 的附加語言環境設定 o 2.4 Linux 上的 DBCS 限制 o 2.5 Microsoft Internet Explorer 上的控制中心問題 o 2.6 控制中心功能流失 o 2.7 Netscape CD 不隨附於 DB2 UDB o 2.8 XML Readme 檔的錯誤 o 2.9 DB2 版本 7.2 中新增的 Business Intelligence 加強功能 o 2.10 FixPak 2A 與更新版本在 IBM DB2 OLAP Server 中發生問題 o 2.11 使用 WebSphere 3.5.5 時的分區段違規 * 線上文件(HTML、PDF 與「搜尋」)附註 o 3.1 Windows 2000 作業系統所支援的 Web 瀏覽器 o 3.2 在 Solaris 系統下搜尋 DB2 線上資訊 o 3.3 切換 NetQuestion for OS/2 以使用 TCP/IP o 3.4 啟動 Netscape 時產生的錯誤訊息 o 3.5 UNIX 系統上 Adobe Acrobat Reader 的架構需求 o 3.6 SQL Reference 僅提供一個 PDF 檔 ------------------------------------------------------------------------ 安裝與架構 * 一般安裝、移轉及架構資訊 o 4.1 下載所有支援的 DB2 從屬站的安裝資料包 o 4.2 附加的必要 Solaris 修補層次 o 4.3 Netscape LDAP 目錄支援 + 4.3.1 擴充 Netscape LDAP 綱目 o 4.4 支援 Windows ME、Windows XP 和 Windows 2000 Datacenter Edition 平台 + 4.4.1 Windows XP + 4.4.1.1 限制 + 4.4.2 Windows ME + 4.4.2.1 限制 + 4.4.3 Windows 2000 Datacenter Server o 4.5 在 Windows 2000 上安裝 DB2 o 4.6 在 Windows 2000 Terminal Server 管理模式下執行 DB2 o 4.7 Microsoft SNA Server 和 SNA 多站更新 (兩階段確定) 支援 o 4.8 Windows NT (CS/NT) 的 IBM Communications 伺服器定義使用者 ID 和通行碼 + 4.8.1 節點定義 o 4.9 如果可移除式磁碟機未連接,則 DB2 安裝會中斷 o 4.10 在 Windows 2000 上使用 CLP 時發生錯誤 SQL1035N o 4.11 關於概略表以特別暫存區定義的移轉問題 o 4.12 Windows 2000 的 IPX/SPX 通信協定支援 o 4.13 升級 DB2 前一版之前先停止 DB2 程序 o 4.14 若已安裝其它 DB2 產品,請在安裝 DB2 之後執行 db2iupdt o 4.15 設定 Linux 環境以執行 DB2 控制中心 o 4.16 DB2 Universal Database Enterprise Edition 及 DB2 Connect Enterprise Edition for Linux on S/390 o 4.17 Linux for S/390 上可能的資料流失 o 4.18 Linux 上的 DB2 的 Gnome 和 KDE 桌面整合 o 4.19 Solaris 核心程式架構參數 (建議值) o 4.20 DB2 Universal Database Enterprise - Extended Edition for UNIX 快速入門 o 4.21 HP-UX 的 shmseg 核心參數 o 4.22 移轉 IBM Visual 倉儲控制資料庫 o 4.23 使用 db2uiddl 指令移轉唯一索引 o 4.24 64 位元 AIX 版本安裝錯誤 + 4.24.1 使用 SMIT o 4.25 移轉期間發生的錯誤 o 4.26 IBM(R) DB2(R) Connect 授權啟動 + 4.26.1 使用「授權中心」安裝您的授權碼並設定授權類型 + 4.26.2 使用 db2licm 指令安裝您的授權碼並設定授權類型 + 4.26.3 分散式安裝的授權注意事項 o 4.27 存取倉儲控制資料庫 o 4.28 Enterprise Edition UNIX CD-ROM 的試用產品 o 4.29 DB2 Connect Enterprise Edition UNIX CD-ROM 的試用產品 o 4.30 字碼頁及語言支援資訊 - 更正 * DB2 Data Links Manager 快速入門 o 5.1 AIX 5.1 上的支援 o 5.2 Dlfm 的啟動失敗訊息:取得 afsfid 字首時發生錯誤 o 5.3 設定備份保存檔的 Tivoli Storage Manager 類別 o 5.4 DFS 從屬站啟動程式的磁碟空間需求 o 5.5 監督在 AIX 的資料鏈結檔案管理程式後端程序 o 5.6 安裝和架構 DB2 Data Links Manager for AIX: DCE-DFS 環境裡的 額外安裝注意事項 o 5.7 失敗的 "dlfm add_prefix" 指令 o 5.8 很少見的事件:複製常駐程式在 dlfm 停止時沒有停止 o 5.9 安裝和架構 DB2 Data Links Manager for AIX: 使用 db2setup 公 用程式在 AIX 上安裝 DB2 Data Links Manager o 5.10 安裝和架構 DB2 Data Links Manager for AIX:DCE-DFS 後置安裝 作業 o 5.11 安裝和架構 DB2 Data Links Manager for AIX: 使用 Smit 來手動 安裝 DB2 Data Links Manager o 5.12 安裝和架構 DB2 Data Links 的 DFS 從屬站啟動程式 o 5.13 安裝和架構 DB2 Data Links Manager for Solaris o 5.14 在 Windows NT 上資料鏈結中的 Administrator 群組專用權 o 5.15 將 Data Links File System Filter (DLFF) 安裝的記載減到最少 + 5.15.1 在安裝後記載訊息 + 5.15.2 將 Sun Solaris 系統上的記載作業縮至最小 o 5.16 DATALINK 復置 o 5.17 捨棄 Data Links Manager o 5.18 使用 SMIT 解除安裝 DLFM 元件可能會除去額外的檔案集 o 5.19 開始之前/決定主電腦名稱 o 5.20 使用 DLFM:從 DB2 資料庫捨棄 DB2 Data Links Manager 後的清除 動作 o 5.21 dlfm Client_conf 失效時的使用者動作 o 5.22 DLFM1001E (新的錯誤訊息) o 5.23 DLFM 設定架構檔選項 o 5.24 復置檔案時可能發生的問題 o 5.25 在 AIX 上執行 Data Links/DFS Script dmapp_prestart 時發生錯 誤 o 5.26 Tivoli Space Manager 與 Data Links 整合 + 5.26.1 功能限制 o 5.27 第 4 章 安裝和架構 DB2 Data Links Manager for AIX + 5.27.1 一般安裝注意事項 + 5.27.1.1 從 DB2 File Manager 版本 5.2 移轉到 DB2 Data Links Manager 版本 7 o 5.28 第 6 章. 驗證 AIX 上的安裝 + 5.28.1 NFS 環境中的解決方案 * 安裝與架構補充資料 o 6.1 第 5 章 在 UNIX 作業系統上安裝 DB2 從屬站 + 6.1.1 HP-UX 核心程式架構參數 o 6.2 第 12 章 執行您自己的應用程式 + 6.2.1 使用 Run-Time Client 連結資料庫公用程式 + 6.2.2 UNIX 從屬站使用 ODBC 存取 DB2 o 6.3 第 24 章 設置聯合系統來存取多重資料來源 + 6.3.1 聯合系統 + 6.3.2 限制 + 6.3.3 安裝 DB2 Relational Connect + 6.3.3.1 在 Windows NT 伺服器上安裝 DB2 Relational Connect + 6.3.3.2 在 UNIX 伺服器上安裝 DB2 Relational Connect o 6.4 第 26 章 存取 Oracle 資料來源 + 6.4.1 文件錯誤 o 6.5 存取 Sybase 資料來源 + 6.5.1 新增 Sybase 資料來源至聯合伺服器 + 6.5.1.1 步驟 1:設定環境變數並更新設定檔登錄 (僅適用於 AIX 及 Solaris) + 6.5.1.2 步驟 2:將 DB2 鏈結至 Sybase 從屬站軟體 (僅 AIX 與 Solaris) + 6.5.1.3 步驟 3:重新使用 DB2 案例 (僅適用於 AIX 及 Solaris) + 6.5.1.4 步驟 4:建立並設定介面檔案 + 6.5.1.5 步驟 5:建立外層 + 6.5.1.6 步驟 6:選用的:設定 DB2_DJ_COMM 環境變數 + 6.5.1.7 步驟 7:建立伺服器 + 6.5.1.8 步驟 8:選用的:設定 CONNECTSTRING 伺服器選項 + 6.5.1.9 步驟 9:建立使用者對映 + 6.5.1.10 步驟 10:建立表格與概略表的暱名 + 6.5.2 指定 Sybase 字碼頁 o 6.6 使用 ODBC 存取 Microsoft SQL Server 資料來源(新增章節) + 6.6.1 新增 Microsoft SQL Server 資料來源至聯合伺服器 + 6.6.1.1 步驟 1:設定環境變數 (僅 AIX) + 6.6.1.2 步驟 2:執行 Shell Script (僅 AIX) + 6.6.1.3 步驟 3:選用的:設定 DB2_DJ_COMM 環境變數 (僅適 用於 AIX) + 6.6.1.4 步驟 4:重新使用 DB2 案例 (僅 AIX) + 6.6.1.5 步驟 5:建立外層 + 6.6.1.6 步驟 6:建立伺服器 + 6.6.1.7 步驟 7:建立使用者對映 + 6.6.1.8 步驟 8:建立表格與概略表的暱名 + 6.6.1.9 步驟 9:選用的:獲得 ODBC 追蹤 + 6.6.2 複查 Microsoft SQL Server 字碼頁 (僅適用於 Windows NT) o 6.7 存取 Informix 資料來源(新增章節) + 6.7.1 新增 Informix 資料來源至聯合伺服器 + 6.7.1.1 步驟 1:設定環境變數並更新設定檔登錄 + 6.7.1.2 步驟 2︰鏈結 DB2 至 Informix 從屬站軟體 + 6.7.1.3 步驟 3:重新使用 DB2 案例 + 6.7.1.4 步驟 4︰建立 Informix sqlhosts 檔案 + 6.7.1.5 步驟 5:建立外層 + 6.7.1.6 步驟 6:選用的:設定 DB2_DJ_COMM 環境變數 + 6.7.1.7 步驟 7:建立伺服器 + 6.7.1.8 步驟 8︰建立使用者對映 + 6.7.1.9 步驟 9︰建立表格、概略表與 Informix 同義字的暱 名 ------------------------------------------------------------------------ 管理 * Administration Guide o 7.1 Update Available * Administration Guide: Planning o 8.1 Chapter 8. Physical Database Design + 8.1.1 Table Space Design Considerations + 8.1.1.1 Optimizing Table Space Performance when Data is Place on Raid o 8.2 Appendix D. National Language Support (NLS) + 8.2.1 Country/Region Code and Code Page Support: + 8.2.2 Import/Export/Load Considerations -- Restrictions for Code Pages 1394 and 5488 * Administration Guide: Performance o 9.1 System Temporary Table Schemas o 9.2 Chapter 8. Operational Performance + 9.2.1 Block- Based Buffer Pool + 9.2.1.1 Block-based Buffer Pool Examples o 9.3 Chapter 10. Scaling Your Configuration Through Adding Processors + 9.3.1 Problems When Adding Nodes to a Partitioned Database o 9.4 DB2 Registry and Environment Variables + 9.4.1 Corrections to Performance Variables + 9.4.2 Corrections and Additions to Miscellaneous Registry Variables + 9.4.3 Corrections and Additions to General Registry Variables * Administration Guide: Implementation o 10.1 Chapter 8. Recovering a Database + 10.1.1 How to Use Suspended I/O * Administering Satellites Guide and Reference (無中文版) o 11.1 Setting up Version 7.2 DB2 Personal Edition and DB2 Workgroup Edition as Satellites + 11.1.1 Prerequisites + 11.1.1.1 Installation Considerations + 11.1.2 Configuring the Version 7.2 System for Synchronization + 11.1.3 Installing FixPak 2 or Higher on a Version 6 Enterprise Edition System + 11.1.3.1 Upgrading Version 6 DB2 Enterprise Edition for Use as the DB2 Control Server + 11.1.4 Upgrading a Version 6 Control Center and Satellite Administration Center * Command Reference o 12.1 可用更新 o 12.2 db2updv7 - 更新資料庫為版本 7 現行修正程式層次 o 12.3 REBIND + Missing value o 12.4 db2inidb - 起始設定鏡映資料庫 + 12.4.1 使用情況資訊 o 12.5 GET ROUTINE 指令中的額外選項 + GET ROUTINE * Data Recovery and High Availability Guide and Reference(無中文版) o 13.1 可在線上取得 Data Recovery and High Availability Guide and Reference o 13.2 當 LOGRETAIN=CAPTURE 時的新備份與復置行為 o 13.3 NEWLOGPATH2 現在稱為 DB2_NEWLOGPATH2 o 13.4 選擇 AIX 或 Solaris 上 DB2 Data Links Manager 的備份方法 o 13.5 Tivoli Storage Manager -- LAN Free Data Transfer * Data Movement Utilities Guide and Reference (無中文版) o 14.1 Change to LOB File Handling by Export, Import and Load + 14.1.1 IXF considerations o 14.2 Code Page Support for Import, Export and Load Utilities o 14.3 db2relocatedb (new command) + db2relocatedb - Relocate Database o 14.4 db2move -- New Options Available + Moving Data Using the db2move Tool o 14.5 Chapter 2. Import + 14.5.1 Using Import with Buffered Inserts o 14.6 Chapter 3. Load + 14.6.1 Pending States After a Load Operation + 14.6.2 Load Restrictions and Limitations + 14.6.3 totalfreespace File Type Modifier o 14.7 Chapter 4. AutoLoader + 14.7.1 rexecd Required to Run AutoLoader When Authentication Set to YES o 14.8 AutoLoader May Hang During a Fork o 14.9 Appendix C. Export/Import/Load Utility File Formats * Replication 指南與參考手冊 o 15.1 抄寫及非 IBM 伺服器 o 15.2 在 Windows 2000 上的抄寫 o 15.3 儲存 SQL 檔案時的已知錯誤 o 15.4 DB2 維護 o 15.5 Web 上的 Data Difference Utility o 15.6 第 3 章. 資料抄寫實務範例 + 15.6.1 抄寫實務 o 15.7 第 5 章. 抄寫規劃 + 15.7.1 表格及直欄名稱 + 15.7.2 DATALINK 抄寫 + 15.7.3 LOB 限制 + 15.7.4 規劃抄寫 o 15.8 第 6 章. 設定抄寫環境 + 15.8.1 隨處更新 (Update-anywhere) 先決條件 + 15.8.2 設定抄寫環境 o 15.9 第 8 章 問題判斷 o 15.10 第 9 章 AS/400 的擷取程式和引用程式 o 15.11 第 10 章 OS/390 的擷取程式和引用程式 + 15.11.1 DB2 DataPropagator for OS/390 的先決條件 + 15.11.2 OS/390 上的 UNICODE 和 ASCII 編碼方法 + 15.11.2.1 選擇編碼方法 + 15.11.2.2 設定編碼方法 o 15.12 第 11 章 UNIX 平台的擷取程式和引用程式 + 15.12.1 在 UNIX 和 Windows 上設定「擷取程式」和「引用程式」 的環境變數 o 15.13 第 14 章 表格結構 o 15.14 第 15 章 擷取程式和引用程式訊息 o 15.15 附錄 A. 從應用程式內啟動擷取程式和引用程式 * System Monitor Guide and Reference(無中文版) o 16.1 db2ConvMonStream * Troubleshooting Guide (無中文版) o 17.1 Starting DB2 on Windows 95, Windows 98, and Windows ME When the User Is Not Logged On o 17.2 Chapter 1. Good Troubleshooting Practices + 17.2.1 Problem Analysis and Environment Collection Tool + 17.2.1.1 Collection Outputs + 17.2.1.2 Viewing detailed_system_info.html + 17.2.1.3 Viewing DB2 Support Tool Syntax One Page at a Time o 17.3 Chapter 2. Troubleshooting the DB2 Universal Database Server o 17.4 Chapter 8. Troubleshooting DB2 Data Links Manager * 在 64 位元的平台上使用 DB2 Universal Database o 18.1 第 5 章 架構 + 18.1.1 LOCKLIST + 18.1.2 shmsys:shminfo_shmmax o 18.2 第 6 章 限制 * XML Extender Administration and Programming(無中文版) * MQSeries o 20.1 安裝與架構 DB2 MQSeries 函數 + 20.1.1 安裝 MQSeries + 20.1.2 安裝 MQSeries AMI + 20.1.3 啟用 DB2 MQSeries Function o 20.2 MQSeries 傳訊樣式 o 20.3 訊息結構 o 20.4 MQSeries 功能概觀 + 20.4.1 限制 + 20.4.2 錯誤碼 o 20.5 用法實務手冊 + 20.5.1 基本傳訊 + 20.5.2 傳送訊息 + 20.5.3 擷取訊息 + 20.5.4 應用程式對應用程式連接 + 20.5.4.1 Request/Reply 通信 + 20.5.4.2 發佈/訂閱 o 20.6 enable_MQFunctions + enable_MQFunctions o 20.7 disable_MQFunctions + disable_MQFunctions ------------------------------------------------------------------------ 管理工具 * 執行工具之前的其它設置 o 21.1 停用 Linux 上的浮點堆疊 o 21.2 日文 Linux 環境需要特定的 Java 層次 * 控制中心 o 22.1 管理 DB2 Server for VSE & VM 伺服器能力 o 22.2 Java 1.2 支援控制中心 o 22.3 在 Windows 作業系統下使用線上說明的「無效捷徑」錯誤 o 22.4 快速鍵無效 o 22.5 OS/2 系統下的 Java 控制中心 o 22.6 在 Windows 作業系統之異動日誌檢視已完成工作的「檔案拒絕存 取」錯誤 o 22.7 多位置更新測試連接 o 22.8 DB2 for OS/390 的控制中心 o 22.9 OS/390 控制中心必要的修正程式 o 22.10 「建立空間層」對話框的變更 o 22.11 DB2 控制中心的疑難排解 o 22.12 UNIX 系統控制中心的疑難排解 o 22.13 OS/2 可能的 Infopop 問題 o 22.14 jdk11_path 架構參數的說明 o 22.15 使用「Script 中心」或「異動日誌」時發生的 Solaris 系統錯誤 (SQL10012N) o 22.16 DPREPL.DFT 檔案的說明 o 22.17 啟動多個控制中心 applet o 22.18 控制中心以 Applet 執行時的線上說明 o 22.19 在 Applet 模式 (Windows 95) 下執行控制中心 o 22.20 使用大量的查詢結果 * 命令中心 o 23.1 現在命令中心交談頁可以辨識陳述式結束字元 * 資訊中心 o 24.1 在 Windows 作業系統下的「無效捷徑」錯誤 o 24.2 當 Netscape 已開啟時,在 Netscape Navigator 中開啟外部 Web 鏈結(UNIX 系統) o 24.3 啟動「資訊中心」的問題 * 精靈 o 25.1 在建立資料庫精靈設定擴充大小 o 25.2 MQSeries 輔助精靈 o 25.3 OLE DB 輔助精靈 o 25.4 使用儲存程序建置器建置 OS/390 的 Java 儲存程序 ------------------------------------------------------------------------ Business Intelligence * Business Intelligence 教學指導 o 26.1 經過修訂的 Business Intelligence 教學指導 * DB2 Universal Database 快速導覽 * 資料倉儲中心 Administration Guide o 28.1 可用更新 o 28.2 倉儲伺服器加強功能 o 28.3 使用 OS/390 代理程式執行 Trillium 批次系統 JCL o 28.4 資料倉儲中心中的二個新範例程式 o 28.5 用 DB2 Warehouse Manager 來管理 ETI.Extract(R) 轉換程式已更 新 o 28.6 使用 Common Warehouse Metadata Interchange (CWMI) 匯入及匯出 描述資料 + 28.6.1 簡介 + 28.6.2 匯入描述資料 + 28.6.3 在執行匯入公用程式之後更新描述資料 + 28.6.4 匯出描述資料 o 28.7 標示語言描述資料匯入/匯出公用程式 + 28.7.1 鍵定義 + 28.7.2 步驟與程序排程 o 28.8 SAP 步驟資訊 + 28.8.1 指定 SAP 步驟的輸出參數時延遲 + 28.8.2 SAP 步驟間共用輸入參數值 + 28.8.3 執行 SAP 步驟時發生存取違規錯誤 o 28.9 SAP Connector 資訊 + 28.9.1 SAP Connector 安裝限制 + 28.9.2 GetDetail BAPI 的效能 * DB2 OLAP Starter Kit o 29.1 OLAP Server 網站 o 29.2 支援的作業系統服務程式等級 o 29.3 完成 DB2 OLAP Starter Kit 在 UNIX 上的安裝 o 29.4 Solaris 作業環境的附加架構 o 29.5 所有作業系統的附加架構 o 29.6 架構 OLAP Starter Kit 的 ODBC + 29.6.1 在 UNIX 系統上架構資料來源 + 29.6.1.1 架構 ODBC 環境變數 + 29.6.1.2 編輯 odbc.ini 檔案 + 29.6.1.3 新增資料來源到 odbc.ini 檔 + 29.6.1.4 ODBC 的 DB2 設定值範例 + 29.6.1.5 ODBC 的 Oracle 設定值範例 + 29.6.2 在 UNIX 系統上架構 OLAP 描述資料型錄 + 29.6.3 在 Windows 系統上架構資料來源 + 29.6.4 在 Windows 系統上架構 OLAP 描述資料型錄 + 29.6.5 在您架構資料來源之後 o 29.7 從 OLAP Starter Kit 桌上管理程式登入 + 29.7.1 Starter Kit 登入範例 o 29.8 自行建立及架構 OLAP Starter Kit 的範例資料庫 o 29.9 移轉應用程式至 OLAP Starter Kit 版本 7.2 o 29.10 已知問題與限制 o 29.11 OLAP 試算表增益集 EQD 檔案遺失 * 資訊型錄管理程式管理手冊 o 30.1 資訊型錄管理程式起始設定公用程式 + 30.1.1 + 30.1.2 版權問題 + 30.1.3 安裝問題 o 30.2 資訊型錄管理程式加強功能 o 30.3 在 Windows 環境中「資訊型錄管理程式」及 Sybase 之間的不相容 o 30.4 以 DB2 版本 7 資訊型錄管理程式存取 DB2 版本 5 資訊型錄 o 30.5 設置資訊型錄 o 30.6 與其它產品交換描述資料 o 30.7 使用 flgnxoln 指令交換描述資料 o 30.8 使用 MDISDGC 指令交換描述資料 o 30.9 呼叫程式 * Information Catalog Manager Programming Guide and Reference(無中文版) o 31.1 Information Catalog Manager Reason Codes * 資訊型錄管理程式使用手冊 * 資訊型錄管理程式:線上訊息 o 33.1 更正 FLG 訊息 + 33.1.1 訊息 FLG0260E + 33.1.2 訊息 FLG0051E + 33.1.3 訊息 FLG0003E + 33.1.4 訊息 FLG0372E + 33.1.5 訊息 FLG0615E * 資訊型錄管理程式:線上說明 o 34.1 Web 資訊型錄管理程式 * DB2 Warehouse Manager 安裝手冊 o 35.1 可以使用 DB2 Warehouse Manager 安裝手冊更新版 o 35.2 倉儲轉換程式的軟體需求 * Query Patroller Administration Guide(無中文版) o 36.1 DB2 Query Patroller Client is a Separate Component o 36.2 Changing the Node Status o 36.3 Migrating from Version 6 of DB2 Query Patroller Using dqpmigrate o 36.4 Enabling Query Management o 36.5 Location of Table Space for Control Tables o 36.6 New Parameters for dqpstart Command o 36.7 New Parameter for iwm_cmd Command o 36.8 New Registry Variable: DQP_RECOVERY_INTERVAL o 36.9 Starting Query Administrator o 36.10 User Administration o 36.11 Creating a Job Queue o 36.12 Using the Command Line Interface o 36.13 Query Enabler Notes o 36.14 DB2 Query Patroller Tracker may Return a Blank Column Page o 36.15 Query Patroller and Replication Tools o 36.16 Improving Query Patroller Performance o 36.17 Lost EXECUTE Privilege for Query Patroller Users Created in Version 6 o 36.18 Query Patroller Restrictions o 36.19 Appendix B. Troubleshooting DB2 Query Patroller Clients ------------------------------------------------------------------------ 應用程式開發 * Administrative API Reference (無中文版) o 37.1 db2ArchiveLog (new API) + db2ArchiveLog o 37.2 db2ConvMonStream o 37.3 db2DatabasePing (new API) + db2DatabasePing - Ping Database o 37.4 db2HistData o 37.5 db2HistoryOpenScan o 37.6 db2XaGetInfo (new API) + db2XaGetInfo - Get Information for Resource Manager o 37.7 db2XaListIndTrans (new API that supercedes sqlxphqr) + db2XaListIndTrans - List Indoubt Transactions o 37.8 db2GetSnapshot - Get Snapshot o 37.9 Forget Log Record o 37.10 sqlaintp - Get Error Message o 37.11 sqlbctcq - Close Tablespace Container Query o 37.12 sqleseti - Set Client Information o 37.13 sqlubkp - Backup Database o 37.14 sqlureot - Reorganize Table o 37.15 sqlurestore - Restore Database o 37.16 Documentation Error Regarding AIX Extended Shared Memory Support (EXTSHM) o 37.17 SQLFUPD + 37.17.1 locklist o 37.18 SQLEDBDESC * 應用程式開發手冊 o 38.1 可用更新 * Application Development Guide o 39.1 Update Available o 39.2 IBM OLE DB Provider for DB2 UDB * CLI Guide and Reference (無中文版) o 40.1 Binding Database Utilities Using the Run-Time Client o 40.2 Using Static SQL in CLI Applications o 40.3 Limitations of JDBC/ODBC/CLI Static Profiling o 40.4 ADT Transforms o 40.5 Chapter 1. Introduction to CLI + 40.5.1 Differences Between DB2 CLI and Embedded SQL o 40.6 Chapter 3. Using Advanced Features + 40.6.1 Writing Multi-Threaded Applications + 40.6.2 Writing a DB2 CLI Unicode Application + 40.6.2.1 Unicode Functions + 40.6.2.2 New datatypes and Valid Conversions + 40.6.2.3 Obsolete Keyword/Patch Value + 40.6.2.4 Literals in Unicode Databases + 40.6.2.5 New CLI Configuration Keywords + 40.6.3 Microsoft Transaction Server (MTS) as Transaction Monitor + 40.6.4 Scrollable Cursors + 40.6.4.1 Server-side Scrollable Cursor Support for OS/390 + 40.6.5 Using Compound SQL + 40.6.6 Using Stored Procedures + 40.6.6.1 Writing a Stored Procedure in CLI + 40.6.6.2 CLI Stored Procedures and Autobinding o 40.7 Chapter 4. Configuring CLI/ODBC and Running Sample Applications + 40.7.1 Configuration Keywords + 40.7.1.1 CURRENTFUNCTIONPATH + 40.7.1.2 SKIPTRACE o 40.8 Chapter 5. DB2 CLI Functions + 40.8.1 SQLBindFileToParam - Bind LOB File Reference to LOB Parameter + 40.8.2 SQLColAttribute -- Return a Column Attribute + 40.8.3 SQLGetInfo - Get General Information + 40.8.4 SQLGetLength - Retrieve Length of A String Value + 40.8.5 SQLNextResult - Associate Next Result Set with Another Statement Handle + 40.8.5.1 Purpose + 40.8.5.2 Syntax + 40.8.5.3 Function Arguments + 40.8.5.4 Usage + 40.8.5.5 Return Codes + 40.8.5.6 Diagnostics + 40.8.5.7 Restrictions + 40.8.5.8 References + 40.8.6 SQLSetEnvAttr - Set Environment Attribute + 40.8.7 SQLSetStmtAttr -- Set Options Related to a Statement o 40.9 Appendix C. DB2 CLI and ODBC + 40.9.1 ODBC Unicode Applications + 40.9.1.1 ODBC Unicode Versus Non-Unicode Applications o 40.10 Appendix D. Extended Scalar Functions + 40.10.1 Date and Time Functions o 40.11 Appendix K. Using the DB2 CLI/ODBC/JDBC Trace Facility * 訊息參考手冊 o 41.1 可用更新 o 41.2 訊息更新 + 41.2.1 SQL2554N 新原因碼 12 + 41.2.2 其它新訊息和 SQLSTATE * SQL Reference (無中文版) o 42.1 SQL Reference Update Available o 42.2 Enabling the New Functions and Procedures o 42.3 MQSeries Information + 42.3.1 Scalar Functions + 42.3.1.1 MQPUBLISH + 42.3.1.2 MQREADCLOB + 42.3.1.3 MQRECEIVECLOB + 42.3.1.4 MQSEND + 42.3.2 Table Functions + 42.3.2.1 MQREADALLCLOB + 42.3.2.2 MQRECEIVEALLCLOB + 42.3.3 CLOB data now supported in MQSeries functions o 42.4 Data Type Information + 42.4.1 Promotion of Data Types + 42.4.2 Casting between Data Types + 42.4.3 Assignments and Comparisons + 42.4.3.1 String Assignments + 42.4.3.2 String Comparisons + 42.4.4 Rules for Result Data Types + 42.4.4.1 Character and Graphic Strings in a Unicode Database + 42.4.5 Rules for String Conversions + 42.4.6 Expressions + 42.4.6.1 With the Concatenation Operator + 42.4.7 Predicates o 42.5 Unicode Information + 42.5.1 Scalar Functions and Unicode o 42.6 Larger Index Keys for Unicode Databases + 42.6.1 ALTER TABLE + 42.6.2 CREATE INDEX + 42.6.3 CREATE TABLE o 42.7 Additional Options in the GET DIAGNOSTICS Statement + GET DIAGNOSTICS Statement o 42.8 ORDER BY in Subselects + 42.8.1 fullselect + 42.8.2 subselect + 42.8.3 order-by-clause + 42.8.4 select-statement + SELECT INTO statement + 42.8.5 OLAP Functions (window-order-clause) o 42.9 New Input Argument for the GET_ROUTINE_SAR Procedure o 42.10 Required Authorization for the SET INTEGRITY Statement * Unicode 更新 o 43.1 簡介 + 43.1.1 DB2 Unicode 資料庫及應用程式 + 43.1.2 文件更新 ------------------------------------------------------------------------ 連接到主電腦系統 * DB2 Connect User's Guide (無中文版) o 44.1 Increasing DB2 Connect data transfer rate + 44.1.1 Extra Query Blocks + 44.1.2 RFC-1323 Window Scaling * 連接環境補充資料 o 45.1 在 VM 環境下安裝應用程式伺服器 o 45.2 CLI/ODBC/JDBC 架構 PATCH1 和 PATCH2 設定值 ------------------------------------------------------------------------ 附加資訊 * 附加資訊 o 46.1 DB2 Everywhere 已改為 DB2 Everyplace o 46.2 DB2 UDB 版本 7 的存取特性 + 46.2.1 鍵盤之輸入和導引 + 46.2.1.1 鍵盤輸入 + 46.2.1.2 鍵盤焦點 + 46.2.2 方便顯示特性 + 46.2.2.1 明顯對照模式 + 46.2.2.2 字型設定值 + 46.2.2.3 無關顏色 + 46.2.3 選擇式警告提示 + 46.2.4 支援技術的相容性 + 46.2.5 可存取的文件 o 46.3 滑鼠需求 o 46.4 試圖從 DB2 Run-time Client 連結導致「找不到連結檔案」錯誤 o 46.5 Search 探索 (Search Discovery) o 46.6 HP-UX 11 的記憶體視窗 o 46.7 解除安裝 DB2 DFS 從屬站啟動程式 o 46.8 Windows NT 從屬站身分驗證 o 46.9 聯合系統的限制 o 46.10 MPP 分割區表格的聯合限制 o 46.11 DataJoiner 限制 o 46.12 Windows NT 的希伯來文資訊型錄管理程式 o 46.13 啟動 Windows 之後無法啟動 DB2 的 SNA SPM o 46.14 Windows NT 及 Windows 2000 上的 DB2 服務帳戶需求 o 46.15 需要確定所有會在資料倉儲中心(DWC)中使用的使用者定義程式 o 46.16 Windows NT 上的從屬站端快取 o 46.17 Life Sciences Data Connect + 46.17.1 新外層 + 46.17.2 注意- o 46.18 SQL 輔助程式的加強功能 o 46.19 備份與復置指令的說明 o 46.20 "Warehouse Manager" 應為 "DB2 Warehouse Manager" ------------------------------------------------------------------------ 附錄與後記 * 附錄 A. 注意事項 o A.1 商標 * 索引 ------------------------------------------------------------------------ 前言 歡迎使用 DB2 Universal Database 版本 7 FixPak 5! 註: 設定字型為單距以方便檢視「版本注意事項」。 DB2 Universal Database 與 DB2 Connect 支援網站會定期更新。 請跳至: http://www.ibm.com/software/data/db2/udb/winos2unix/support,以取得最新的資 訊。 本檔案包含下列的產品資訊;在 DB2 的手冊印製時,尚無法取得這部份的資訊: IBM DB2 Universal Database Personal Edition,版本 7.2 IBM DB2 Universal Database Workgroup Edition,版本 7.2 IBM DB2 Universal Database Enterprise Edition,版本 7.2 IBM DB2 Data Links Manager,版本 7.2 IBM DB2 Universal Database Enterprise - Extended Edition,版本 7.2 IBM DB2 Query Patroller,版本 7.2 IBM DB2 Personal Developer's Edition,版本 7.2 IBM DB2 Universal Developer's Edition,版本 7.2 IBM DB2 Data Warehouse Manager,版本 7.2 IBM DB2 Relational Connect,版本 7.2 另有一個「版本注意事項」檔案為 READCON.TXT, 這個檔案提供下列產品的資訊: IBM DB2 Connect Personal Edition,版本 7.2 IBM DB2 Connect Enterprise Edition,版本 7.2 您可以從 IBM 軟體網站 http://www.ibm.com/software/data/db2/lifesciencesdataconnect/library.html 下載 DB2 Life Sciences Data Connect 產品文件。您可以從 http://www.ibm.com/software/data/db2/lifesciencesdataconnect 線上取得本產品 的相關資訊。 FixPak 4 的下列書籍已更新, 而您可以從 http://www.ibm.com/software/data/db2/udb/winos2unix/support 線上下載最新的 PDF。 這些注意事項中的資訊是用以補充更新的參照。您也可以在 CD 中取得所有已 更新的文件。透過 DB2 服務並使用 PTF 號碼 U478862,即可訂購此 CD。您可以從 http://www.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/help.d2w/report 取得聯絡「DB2 服務」的相關資訊。 Administration Guide 應用程式開發手冊 Application Development Guide Command Reference Data Recovery and High Availability Guide and Reference 資料倉儲中心 Administration Guide 訊息參考手冊 SQL Reference DB2 Warehouse Manager 安裝手冊 「新特性介紹」一書中包含部份的 DB2 版本 7.2 主要增加的概觀。如果您沒有「新 特性介紹」一書的 7.2 版本, 可以從 http://www.ibm.com/software/data/db2/udb/winos2unix/support 檢視及下載。 有關 DB2 產品系列的最新資訊,您可以訂閱免費的 DB2 Magazine。線上版的雜誌可 於 http://www.db2mag.com 取得; 在網頁上也有訂閱雜誌的指示。 註: 在整個「版本注意事項」中,凡適用於 Windows NT 的參考資料尚適用於 Windows 2000。這項參照在4.4, 支援 Windows ME、Windows XP 和 Windows 2000 Datacenter Edition 平台列出的產品環境定義中,也包含 Windows XP (除非另有指定)。 註: 在頁面左側的修訂列 (|) 是表示該行自「版本注意事項」第一版之後有新增或 修改。 ------------------------------------------------------------------------ 請先讀我 ------------------------------------------------------------------------ FixPak 5 重點 這個 FixPak 新增了下列資訊。本列示只是概要性的介紹主要的文件變更重點。請務 必閱讀與您工作環境有關的所有版本注意事項章節,隨時掌握最新更新資料。 * 執行工具之前的其它設置 * 2.4, Linux 上的 DBCS 限制 * 2.11, 使用 WebSphere 3.5.5 時的分區段違規 * 4.19, Solaris 核心程式架構參數 (建議值) * 5.15, 將 Data Links File System Filter (DLFF) 安裝的記載減到最少 * 5.26, Tivoli Space Manager 與 Data Links 整合 * 9.4, DB2 Registry and Environment Variables * 10.1.1, How to Use Suspended I/O * 12.4, db2inidb - 起始設定鏡映資料庫 * 12.5, GET ROUTINE 指令中的額外選項 * 13.5, Tivoli Storage Manager -- LAN Free Data Transfer * 14.4, db2move -- New Options Available * 23.1, 現在命令中心交談頁可以辨識陳述式結束字元 * 28.2, 倉儲伺服器加強功能 * 28.3, 使用 OS/390 代理程式執行 Trillium 批次系統 JCL * 28.4, 資料倉儲中心中的二個新範例程式 * 36.2, 變更節點狀態 * 41.2, 訊息更新 * 42.7, Additional Options in the GET DIAGNOSTICS Statement * 42.8, ORDER BY in Subselects * 42.9, New Input Argument for the GET_ROUTINE_SAR Procedure ------------------------------------------------------------------------ 產品注意事項 ------------------------------------------------------------------------ 2.1 DB2 for Solaris 版本 7 所支援的 CPU UltraSparc 之前的 CPU 版本並不支援。 ------------------------------------------------------------------------ 2.2 Red Flag Linux 的中文語言環境修正程式 如果您使用「簡體中文紅旗 Linux 伺服器版本 1.1」, 請洽詢「紅旗」以取得簡體 中文語言環境修正程式。沒有版本 1.1 的簡體中文語言環境修正程式, DB2 就無法 辨識簡體中文的字碼頁是 1386。 ------------------------------------------------------------------------ 2.3 日文和簡體中文 Linux 環境之 DB2 for Linux 的附加語言環境設定 當您要在日文或簡體中文 Linux 系統上使用 Java GUI 工具(例如「控制中心」) 時, 則需要額外的語言環境設定。若沒有這項設定則無法正確顯示日文或中文字元。 請在您的使用者設定檔裡加入下列設定, 或者在每個「控制中心」呼叫之前從指令行 執行此設定。 針對日文系統: export LC_ALL=ja_JP 針對簡體中文系統: export LC_ALL=zh_CN ------------------------------------------------------------------------ 2.4 Linux 上的 DBCS 限制 Glibc 層次 1.95、2.1 或 2.2 的日文、韓文、簡體中文和繁體中文 Linux 平台,無 法顯示 DB2 UDB 使用的某些字元。如果您使用其中任一平台,就無法在 DB2 指令行 上顯示 IBM 字碼頁上的字元以及其後輸入的任何字元。 ------------------------------------------------------------------------ 2.5 Microsoft Internet Explorer 上的控制中心問題 這是 Internet Explorer 安全性選項設定所造成的問題。 「控制中心」使用未簽署 的 jar,因此存取系統資訊被安全管理程式停用了。 若要消除這個問題,請重新配置 IE 的安全性選項,如下所示: 1. 選取檢視功能表 (IE4) 或工具功能表 (IE5) 上的 Internet 選項。 2. 在「安全性」頁面,選取信任的網站。 3. 按一下新增網站...。 4. 將「控制中心 Web 伺服器」新增到信任的網站清單。 如果控制中心 Web 伺服 器在相同的網域中,可能只須要將 Web 伺服器名稱加入即可 (不含網域名稱)。 例如: http://ccWebServer.ccWebServerDomain http://ccWebServer 註: 在輸入 URL 時,您必須使用 https:// 字首, 或取消選取此區域內的所 有網站需要伺服器驗證 (https:) 選項, 以新增網站 5. 按一下確定。 6. 按一下設定值...(IE4), 或按一下自訂層次... (IE5)。 7. 捲動到下方的 Java --> Java 權限,再選取自訂。 8. 按一下 Java 自訂設定...。 9. 選取「編輯許可權」頁面。 10. 捲動到下方的「未簽名的內容 --> 執行未簽名的內容 --> 其它未簽名的許可權 --> 系統資訊」,再選取啟動。 11. 按一下每個開啟視窗的確定。 可將 FixPak 2 引用到 DB2 伺服器, 則對於舊版的控制中心從屬站,應該不會有此 處所描述的問題。然而,在 DB2 版本 7.2, 舊版控制中心從屬站幾乎失去了所有的 功能。 這裡所說的舊版是指任何版本 6 FixPak 6 以前的從屬站, 以及任何版本 7 FixPak 2 以前的從屬站。版本 5 的從屬站並不受影響。 建議的修正方式是升級任何受到影響的從屬站。版本 6 從屬站必須升級到 FixPak 6 或更新版本, 版本 7 從屬站必須升級到 FixPak 2 或更新版本。 ------------------------------------------------------------------------ 2.7 Netscape CD 不隨附於 DB2 UDB Netscape CD 不再隨附於 DB2 UDB。請從 http://www.netscape.com,獲取 Netscape 產品。 ------------------------------------------------------------------------ 2.8 XML Readme 檔的錯誤 在 DB2 XML Extender 版本 7.1 README.TXT 檔的「注意事項」中提到: 3. DB2 UDB 的預設版本是 DB2 UDB 版本 7.1。若您要在 AIX 與 Solaris 使用 DB2 UDB 版本 6.1, 請確定您應該與 DB2 UDB 版本 6.1 案例及 DB2 UDB 版本 6.1 檔案庫一起執行。 這是不正確的。DB2 XML Extender 僅在 DB2 版本 7.1 與 7.2 被支援。 檔案 readme.aix、readme.nt 與 readme.sun 所列示的軟體需求為: * DB2 UDB 6.1 (FP1_U465423) 或以上 (AIX) * DB2 Universal Database 版本 6.1 或以上 (安裝 FixPak 3) (NT) * DB2 UDB 版本 6.1 (FixPak FP1_U465424) 或以上 (Sun) 這是不正確的。DB2 XML Extender 需要 DB2 版本 7.1 或 7.2。 ------------------------------------------------------------------------ 2.9 DB2 版本 7.2 中新增的 Business Intelligence 加強功能 在「新特性介紹」版本 7.2 一書與其他文件中,關於新的 Business Intelligence 加強功能的參考資料已新增於版本 7.2 中。 這些加強功能會在日後可使用。 ------------------------------------------------------------------------ 2.10 FixPak 2A 與更新版本在 IBM DB2 OLAP Server 中發生問題 如果您在 UNIX 上使用 IBM DB2 OLAP Server,則在安裝了 DB2 Universal Database V7 的 FixPak 2A 後, DB2 OLAP Server 可能會發生問題。 FixPak 2A 及更新版本 的 FixPaks 會安裝支援 Unicode 的新 ODBC 驅動程式, 但 DB2 OLAP Server 不支 援這些新驅動程式。對於 DB2 OLAP Server 的解決方法是切換您的 ODBC 檔案, 並 指向非 UNICODE 的 ODBC 驅動程式。 非 UNICODE 的驅動程式已經更名,在名稱中加了 "_36"。 例如,若為 Solaris, 驅 動程式 libdb2.so 已更名為 libdb2_36.so。如需變更 ODBC 驅動程式的相關資訊, 請參閱 OLAP 安裝與使用手冊一書, 第 4 章「在 AIX、Solaris 作業環境及 HP-UX 上安裝」中的「載入及架構 SQL 介面的 ODBC」。 ------------------------------------------------------------------------ 2.11 使用 WebSphere 3.5.5 時的分區段違規 如果您在 Linux390 上使用 DB2 V7.2 FixPak 4 或更新版本來執行 WebSphere 3.5.5 使用者設定檔範例,您可能會收到 SIGSEGV 11 (*) 分區段違規通知。這個問題與 JDK 上的一項錯誤有關,JDK 1.2.2 和 JDK 1.3 都會發生這個問題。 這個問題還可能影響其它 JDBC 應用程式。 JDK 1.2.2 的 11 月服務版次會修正這個問題。JDK 1.3 的 1 月服務版次也將修正 JDK 1.3。 若要解決這個問題,您可以使用下列指令來關閉 JIT: export JAVA_COMPILER=NONE ------------------------------------------------------------------------ 線上文件(HTML、PDF 與「搜尋」)附註 ------------------------------------------------------------------------ 3.1 Windows 2000 作業系統所支援的 Web 瀏覽器 我們建議您在 Windows 2000 上使用 Microsoft Internet Explorer。 若您使用 Netscape,請注意下列事項: * 使用 Netscape 會讓 Windows 2000 上的 DB2 線上資訊搜尋耗時較長。 Netscape 將使用所有可用的 CPU 資源,並且似乎是不明確地執行。 當最後傳 回搜尋結果時,我們建議您在提出搜尋之後,在另一個視窗上按一下以變更焦 點。 接著會在合理的時間量裡傳回搜尋結果。 * 您可能會注意到:當您要求的說明正確地顯示在一個 Netscape 瀏覽器視窗內, 然而,如果瀏覽器視窗一直開啟著,且稍後又從不同的「控制中心」部份要求說 明, 則瀏覽器裡不會有任何改變。 若關閉瀏覽器視窗並再次要求說明,將會出 現正確的說明。 您可透過 3.4, 啟動 Netscape 時產生的錯誤訊息 裡的下列步 驟來修正這個問題。 您也可以在要求「控制中心」說明之前關閉瀏覽器視窗, 以避免這個問題。 * 要求「控制中心」的說明,或者「資訊中心」的主題時,您可能會收到錯誤訊 息。 要修正這個問題,請遵循 3.4, 啟動 Netscape 時產生的錯誤訊息 裡的步 驟。 ------------------------------------------------------------------------ 3.2 在 Solaris 系統下搜尋 DB2 線上資訊 如果您有在 Solaris 系統下搜尋 DB2 線上資訊的問題, 請檢查系統在 /etc/system 內的核心程式參數。以下是 DB2 搜尋系統所需核心程式參數的最小值, NetQuestion: semsys:seminfo_semmni 256 semsys:seminfo_semmap 258 semsys:seminfo_semmns 512 semsys:seminfo_semmnu 512 semsys:seminfo_semmsl 50 shmsys:shminfo_shmmax 6291456 shmsys:shminfo_shmseg 16 shmsys:shminfo_shmmni 300 欲設定核心程式參數,在 /etc/system 之後新增下列指令: set = value 欲使任何新建或變更的值生效,您必須重新啟動系統。 ------------------------------------------------------------------------ 3.3 切換 NetQuestion for OS/2 以使用 TCP/IP 切換g NetQuestion 以在 OS/2 系統上使用 TCP/IP 的指示不完整。 這些指示的 *.cfg 檔位置是 NetQuestion 安裝目錄的資料次目錄。 您可以輸入下列其中一項指 令來決定 NetQuestion 安裝目錄: echo %IMNINSTSRV% //適用 SBCS 安裝 echo %IMQINSTSRV% //適用 DBCS 安裝 ------------------------------------------------------------------------ 3.4 啟動 Netscape 時產生的錯誤訊息 當您啟動 Netscape 時,如果您發現下列的錯誤訊息: 找不到<檔案路徑>之檔案 (或是其中的元件)。 檢查並確定路徑和檔名的正確性,以及所有必要的檔案庫為有效性。 無法開啟 "D:\Program Files\SQLLIB\CC\..\doc\html\db2help\XXXXX.htm" 您應該執行下列步驟,以更正在 Windows NT、95 或 98 上的這個問題 (請參閱以下 步驟,以了解如何在 Windows 2000 上執行): 1. 從「開始」功能表,選取「程式集」-->「Windows 檔案總管」。即可開啟 「Windows 檔案總管」。 2. 從「Windows 檔案總管」選取「檢視」-->「資料夾選項」。即可開啟「資料夾 選項」筆記本。 3. 按一下檔案類型標籤。開啟「檔案類型」頁。 4. 在登錄檔案類型欄位中選取 Netscape Hypertext Document,並按一下「編輯」 。 即可開啟「編輯」檔案類型視窗。 5. 選取動作欄位中的開啟。 6. 按一下編輯按鈕。類型視窗的編輯動作開啟。 7. 取消使用 DDE 的勾選框。 8. 在用來執行動作的應用程式欄位中, 請確定 "%1" 出現在字串的最後面 (包括 引號以及第一個引號之前的空格)。 若在 Windows 2000 上發現錯誤訊息,您應該執行下列步驟: 1. 從開始功能表,選取 Windows 檔案總管。即可開啟「Windows 檔案總管」。 2. 從「Windows 檔案總管」,選取工具 --> 資料夾選項。即可開啟「資料夾選 項」筆記本。 3. 按一下檔案類型標籤。 4. 在「檔案類型」頁上、已登錄的檔案類型 欄位中,強調顯示:HTM Netscape Hypertext Document,再按一下進階 。即可開啟「編輯檔案類型」視窗。 5. 強調顯示動作欄位中的「開啟」。 6. 按一下編輯按鈕。即可開啟「編輯類型的動作」視窗。 7. 取消使用 DDE 的勾選框。 8. 在用來執行動作的應用程式欄位中, 請確定 "%1" 出現在字串的最後面 (包括 引號以及第一個引號之前的空格)。 9. 按一下確定。 10. 針對 HTML Netscape Hypertext Document 和 SHTML Netscape Hypertext Document 檔案類型重複步驟 4 到 8。 ------------------------------------------------------------------------ 3.5 UNIX 系統上 Adobe Acrobat Reader 的架構需求 在 UNIX 型平台,Acrobat Reader 只提供英文版。欲以英文以外的語言環境開啟 PDF 檔案, 系統會傳回錯誤訊息。訊息指出 PDF 檔案的字型存取或解壓縮產生錯誤,但 是,實際上是因為英文版的 Acrobat Reader 無法在非英文語言環境的 UNIX 中執 行。 欲檢視此 PDF 檔案,啟動英文版的 Acrobat Reader 前,先執行下列其中一項步驟, 切換至英文的語言環境: * 編輯 Acrobat Reader 的啟動 script,在啟動 script 內, #!/bin/sh 陳述式 之後新增下列指令: LANG=C;export LANG 這樣的話,當 Acrobat Reader 被其它的應用程式啟動,如被 Netscape 導引器 或應用程式說明功能表啟動時,會產生正確的行為。 * 在命令提示內輸入 LANG=C,將 Acrobat Reader 的應用程式環境設定為英文。 進一步資訊,請連線 Adobe 系統 (http://www.Adobe.com)。 ------------------------------------------------------------------------ 3.6 SQL Reference 僅提供一個 PDF 檔 每本書籍的「使用 DB2 檔案庫」附錄中,指出 SQL Reference 為 PDF 格式且有兩 冊。這是不正確的。 雖然列印的書籍有兩冊,而且兩冊相對應的書號都正確,但是只有一個 PDF 檔案,它 包含了兩冊。PDF 檔名是 db2s0x70。 ------------------------------------------------------------------------ 安裝與架構 部份目錄 * 一般安裝、移轉及架構資訊 o 4.1 下載所有支援的 DB2 從屬站的安裝資料包 o 4.2 附加的必要 Solaris 修補層次 o 4.3 Netscape LDAP 目錄支援 + 4.3.1 擴充 Netscape LDAP 綱目 o 4.4 支援 Windows ME、Windows XP 和 Windows 2000 Datacenter Edition 平台 + 4.4.1 Windows XP + 4.4.1.1 限制 + 4.4.2 Windows ME + 4.4.2.1 限制 + 4.4.3 Windows 2000 Datacenter Server o 4.5 在 Windows 2000 上安裝 DB2 o 4.6 在 Windows 2000 Terminal Server 管理模式下執行 DB2 o 4.7 Microsoft SNA Server 和 SNA 多站更新 (兩階段確定) 支援 o 4.8 Windows NT (CS/NT) 的 IBM Communications 伺服器定義使用者 ID 和通行碼 + 4.8.1 節點定義 o 4.9 如果可移除式磁碟機未連接,則 DB2 安裝會中斷 o 4.10 在 Windows 2000 上使用 CLP 時發生錯誤 SQL1035N o 4.11 關於概略表以特別暫存區定義的移轉問題 o 4.12 Windows 2000 的 IPX/SPX 通信協定支援 o 4.13 升級 DB2 前一版之前先停止 DB2 程序 o 4.14 若已安裝其它 DB2 產品,請在安裝 DB2 之後執行 db2iupdt o 4.15 設定 Linux 環境以執行 DB2 控制中心 o 4.16 DB2 Universal Database Enterprise Edition 及 DB2 Connect Enterprise Edition for Linux on S/390 o 4.17 Linux for S/390 上可能的資料流失 o 4.18 Linux 上的 DB2 的 Gnome 和 KDE 桌面整合 o 4.19 Solaris 核心程式架構參數 (建議值) o 4.20 DB2 Universal Database Enterprise - Extended Edition for UNIX 快速入門 o 4.21 HP-UX 的 shmseg 核心參數 o 4.22 移轉 IBM Visual 倉儲控制資料庫 o 4.23 使用 db2uiddl 指令移轉唯一索引 o 4.24 64 位元 AIX 版本安裝錯誤 + 4.24.1 使用 SMIT o 4.25 移轉期間發生的錯誤 o 4.26 IBM(R) DB2(R) Connect 授權啟動 + 4.26.1 使用「授權中心」安裝您的授權碼並設定授權類型 + 4.26.2 使用 db2licm 指令安裝您的授權碼並設定授權類型 + 4.26.3 分散式安裝的授權注意事項 o 4.27 存取倉儲控制資料庫 o 4.28 Enterprise Edition UNIX CD-ROM 的試用產品 o 4.29 DB2 Connect Enterprise Edition UNIX CD-ROM 的試用產品 o 4.30 字碼頁及語言支援資訊 - 更正 * DB2 Data Links Manager 快速入門 o 5.1 AIX 5.1 上的支援 o 5.2 Dlfm 的啟動失敗訊息:取得 afsfid 字首時發生錯誤 o 5.3 設定備份保存檔的 Tivoli Storage Manager 類別 o 5.4 DFS 從屬站啟動程式的磁碟空間需求 o 5.5 監督在 AIX 的資料鏈結檔案管理程式後端程序 o 5.6 安裝和架構 DB2 Data Links Manager for AIX: DCE-DFS 環境裡的 額外安裝注意事項 o 5.7 失敗的 "dlfm add_prefix" 指令 o 5.8 很少見的事件:複製常駐程式在 dlfm 停止時沒有停止 o 5.9 安裝和架構 DB2 Data Links Manager for AIX: 使用 db2setup 公 用程式在 AIX 上安裝 DB2 Data Links Manager o 5.10 安裝和架構 DB2 Data Links Manager for AIX:DCE-DFS 後置安裝 作業 o 5.11 安裝和架構 DB2 Data Links Manager for AIX: 使用 Smit 來手動 安裝 DB2 Data Links Manager o 5.12 安裝和架構 DB2 Data Links 的 DFS 從屬站啟動程式 o 5.13 安裝和架構 DB2 Data Links Manager for Solaris o 5.14 在 Windows NT 上資料鏈結中的 Administrator 群組專用權 o 5.15 將 Data Links File System Filter (DLFF) 安裝的記載減到最少 + 5.15.1 在安裝後記載訊息 + 5.15.2 將 Sun Solaris 系統上的記載作業縮至最小 o 5.16 DATALINK 復置 o 5.17 捨棄 Data Links Manager o 5.18 使用 SMIT 解除安裝 DLFM 元件可能會除去額外的檔案集 o 5.19 開始之前/決定主電腦名稱 o 5.20 使用 DLFM:從 DB2 資料庫捨棄 DB2 Data Links Manager 後的清除 動作 o 5.21 dlfm Client_conf 失效時的使用者動作 o 5.22 DLFM1001E (新的錯誤訊息) o 5.23 DLFM 設定架構檔選項 o 5.24 復置檔案時可能發生的問題 o 5.25 在 AIX 上執行 Data Links/DFS Script dmapp_prestart 時發生錯 誤 o 5.26 Tivoli Space Manager 與 Data Links 整合 + 5.26.1 功能限制 o 5.27 第 4 章 安裝和架構 DB2 Data Links Manager for AIX + 5.27.1 一般安裝注意事項 + 5.27.1.1 從 DB2 File Manager 版本 5.2 移轉到 DB2 Data Links Manager 版本 7 o 5.28 第 6 章. 驗證 AIX 上的安裝 + 5.28.1 NFS 環境中的解決方案 * 安裝與架構補充資料 o 6.1 第 5 章 在 UNIX 作業系統上安裝 DB2 從屬站 + 6.1.1 HP-UX 核心程式架構參數 o 6.2 第 12 章 執行您自己的應用程式 + 6.2.1 使用 Run-Time Client 連結資料庫公用程式 + 6.2.2 UNIX 從屬站使用 ODBC 存取 DB2 o 6.3 第 24 章 設置聯合系統來存取多重資料來源 + 6.3.1 聯合系統 + 6.3.2 限制 + 6.3.3 安裝 DB2 Relational Connect + 6.3.3.1 在 Windows NT 伺服器上安裝 DB2 Relational Connect + 6.3.3.2 在 UNIX 伺服器上安裝 DB2 Relational Connect o 6.4 第 26 章 存取 Oracle 資料來源 + 6.4.1 文件錯誤 o 6.5 存取 Sybase 資料來源 + 6.5.1 新增 Sybase 資料來源至聯合伺服器 + 6.5.1.1 步驟 1:設定環境變數並更新設定檔登錄 (僅適用於 AIX 及 Solaris) + 6.5.1.2 步驟 2:將 DB2 鏈結至 Sybase 從屬站軟體 (僅 AIX 與 Solaris) + 6.5.1.3 步驟 3:重新使用 DB2 案例 (僅適用於 AIX 及 Solaris) + 6.5.1.4 步驟 4:建立並設定介面檔案 + 6.5.1.5 步驟 5:建立外層 + 6.5.1.6 步驟 6:選用的:設定 DB2_DJ_COMM 環境變數 + 6.5.1.7 步驟 7:建立伺服器 + 6.5.1.8 步驟 8:選用的:設定 CONNECTSTRING 伺服器選項 + 6.5.1.9 步驟 9:建立使用者對映 + 6.5.1.10 步驟 10:建立表格與概略表的暱名 + 6.5.2 指定 Sybase 字碼頁 o 6.6 使用 ODBC 存取 Microsoft SQL Server 資料來源(新增章節) + 6.6.1 新增 Microsoft SQL Server 資料來源至聯合伺服器 + 6.6.1.1 步驟 1:設定環境變數 (僅 AIX) + 6.6.1.2 步驟 2:執行 Shell Script (僅 AIX) + 6.6.1.3 步驟 3:選用的:設定 DB2_DJ_COMM 環境變數 (僅適 用於 AIX) + 6.6.1.4 步驟 4:重新使用 DB2 案例 (僅 AIX) + 6.6.1.5 步驟 5:建立外層 + 6.6.1.6 步驟 6:建立伺服器 + 6.6.1.7 步驟 7:建立使用者對映 + 6.6.1.8 步驟 8:建立表格與概略表的暱名 + 6.6.1.9 步驟 9:選用的:獲得 ODBC 追蹤 + 6.6.2 複查 Microsoft SQL Server 字碼頁 (僅適用於 Windows NT) o 6.7 存取 Informix 資料來源(新增章節) + 6.7.1 新增 Informix 資料來源至聯合伺服器 + 6.7.1.1 步驟 1:設定環境變數並更新設定檔登錄 + 6.7.1.2 步驟 2︰鏈結 DB2 至 Informix 從屬站軟體 + 6.7.1.3 步驟 3:重新使用 DB2 案例 + 6.7.1.4 步驟 4︰建立 Informix sqlhosts 檔案 + 6.7.1.5 步驟 5:建立外層 + 6.7.1.6 步驟 6:選用的:設定 DB2_DJ_COMM 環境變數 + 6.7.1.7 步驟 7:建立伺服器 + 6.7.1.8 步驟 8︰建立使用者對映 + 6.7.1.9 步驟 9︰建立表格、概略表與 Informix 同義字的暱 名 ------------------------------------------------------------------------ 一般安裝、移轉及架構資訊 ------------------------------------------------------------------------ 4.1 下載所有支援的 DB2 從屬站的安裝資料包 若要下載所有支援的 DB2 從屬站之安裝資料包,包括所有版本 7 之前的從屬站, 請 造訪 IBM DB2 FixPaks and Clients 網站,網址為: http://www-4.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/download.d2w/report 。 ------------------------------------------------------------------------ 4.2 附加的必要 Solaris 修補層次 除了列示在DB2 for UNIX 快速入門手冊內的修補程式之外, 還列示了 DB2 Universal Database 版本 7 for Solaris 版本 2.6 所需要的 106285-02 或更新的 修補程式。 ------------------------------------------------------------------------ 4.3 Netscape LDAP 目錄支援 Netscape LDAP Server 的支援層次是 v4.12 或更新版本。 4.3.1 擴充 Netscape LDAP 綱目 Netscape Directory Server 可以讓應用程式在下列兩個檔案中新增屬性及物件類別 定義, 以擴充綱目:slapd.user_oc.conf 及 slapd.user_at.conf。這兩個檔案是位 於 \slapd-\config 目錄中。 必須新增 DB2 屬性至 slapd.user_at.conf,如下所示: 註: 這個環境定義中的 bin、cis、ces 和 dn,分別代表二進位、不區分大小寫的字 串、區分大小寫的字串和識別名稱。 : ############################################################################ # # IBM DB2 Universal Database V7.2 # 屬性定義 # ############################################################################ attribute binProperty 1.3.18.0.2.4.305 bin attribute binPropertyType 1.3.18.0.2.4.306 cis attribute cesProperty 1.3.18.0.2.4.307 ces attribute cesPropertyType 1.3.18.0.2.4.308 cis attribute cisProperty 1.3.18.0.2.4.309 cis attribute cisPropertyType 1.3.18.0.2.4.310 cis attribute propertyType 1.3.18.0.2.4.320 cis attribute systemName 1.3.18.0.2.4.329 cis attribute db2nodeName 1.3.18.0.2.4.419 cis attribute db2nodeAlias 1.3.18.0.2.4.420 cis attribute db2instanceName 1.3.18.0.2.4.428 cis attribute db2Type 1.3.18.0.2.4.418 cis attribute db2databaseName 1.3.18.0.2.4.421 cis attribute db2databaseAlias 1.3.18.0.2.4.422 cis attribute db2nodePtr 1.3.18.0.2.4.423 dn attribute db2gwPtr 1.3.18.0.2.4.424 dn attribute db2additionalParameters 1.3.18.0.2.4.426 cis attribute db2ARLibrary 1.3.18.0.2.4.427 cis attribute db2authenticationLocation 1.3.18.0.2.4.425 cis attribute db2databaseRelease 1.3.18.0.2.4.429 cis attribute DCEPrincipalName 1.3.18.0.2.4.443 cis 必須新增 DB2 物件類別至 slapd.user_oc.conf 檔案,如下所示: ############################################################################ # # IBM DB2 Universal Database V7.2 # 物件類別定義 # ############################################################################ objectclass eProperty oid 1.3.18.0.2.6.90 requires objectClass allows cn, propertyType, binProperty, binPropertyType, cesProperty, cesPropertyType, cisProperty, cisPropertyType objectclass eApplicationSystem oid 1.3.18.0.2.6.8 requires objectClass, systemName objectclass DB2Node oid 1.3.18.0.2.6.116 requires objectClass, db2nodeName allows db2nodeAlias, host, db2instanceName, db2Type, description, protocolInformation objectclass DB2Database oid 1.3.18.0.2.6.117 requires objectClass, db2databaseName, db2nodePtr allows db2databaseAlias, description, db2gwPtr, db2additionalParameters, db2authenticationLocation, DCEPrincipalName, db2databaseRelease, db2ARLibrary 新增 DB2 綱目定義後,並須重新啟動 Directory Server 才能讓所有變更生效。 ------------------------------------------------------------------------ 4.4 支援 Windows ME、Windows XP 和 Windows 2000 Datacenter Edition 平台 現在 DB2 支援 Microsoft Windows ME、Windows XP 和 Windows 2000 Datacenter Edition 平台。下面介紹平台特有的其它資訊。 4.4.1 Windows XP 下列產品和版本若是以 FixPak 4 或更新版本安裝,即可支援 32 位元 Windows XP: * IBM DB2 UDB Personal Edition 版本 7.2 * IBM DB2 Personal Developer's Edition 版本 7.2 * IBM DB2 Universal Developer's Edition 版本 7.2 * IBM DB2 Connect Personal Edition 版本 7.2 * IBM DB2 Connect Enterprise Edition 版本 7.2 * IBM DB2 UDB Workgroup Edition 版本 7.2 * IBM DB2 UDB Enterprise Edition 版本 7.2 * IBM DB2 Run-Time Client 版本 7.2 * IBM DB2 Administration Client 版本 7.2 * IBM DB2 Application Development Client 版本 7.2 DB2 在 Windows XP 系統上支援的國家語言,與其它版本相同。 4.4.1.1 限制 當您在安裝時輸入使用者 ID 和通行碼時,可能會收到一則訊息指出您在安裝畫面上 輸入的使用者帳戶無效,但事實上是有效的。發生這種情形是因為電腦上已經有您輸 入的使用者 ID。如果您輸入電腦上沒有的使用者名稱,就不會發生這種問題。 如果您想在 db2admin 以外的其它使用者帳戶下安裝 DB2,請先確定帳戶名稱符合 DB2 的命名規則。最重要的一點是,名稱中不能有任何空格。例如,my_name 是正確 的,my name 是錯誤的。 如果您在安裝產品時收到錯誤 1052,請執行下列步驟: 1. 讓錯誤視窗保持開啟。 2. 開啟指令視窗。 3. 執行指令 db2start.exe。 4. 使用指令行上顯示的使用者的通行碼,來執行錯誤視窗中指定的指令。 5. 回到錯誤視窗,然後按一下確定。 現在,您可以繼續安裝。 如果您發現「控制中心」無法正確顯示您使用的「簡體中文」字型, 請修改 sqllib\java\java12\jdk\jre\lib\font.properties.zh, 方法是將登錄項目 filename.\u5b8b\u4f53=simsun.ttf 換成 filename.\u5b8b\u4f53=simsun.ttc。 4.4.2 Windows ME 下列產品和版本若是以 FixPak 2 或更新版本安裝,即可支援 Windows ME: * IBM DB2 UDB Personal Edition 版本 7.1 * IBM DB2 Personal Developer's Edition 版本 7.1 * IBM DB2 Universal Developer's Edition 版本 7.1 * IBM DB2 Connect Personal Edition 版本 7.1 * IBM DB2 Run-Time Client 版本 7.1 * IBM DB2 Administration Client 版本 7.1 * IBM DB2 Application Development Client 版本 7.1 4.4.2.1 限制 目前 Window ME 尚未支援「HTML 搜尋伺服器」功能。 當您解除安裝 DB2 時,您可能會收到一則錯誤訊息指出找不到 MFC42U.DLL 檔。若要 完全解除安裝 DB2,請在解除安裝活動完成後,手動刪除 sqllib 目錄。 4.4.3 Windows 2000 Datacenter Server 下列 DB2 產品已經獲得 Windows 2000 Datacenter Server、Windows 2000 Advanced Server 和 Windows 2000 Server 的認證: * IBM DB2 Universal Database Enterprise - Extended Edition 版本 7.2 * IBM DB2 Universal Database Enterprise Edition 版本 7.2 * IBM DB2 Database Workgroup Edition 版本 7.2 * IBM DB2 Connect Enterprise Edition 版本 7.2 ------------------------------------------------------------------------ 4.5 在 Windows 2000 上安裝 DB2 在 Windows 2000 上,安裝在前版 DB2 之上時,或是重新安裝現行版本時, 請確定 將所有 DB2 服務的回復選項設定為「Take No Action」。 ------------------------------------------------------------------------ 4.6 在 Windows 2000 Terminal Server 管理模式下執行 DB2 對於 DB2 UDB Version 7.1,FixPak 3 及更高的版本,DB2 可在 Windows 2000 Terminal Server 管理模式下執行。在此之前,您無法在 Windows 2000 Terminal Server 管理模式的從屬站階段作業下執行 DB2。 ------------------------------------------------------------------------ 4.7 Microsoft SNA Server 和 SNA 多站更新 (兩階段確定) 支援 當 Microsoft SNA Server 是使用中的 SNA 產品時, 主電腦和 AS/400 應用程式無 法存取使用 SNA 兩階段確定的 DB2 UDB 伺服器。任何表示支援以上功能的 DB2 UDB 出版品都是不正確的。必須要有 IBM Communications Server for Windows NT 5.02 版或以上的版本。 註: 使用 DB2 UDB for Windows 來存取主電腦及 AS/400 資料庫伺服器的應用程式 可以使用 Microsoft SNA Server 版本 4 Service Pack 3 或以上版本來使用 SNA 兩階段確定。 ------------------------------------------------------------------------ 4.8 Windows NT (CS/NT) 的 IBM Communications 伺服器定義使用者 ID 和通行碼 如果您使用 APPC 作為遠端 DB2 從屬站與 DB2 伺服器連接之通訊協定, 同時,您把 CS/NT 當成 SNA 產品使用,請確定您已在 CS/NT 架構檔內正確的設定了下列關鍵 字。通常您可以在 x:\ibmcs\private 目錄下找在該檔。 4.8.1 節點定義 TG_SECURITY_BEHAVIOR 此參數容許使用者決定,如果 TP 不是機密保護的架構,節點是如何處理出現在 ATTACH 內的安全資訊。 IGNORE_IF_NOT_DEFINED 此參數容許使用者決定是否讓機密保護參數出現在 ATTACH 內,同時,若 TP 不 是機密保護的架構時可忽略它們。 若您使用 IGNORE_IF_NOT_DEFINED,則無須於 CS/NT 定義使用者 ID 和通行 碼。 VERIFY_EVEN_IF_NOT_DEFINED 此參數容許使用者決定是否讓機密保護參數出現在 ATTACH 內, 並驗證它們, 即使 TP 未架構為機密保護。這是預設值。 若您使用 VERIFY_EVEN_IF_NOT_DEFINED,則必須於 CS/NT 內定義使用者 ID 和 通行碼。 欲定義 CS/NT 使用者 ID 和通行碼,請執行下列步驟: 1. 開始 --> 程式集 --> IBM Communications Server --> SNA Node Configuration。 即開啟「歡迎使用 Communications Server 架構視窗」。 2. 選擇您要修改的架構檔。按一下「下一步」。所選擇的架構實務範例視窗開啟。 3. 強調顯示 CPI-C, APPC 或 5250 模擬程式。按一下「完成」。即可開啟 Communications Server SNA 節點視窗。 4. 按一下 CPI-C 和 APPC 旁邊的 [+] 號。 5. 按一下 LU6.2 機密保護旁邊的 [+] 號。 6. 右邊按一下使用者通行碼,並選取建立。定義使用者 ID 通行碼的視窗開啟。 7. 填寫使用者 ID 和通行碼。按一下確定。 按一下完成以接受變更。 ------------------------------------------------------------------------ 4.9 如果可移除式磁碟機未連接,則 DB2 安裝會中斷 在安裝 DB2 的期間,如果電腦的可移除式磁碟機未連接, 則在選取安裝類型之後, 安裝程式可能會中斷。 若要解決此問題,在執行安裝程式時指定 -a 選項: setup.exe -a ------------------------------------------------------------------------ 4.10 在 Windows 2000 上使用 CLP 時發生錯誤 SQL1035N 如果安裝 DB2 到只有某些使用者 (例如,管理者) 才具有寫入權的目錄, 一般使用 者會在嘗試使用 DB2 命令行處理器時收到錯誤 SQL1035N。 若要解決此問題,應在所有使用者都具有寫入權的目錄中安裝 DB2。 ------------------------------------------------------------------------ 4.11 關於概略表以特別暫存區定義的移轉問題 資料庫移轉之後,如果特別暫存區 USER 或 CURRENT SCHEMA 被用來定義概略表直 欄,則概略表會變成無法使用。 例如: create view v1 (c1) as values user 在版本 5,USER 和 CURRENT SCHEMA 的資料類型是 CHAR(8)。 自版本 6 起,它們被 定義為 VARCHAR(128)。 本範例中,如果概略表是由版本 5 所建立,直欄 cl 的資料 類型則為 CHAR。 移轉之後使用概略表,它會在執行時間編譯,但是,它會因為資料 類型不符而失敗。 解決方案是放棄並重新建立該概略表。 在捨棄概略表之前,查詢 SYSCAT.VIEWS 型錄 概略表來擷取用來建立概略表的語法。 例如: select text from syscat.views where viewname='<>' ------------------------------------------------------------------------ 4.12 Windows 2000 的 IPX/SPX 通信協定支援 此資訊是參照「快速入門」一書的「安裝」這一章的「可能的主從連接實務」這一 節。 已公佈的通信協定支援圖表並不完全正確。 不支援使用 IPX/SPX 連接 OS/2 或 UNIX 型伺服器的 Windows 2000 從屬站。 也不支援使用 IPX/SPX 連接 Windows 2000 伺 服器的 OS/2 或 UNIX 型從屬站。 ------------------------------------------------------------------------ 4.13 升級 DB2 前一版之前先停止 DB2 程序 此資訊是參照「DB2 for Windows 快速入門」一書中的移轉資訊。 若您要升級在 Windows 機器上執行的前一版 DB2, 安裝程式所提供的警告包含了將 DB2 DLL 保留在記憶體的程序列示。 在此時,您可以將列示裡的程序以手動方式停 止,或者讓安裝程式自動關掉這些程序。 建議您在安裝之前手動停止所有 DB2 程 序,以避免流失資料。 要確定 DB2 程序不在執行中的最佳方式是透過「Windows 服 務」畫面來檢視系統的程序。 在「Windows 服務」畫面中,請確定沒有執行 DB2 服 務、 OLAP 服務、或資料倉儲服務。 註: Windows 平台上一次只能執行一種版本的 DB2。 例如,您無法在同樣的 Windows 機器上同時執行 DB2 版本 7 和 DB2 版本 6。若您要將 DB2 版本 7 安裝在已安裝 DB2 版本 6 的機器上, 安裝程式會在安裝期間刪除 DB2 版本 6。請參照適當的快速入門手冊, 以取得從 DB2 的前一版來移轉的相關資訊。 ------------------------------------------------------------------------ 4.14 若已安裝其它 DB2 產品,請在安裝 DB2 之後執行 db2iupdt 下列資訊在您的「快速入門」安裝文件中已提供。 在 UNIX 型系統上安裝 DB2 UDB 版本 7 時,若已安裝 DB2 產品, 您需要執行 db2iupdt 指令,以更新您要使用本產品新特性的案例。有些特性要在執行這個指令之 後才能使用。 ------------------------------------------------------------------------ 4.15 設定 Linux 環境以執行 DB2 控制中心 此資訊內含於「快速入門」一書的「安裝 DB2 控制中心」這一章。 離開 Linux 的 DB2 安裝程式並回到終端機視窗之後, 請鍵入下列指令、設定正確的 環境,以執行 DB2「控制中心」: su -l <案例名稱> export JAVA_HOME=/usr/jdk118 export DISPLAY=<機器名稱>:0 然後,開啟另一個終端機視窗並鍵入: su root xhost +<機器名稱> 關閉該終端機視窗,返回您登入為案例擁有者 ID 的終端機, 並鍵入指令: db2cc 以啟動「控制中心」。 ------------------------------------------------------------------------ 4.16 DB2 Universal Database Enterprise Edition 及 DB2 Connect Enterprise Edition for Linux on S/390 DB2 Universal Database Enterprise Edition 及 DB2 Connect Enterprise Edition 現在可在 Linux/390 上使用了。 在安裝 Linux 到 S/390 機器上之前, 您應該要意 識到軟體及硬體的需求: 硬體 S/390 9672 Generation 5 或以上,Multiprise 3000。 軟體 * SuSE Linux v7.0 for S/390 或 Turbolinux Server 6 for zSeries 及 S/390 * 核心層次 2.2.16,含 S/390 修補程式 (請見下述) * glibc 2.1.3 * libstdc++ 6.1 Linux/390 需要下列修補程式: * 此時不需要修補程式。 若需最新的更新資訊,請至 http://www.software.ibm.com/data/db2/linux 網站。 註: 1. 只支援 32 位元的 Intel-based Linux 及 Linux/390。 2. Linux/390 的 DB2 版本 7 未提供下列項目: o DB2 UDB Enterprise - Extended Edition o DB2 Extenders o Data Links Manager o DB2 Administrative Client o 變更通行碼支援 o LDAP 支援 ------------------------------------------------------------------------ 4.17 Linux for S/390 上可能的資料流失 若在 Linux for S/390 (已安裝 2.2 系列核心程式) 使用 DB2,該 Linux 電腦上的 可用 RAM 數量限制將會小於 1 GB。限制 RAM 到 1 GB 能避免因 Linux 核心程式錯 誤造成的可能性 DB2 資料流失。 這只發生於 DB2 在 Linux for S/390,不發生於 Linux on Intel。 您可從 http://www10.software.ibm.com/developerworks/opensource/linux390/alpha_src.html 取得核心修補程式以便能使用 1 GB 以上的 RAM。 ------------------------------------------------------------------------ 4.18 Linux 上的 DB2 的 Gnome 和 KDE 桌面整合 DB2 現在提供一組公用程式來建立 DB2 桌上管理程式資料夾和圖示, 用以在 Gnome 和 KDE 桌上管理程式上啟動最常用的 DB2 工具, 供以 Intel 為基礎的 Linux 分送 程式使用。 依照預設值,DB2 版本 7.2 會安裝這些公用程式, 且在安裝後可用它們 來建立及除去一或多個選定使用者的桌上管理程式圖示。 欲新增一組桌上管理程式圖示給一或多個使用者,請使用下列指令: db2icons [ ...] 註: 請注意,若在 Gnome 或 KDE 桌上管理程式環境執行時產生圖示, 使用者可能 需要手動復新桌上管理程式才能看見新圖示。 欲除去一或多個使用者的一組桌上管理程式圖示,請使用下列指令: db2rmicons [ ...] 註: 您必須具備足夠的權限才能產生或除去其他使用者的圖示。 通常,如果您是一 般使用者的話,db2icons 和 db2rmicons 可用來建立或除去您自己的圖示,但 唯有您是 root 使用者或是具有權限寫入指定之使用者起始目錄的另一個使用 者,您才能夠用這兩個指令來建立或除去別人的圖示。 ------------------------------------------------------------------------ 4.19 Solaris 核心程式架構參數 (建議值) DB2 for UNIX 快速入門和 DB2 Enterprise - Extended Edition for UNIX 快速入門 書中「Solaris」這一章的「開始之前」這一節, 對 Solaris 核心程式架構參數提供 了一些建議。下表是對有實際記憶體 512 MB 以上的系統,提供一些其它的核心程式 架構參數建議。 表 1. Solaris 核心程式架構參數 (建議值) 核心程式參數 512 MB-1 GB 1 GB-4 GB 4 GB+ msgsys:msginfo_msgmax 65,535 65,535 65,535 msgsys:msginfo_msgmnb 65,535 65,535 65,535 msgsys:msginfo_msgmap 514 1,026 2,050 msgsys:msginfo_msgmni 512 1,024 2,048 msgsys:msginfo_msgssz 16 32 64 msgsys:msginfo_msgtql 1,024 2,048 4,096 msgsys:msginfo_msgseg 32,767 32,767 32,767 shmsys:shminfo_shmmax 483,183,820 - 966,367,641 - 3,865,470,566 - 966,367,641 3,865,470,566 4,294,967,296 shmsys:shminfo_shmseg 50 100 200 shmsys:shminfo_shmmni 300 1,024 2,048 semsys:seminfo_semmni 1,024 2,048 4,198 semsys:seminfo_semmap 1,026 2,050 4,096 semsys:seminfo_semmns 2,048 4,096 8,192 semsys:seminfo_semmnu 2,048 4,096 8,192 semsys:seminfo_semume 50 50 50 註: 1. 32 位元系統的 shmsys:shminfo_shmmax 參數限制是 4 G。 2. msgsys:msginfo_msgmnb 和 msgsys:msginfo_msgmax 參數必須設定為大於或等 於 65,535。 3. msgsys:msginfo_msgseg 參數必須設定為不大於 32,767。 4. shmsys:shminfo_shmmax 參數應該設定為上述表格中的建議值或是實體記憶體的 90% (以位元組為單位),取其大者。例如,如果您的系統有實體記憶體 196 MB,就應該將 shmsys:shminfo_shmmax 參數設定為 184,968,806 (196*1024*1024*0.9)。 ------------------------------------------------------------------------ 4.20 DB2 Universal Database Enterprise - Extended Edition for UNIX 快速入門 第 5 章「在 Linux 上安裝和架構 DB2 Universal Database」指出 Linux EEE 叢集 中的每一個實體節點必須具備相同的 kernel、glibc 及 libstdc++ 層次。 DB2 EEE for Linux 試用版可從下列網站下載: http://www6.software.ibm.com/dl/db2udbdl/db2udbdl-p ------------------------------------------------------------------------ 4.21 HP-UX 的 shmseg 核心參數 您的「快速入門」一書中提供有關更新 HP-UX 核心架構參數的資訊不正確。 應該忽 略 HP-UX 的 shmseg 核心參數的建議值。 應改用預設的 HP-UX 值 (120)。 ------------------------------------------------------------------------ 4.22 移轉 IBM Visual 倉儲控制資料庫 DB2 Universal Database for Windows 快速入門提供有關 Windows NT 和 Windows 2000 進行 DB2 Universal Database 版本 7 典型安裝期間,如何移轉作用中倉儲控 制資料庫的資訊。如果要移轉一個以上的倉儲控制資料庫, 則必須使用倉儲控制資料 庫管理視窗進行附加資料庫的移轉。一次只能有一個倉儲控制資料庫作用。重新登入 資料倉儲中心時,如果上一個資料庫不是您要使用的資料庫, 則必須使用倉儲控制資 料庫管理視窗來進行登記您所要使用的資料庫。 ------------------------------------------------------------------------ 4.23 使用 db2uiddl 指令移轉唯一索引 在「DB2 快速入門」手冊的「DB2 後置安裝移轉作業」一章中, 在「選用後置移轉工 作」下說明您必須使用 db2uiddl 指令, 自 DB2 版本 5.x 及 DB2 版本 6 中移轉唯 一索引。這是不正確的。只有在您是要從版本 5 之前的 DB2 版本中進行移轉時, 才 需要使用 db2uidddl 指令移轉唯一索引。 ------------------------------------------------------------------------ 4.24 64 位元 AIX 版本安裝錯誤 使用 db2setup 在現存的 AIX 作業系統上安裝 64 位元 AIX DB2 映像檔時, 請確定 您使用的是相容的 AIX 版本,否則安裝會失敗。 AIX 版本 5 DB2 映像檔不能安裝在 現存的 AIX 版本 4 作業系統上。同樣地, 在現存的 AIX 版本 5 作業系統上安裝 64 位元 AIX 版本 4 DB2 映像檔也會造成安裝錯誤。 嘗試安裝不相容的 64 位元 AIX 版本時,db2setup 公用程式 會在先決條件檢查時發 現版本不符,並因而發出錯誤訊息,如下所示: DBI1009E 安裝媒體與 AIX 版本不符 若要避免此錯誤,請確定您安裝的是正確的 64 位元 AIX 版本。 4.24.1 使用 SMIT 如果您使用 SMIT,則會收到 AIX 版本 4 DB2 被 AIX 版本 5 DB2 取代的錯誤, 但 若反過來就不會發生錯誤。因此, 64 位元 AIX 版本 5 使用者應確定他們所安裝的 版本是正確的。 如果可以啟動 db2setup,且沒有收到任何錯誤訊息,則表示 AIX 版 本相容性的檢查順利完成。 註: 此不相容錯誤不適用於 32 位元 AIX 版本。 ------------------------------------------------------------------------ 4.25 移轉期間發生的錯誤 移轉期間,即使移轉成功,錯誤項目仍會出現在 db2diag.log 檔案內 (資料庫未移 轉)。此時,可予以忽略。 ------------------------------------------------------------------------ 4.26 IBM(R) DB2(R) Connect 授權啟動 DB2 Connect Enterprise Edition、DB2 Connect Unlimited Edition 及 DB2 Connect Web Starter Kit 的安裝程式不會安裝產品授權。 安裝後,由於這些產品並 沒有軟體使用權檔案, 因此會以試用並購買 (Try-and-Buy) 模式運作 90 天的時 間。90 天後, 除非您啟動適當的授權,否則您安裝的產品將會停止運作。 若要啟動產品授權,您可以使用「DB2 授權中心」或 db2licm 指令。 4.26.1 使用「授權中心」安裝您的授權碼並設定授權類型 1. 啟動「DB2 控制中心」,然後從工具功能表中選取授權中心。 2. 選取您要安裝其授權的系統。已安裝的產品欄位會顯示您已安裝的產品名稱。 3. 從授權功能表中選取新增。 4. 在「新增授權」視窗中,選取從檔案圓鈕, 然後選取軟體使用權檔案: o 在 Windows 伺服器上:x:\db2\license\connect\license_filename,其 中 x: 表示含有 DB2 Connect 產品 CD 的光碟機。 o 在 UNIX 伺服器上:/db2/license/connect/license_filename 其中 license_filename 表示 DB2 Connect Enterprise Edition 且 DB2 Connect Unlimited Edition 是 db2conee.lic,至於 DB2 Connect Web Starter Kit 則是 db2consk.lic。 5. 按一下引用以新增授權碼。 6. 設定授權類型。 o 若為 DB2 Connect Unlimited Edition 及 DB2 Connect Web Starter Kit: 在「授權中心」中,從授權功能表中選取變更。在「變更授權」視窗中, 選取測量用法勾選框。按一下確定以關閉「變更授權」視窗, 並返回「授 權中心」。 註: 若為 DB2 Connect Web Starter Kit,請確定到期日是設定為自您安 裝產品日起的 270 天。 o 若為 DB2 Connect Enterprise Edition: 在「授權中心」中,從授權功能表中選取變更。 在「變更授權」視窗中, 選取您購買的授權類型。 + 如果您購買「並行使用者」授權,請選取並行 DB2 Connect 使用者 並輸入您購買的使用者授權數。 註: DB2 Connect Enterprise Edition 提供一個使用者的軟體使用 權。 其餘的 DB2 Connect 使用者授權必須個別購買。 + 如果您購買「已註冊使用者」授權,請選取註冊的 DB2 Connect 使 用者, 然後按一下確定以關閉「變更授權」視窗, 然後返回「授權 中心」。按一下使用者標籤, 然後新增您購買其軟體使用權的每一 個使用者 ID。 4.26.2 使用 db2licm 指令安裝您的授權碼並設定授權類型 您可以使用 db2licm 指令來新增授權碼, 而不用使用「授權中心」。如欲使用 db2licm 指令新增您的授權碼︰ 1. 在 Windows 伺服器上,輸入下列指令: db2licm -a x:\db2\license\connect\license_filename 其中 x: 代表含有 DB2 Connect 產品 CD 的光碟機。 在 UNIX 伺服器上,輸入下列指令: db2licm -a db2/license/connect/license_filename 其中 license_filename 代表 DB2 Connect Enterprise Edition,DB2 Connect Unlimited Edition 是 db2conee.lic,且 DB2 Connect Web Starter Kit 是 db2consk.lic。 註: 若為 DB2 Connect Web Starter Kit,請確定到期日是設定為自您安裝產 品日起的 270 天。 2. 設定授權類型︰ o 若為 DB2 Connect Unlimited Edition 及 DB2 Connect Web Starter Kit: 輸入下列指令︰ db2licm -p db2conee measured o 若為 DB2 Connect Enterprise Edition: 如果您購買「並行使用者」授權,請輸入下列指令: db2licm -p db2conee concurrent db2licm -u N 其中 N 代表您購買的並行使用者授權數。 如果您購買「已註冊使用者」授權,請輸入下列指令: db2licm -p db2conee registered 4.26.3 分散式安裝的授權注意事項 如果您要建立用於分散式安裝的映像檔,則必須進行特殊安排以便在安裝作業後安裝 授權。 新增前面說明的 db2licm 指令到您的分散式安裝 Script。 ------------------------------------------------------------------------ 4.27 存取倉儲控制資料庫 於 Windows NT 安裝 DB2 版本 7,建立 DB2 版本 7 倉儲控制資料庫和倉儲伺服器。 如果您有名為 Visual Warehouse 的倉儲控制資料庫, 請將含有倉儲控制資料庫的 DB2 伺服器升級到 DB2 版本 7,倉儲控制資料庫的描述資料會移轉, 以供 DB2 版本 7 資料倉儲中心所使用。欲繼續使用版本 7,請移轉所有的倉儲控制資料庫。 DB2 版 本 7 安裝期間,作用中的倉儲控制資料庫的描述資料會移轉到版本 7。欲移轉附加倉 儲控制資料庫的描述資料,請使用倉儲控制資料庫移轉公用程式。於 Windows NT,選 取開始 --> 程式集 --> IBM DB2 --> 倉儲控制資料庫管理,進行啟動。有關倉儲控 制資料庫的移轉,請參閱Windows DB2 Universal Database 快速入門 ------------------------------------------------------------------------ 4.28 Enterprise Edition UNIX CD-ROM 的試用產品 適用於 UNIX 平台版本 6 及版本 7 的 DB2 Universal Database (UDB) Enterprise Edition (EE) CD-ROM, 包含一套 90 天的 DB2 Connect Enterprise Edition (CEE) 試用版。由於 DB2 Connect 功能是建立於 DB2 UDB EE 產品中, 您不需要在已安裝 DB2 UDB EE 的系統上安裝 DB2 CEE 產品就能使用 DB2 Connect 功能。 如果您安裝 了 90 天的 DB2 CEE 試用版,並且決定昇級至授權版本,就必須購買 DB2 CEE 產品 並安裝 DB2 CEE 授權碼。您不需要重新安裝產品。 在 DB2 EE 或 DB2 CEE for UNIX 快速入門一書中提供了安裝授權碼的指示。 如果您已隨著 EE 的安裝,安裝試用的 CEE 產品,卻不想要永久地安裝 CEE, 您可 以遵循下列指示,除去 90 天的 CEE 試用版。如果您除去 Connect EE 的試用版, 將仍然可以使用 DB2 EE 的 DB2 Connect 功能。 若要除去 DB2 Connect 版本 7,請從各個平台解除安裝下列的檔案集: * 在 AIX,解除安裝 db2_07_01.clic 檔案集。 * 在 NUMA-Q 及 Solaris 作業環境,解除安裝 db2clic71 套裝軟體。 * 在 Linux,解除安裝 db2clic71-7.1.0-x RPM。 * 在 HP-UX,解除安裝 DB2V7CONN.clic 檔案集。 若要除去 DB2 Connect 版本 6,請從各個平台解除安裝下列的檔案集: * 在 AIX,解除安裝 db2_06_01.clic 檔案集。 * 在 NUMA-Q 及 Solaris 作業環境,解除安裝 db2cplic61 套裝軟體。 * 在 Linux,解除安裝 db2cplic61-6.1.0-x RPM。 * 在 HP-UX,解除安裝 DB2V6CONN.clic 檔案集。 ------------------------------------------------------------------------ 4.29 DB2 Connect Enterprise Edition UNIX CD-ROM 的試用產品 適用於 UNIX 平台版本 6 及版本 7 的 DB2 Connect Enterprise Edition (EE) CD-ROM, 包含一套 90 天的 DB2 Universal Database (UDB) Enterprise Edition (EE) 試用版。提供 90 天的 DB2 UDB EE 試用版作為評估之用, 對 DB2 Connect 的 運作並不是必要的。 如果您安裝了 90 天的 DB2 UDB EE 試用版,並且決定昇級至授權版本, 就必須購買 DB2 UDB EE 產品並安裝 DB2 UDB EE 授權碼。 您不需要重新安裝產品。在 DB2 EE 或 DB2 CEE for UNIX 快速入門一書中提供了安裝授權碼的指示。 如果您已隨著 Connect EE 的安裝,安裝試用的 UDB EE 產品, 卻不想要永久地安裝 CEE,您可以 遵循下列指示,除去 90 天的 EE 試用版。 如果您除去 DB2 UDB EE 的試用版,將不 影響 DB2 Connect EE 的功能。 若要除去 DB2 UDB EE 版本 7,請從各個平台解除安裝下列的檔案集: * 在 AIX,解除安裝 db2_07_01.elic 檔案集。 * 在 NUMA-Q 及 Solaris 作業環境,解除安裝 db2elic71 套裝軟體。 * 在 Linux,解除安裝 db2elic71-7.1.0-x RPM。 * 在 HP-UX,解除安裝 DB2V7ENTP.elic 檔案集。 若要除去 DB2 UDB EE 版本 6,請從各個平台解除安裝下列的檔案集: * 在 AIX,解除安裝 db2_06_01.elic 檔案集。 * 在 NUMA-Q 及 Solaris 作業環境,解除安裝 db2elic61 套裝軟體。 * 在 Linux,解除安裝 db2elic61-6.1.0-x RPM。 * 在 HP-UX,解除安裝 DB2V6ENTP.elic 檔案集。 ------------------------------------------------------------------------ 4.30 字碼頁及語言支援資訊 - 更正 在「快速入門」一書的「國家語言支援 (NLS)」附錄中, 「字碼頁及語言支援」表格 有下列錯誤: * 直欄標頭 "國碼" 應讀取 "國家/地區字碼" * 直欄標頭 "語言" 應讀取 "語言/Script" * Slovenia 的代碼是 "sl",而不是表中所指出的 "si" ------------------------------------------------------------------------ DB2 Data Links Manager 快速入門 ------------------------------------------------------------------------ 5.1 AIX 5.1 上的支援 現在在 AIX 5.1 上已完全支援「資料鏈結檔案管理程式」及「檔案過濾器」元件。 在之前 AIX 版次上所有與「資料鏈結」相關且之前支援的工具及指令, 現在在 AIX 5.1 上均完全支援且適用。 ------------------------------------------------------------------------ 5.2 Dlfm 的啟動失敗訊息:取得 afsfid 字首時發生錯誤 針對在 DCE-DFS 環境裡執行的 Data Links Manager,如果 dlfm 因下列錯誤啟動失 敗, 請洽詢 IBM 服務中心: 取得 afsfid 字首時發生錯誤 當使用 "dlfm add_prefix" 登記到 Data Links Manager 的 DFS 檔案集被刪除時, 將會發生錯誤。 ------------------------------------------------------------------------ 5.3 設定備份保存檔的 Tivoli Storage Manager 類別 欲指定備份保存檔使用那一個 TSM 管理類別,請設定 DLFM_TSM_MGMTCLASS DB2 登錄 項目一個適當的管理類別名稱。 ------------------------------------------------------------------------ 5.4 DFS 從屬站啟動程式的磁碟空間需求 DFS 從屬站啟動程式為選用的元件,您可以在 DB2 Universal Database 從屬站或伺 服器安裝期間作選擇。 雖然 DFS 從屬站啟動程式執行時並不需要 DB2 UDB 從屬站或 伺服器, 但是,安裝 DFS 從屬站啟動程式之前您必須安裝 DB2 Universal Database 從屬站。 除了 DFS 從屬站啟動程式字碼需要 2 MB 的磁碟空間外, 在安裝 DFS 從 屬站啟動程式為 DB2 執行時間從屬站安裝的一部份時, 您應該另外保留 40 MB 的額 外磁碟空間。 安裝 DFS 從屬站啟動程式為 DB2 管理從屬站或 DB2 伺服器安裝之一 部份時,您需要更多的磁碟空間。 有關 DB2 Universal Database 產品所需要的磁碟 空間,詳細資訊請參閱 DB2 for UNIX 快速入門手冊。 ------------------------------------------------------------------------ 5.5 監督在 AIX 的資料鏈結檔案管理程式後端程序 dlfm see 指令的輸出有變更。 發出此指令來監督在 AIX 的資料鏈結檔案管理程式後 端程序,結果與下列所示類似: PID PPID PGID RUNAME UNAME ETIME DAEMON NAME 17500 60182 40838 dlfm root 12:18 dlfm_copyd_(dlfm) 41228 60182 40838 dlfm root 12:18 dlfm_chownd_(dlfm) 49006 60182 40838 dlfm root 12:18 dlfm_upcalld_(dlfm) 51972 60182 40838 dlfm root 12:18 dlfm_gcd_(dlfm) 66850 60182 40838 dlfm root 12:18 dlfm_retrieved_(dlfm) 67216 60182 40838 dlfm dlfm 12:18 dlfm_delgrpd_(dlfm) 60182 1 40838 dlfm dlfm 12:18 dlfmd_(dlfm) DLFM SEE 要求成功。 括弧內的名稱為 dlfm 案例的名稱,本例名稱為 "dlfm"。 ------------------------------------------------------------------------ 5.6 安裝和架構 DB2 Data Links Manager for AIX: DCE-DFS 環境裡的額外安裝注 意事項 在「安裝先決條件」區段裡,應該新增的新資訊: 您也必須安裝 e-fix for DFS 3.1,或者 PTF 集 1 (變成可用時)。 可在以下網站找到 e-fix 的資訊: http://www.transarc.com/Support/dfs/datalinks/efix_dfs31_main_page.html 以及: 必須在安裝 Data Links Manager 之前執行 dfs 從屬站。 使用 db2setup 或 smitty。 在「Keytab 檔案」區段裡,有個錯誤應該更正為: 含有主體和通行碼資訊的 keytab 檔案,應該稱為 datalink.ktb 和 .... 正確的名稱:datalink.ktb 是用在下面的範例中。 「Keytab 檔案」區段應該移到 「DCE-DFS 後置安裝作業」之下, 因為 DLMADMIN 案例建立後,這個檔案才能建立。 在「Data Links File Manager 伺服器與從屬站」中, 請注意,必須在 Data Links Manager 從屬站之前先安裝 Data Links Manager 伺服器。 應該新增「備份目錄」章節: 若備份方法是針對本端檔案系統, 這必須是 DFS 檔案系統裡的目錄。 請確定 DFS 管理者已建立此 DFS 檔案集。 此檔案集應該不是 DMLFS 檔案集。 ------------------------------------------------------------------------ 5.7 失敗的 "dlfm add_prefix" 指令 針對在 DCE/DFS 環境裡執行的 Data Links Manager, dlfm add_prefix 指令可能會 失敗,而回覆碼為 -2061 (備份失敗)。若發生此狀況,請執行下列步驟: 1. 發出 dlfm stop 指令來停止 Data Links Manager 的常駐程式程序。 2. 發出 dlfm stopdbm 指令來停止 DB2 程序。 3. 發出 dce_login root 指令來取得 dce root 認證。 4. 發出 dlfm startdbm 指令來啟動 DB2 程序。 5. 發出 dlfm add_prefix指令來登記 Data Links Manager 的檔案集。 6. 發出 dlfm start 指令來啟動 Data Links Manager 常駐程式程序。 ------------------------------------------------------------------------ 5.8 很少見的事件:複製常駐程式在 dlfm 停止時沒有停止 這種情況很少發生。當使用者發出 dlfm stop 指令或不正常關機時, dlfm_copyd (copy 常駐程式) 沒有停止。 如果發生這種情況,在嘗試重新啟動 dlfm 之前,發出 dlfm shutdown 指令。 ------------------------------------------------------------------------ 5.9 安裝和架構 DB2 Data Links Manager for AIX: 使用 db2setup 公用程式在 AIX 上安裝 DB2 Data Links Manager 在「已建立 DB2 資料庫 DLFM_DB」區段中,DLFM_DB 並不是建立在 DCE_DFS 環境 中。必須以後置安裝步驟來執行。 在「DMAPP 的 DCE-DFS 預先啟動登錄」區段中,步驟 2 應該變更如下: 2. 新增指令到 /opt/dcelocal/tcl/user_cmd.tcl,以確定 DFS 啟動時也啟動了 DMAPP。 ------------------------------------------------------------------------ 5.10 安裝和架構 DB2 Data Links Manager for AIX:DCE-DFS 後置安裝作業 應該新增下列「完成 Data Links Manager 安裝」章節: 在 Data Links Manager 伺服器上,必須執行下列步驟,以完成安裝: 1. 在「安裝和架構 DB2 Data Links Manager for AIX」這章的「DCE-DFS 環境的 額外安裝注意事項」這節裡, 將 keytab 檔建立為「Keytab 檔案」之下的概 要。 2. 以 root 身分,輸入下列指令以啟動 DMAPP: stop.dfs all start.dfs all 3. 如下列步驟,使用 dce root 認證來執行 "dlfm setup"。 a. 以 Data Links Manager 的 DLMADMIN 管理者登入。 b. 以 root 身分,發出 dce_login。 c. 輸入指令:dlfm setup。 在 Data Links Manager 從屬站上,必須執行下列步驟,以完成安裝: 1. 在「安裝和架構 DB2 Data Links Manager for AIX」這章的「DCE-DFS 環境的 額外安裝注意事項」這節裡, 將 keytab 檔建立為「Keytab 檔案」之下的概 要。 2. 以 root 身分,輸入下列指令以啟動 DMAPP: stop.dfs all start.dfs all ------------------------------------------------------------------------ 5.11 安裝和架構 DB2 Data Links Manager for AIX: 使用 Smit 來手動安裝 DB2 Data Links Manager 根據「SMIT 後置安裝作業」章節,修改步驟 7 以指出 "dce_login root" 指令必須 在 "dlfm setup" 之前發出。 不需要步驟 11。 在步驟 6 (dlfm server_conf) 和步 驟 8 (dlfm client_conf) 完成時,會自動執行此步驟。 也請移除步驟 12 (dlfm start)。 若要完成安裝,請執行下列步驟: 1. 在「安裝和架構 DB2 Data Links Manager for AIX」這章的「DCE-DFS 環境的 額外安裝注意事項」這節裡, 將 keytab 檔建立為「Keytab 檔案」之下的概 要。 2. 以 root 身分,輸入下列指令以啟動 DMAPP: stop.dfs all start.dfs all ------------------------------------------------------------------------ 5.12 安裝和架構 DB2 Data Links 的 DFS 從屬站啟動程式 在「架構 DFS 從屬站啟動程式」章節裡,將下列資訊加到步驟 2: 執行 "secval" 指令通常會完成架構。 不過,也可能需要重新啟動機器。 若在存取 READ PERMISSION DB 檔案時發現問題, 請重新啟動安裝 DB2 DFS 從屬站啟動程式的機器。 ------------------------------------------------------------------------ 5.13 安裝和架構 DB2 Data Links Manager for Solaris 在安裝 DB2 Data Links Manager for Solaris 之後必須執行下列動作: 1. 將下列三行新增到 /etc/system 檔案: set dlfsdrv:glob_mod_pri=0x100800 set dlfsdrv:glob_mesg_pri=0xff set dlfsdrv:ConfigDlfsUid=UID 其中 UID 代表 id dlfm 的使用者 ID。 2. 重新開機,以使變更生效。 ------------------------------------------------------------------------ 5.14 在 Windows NT 上資料鏈結中的 Administrator 群組專用權 在 Windows NT 上,就大部份的函數而言,有關使用 DataLinks 來鏈結的檔案, 使 用者 dlmadmin 與 UNIX 上的 root 使用者具有相同的專用權。 下面的表格將兩者做 了比較。 作業 Unix (root) Windows NT (dlmadmin) 更名 是 是 不需符記可存取檔案 是 是 刪除 是 否 (請看下面的說明) 更新 是 否 (請看下面的說明) 註: NTFS 不允許這些作業在唯讀檔案上執行。 dlmadmin 使用者可以啟用檔案的寫 入許可權, 以順利完成這些作業。 ------------------------------------------------------------------------ 5.15 將 Data Links File System Filter (DLFF) 安裝的記載減到最少 您可以變更 dlfs_cfg 檔案, 將 Data Links File System Filter (DLFF) 安裝的記 載減到最少。dlfs_cfg 檔案會傳到 strload 常式來載入驅動程式及架構參數。 檔案 的位置在 /usr/lpp/db2_07_01/cfg/ 目錄。 透過符號鏈結,也可在 /etc 目錄找到 這個檔案。 dlfs_cfg 檔案的格式如下: d - 0 1 其中: d d 參數指定要載入驅動程式。 driver-name driver-name 是要載入的驅動程式的完整路徑。例如, DB2 版本 7 的完整路徑 是 /usr/lpp/db2_07_01/bin/dlfsdrv。驅動程式名稱是 dlfsdrv。 vfs number 這是 DLFS 在 /etc/vfs 中的 vfs 項目。 dlfm id 這是 DataLinks Manager 管理者的使用者 ID。 global message priority 這是 DLFS 驅動程式中可配置的參數。它會定義要記載到系統日誌檔的訊息種類 列示。 global module priority 這是 DLFS 驅動程式中可配置的參數。它會定義要記載到系統日誌檔的驅動程式 常式、VFS 作業及 Vnode 作業的列示。 0 1 0 1 是用來建立此驅動程式非複製節點的較小數字。 節點名稱是將較小數字附 加到被複製的驅動程式節點名稱來建立的。 不可給超過 5 個以上的較小數字 (0-4)。 現實中的範例可能如下: d /usr/lpp/db2_07_01/bin/dlfsdrv 14,208,255,-1 - 0 1 會記載的訊息是依據 global message priority 及 global module priority 的設定 值而定。 若要將記載減到最少,您可以變更 global message priority 的值。 有 4 個訊息優先順序可以使用: #define LOG_EMERGENCY 0x01 #define LOG_TRACING 0x02 #define LOG_ERROR 0x04 #define LOG_TROUBLESHOOT 0x08 大部份 DLFF 中的訊息使用 LOG_TROUBLESHOOT 作為訊息優先順序。 這裡是一些替代 架構範例: 如果您真的需要緊急(emergency)訊息及錯誤訊息, 請將 dlfs_cfg 配置檔中的廣域 訊息優先順序設定為 5 (1+4): d /usr/lpp/db2_07_01/bin/dlfsdrv 14,208,5,-1 - 0 1 如果只需要錯誤訊息,請將廣域訊息優先順序設定為 4: d /usr/lpp/db2_07_01/bin/dlfsdrv 14,208,4,-1 - 0 1 如果您不需要 DLFS 記載, 則將廣域訊息優先順序設定為 0: d /usr/lpp/db2_07_01/bin/dlfsdrv 14,208,0,-1 - 0 1 5.15.1 在安裝後記載訊息 如果您在安裝之後需要記載緊急、錯誤及疑難排解訊息, 您必須修改 dlfs_cfg 檔 案。 dlfs_cfg 檔案的位置在/usr/lpp/db2_07_01/cfg 目錄。 廣域訊息優先順序必 須設定為 255 (最大優先順序) 會 13 (8+4+1)。 將優先順序設定為 13 (8+4+1) 會 記載緊急、錯誤及疑難排解資訊。 在設定廣域訊息優先順序之後,解除裝載 DLFS 過濾檔案系統, 並重新載入 dlfsdrv 驅動程式以在載入時使用新的優先順序值。 在重新載入 dlfsdrv 驅動程式之後, 必 須重新裝載 DLFS 過濾檔案系統。 註: 直到再度變更 dlfs_cfg 檔案, 任何後續的 dlfsdrv 驅動程式載入會使用相同 dlfs_cfg 設定值。 5.15.2 將 Sun Solaris 系統上的記載作業縮至最小 Sun(TM) Solaris(TM) 系統中沒有 dlfs_cfg 檔。系統日誌常駐程式 (syslogd) 將系 統訊息轉遞給適當日誌檔時所使用的資訊,都放在 /etc/syslog.conf 系統檔中。如 果您想將「DLFF 安裝」的記載作業縮至最小,請將 /etc/syslog.conf 中的 kern.notice 和 kern.debug 登錄項目設定為註解。此外,您還必須停止 syslogd 後 再重新啟動,這項變更才會生效。 當您又想記載所有核心程式的通知和錯誤時,請解除 /etc/syslog.conf 中 kern.notice 和 kern.debug 登錄項目的註解符號,並且同樣要停止 syslogd 後再重 新啟動,讓這項變更生效。 ------------------------------------------------------------------------ 5.16 DATALINK 復置 資料庫復置之後所進行的離線備份復置,無論有或沒有 ROLL-FORWARD, 都不會牽扯 到快速一致性的處理程序。此情況下,檔案鏈結控制項之下有 DATALINK 直欄的所有 表格將被置於資料鏈結一致性擱置 (DRP) 狀態下。 ------------------------------------------------------------------------ 5.17 捨棄 Data Links Manager 您現在可以捨棄指定資料庫的 DB2 Data Links Manager。某些資料鍵結相關的 SQL 要求之處理程序 與公用程式一樣 (例如,備份/復置),包含了與已架構資料庫的 DLM 之間的通信。 在以前,DB2 無法捨棄已架構的 DLM,即使它尚未被選用。 這導致 SQL 及公用程式處理程序附加的額外負荷。 一旦新增 DLM,在要求的處理程序中與它 通信的引擎,可能會導致某些 SQL 要求的失敗 (例如, 除去表格/表格空間/資料 庫)。 ------------------------------------------------------------------------ 5.18 使用 SMIT 解除安裝 DLFM 元件可能會除去額外的檔案集 在從安裝 Data Links Manager 的 AIX 機器上解除安裝 DB2 (版本 5、6 或 7) 之 前, 請遵循下列步驟: 1. 以 root 的身分,使用下列指令備份 /etc/vfs: cp -p /etc/vfs /etc/vfs.bak 2. 解除安裝 DB2。 3. 以 root 的身分,用步驟 1 所做的備份取代 /etc/vfs: cp -p /etc/vfs.bak /etc/vfs ------------------------------------------------------------------------ 5.19 開始之前/決定主電腦名稱 您必須決定每一台 DB2 伺服器及資料鏈結伺服器的名稱。您必須要知道這些主電腦名 稱,才能驗證安裝作業。 在連接到「DB2 Data Links 檔案管理程式」時,DB2 UDB 伺服器會內部傳送下列資訊到 DLFM: * 資料庫名稱 * 案例名稱 * 主電腦名稱 然後 DLFM 會將此資訊與它的內部表格作比對, 以決定是否容許連線成立。只有資料 庫名稱、案例名稱和主電腦名稱的組合都已使用 dlfm add_db 指令註冊到 DLFM 時, 連線才會成立。在 dlfm add_db 指令中使用的主電腦名稱必須和 DB2 UDB 伺服器 所 內部傳送的主電腦名稱完全相符。 使用以下列方式所得到的主電腦名稱: 1. 在 DB2 伺服器上輸入 hostname 指令。例如,此指令可能會傳回 db2server。 2. 根據您的平台,執行下列其中一項: o 在 AIX 上,輸入 host db2server 指令,其中 db2server 是先前步驟中 所得到的名稱。 這個指令應該會傳回類似下列的輸出: db2server.services.com is 9.11.302.341, Aliases: db2server o 在 Windows NT 上,輸入 nslookup db2server 指令,其中 db2server 是 先前步驟中所得到的名稱。 這個指令應該會傳回類似下列的輸出: 伺服器:dnsserv.services.com 位址:9.21.14.135 名稱:db2server.services.com 位址:9.21.51.178 o 在 Solaris 上,輸入 cat /etc/hosts | grep 'hostname'。如果主電腦 名稱在 /etc/hosts 中指定時不含領域名稱, 則這個指令應該會傳回類似 下列的輸出: 9.112.98.167 db2server loghost 如果主電腦名稱指定時含領域名稱,則指令會傳回類似下列的輸出: 9.112.98.167 db2server.services.com loghost 在使用 dlfm add_db 指令註冊 DB2 UDB 資料庫時請用 db2server.services.com 作 為主電腦名稱。 如果在 dlfm add_db 指令中使用任何其它的別名, 則 DB2 伺服器 內部到 DLFM 的連線會失敗。 若要將 Data Links 伺服器註冊到 DB2 資料庫, 可使用 DB2 "add datalinks manager for database database_alias using node hostname port port_number" 指令。 hostname 是 Data Links 伺服器的名稱。在此指令中可使用任何 Data Links 伺服器 的有效別名。 參照此 Data Links 伺服器的 DATALINK 值必須用 URL 值來指定 hostname; 亦即在指派 URL 值給 DATALINK 直欄時,必須使用 "add datalinks manager" 指令中所使用的名稱。 使用不同的別名將會造成 SQL 陳述式失敗。 ------------------------------------------------------------------------ 5.20 使用 DLFM:從 DB2 資料庫捨棄 DB2 Data Links Manager 後的清除動作 當使用 DROP DATALINKS MANAGER 指令從資料庫將 DB2 Data Links Manager 捨棄 時, 指令本身不會清除關於 DB2 Data Links Manager 的相關資訊。使用者可以明確 地起始解除鏈結任何鏈結到資料庫的檔案, 以及備份資訊的垃圾收集。 這可以使用 dlfm drop_dlm 指令來完成。這個指令會將特定資料庫的所有資訊非同步的刪除。DB2 Data Links Manager 必須在執行中,此指令才會成功。 非常重要:此指令只在捨棄 DB2 Data Links Manager 之後才能使用; 否則,將會失去關於 DB2 Data Links Manager 的重要資訊,且無法回復。 若要對特定資料庫起始解除鏈結處理程序及備份資訊的垃圾收集: 1. 以「Data Links 檔案管理程式」管理者身分登入系統。 2. 發出下列指令: dlfm drop_dlm database instance hostname 其中: database 是遠端 DB2 UDB 資料庫的名稱; instance 是資料庫所在的案例; hostname 是資料庫所在的 DB2 UDB 伺服器的主電腦名稱。 3. 登出。 若需完整的用法實務範例,顯示應該如何使用此指令的上下文,請參閱 Command Reference。 已為此指令建立了一個新的錯誤碼 (請參閱5.22, DLFM1001E (新的錯誤訊息))。 ------------------------------------------------------------------------ 5.21 dlfm Client_conf 失效時的使用者動作 在 DLFM 從屬站中,如果 dlfm client_conf 因為某些理由而失敗, DB2 型錄中的 "stale" 項目或許是因素之一。解決方案為發出下列指令: db2 uncatalog db db2 uncatalog node db2 terminate 然後,再嘗試 dlfm client_conf。 ------------------------------------------------------------------------ 5.22 DLFM1001E (新的錯誤訊息) DLFM1001E: 在 drop_dlm 處理程序時發生錯誤。 原因: Data Links Manager 無法對指定的資料庫起始解除鏈結及垃圾收集處理程序。 這可 能因為下列任一原因而發生: * Data Links Manager 不在執行中。 * 指令中指定的資料庫、案例及主電腦名稱的組合無效。 * 在 Data Links Manager 的任一元件服務失敗。 動作: 請執行下列步驟: 1. 確定 Data Links Manager 在執行中。啟動 Data Links Manager,如果它不在 執行中。 2. 確定資料庫、案例及主電腦名稱的組合定義一個已註冊的資料庫。您可在 Data Links Manager 上使用 "dlfm list registered databases" 指令來達到目的。 3. 如果錯誤仍然發生,請參照 db2diag.log 檔案中的資訊, 檢查是否有任何元件 服務 (例如,Connection Management Service、 Transaction Management Service 等等) 失敗。注意 db2diag.log 中的錯誤碼, 並採取錯誤碼底下所建 議的適當動作。 ------------------------------------------------------------------------ 5.23 DLFM 設定架構檔選項 dlfm setup dlfm.cfg 選項已被除去。在文件中若有提及,請予以忽略。 ------------------------------------------------------------------------ 5.24 復置檔案時可能發生的問題 問題:如果一個檔案的不同版本分別在不同時間鏈結到資料庫,當資料庫要進行復置 時,Data Links File Manager (DLFM) Retrieve 常駐程式會無法擷取正確的存檔版 本。 背景:當您從備份映像檔復置資料庫時,備份映像檔中鏈結的檔案,也會因為存檔中 的 Data Links Manager File System (DLFS) 而跟著一起復置。下面介紹 Data Links Manager 的擷取和復置程序的運作方式。 * 如果磁碟上檔案現行版本的前次修改時間和大小等屬性「不同於」存檔中要復置 的檔案屬性,則磁碟上的現行檔案會被視為是不同的檔案版本。磁碟上的現行檔 案會另外儲存為 filename.MOD,實際復置的則是 DLFM 存檔中的檔案原始版 本。例如,如果現行檔案名稱是 abc,abc 會被複製到 abc.MOD。 * 如果磁碟上現行檔案的前次修改時間和大小等屬性「等於」存檔中要復置的檔案 屬性,Data Links Retrieve 常駐程式會假設檔案未經修改,因而不再從存檔中 復置檔案版本。 重要事項:檔案有可能經過修改,但前次修改時間和大小等屬性保持不變。這種「隱 藏修改」的作法是變更檔案但不影響檔案的大小,然後將前次修改時間屬性重設為原 始檔案的前次修改時間屬性。 範例:假設您有一個資料庫 DBTEST,資料庫的表格中有一個 DATALINK 欄。現在,您 依序執行下列作業: 1. 在有裝載 DLFS 的容體中建立 fileA 檔案。這是檔案的第一個版本。 2. 在 DBTEST 資料庫中插入 fileA 參照 (URL)。 3. 製作 DBTEST 資料庫的備份。 4. 刪除 DBTEST 資料庫中的 fileA 參照。 5. 在有裝載 DLFS 的容體中刪除 fileA。 6. 在有裝載 DLFS 的容體中建立另一個 fileA 檔案。 這是檔案的第二個版本。 7. 在 DBTEST 資料庫中插入 fileA 參照 (URL)。 8. 復置備份映像檔中的 DBTEST 資料庫。 DLFM Retrieve 常駐程式會將第二個版本的 fileA 複製到 fileA.MOD,再將存檔中第 一個版本的 fileA 複製到有裝載 DLFS 的容體中,作為工作版本的 fileA。 但是,如果這二個版本的 fileA 擁有相同的前次修改時間和大小等屬性,DLFM Retrieve 常駐程式會假設這些檔案的版本相同,因而不進行復置。 最後,留在有裝載 DLFS 的容體上的是檔案的第二個版本,而非第一個版本。您並沒 有真正將檔案系統復置成與備份中的狀態相同。 解決方案:確定應用程式不會將檔案換成屬性 (前次修改時間和大小) 相同的較新版 檔案。 ------------------------------------------------------------------------ 5.25 在 AIX 上執行 Data Links/DFS Script dmapp_prestart 時發生錯誤 如果指令 /usr/sbin/cfgdmepi -a "/usr/lib/drivers/dmlfs.ext" 失敗,而回覆碼為 1 (在您執行 Data Links/DFS Script dmapp_prestart),請安裝 DFS 3.1 ptfset1 來修正 cfgdmepi。 ------------------------------------------------------------------------ 5.26 Tivoli Space Manager 與 Data Links 整合 DB2 Data Links Manager 現在已具有 Tivoli Space Manager 功能上的優點。 Tivoli Space Manager Hierarchical Storage Manager (HSM) 從屬站程式 會自動將 合格檔案移轉至儲存體,以維護本端檔案系統上特定層次的可用空間。 當存取移轉的 檔案時,會自動重新呼叫這些檔案,而且容許使用者移轉及重新呼叫特定的檔案。 這個功能的先決條件是 Tivoli Space Manager 版本 4.2。 對於所使用檔案系統內含需要定期移至第三層儲存體 (其中的檔案系統空間需要在一 般基礎上管理) 的大型檔案之客戶而言,這個新特性很有幫助。 Tivoli Space Manager 目前提供一些方法來管理許多客戶的第三層儲存體。 Tivoli Space Manager 的 DB2 Data Links Manager 新功能提供更大的彈性來管理 DATALINK 檔案空間。 Tivoli Space Manager 容許定期調整 Data Links 管理的檔案系統配置, 避免正常 使用期間因疏乎而導致檔案系統填滿的風險,而不需要在所有檔案可能儲存於其中的 DB2 Data Links Manager 檔案系統中預先配置足夠的空間。 新增 Data Links 與 HSM 支援到檔案系統 以 Hierarchical Storage Management (HSM) 登記檔案系統時, 請先以 HSM 登記再以 DataLinks File Manager 登記。 1. 登記 HSM 時,請使用指令 "dsmmigfs add /fs"。 2. 登記 DLM 時,請使用指令 "dlfmfsmd/fs"。 檔案系統的 Data Links 支援透過下列登錄,反映在 HSM 檔案系統的 /etc/filesystems 之段落中: vfs = dlfs mount = false options = rw,Basefs=fsm nodename = - 新增 Data Links 支援到現存的 HSM 檔案系統 登記 DLM 時,請使用指令 "dlfmfsmd/fs"。 新增 HSM 支援到現存的 Data Links 檔案系統 1. 登記 HSM 時,請使用指令 "dsmmigfs add /fs"。 2. 登記 DLM 時,請使用指令 "dlfmfsmd/fs"。 從 Data Links-HSM 檔案系統移除 Data Links 支援 移除 Data Links 支援時,請使用指令 "dlfmfsmd -j /fs"。 從 Data Links-HSM 檔案系統移除 HSM 支援 1. 移除 HSM 支援,請使用指令 "dsmmigfs remove /fs"。 2. 移除 Data Links 支援是 "dlfmfsmd -j /fs"。 3. 登記 DLM 時,請使用指令 "dlfmfsmd/fs"。 從 Data Links-HSM 檔案系統移除 Data Links 與 HSM 支援 1. 移除 HSM 支援,請使用指令 "dsmmigfs remove /fs"。 2. 移除 Data Links 支援時,請使用指令 "dlfmfsmd -j /fs"。 5.26.1 功能限制 本功能至目前僅支援在 AIX 上使用。 FC (Read permission DB) 鏈結檔的選擇性移轉 (dsmmigrate) 及取回只應由 root 使用者完成。 在 Read Permission DB 檔案為 DataLink Manager Administrator (dlfm) 的 情況下,選擇性移轉只能由檔案擁有者執行。若要存取這類型檔案, 則需要主 電腦資料庫端的符記。 唯一不需要符記的使用者為 root 使用者。root 使用者 對 Read Permission DB 檔案執行選擇性移轉及取回比較容易。僅在第一次移轉 時, dlfm 使用者才能使用有效的符記移轉 FC 檔案。若在取回之後嘗試第二次 移轉, 此作業會失敗,傳回錯誤訊息 "ANS1028S 內部程式錯誤。 請聯絡客戶 服務代表。" 非 root 使用者無法對 FC 檔案執行 dsmmigrate。一般而言,此 限制對存取檔案伺服器上檔案 的管理者影響不大。 stat 和 statfs 系統呼叫會將 Vfs 類型顯示為 fsm,而非顯示為 dlfs, 雖然 dlfs 裝載在 fsm 之上。 上述行為代表 dsmrecalld 常駐程式的正常功能,其在檔案系統上執行 statfs 來檢查其 Vfs 類型是否為 fsm。 若檔案的最小 inode 號碼為 FC (Read permission DB) 鏈結的號碼, 則指令 "dsmls" 不顯示任何輸出 dsmls 指令類似 ls 指令,其列示由 TSM 管理的檔案。 不需要使用者動作 ------------------------------------------------------------------------ 5.27 第 4 章 安裝和架構 DB2 Data Links Manager for AIX 5.27.1 一般安裝注意事項 5.27.1.1 從 DB2 File Manager 版本 5.2 移轉到 DB2 Data Links Manager 版本 7 步驟 3 中的資訊不正確。步驟 3 應如下所示: "3. 以 DLFM 管理者身份,執行 /usr/lpp/db2_07_01/adm/db2dlmmg 指令。 ------------------------------------------------------------------------ 5.28 第 6 章. 驗證 AIX 上的安裝 5.28.1 NFS 環境中的解決方案 此章節說明在 NFS 環境中執行 DB2 Data Links Manager for AIX 時對於已知問題的 解決方案, 這部份在現行文件中並未併入。 這些問題是 NFS 特有的,和 DB2 Data Links Manager 或 DB2 Universal Database 並沒有任何關係。 附加的 NFS 快取事項 在 AIX 的 NFS 從屬站上保有兩個不同的快取記憶體。NFS 從屬站會以最近存取 的檔案及目錄之屬性來維護某一個快取記憶體。 從屬站也會選用性地支援資料 快取記憶體, 以便快取從屬站上的檔案內容。 屬性快取處理有時會在鏈結 READ PERMISSION DB 檔案後, 在 NFS 從屬站上產 生不尋常的狀況。 如果使用者是在鏈結檔案之前就已連接到機器,則有時這些 使用者將可以存取 READ PERMISSION DB 檔案而無需存取控制權。 使用下列任 一方法來減少未獲授權的檔案存取可能性: o 先在檔案上使用 touch 指令, 然後再執行 SQL INSERT 陳述式以設定鏈 結。 o 在含有該檔案的目錄上使用 touch 指令。 o 使用 mount 指令與五個屬性快取架構參數 (actimeo、 cregmin、 acregmax、acdirmin、acdirmax) 之一, 以將檔案或目錄修改後保留快取 屬性的時間縮至最小。 在「資料鏈結」函數測試期間,您最有可能觀察到未獲授權存取 READ PERMISSION DB 檔案的情形, 因為只有一個檔案被鏈結且 NFS 活動極少。 您 比較不可能在生產環境中遇到此實務範例, 因為 NFS 活動繁多且通常 NFS 屬 性快取記憶體不保留所有已鏈結檔案的屬性。 ------------------------------------------------------------------------ 安裝與架構補充資料 ------------------------------------------------------------------------ 6.1 第 5 章 在 UNIX 作業系統上安裝 DB2 從屬站 6.1.1 HP-UX 核心程式架構參數 建議設定 HP-UX 核心程式參數錯誤指出 msgmbn 及 msgmax 應該設定為 65535 或更 高。兩個參數都應該設定為 65535。 ------------------------------------------------------------------------ 6.2 第 12 章 執行您自己的應用程式 6.2.1 使用 Run-Time Client 連結資料庫公用程式 Run-Time Client 不能用來連結資料庫公用程式 (匯入、匯出、重組、命令行處理 器), 且 DB2 CLI 會在資料庫可以使用檔案之前將檔案連結到每一個資料庫。 您必 須改用 DB2 Administration Client 或 DB2 Application Development Client。 在資料庫可以使用這些資料庫公用程式和 DB2 CLI 連結檔案之前,必須將該資料庫和 它們之間進行連接。 網路環境下,如果您使用不同作業系統的多重從屬站,或是不同 的 DB2 版本或服務程式等級,您必須馬上連結各個作業系統和 DB2 版本組合的公用 程式。 6.2.2 UNIX 從屬站使用 ODBC 存取 DB2 在第 12 章 (「執行您自己的應用程式」) 中提到, 以 ODBC 從屬站應用程式或 ODBC SDK 來安裝 ODBC 驅動程式管理程式, 則需要更新 odbcinst.ini。 這樣的說 法不太正確。因為,當您安裝 Merant ODBC 驅動程式管理程式產品時,則不需要更新 odbcinst.ini。 ------------------------------------------------------------------------ 6.3 第 24 章 設置聯合系統來存取多重資料來源 6.3.1 聯合系統 DB2 聯合系統是一種 DBMS 的特殊類型。 聯合系統可讓您查詢並擷取位在其他 DBMS 上的資料。 單一 SQL 陳述式可以參照多重 DBMS 或個別資料庫。 例如,您可以結合 位在 DB2 Universal Database 表格、Oracle 表格及 Sybase 概略表中的資料。 DB2 聯合系統包含具有 DB2 案例的伺服器 (資料庫將以聯合資料庫伺服) 以及一個或 多個資料來源。 聯合資料庫包含識別資料來源及其性質的目錄登錄。 資料來源包括 DBMS 與資料。支援的資料來源包括: * Oracle * Sybase * Microsoft SQL Server * Informix * DB2 Universal Database 系列(如 DB2 for OS/390、 DB2 for AS/4000 及 DB2 for Windows)的成員 DB2 Universal Database 聯合伺服器可以利用稱為外層的通信協定來通信並擷取資料 來源的資料。 您使用的外層需視執行 DB2 案例的作業系統而定。 暱名是用來識別位 在資料來源中的表格與概略表。 應用程式可以連接到聯合資料庫,就像任何其它的 DB2 資料庫一樣。 它還可以使用暱名來查詢資料來源,好像它們是聯合資料庫中的表 格或概略表一般。 設定聯合系統後,即可存取資料來源中的資訊,即使資料是在單一的本端資料庫中。 使用者及應用程式傳送查詢至聯合資料庫,該資料庫便從資料來源中擷取資料。 DB2 聯合系統在部份限制下操作。分散式要求限制在 DB2 版本 7 中進行唯讀作業。 此外,您不能執行與暱名相反的公用程式作業 (像 LOAD、REORG、REORGCHK、IMPORT 、RUNSTATS 等等)。 但是,您可以使用透通機能,使用與該資料來源相關的 SQL 用 語,將 DDL 及 DML 陳述式直接提出至 DBMS。 6.3.2 限制 在此 FixPak 中無法使用版本 7.2 的新外層(如 AIX、HP 及 Solaris 上的 Informix; Linux、HP 及 Solaris 上的 Oracle;AIX 及 Solaris 上的 Sybase; 以及 AIX 與 NT 上的 Microsoft SQL Server);您必須購買 DB2 Relational Connect 版本 7.2。 6.3.3 安裝 DB2 Relational Connect 本節提供在伺服器上安裝 DB2 Relational Connect 的指令,您將以該伺服器作為聯 合系統伺服器。 Relational Connect 是存取 Oracle、Sybase、Microsoft SQL Server 及 Informix 資料來源所必需的。 存取 DB2 Universal Database 系列的成 員,則不需要 DB2 Relational Connect。 安裝 DB2 Relational Connect 之前︰ * 請確定聯合伺服器上有安裝 DB2 Universal Database Enterprise Edition 或 DB2 Universal Database Enterprise -- Extended Edition。 在 DB2 for UNIX 伺服器上︰ 若您打算將 DB2 系列資料庫併入您的分散式要求中,則當您安裝 DB2 Universal Database 時,您必須選取分散式結合 DB2 資料來源選項。若 要驗證是否已實行此選項, 請檢查 FEDERATED 參數是否設定為 YES。您 可以發出 GET DATABASE MANAGER CONFIGURATION 指令來檢查此設定, 它 會顯示所有參數及其現行設定。 * 請確定在您的聯合伺服器上已安裝了資料來源的從屬站軟體。 6.3.3.1 在 Windows NT 伺服器上安裝 DB2 Relational Connect 1. 以您為了執行 DB2 Universal Database 安裝所建立的使用者帳戶登入聯合伺服 器。 2. 關閉任何執行中的程式,安裝程式才能依照要求來更新檔案。 3. 呼叫安裝程式。您可以自動方式或以人工方式來呼叫安裝程式。 若安裝程式無 法自動啟動,或您想要以不同的語言執行安裝,請以人工方式呼叫安裝程式。 o 若要自動呼叫安裝程式︰ a. 將 DB2 Relational Connect CD 插入磁碟機。 b. 自動執行特性會自動啟動安裝程式。 決定系統語言,並啟動該語言 的安裝程式。 o 自行呼叫安裝程式: a. 按一下開始,選取執行選項。 b. 在開啟欄位中,輸入下列指令: x:\setup /i language 其中: x 代表您的 CD-ROM 光碟機。 language 代表您語言的國家/地區碼(例如:EN 代表英文)。 c. 按一下確定。 即會開啟安裝發射台。 4. 按一下安裝,開始安裝程序。 5. 遵循安裝程式中的提示。 安裝完成時, DB2 Relational Connect 會與其它的 DB2 產品安裝在目錄中。 例如,Oracle NET8 從屬站軟體 (net8.dll) 的外層檔案庫,將會安裝在 c:\Program Files\SQLLIB\bin 目錄中。 6.3.3.2 在 UNIX 伺服器上安裝 DB2 Relational Connect 若要在 UNIX 聯合伺服器上安裝 DB2 Relational Connect, 請使用 db2setup 公用 程式。 註: 在您使用 db2setup 公用程式時所出現的螢幕, 需視已安裝在聯合伺服器上的 項目而定。 這些步驟會假設您沒有安裝 Relational Connect。 1. 以根權限使用者登入。 2. 插入並裝載您的 DB2 產品 CD-ROM。如需裝載 CD-ROM 的方法, 請參閱 DB2 for UNIX 快速入門。 3. 輸入 cd /cdrom 指令 (其中 cdrom 是您的產品 CD-ROM 的裝載點),以變更裝 載 CD-ROM 的目錄。 4. 輸入 ./db2setup 指令。幾分鐘後, 會開啟「安裝 DB2 V7」視窗。此視窗會列 出您目前已安裝的項目及您可以用來安裝的項目。 5. 導覽至您要安裝的分散式結合,如 分散式結合 Informix 資料來源, 然後按下 空格鍵以選取它。 當您選取選項時,其旁邊即會出現星號。 6. 選取確定。 即會開啟「建立 DB2 服務」視窗。 7. 既然聯合伺服器已經含有 DB2 案例, 請選擇不建立 DB2 案例選項,然後選取 確定。 8. 如果您選擇不建立「管理伺服器」,則會出現警告。 選取確定。 「DB2 安裝公 用程式」視窗會顯示要安裝項目的「總結報告」。 因為您之前未安裝 Relational Connect,應該會列出兩個項目: o DB2 Relational Connect 的產品標記 o 您選取的分散式結合資料來源 9. 選擇繼續執行。 即會出現一視窗,指出這是您停止 Relational Connect 的最 後機會。 選擇確定以繼續執行安裝。可能需要幾分鐘的時間才能完成安裝。 10. 「DB2 安裝公用程式」視窗會顯示「狀態報告」,指出哪些元件已順利安裝完 成。 選擇確定。會開啟「DB2 安裝公用程式」視窗。選擇關閉, 然後選取確定 以結束公用程式。 安裝完成時,DB2 Relational Connect 會與其它的 DB2 產品安裝在目錄中。 o 在 DB2 for AIX 伺服器中,目錄為 /usr/lpp/db2_07_01。 o 在 DB2 for Solaris Operating Environment 伺服器中,目錄為 /opt/IBMdb2/V7.1。 o 在 DB2 for HP-UX 伺服器中,目錄為 /opt/IBMdb2/V7.1。 o 在 DB2 for Linux 伺服器中,目錄為 /usr/IBMdb2/V7.1。 ------------------------------------------------------------------------ 6.4 第 26 章 存取 Oracle 資料來源 除了在 AIX 及 Windows NT 上支援外層以外, DB2 Universal Database 現在也支援 Linux、Solaris 作業環境及 HP-UX 上的 Oracle 外層。此支援限於 Oracle 版本 8。 若要存取這些平台的外層,您必須插入 V7.2 DB2 Relational Connect CD 並選 取「分散式結合 Oracle 資料來源」。 一旦您安裝了 DB2 Relational Connect,您可以將 Oracle 資料來源新增到聯合伺服 器中: 1. 在 DB2 聯合伺服器上安裝及架構 Oracle 從屬站軟體。 2. 對於 UNIX 上的 DB2 聯合伺服器,請執行 djxlink Script, 將 Oracle SQL*Net 或 Net8 檔案庫鏈結編輯到您的 DB2 聯合伺服器,並且建立 DB2 聯合 外層檔案庫,以便與 Oracle 搭配使用。 3. 建立 (或更新) db2dj.ini 檔,以便新增 Oracle 的環境變數。這個檔案中必須 有 ORACLE_HOME 環境變數的定義。 4. (選用的) 設定 DB2_DJ_INI 和 DB2_DJ_COMM 設定檔登錄變數。 5. 檢查 DB2 聯合伺服器上 Oracle tnsnames.ora 檔的位置和內容,並且使用 Oracle sqlplus 來測試 Oracle 伺服器連線。 6. 重新使用 DB2 案例。 7. 建立外層。 8. 建立伺服器定義。 9. 建立使用者對映。 10. 使用 Set Passthru 來測試對 Oracle 伺服器的架構。 11. 建立表格與概略表的暱名。 有關這些步驟的指示,包括設定環境變數,可見於「第 26 章」。 設置聯合系統來存 取 DB2 安裝與架構補充資料中的 Oracle 資料來源。 您也可以從 http://www.ibm.com/software/data/db2/relconnect/ 線上取得此資訊。 6.4.1 文件錯誤 在"新增 Oracle 資料來源至聯合系統"段落有下列錯誤: * 在本書的步驟 2 及 3 之間需要一個附加步驟。前三個步驟應如下所示: 1. 參考 Oracle 提供的文件,在 DB2 聯合伺服器上安裝及架構 Oracle 從屬 站軟體。 2. 設定 ORACLE_HOME 環境變數: export ORACLE_HOME=. 3. 對於 UNIX 平台上執行的 DB2 聯合伺服器,請執行 djxlink Script, 將 Oracle SQL*Net 或 Net8 檔案庫鏈結編輯到您的 DB2 聯合伺服器。 根據 您的平台,djxlink Script 的位置在: /usr/lpp/db2_07_01/bin on AIX Solaris 作業環境上的 /opt/IBMdb2/V7.1/bin /opt/IBMdb2/V7.1/bin HP-UX /usr/IBMdb2/V7.1/bin Linux 只有在 DB2 聯合伺服器上安裝 Oracle 的從屬站軟體之後,才執行此 Script。 4. 修改 db2dj.ini 檔案並發出 db2set 指令, 以設定資料來源環境變數。 db2set 指令會用您的設定值更新 DB2 設定檔登錄。 有關設定環境變數的詳細指示可見於「第 26 章」。設置離合系統來存取 DB2 安裝與架構補充資料中的 Oracle 資料來源。 5. 繼續執行本書中所述的步驟 3 以後的步驟。 * 文件指出要設定: DB2_DJ_INI = sqllib/cfg/db2dj.ini 這是不正確的,應該設定如下: DB2_DJ_INI = $INSTHOME/sqllib/cfg/db2dj.ini ------------------------------------------------------------------------ 6.5 存取 Sybase 資料來源 在您將 Sybase 資料來源新增至聯合伺服器之前,您必須將 Sybase Open Client 軟 體安裝並架構在 DB2 聯合伺服器上。 請參閱文件中的安裝程序,其隨附在 Sybase 資料庫軟體中,以取得如何安裝 Open Client 軟體的特定明細。 因為是安裝的一部 份,請確定包括了型錄儲存程序及 Sybase Open Client 檔案庫。 架構從屬站軟體與 Sybase 伺服器之間的連線後,請使用其中一種 Sybase 工具來測試連線。isql 工具 適用於 UNIX,SQL Advantage 工具適用於 Windows。 若要設定聯合伺服器,以存取儲存在 Sybase 資料來源的資料,您必須: 1. 安裝 DB2 Relational Connect 版本 7.2。 請參閱6.3.3, 安裝 DB2 Relational Connect。 2. 新增 Sybase 資料來源至您的聯合伺服器中。 3. 指定 Sybase 字碼頁。 本章討論步驟 2 及 3。 本章的指示可引用在 Windows NT、AIX 及 Solaris 作業環境。特定平台的不同處備 註於其發生的地方。 6.5.1 新增 Sybase 資料來源至聯合伺服器 若要新增 Sybase 資料來源至聯合伺服器,您必須: 1. 設定環境變數並更新設定檔登錄 (僅適用於 AIX 及 Solaris)。 2. 鏈結 DB2 與 Sybase 從屬站軟體 (僅適用於 AIX 及 Solaris)。 3. 重新使用 DB2 案例 (僅適用於 AIX 及 Solaris)。 4. 建立並設定介面檔案。 5. 建立外層。 6. 選用的:設定 DB2_DJ_COMM 環境變數。 7. 建立伺服器。 8. 選用的:設定 CONNECTSTRING 伺服器選項。 9. 建立使用者對映。 10. 建立表格與概略表的暱名。 本節將對這些步驟作詳細的解釋。 6.5.1.1 步驟 1:設定環境變數並更新設定檔登錄 (僅適用於 AIX 及 Solaris) 修改 db2dj.ini 檔案並發出 db2set 指令, 以設定資料來源環境變數。db2dj.ini 檔案包含了安裝在聯合伺服器上的 Sybase 從屬站軟體之架構資訊。db2set 指令會用 您的設定值更新 DB2 設定檔登錄。 在分割的資料庫系統中,您可以使用特殊案例中的所有節點之單一 db2dj.ini 檔案, 或使用特殊案例中的一或多個節點之唯一的 db2dj.ini 檔案。 未分割的資料庫系統 中,每一案例僅可有一個 db2dj.ini 檔案。 若要設定環境變數: 1. 編輯位在 sqllib/cfg 的檔案 db2dj.ini,並設定下列環境變數: SYBASE="" 其中 是 Sybase 從屬站安裝的目錄。 2. 發出 db2set 指令,用您的變更來更新 DB2 設定檔登錄。 此指令的語法 db2set,是以您的資料庫系統結構為依據。 若您正在下列任何資料庫系統結構 中使用 db2dj.ini 檔案,才需要此步驟: 若您正在未分割的資料庫系統中使用 db2dj.ini 檔案, 或您要 db2dj.ini 檔 案僅引用於目前的節點,請發出: db2set DB2_DJ_INI=$HOME/sqllib/cfg/db2dj.ini 若您正在分割資料庫系統中使用 db2dj.ini 檔案, 或您要 db2dj.ini 檔案中 的值引用於此案例的所有節點,請發出: db2set -g DB2_DJ_INI=$HOME/sqllib/cfg/db2dj.ini 若您正在分割資料庫系統中使用 db2dj.ini 檔案, 或您要 db2dj.ini 檔案中 的值引用於特定的節點,請發出: db2set -i INSTANCEX 3 DB2_DJ_INI=$HOME/sqllib/cfg/node3.ini 其中: INSTANCEX 代表案例名稱。 3 代表列示在 db2nodes.cfg 檔案的節點號碼。 node3.ini 代表 db2dj.ini 檔案的修改及更名版本。 6.5.1.2 步驟 2:將 DB2 鏈結至 Sybase 從屬站軟體 (僅 AIX 與 Solaris) 若要啟用存取 Sybase 資料來源,DB2 聯合伺服器必須鏈結編輯至從屬站檔案庫。鏈 結編輯程序以聯合伺服器將通信的資料來源來建立每一個資料來源的外層。當您執行 djxlink Script 時,建立外層檔案庫。 若要發出 djxlink Script 類型: djxlink 6.5.1.3 步驟 3:重新使用 DB2 案例 (僅適用於 AIX 及 Solaris) 若要確定環境變數設定於程式中,請重新使用 DB2 案例。 當您重新使用案例時,復 新 DB2 案例以接受您所作的變更。 發出下列指令以重新使用 DB2 案例: 在 DB2 for Windows NT 伺服器上: NET STOP instance_name NET START instance_name 在 DB2 for AIX 及 Solaris 伺服器上: db2stop db2start 6.5.1.4 步驟 4:建立並設定介面檔案 若要建立並設定介面檔案,您必須建立檔案並使檔案可存取。 1. 使用 Sybase 提供的公用程式來建立介面檔案,其包括想存取的所有 Sybase Open Server 的資料。請參閱 Sybase 的安裝文件,以取得有關使用此公用程式 的詳細資訊。 Windows NT 通常將此檔案命名為 sql.ini。 將您剛建立的檔案,從 sql.ini 重新命名為 interfaces, 為廣用於所有平台的檔案命名。 若您選擇不要將 sql.ini 重新命名為 interfaces, 您必須使用 IFILE 參數或 CONNECTSTRING 選項,其在步驟 8 中有說明。 在 AIX 及 Solaris 系統上,此檔案是命名為 /sqllib/interfaces。 2. 讓介面檔案可存取 DB2。 在 DB2 for Windows NT 伺服器上: 將檔案放置在 DB2 案例的 %DB2PATH% 目錄。 在 DB2 for AIX 及 Solaris 伺服器上: 將檔案放置在 DB2 案例的 $HOME/sqllib 目錄。使用 ln 指令,鏈結到從 DB2 案例的 $HOME/sqllib 目錄之檔案。例如: ln -s -f /home/sybase/interfaces /home/db2djinst1/sqllib 6.5.1.5 步驟 5:建立外層 使用 CREATE WRAPPER 陳述式來指定外層,其將用來存取 Sybase 資料來源。外層是 一種機制,聯合伺服器用此機制來通信及擷取資料來源的資料。DB2 包括兩個 Sybase 外層:CTLIB 及 DBLIB。 下列範例顯示 CREATE WRAPPER 陳述式: CREATE WRAPPER CTLIB 其中 CTLIB 是 Sybase Open Client 軟體使用的預設外層名稱。CTLIB 外層可使用於 Windows NT、AIX 及 Solaris 伺服器。 您可以用您選擇的名稱來取代預設外層名稱。 但是,若您這麼做,您也必須包含 CREATE WRAPPER 陳述式的聯合伺服器之 LIBRARY 參數及外層檔案庫的名稱。請參閱 DB2 SQL Reference 中的 CREATE WRAPPER 陳述式,以取得有關外層常式庫名稱的詳 細資訊。 6.5.1.6 步驟 6:選用的:設定 DB2_DJ_COMM 環境變數 若要在存取 Sybase 資料來源時增進效能,請設定 DB2_DJ_COMM 環境變數。此變數會 判斷是否要在聯合伺服器起始設定時,載入外層。 設定 DB2_DJ_COMM 環境變數以包 括外層檔案庫, 與您在前一步驟指定的外層相符;例如: 在 DB2 for AIX 伺服器上: db2set DB2_DJ_COMM='libctlib.a' 在 DB2 for Solaris 伺服器上: db2set DB2_DJ_COMM='libctlib.so' 請確定等號 (=) 的兩邊都沒有空格。 請參閱 DB2 SQL Reference,以取得有關外層常式庫名稱的詳細資訊。 請參閱 Administration Guide,以取得有關 DB2_DJ_COMM 環境變數的資訊。 6.5.1.7 步驟 7:建立伺服器 使用 CREATE SERVER 陳述式來定義每一個想要從其中存取資料來源的 Sybase 伺服 器, 例如: CREATE SERVER SYBSERVER TYPE SYBASE VERSION 12.0 WRAPPER CTLIB OPTIONS (NODE 'sybnode', DBNAME'sybdb') 其中: SYBSERVER 代表您指定給 Sybase 伺服器的名稱。此名稱必須是唯一的。 SYBASE 代表您要架構存取的資料來源類型。Sybase 是唯一有支援的資料來源。 12.0 代表您要存取的 Sybase 版本。支援的版本有 10.0、11.0、11.1、11.5、11.9 及 12.0。 CTLIB 代表您在 CREATE WRAPPER 陳述式中指定的外層名稱。 'sybnode' 代表 SYBSERVER 常駐的節點名稱。在介面檔案中取得節點值。 此值有區分大小 寫。 雖然節點名稱是指定為選項,但此為 Sybase 資料來源所需的。請參閱 DB2 SQL Reference,以取得其他選項的資訊。 'sybdb' 代表您想要存取的 Sybase 資料庫名稱。您可以從 Sybase 伺服器中取得這個名 稱 6.5.1.8 步驟 8:選用的:設定 CONNECTSTRING 伺服器選項 指定逾時臨界值、介面檔案的路徑與名稱及介面檔案的分封大小。 Sybase Open Client 使用逾時臨界值來岔斷執行時間太長的查詢與回應。您可以使用 CREATE SERVER OPTION DDL 陳述式的 CONNECTSTRING 選項,設定 DB2 的臨界值。使用 CONNECTSTRING 來指定: * SQL 查詢的逾時期間。 * 登入回應的逾時期間。 * 名稱介面的路徑名稱。 * 分封大小。 .-;----------------------------. V | >>---+--------------------------+-+---------------------------->< +-TIMEOUT-- = --秒---------+ +-LOGIN_TIMEOUT-- = --秒---+ +-IFILE-- = --"string"-----+ +-PACKET_SIZE-- = --位元組-+ '-;------------------------' TIMEOUT 指定 DB2 Universal Database 等待任何 SQL 陳述式的 Sybase Open Client 之回應的秒數。seconds 值在 DB2 Universal Database 整數範圍中,是一個正 整數。您指定的逾時值是依據您使用的外層。 Windows NT、AIX 及 Solaris 伺 服器都可以利用 DBLIB 外層。DBLIB 外層的預設值是 0。 在 Windows NT、AIX 及 Solaris 伺服器上,DBLIB 的預設值會使 DB2 Universal Database 無限期 地等待回應。 LOGIN_TIMEOUT 指定 DB2 Universal Database 等待 Sybase Open Client 之回應登入要求的秒 數。預設值與 TIMEOUT 相同。 IFILE 指定 Sybase Open Client 介面檔案的路徑名稱。 在 string 中識別的路徑必 須以雙引號 (") 含括。 在 Windows NT 伺服器上,預設值是 %DB2PATH%。 在 AIX 及 Solaris 伺服器上,預設值是 sqllib/interfaces,在您的 DB2 Universal Database 案例的起始目錄中。 PACKET_SIZE 指定介面檔案的分封大小 (位元組)。 若資料來源不支援指定的分封大小,連線 將會失敗。 當每一個記錄都很大時 (例如,將列數插入大型表格中),增加分封 大小可明顯地增加效能。 位元組大小是一個數值。請參閱 Sybase 參考手冊以 取得詳細資訊。 範例: 在 Windows NT 伺服器上,使用下列指令,將逾時值設定為 60 秒,並將介面檔案設 定至 C:\etc\interfaces 中: CREATE SERVER OPTION connectstring FOR SERVER sybase1 SETTING 'TIMEOUT=60;LOGIN_TIMEOUT=5;IFILE="C:\etc\interfaces"' 在 AIX 與 Solaris 伺服器上,使用下列指令,將逾時值設定為 60 秒,並將介面檔 案設定至 /etc/interfaces 中: CREATE SERVER OPTION connectstring FOR SERVER sybase1 SETTING 'TIMEOUT=60;PACKET_SIZE=4096;IFILE="/etc/interfaces"' 6.5.1.9 步驟 9:建立使用者對映 若聯合伺服器中的使用者 ID 與通行碼,與 Sybase 中的使用者 ID 與通行碼不同, 請使用 CREATE USER MAPPING 陳述式,使本端使用者 ID 與 Sybase 資料來源中定義 的使用者 ID 與通行碼相互對映;例如: CREATE USER MAPPING FOR DB2USER SERVER SYBSERVER OPTIONS ( REMOTE_AUTHID 'sybuser', REMOTE_PASSWORD 'day2night') 其中: DB2USER 代表您用來對映使用者 ID (定義於 Sybase 資料來源中) 的本端使用者 ID。 SYBSERVER 代表您在 CREATE SERVER 陳述式中定義的 Sybase 資料來源名稱。 'sybuser' 代表您要對映 DB2USER 的 Sybase 資料來源的使用者 ID。此值有區分大小寫。 'day2night' 代表與 'sybuser' 相關的通行碼。此值有區分大小寫。 請參閱 DB2 SQL Reference,以取得其他選項的詳細資訊。 6.5.1.10 步驟 10:建立表格與概略表的暱名 指定在您的 Sybase 資料來源中的每一個概略表或表格的暱名。 當您查詢 Sybase 資 料來源時,將使用這些暱名。 Sybase 暱名有區分大小寫。將綱目及表格名稱以雙引 號 (") 含括。下列範例顯示 CREATE NICKNAME 陳述式: CREATE NICKNAME SYBSALES FOR SYBSERVER."salesdata"."europe" 其中: SYBSALES 代表 Sybase 表格或概略表的專用暱名。 SYBSERVER."salesdata"."europe" 代表遵循下列格式的三部分識別字: data_source_name."remote_schema_name"."remote_table_name" 針對您想要建立暱名的每一個表格或概略表,重複此步驟。 當您建立暱名時,DB2 將 使用連線來查詢資料來源型錄。 此查詢會測試連接到資料來源的狀態。 若連線無法 運作,您會接收到一個錯誤訊息。 請參閱 DB2 SQL Reference,以取得有關 CREATE NICKNAME 陳述式的詳細資訊。有關 一般暱名及驗證資料類型對映的詳細資訊,請參閱 DB2 Administration Guide。 6.5.2 指定 Sybase 字碼頁 此步驟僅在 DB2 聯合伺服器及 Sybase 伺服器執行不同的字碼頁時才需要。使用與 DB2 相同的字碼集之資料來源不需要轉換。 下列表格提供 一般「國家語言支援 (NLS)」字碼頁的同等 Sybase 選項。 您的 Sybase 資料來源架構必須與其語意相 符,或者從屬站程式碼必須能夠偵測不符的語意,並將其標示為錯誤、或使用其本身 的語意來對映資料。 若從原始字碼頁到目標字碼頁,都找不到轉換表,則 DB2 會發 出錯誤訊息。 請參閱您的 Sybase 文件以取得詳細資訊。 表 2. 「Sybase 字碼頁」選項 字碼頁 同等 Sybase 選項 850 cp850 897 sjis 819 iso_1 912 iso_2 1089 iso_6 813 iso_7 916 iso_8 920 iso_9 ------------------------------------------------------------------------ 6.6 使用 ODBC 存取 Microsoft SQL Server 資料來源(新增章節) 在您將 Microsoft SQL Server 資料來源新增至 DB2 聯合伺服器之前, 您必須將 ODBC 驅動程式安裝並架構在聯合伺服器上。 請參閱文件中的安裝程序,其隨附在 ODBC 驅動程式,以取得如何安裝 ODBC 驅動程式的特定明細。 若要設定聯合伺服器以存取儲存在 Microsoft SQL Server 資料來源的資料,您必 須: 1. 在聯合伺服器上安裝並架構 ODBC 驅動程式。 請參閱文件中的安裝程序,其隨 附在 ODBC 驅動程式,以取得如何安裝 ODBC 驅動程式的特定明細。 在 DB2 for Windows NT 伺服器上: 使用 ODBC 裝置管理程式架構系統 DSN。在 Windows ODBC Data Administrator 中指定 SQL Server 驅動程式,並且按照對話,新增新的 「系統 DSN」。請指定「SQL 伺服器身分驗證採用使用者提供的登入 ID 和通行碼」。 在 DB2 for AIX 伺服器上: 安裝 MERANT 提供的執行緒版本,指定 MERANT 檔案庫目錄為 LIBPATH 中 的第一個登錄,並設定 .odbc.ini 檔案。 2. 安裝 DB2 Relational Connect 版本 7.2。 請參閱6.3.3, 安裝 DB2 Relational Connect。 3. 新增 Microsoft SQL Server 資料來源至您的聯合伺服器中。 4. 指定 Microsoft SQL Server 字碼頁。(僅適用於 Windows NT) 本章討論步驟 3 及 4。 本章的指示可引用在 Windows NT 及 AIX 平台。 特定平台的不同處備註於其發生的 地方。 6.6.1 新增 Microsoft SQL Server 資料來源至聯合伺服器 在您安裝 ODBC 驅動程式及 DB2 Relational Connect 之後,使用下列步驟,將 Microsoft SQL Server 資料來源新增到您的中: 1. 設定環境變數 (僅 AIX)。 2. 執行 Shell Script (僅 AIX)。 3. 選用的:設定 DB2_DJ_COMM 環境變數。(僅適用於 AIX) 4. 重新使用 DB2 案例 (僅 AIX)。 5. 建立外層。 6. 建立伺服器。 7. 建立使用者對映。 8. 建立表格與概略表的暱名。 9. 選用的:獲得 ODBC 追蹤。 下列各節將對這些步驟作詳細的解釋。 6.6.1.1 步驟 1:設定環境變數 (僅 AIX) 修改 db2dj.ini 檔案並發出 db2set 指令, 以設定資料來源環境變數。db2dj.ini 檔案包含資訊目的,以連接 Microsoft SQL Server 資料來源。db2set 指令會用您的 設定值更新 DB2 設定檔登錄。 在分割的資料庫系統中,您可以使用特殊案例中的所有節點之單一 db2dj.ini 檔案, 或使用特殊案例中的一或多個節點之唯一的 db2dj.ini 檔案。 未分割的資料庫系統 中,每一案例僅可有一個 db2dj.ini 檔案。 若要設定環境變數: 1. 編輯位在 sqllib/cf$HOME/sqllib/cfg/g 的檔案 db2dj.ini,並設定下列環境 變數: ODBCINI=$HOME/.odbc.ini DJX_ODBC_LIBRARY_PATH=/lib DB2ENVLIST=LIBPATH 發出 db2set 指令,用您的變更來更新 DB2 設定檔登錄。db2set 的語法,是以您的 資料庫系統結構為依據。 * 若您正在未分割資料庫系統中使用 db2dj.ini 檔案, 或若您在分割的資料庫系 統中使用 db2dj.ini 檔案,且您要 db2dj.ini 檔案中的值僅引用於目前的節 點,請發出下列指令: db2set DB2_DJ_INI=/db2dj.ini * 若您正在分割資料庫系統中使用 db2dj.ini 檔案, 或您要 db2dj.ini 檔案中 的值引用於此案例的所有節點,請發出下列指令: db2set -g DB2_DJ_INI=/db2dj.ini * 若您正在分割資料庫系統中使用 db2dj.ini 檔案, 或您要 db2dj.ini 檔案中 的值引用於特定的節點,請發出下列指令: db2set -i INSTANCEX 3 DB2_DJ_INI=$HOME/sqllib/cfg/node3.ini 其中: INSTANCEX 代表案例名稱。 3 代表列示在 db2nodes.cfg 檔案的節點號碼。 node3.ini 代表 db2dj.ini 檔案的修改及更名版本。 若要設定從屬站檔案庫路徑,請發出這些指令: db2set DB2LIBPATH= db2set DB2ENVLIST=LIBPATH 6.6.1.2 步驟 2:執行 Shell Script (僅 AIX) djxlink.sh Shell Script 鏈結從屬站檔案庫至外層檔案庫。 若要執行 Shell Script: djxlink 6.6.1.3 步驟 3:選用的:設定 DB2_DJ_COMM 環境變數 (僅適用於 AIX) 若您發現其花費過多的時間來存取 Microsoft SQL Server 資料來源, 您可以在聯合 伺服器起始設定,而非在您嘗試存取資料來源時,設定 DB2_DJ_COMM 環境變數來下載 外層, 如此便可增進效能。 設定 DB2_DJ_COMM 環境變數以包括外層檔案庫,與您在 第 5 步驟指定的外層相符。例如: 在 DB2 for Windows NT 伺服器上: db2set DB2_DJ_COMM=djxmssql3.dll 在 DB2 for AIX 伺服器上: db2set DB2_DJ_COMM=libmssql3.a 請確定等號 (=) 的兩邊都沒有空格。 請參閱 DB2 SQL Reference,以取得有關外層常式庫名稱的詳細資訊。 6.6.1.4 步驟 4:重新使用 DB2 案例 (僅 AIX) 若要確定環境變數設定於程式中,請重新使用 DB2 案例。 當您重新使用案例時,復 新 DB2 案例以接受您所作的變更。 發出下列指令,重新使用 DB2 案例: db2stop db2start 6.6.1.5 步驟 5:建立外層 DB2 Universal Database 有兩種通信協定,稱為外層,您可以使用來存取 Microsoft SQL Server 資料來源。外層是一種機制,聯合伺服器用此機制來通信及擷取資料來源 的資料。 您使用的外層是以 DB2 Universal Database 正在執行的平台為依據。 使 用表 3 作為指南,以選取適當的外層。 表 3. ODBC 驅動程式 ODBC 驅動程式 平台 外層名稱 ODBC 3.0 (或更新版本) 驅動程式 Windows NT DJXMSSQL3 MERANT DataDirect Connect ODBC 3.6 AIX MSSQLODBC3 驅動程式 使用 CREATE WRAPPER 陳述式來指定外層,其將用來存取 Microsoft SQL Server 資 料來源。 下列範例顯示 CREATE WRAPPER 陳述式: CREATE WRAPPER DJXMSSQL3 其中 DJXMSSQL3 是 DB2 for Windows NT 伺服器 (使用 ODBC 3.0 驅動程式) 上使用 的預設外層名稱。 若您有 DB2 for AIX 伺服器,您可以指定 MSSQLODBC3 外層名 稱。 您可以用您選擇的名稱來取代預設外層名稱。 但是,若您這麼做,您必須包含 CREATE WRAPPER 陳述式的聯合伺服器平台之 LIBRARY 參數及外層檔案庫的名稱。 例 如: 在 DB2 for Windows NT 伺服器上: CREATE WRAPPER wrapper_name LIBRARY 'djxmssql3.dll' 其中 wrapper_name 是您想要提供給外層的名稱, 而 'djxmssql3.dll' 是常式 庫名稱。 在 DB2 for AIX 伺服器上: CREATE WRAPPER wrapper_name LIBRARY 'libmssql3.a' 其中 wrapper_name 是您想要提供給外層的名稱, 而 'libdjxmssql.a' 是常式 庫名稱。 請參閱 DB2 SQL Reference 中的 CREATE WRAPPER 陳述式,以取得有關外層常式庫名 稱的詳細資訊。 6.6.1.6 步驟 6:建立伺服器 使用 CREATE SERVER 陳述式來定義您想要連接的每一個 Microsoft SQL Server 資料 來源。例如: CREATE SERVER sqlserver TYPE MSSQLSERVER VERSION 7.0 WRAPPER djxmssql3 OPTIONS (NODE 'sqlnode', DBNAME 'database_name') 其中: sqlserver 代表您指定給 Microsoft SQL Server 伺服器的名稱。 此名稱必須是唯一的。 MSSQLSERVER 代表您要架構存取的資料來源類型。 7.0 代表您要存取的 Microsoft SQL Server 版本。DB2 Universal Database 支援 Microsoft SQL Server 版本 6.5 與 7.0。 DJXMSSQL3 代表您在 CREATE WRAPPER 陳述式中定義的外層名稱。 'sqlnode' 是系統 DSN 名稱,參照您正在存取的 Microsoft SQL Server 的版本。 此值有 區分大小寫。DB2 Universal Database 支援 Microsoft SQL Server 版本 6.5 與 7.0。 雖然節點名稱 (系統 DSN 名稱) 是指定為 CREATE SERVER 陳述式中的選項,但 此為 Microsoft SQL Server 資料來源所需的。 若是在 Windows 上,您可以從 Windows ODBC Data Administrator 工具的「系統 DSN」標籤中取得 DSN。若是 在 AIX 上,您可以從 DB2 案例擁有者起始目錄內的 .odbc.ini 檔中取得 DSN。 請參閱 DB2 SQL Reference,以取得您可以與 CREATE WRAPPER 陳述式搭配使用 的其他選項。 'database_name' 代表您要連接的資料庫之名稱。 雖然資料庫名稱是指定為 CREATE SERVER 陳述式中的選項,但此為 Microsoft SQL Server 資料來源所需的。 6.6.1.7 步驟 7:建立使用者對映 若聯合伺服器中的使用者 ID 與通行碼,與 Microsoft SQL Server 中的使用者 ID 與通行碼不同,請使用 CREATE USER MAPPING 陳述式,使本端使用者 ID 與 Microsoft SQL Server 資料來源中定義的使用者 ID 與通行碼相互對映;例如: CREATE USER MAPPING FOR db2user SERVER server_name OPTIONS (REMOTE_AUTHID 'mssqluser', REMOTE_PASSWORD 'day2night') 其中: db2user 代表您用來對映使用者 ID (定義於 Microsoft SQL Server 資料來源中) 的本 端使用者 ID。 server_name 代表您在 CREATE SERVER 陳述式中定義的伺服器名稱。 'mssqluser' 代表 Microsoft SQL Server 資料來源的登入 ID,您要用此來對映 db2user。 此值有區分大小寫。 'day2night' 代表與 'mssqluser' 相關的通行碼。此值有區分大小寫。 請參閱 DB2 SQL Reference,以取得您可以使用 CREATE USER MAPPING 陳述式的其他 選項。 6.6.1.8 步驟 8:建立表格與概略表的暱名 指定您想要存取的 Microsoft SQL Server 資料來源中,每一個概略表及表格之暱 名。 當您查詢 Microsoft SQL Server 資料來源時,將使用這些暱名。 使用 CREATE NICKNAME 陳述式來指定暱名。 暱名有區分大小寫。下列範例顯示 CREATE NICKNAME 陳述式: CREATE NICKNAME mssqlsales FOR server_name.salesdata.europe 其中: mssqlsales 代表 Microsoft SQL Server 表格或概略表的專用暱名。 server_name.salesdata.europe 代表遵循下列格式的三部分識別字: data_source_server_name.remote_schema_name.remote_table_name 建議您在的 remote_schema_name 及 remote_table_name 部份使用雙引號。 當您建立暱名時,DB2 會嘗試存取資料來源型錄表格 (Microsoft SQL Server 參照這 些表格作為系統表格)。這會測試連接到資料來源的狀態。若連線失敗,您會接收到一 個錯誤訊息。 針對您想要建立暱名的所有資料庫表格及概略表,重複此步驟。 有關 CREATE NICKNAME 陳述式的詳細資訊,請參閱 DB2 SQL Reference。 有關一般 暱名及驗證資料類型對映的詳細資訊, 請參閱 DB2 Administration Guide。 6.6.1.9 步驟 9:選用的:獲得 ODBC 追蹤 若您存取資料來源時遇到問題,您可以取得 ODBC 追蹤資訊,以分析並解決這些問 題。 若要確定 ODBC 追蹤的運作正常,請使用「ODBC 資料來源管理者」提供的追蹤 工具。啟動追蹤會影響系統效能,因此當您已解決問題時,應該關閉追蹤。 6.6.2 複查 Microsoft SQL Server 字碼頁 (僅適用於 Windows NT) Microsoft SQL Server 支援許多 DB2 UDB 支援的一般「國家語言支援 (NLS)」字碼 頁選項。 使用與 DB2 相同的字碼集之資料來源不需要轉換。 表格 3 列示 DB2 Universal Database 及 Microsoft SQL Server 均有支援的字碼頁。 表 4. DB2 UDB 及 Microsoft SQL Server 字碼頁選項 字碼頁 支援的語言 1252 ISO 字集 850 多種語言 437 英文 874 泰語 932 日文 936 簡體中文 949 韓語 950 繁體中文 1250 主要歐洲語 1251 斯拉夫語 1253 希臘語 1254 土耳其語 1255 希伯來文 1256 阿拉伯語 當 DB2 聯合伺服器與 Microsoft SQL Server 執行不同的「國家語言支援 (NLS)」字 碼頁時,您的 Microsoft SQL Server 資料來源架構必須與其語意相符,或者從屬站 程式碼必須能夠偵測不符的語意,並將其標示為錯誤、或使用其本身的語意來對映資 料。若從原始字碼頁到目標字碼頁,都找不到轉換表,則 DB2 會發出錯誤訊息。 請 參閱您的 Microsoft SQL Server 文件,以取得詳細資訊。 ------------------------------------------------------------------------ 6.7 存取 Informix 資料來源(新增章節) 在您新增 Informix 資料來源到 DB2 聯合伺服器之前, 必須先在聯合伺服器上安裝 及架構 Informix Client SDK 軟體。 請參閱 Informix 資料庫軟體隨附文件中的安 裝程序, 以取得如何安裝 Client SDK 軟體的特定明細。因為是安裝的一部份, 請 確定包括了 Informix Client SDK 檔案庫。 若要設定聯合伺服器以存取儲存在 Informix 資料來源中的資料, 您必須: 1. 安裝 DB2 Relational Connect。請參閱6.3.3, 安裝 DB2 Relational Connect 。 2. 引用最新的 DB2 FixPak。 3. 新增 Informix 資料來源至聯合伺服器。 本章說明步驟 3。 本章中的指示適用於 AIX、Solaris 作業環境及 HP-UX 作業系統。發生特定作業系統 差異時會加以備註。 6.7.1 新增 Informix 資料來源至聯合伺服器 若要新增 Informix 資料來源至聯合伺服器,您必須: 1. 設定環境變數並更新設定檔登錄。 2. 鏈結 DB2 至 Informix 從屬站軟體。 3. 重新使用 DB2 案例。 4. 建立 Informix sqlhosts 檔案。 5. 建立外層。 6. 選用的:設定 DB2_DJ_COMM 環境變數。 7. 建立伺服器。 8. 建立使用者對映。 9. 建立表格、概略表與 Informix 同義字的暱名。 本節將對這些步驟作詳細的解釋。 6.7.1.1 步驟 1:設定環境變數並更新設定檔登錄 修改 db2dj.ini 檔案並發出 db2set 指令, 以設定資料來源環境變數。db2dj.ini 檔案含有安裝在聯合伺服器上 Informix 從屬站軟體的相關架構資訊。db2set 指令會 用您的設定值更新 DB2 設定檔登錄。 在分割的資料庫系統中,您可以使用特殊案例中的所有節點之單一 db2dj.ini 檔案, 或使用特殊案例中的一或多個節點之唯一的 db2dj.ini 檔案。 未分割的資料庫系統 中,每一案例僅可有一個 db2dj.ini 檔案。 若要設定環境變數: 1. 編輯 sqllib/cfg 目錄中的 db2dj.ini 檔案, 然後設定下列環境變數: INFORMIXDIR 將 INFORMIXDIR 環境變數設定為安裝 Informix Client SDK 軟體的目錄 路徑; 例如: INFORMIXDIR=/informix/csdk INFORMIXSERVER 此變數會定義預設 Informix 伺服器的名稱。 INFORMIXSERVER=inf93 註: 雖然 Informix 外層不使用此變數值, 但 Informix 從屬站要求設 定此變數。 外層會使用 node 伺服器選項的值, 該值指定您要存取的 Informix 資料庫伺服器。 INFORMIXSQLHOSTS 如果您使用的是 Informix sqlhosts 檔案 ($INFORMIXDIR/etc/sqlhosts) 的預設路徑, 您就不需要設定此變數。 但是,如果您是使用預設值以外 的 Informix sqlhosts 檔案路徑, 則您必須將此變數設定為 Informix sqlhosts 檔案的完整路徑名稱。例如: INFORMIXSQLHOSTS=/informix/csdk/etc/my_sqlhosts 2. 使用 Informix 環境變數更新 DB2 案例的 .profile 檔案。 您可以發出下列指 令設定及匯出每一個變數,以完成此作業: PATH=$INFORMIXDIR/bin:$PATH export PATH INFORMIXDIR= export INFORMIXDIR 其中 informix_client_path 是聯合伺服器上安裝 Informix 從屬站的目錄路 徑。 如果路徑中的名稱含有空白,請在路徑前後加上雙引號 (")。 3. 要執行 DB2 案例 .profile,請輸入: . .profile 4. 發出 db2set 指令,用您的變更來更新 DB2 設定檔登錄。 此指令的語法 db2set,是以您的資料庫系統結構為依據。 若您正在下列任何資料庫系統結構 中使用 db2dj.ini 檔案,才需要此步驟: 若您正在未分割的資料庫系統中使用 db2dj.ini 檔案, 或您要 db2dj.ini 檔 案僅引用於目前的節點,請發出: db2set DB2_DJ_INI=sqllib/cfg/db2dj.ini 如果您是在分割的資料庫系統中使用 db2dj.ini 檔案, 且您想要將 db2dj.ini 檔案中的值引用到此案例的所有節點, 請發出: db2set -g DB2_DJ_INI = sqllib/cfg/db2dj.ini 如果您是在分割的資料庫系統中使用 db2dj.ini 檔案, 且您想要將 db2dj.ini 檔案中的值引用到特定節點, 請發出: db2set -i INSTANCEX 3 DB2_DJ_INI=sqllib/cfg/node3.ini 其中: INSTANCEX 代表案例名稱。 3 代表列示在 db2nodes.cfg 檔案的節點號碼。 node3.ini 代表 db2dj.ini 檔案的修改及更名版本。 6.7.1.2 步驟 2︰鏈結 DB2 至 Informix 從屬站軟體 若要啟用存取 Informix 資料來源,則 DB2 聯合伺服器必須鏈結編輯至從屬站檔案 庫。 鏈結編輯處理會針對聯合伺服器要通信的每一個資料來源,建立外層檔案庫。 當您執行 djxlinkInformix Script 時, 即會建立 Informix 外層檔案庫。若要發出 djxlinkInformix Script,請鍵入: djxlinkInformix 註: djxlinkInformix Script 只會建立 Informix 外層檔案庫。另一個 djxlink Script 會嘗試針對 DB2 Universal Database 支援的每一個資料來源(Oracle 、 Microsoft SQL Server 等等)建立外層檔案庫。如果您只有已安裝之部分資 料來源的從屬站軟體, 則當您發出 djxlink Script 時, 會收到每一個遺漏的 資料來源的錯誤訊息。 您必須具備 UNIX Systems Administrator (根) 授權,才能執行 djxlinkInformix 和 djxlink Script。 djxlinkInformix 和 djxlink Script 會根據作業系統,將詳細的錯誤和警告訊 息寫到特定的檔案。例如,若是在 AIX 上,djxlinkInformix Script 會寫到 /usr/lpp/db2_07_01/lib/djxlinkInformix.out,djxlink Script 會寫到 /usr/lpp/db2_07_01/lib/djxlink.out。 djxlinkInformix 和 djxlink Script 會根據作業系統,在特定的目錄中建立外 層檔案庫。例如,若是在 AIX 上, 則會在 /usr/lpp/db2_07_01/lib 目錄中建 立 libinformix.a 外層檔案庫。 建好 libinformix.a 外層檔案庫後,接著還要檢查此檔案庫上的許可權,確定 DB2 案例擁有者可以讀取及執行。如果 DB2 案例擁有者不是 System 群組中的 成員, libinformix.a 外層檔案庫上的許可權必須是 -rwxr-xr-x 根系 統...libinformix.a。 6.7.1.3 步驟 3:重新使用 DB2 案例 若要確定環境變數設定於程式中,請重新使用 DB2 案例。 當您重新使用案例時,復 新 DB2 案例以接受您所作的變更。 發出下列指令以重新使用 DB2 案例: 在 DB2 for AIX、Solaris 作業環境及 HP-UX 伺服器上: db2stop db2start 6.7.1.4 步驟 4︰建立 Informix sqlhosts 檔案 此檔案會指定每一個 Informix 資料庫伺服器的位置及資料庫伺服器的連線(通信協 定)類型。建立這個檔案的方法有許多種。您可以從有 Informix Connect 或 Informix Client SDK 連接 Informix 伺服器的其他系統,來複製此檔。您也可以在 DB2 伺服器上架構 Informix Client SDK 連接 Informix 伺服器,由它來建立 sqlhosts 檔。 當您建立或是複製好 sqlhosts 檔後,DB2 案例擁有者應該就能使用 Informix dbaccess (如果它在 DB2 伺服器上) 來連接及查詢 Informix 伺服器。這樣 Informix Client SDK 就能連接 Informix 伺服器,您也進而能架構 DB2 Relational Connect 來使用 Informix Client SDK。 如需設置此檔案的相關資訊,請參照 Informix 手冊 Administrators Guide for Informix Dynamic Server。 警告︰ 如果您沒有在 sqlhosts 檔案中定義 Informix 資料庫伺服器名稱, 則當您執行需 要連接 Informix 資料庫伺服器的作業時,就會收到錯誤。 6.7.1.5 步驟 5:建立外層 使用 CREATE WRAPPER 陳述式來指定要用來存取 Informix 資料來源的外層。 外層是 一種機制,聯合伺服器用此機制來通信及擷取資料來源的資料。下列範例顯示 CREATE WRAPPER 陳述式: CREATE WRAPPER informix 其中 informix 是 wrapper_name;informix 是與 Informix Client SDK 軟體一起使 用的預設外層名稱。 您可以用您選擇的名稱來取代預設外層名稱。 但是,若您這麼做,您也必須包含 CREATE WRAPPER 陳述式的聯合伺服器之 LIBRARY 參數及外層檔案庫的名稱。請參閱 DB2 SOL Reference 中的 CREATE WRAPPER 陳述式,以取得外層檔案庫名稱的相關資 訊。 Informix 的外層檔案庫名稱︰ * libinformix.a (AIX) * libinformix.so(Solaris 作業環境) * libinformix.sl (HP-UX) 6.7.1.6 步驟 6:選用的:設定 DB2_DJ_COMM 環境變數 若要增進存取 Informix 資料來源時的效能, 請在聯合伺服器上設定 DB2_DJ_COMM 環境變數。此變數會決定是否要在起始設定聯合伺服器時載入外層。 設定 DB2_DJ_COMM 環境變數以併入外層檔案庫, 並對應到您在之前的步驟中所指定的外 層。如果您使用的是 Korn Shell 或 Bourne Shell 指令行介面, 請使用這些匯出指 令: 在 DB2 for AIX 伺服器上: DB2_DJ_COMM='libinformix.a' export DB2_DJ_COMM 在 DB2 for Solaris Operating Environment 伺服器上︰ DB2_DJ_COMM='libinformix.so' export DB2_DJ_COMM 在 DB2 for HP-UX 伺服器上︰ DB2_DJ_COMM='libinformix.sl' export DB2_DJ_COMM 請確定等號 (=) 的兩邊都沒有空格。 如果您使用的是 C Shell 指令行介面, 請使用下列指令設定環境變數: setenv DB2_DJ_COMM 'libinformix.a' (適用於 DB2 for AIX 伺服器) setenv DB2_DJ_COMM 'libinformix.so' (適用於 DB2 for Solaris 作業環境伺服器) setenv DB2_DJ_COMM 'libinformix.sl' (適用於 DB2 for HP--UX 伺服器) 請參照 DB2 SQL Reference,取得外層檔案庫名稱及 DB2_DJ_COMM 環境變數的相關資 訊。 6.7.1.7 步驟 7:建立伺服器 使用 CREATE SERVER 陳述式來定義您要存取其資料來源的每一個 Informix 伺服器。 此陳述式的語法如下︰ CREATE SERVER server_name TYPE server_type VERSION server_version WRAPPER wrapper_name OPTIONS (NODE 'node_name', DBNAME 'database_name') 其中: server_name 代表您指定給 Informix 資料庫伺服器的名稱。這個名稱必須是唯一的,不能與 聯合資料庫中定義的其它 server_name 同名。server_name 不能與聯合資料庫 中的表格空間同名。 TYPE server_type 會指定您要架構其存取權的資料來源類型。 註: 若為 Informix 外層,則 server_type 必須是 informix。 VERSION server_version 代表您要存取的 Informix 資料庫伺服器版本。 支援的 Informix 版本為 5、7 、8 及 9。 WRAPPER wrapper_name 代表您在 CREATE WRAPPER 陳述式中指定的名稱。 NODE 'node_name' 代表 server_name 所在的節點名稱。 node_name 必須定義於 Informix sqlhosts 檔案(請參閱步驟 4)。雖然 node_name 已指定為 CREATE SERVER SQL 陳述式中的選項, 但它是 Informix 資料來源所需的。此值有區分大小 寫。 請參閱 DB2 SQL Reference,以取得其他選項的資訊。 DBNAME 'database_name' 代表您要存取的 Informix 資料庫名稱。 下面是 CREATE SERVER 陳述式範例︰ CREATE SERVER asia TYPE informix VERSION 9 WRAPPER informix OPTIONS (NODE 'abc', DBNAME 'sales') FOLD_ID 及 FOLD_PW 伺服器選項會影響外層在傳送使用者 ID 和通行碼給 Informix 前, 是否將它們轉換成大寫或小寫。 附有 FOLD_ID 與 FOLD_PW 伺服器選項的 CREATE SERVER 陳述式範例如下: CREATE SERVER asia TYPE informix VERSION 9 WRAPPER informix OPTIONS (NODE 'abc', DBNAME 'sales', FOLD_ID 'U', FOLD_PW 'U') 6.7.1.8 步驟 8︰建立使用者對映 如果 DB2 聯合伺服器上的使用者 ID 或通行碼不同於 Informix 資料來源上的使用者 ID 或通行碼, 請使用 CREATE USER MAPPING 陳述式,將本端使用者 ID 對映到定義 於 Informix 資料來源的使用者 ID 及通行碼; 例如: CREATE USER MAPPING FOR local_userid SERVER server_name OPTIONS (REMOTE_AUTHID 'remode_userid', REMOTE_PASSWORD 'remote_password') 其中: local_userid 代表您要對映到定義於 Informix 資料來源上使用者 ID 的本端使用者 ID。 SERVER server_name 代表定義於 CREATE SERVER 陳述式的 Informix 資料來源名稱。 REMOTE_AUTHID 'remote_userid' 代表在 Informix 資料庫伺服器上您要對映 local_userid 的使用者 ID。此值 要區分大小寫, 除非您將 CREATE SERVER 陳述式中的 FOLD_ID 伺服器選項設 定為 'U' 或 'L'。 REMOTE_PASSWORD 'remote_password' 代表與 remote_userid 相關聯的通行碼。 此值要區分大小寫, 除非您將 CREATE SERVER 陳述式中的 FOLD_PW 伺服器選項設定為 'U' 或 'L'。 下面是 CREATE USER MAPPING 陳述式範例︰ CREATE USER MAPPING FOR robert SERVER asia OPTIONS (REMOTE_AUTHID 'bob', REMOTE_PASSWORD 'day2night') 您可以使用 DB2 特別暫存區 USER, 以便將發出 CREATE USER MAPPING 陳述式的使 用者授權 ID 對映到 REMOTE_AUTHID 使用者選項所指定的資料來源授權 ID。 下面是 CREATE USER MAPPING 陳述式範例,其中含有 USER 特別暫存區︰ CREATE USER MAPPING FOR USER SERVER asia OPTIONS (REMOTE_AUTHID 'bob', REMOTE_PASSWORD 'day2night') 請參閱 DB2 SQL Reference,以取得其他選項的詳細資訊。 6.7.1.9 步驟 9︰建立表格、概略表與 Informix 同義字的暱名 針對您 Informix 資料來源上的每一個表格、概略表或 Informix 同義字, 指定其暱 名。 暱名長度可以有 128 個字元。 當您查詢 Informix 資料來源時,將會使用這些 暱名。DB2 會將伺服器、綱目與表格名稱轉換為大寫, 除非您以雙引號 (") 將它們 括住。下列範例顯示 CREATE NICKNAME 陳述式: CREATE NICKNAME nickname FOR server_name."remote_schema_name"."remote_table_name" 其中: nickname 代表唯一暱名,用來識別 Informix 表格、概略表或同義字。 server_name."remote_schema_name"."remote_table_name" 代表遠端物件識別字的三個部份: o server_name 代表您在 CREATE SERVER 陳述式中指定給 Informix 資料庫 伺服器的名稱。 o remote_schema_name 代表表格、概略表或同義字所屬的遠端綱目名稱。 o remote_table_name 代表您要存取的遠端表格、概略表或同義字名稱。 下面是 CREATE NICKNAME 陳述式範例︰ CREATE NICKNAME salesjapan FOR asia."salesdata"."japan" 針對您要建立其暱名的每一個表格或概略表,請重複此步驟。 當您建立暱名時,DB2 將使用連線來查詢資料來源型錄。 此查詢會測試連接到資料來源的狀態。 若連線無 法運作,您會接收到一個錯誤訊息。 請參閱 DB2 SQL Reference,以取得有關 CREATE NICKNAME 陳述式的詳細資訊。有關 一般暱名及驗證資料類型對映的詳細資訊,請參閱 DB2 Administration Guide。 ------------------------------------------------------------------------ 管理 部份目錄 * Administration Guide o 7.1 Update Available * Administration Guide: Planning o 8.1 Chapter 8. Physical Database Design + 8.1.1 Table Space Design Considerations + 8.1.1.1 Optimizing Table Space Performance when Data is Place on Raid o 8.2 Appendix D. National Language Support (NLS) + 8.2.1 Country/Region Code and Code Page Support: + 8.2.2 Import/Export/Load Considerations -- Restrictions for Code Pages 1394 and 5488 * Administration Guide: Performance o 9.1 System Temporary Table Schemas o 9.2 Chapter 8. Operational Performance + 9.2.1 Block- Based Buffer Pool + 9.2.1.1 Block-based Buffer Pool Examples o 9.3 Chapter 10. Scaling Your Configuration Through Adding Processors + 9.3.1 Problems When Adding Nodes to a Partitioned Database o 9.4 DB2 Registry and Environment Variables + 9.4.1 Corrections to Performance Variables + 9.4.2 Corrections and Additions to Miscellaneous Registry Variables + 9.4.3 Corrections and Additions to General Registry Variables * Administration Guide: Implementation o 10.1 Chapter 8. Recovering a Database + 10.1.1 How to Use Suspended I/O * Administering Satellites Guide and Reference (無中文版) o 11.1 Setting up Version 7.2 DB2 Personal Edition and DB2 Workgroup Edition as Satellites + 11.1.1 Prerequisites + 11.1.1.1 Installation Considerations + 11.1.2 Configuring the Version 7.2 System for Synchronization + 11.1.3 Installing FixPak 2 or Higher on a Version 6 Enterprise Edition System + 11.1.3.1 Upgrading Version 6 DB2 Enterprise Edition for Use as the DB2 Control Server + 11.1.4 Upgrading a Version 6 Control Center and Satellite Administration Center * Command Reference o 12.1 可用更新 o 12.2 db2updv7 - 更新資料庫為版本 7 現行修正程式層次 o 12.3 REBIND + Missing value o 12.4 db2inidb - 起始設定鏡映資料庫 + 12.4.1 使用情況資訊 o 12.5 GET ROUTINE 指令中的額外選項 + GET ROUTINE * Data Recovery and High Availability Guide and Reference(無中文版) o 13.1 可在線上取得 Data Recovery and High Availability Guide and Reference o 13.2 當 LOGRETAIN=CAPTURE 時的新備份與復置行為 o 13.3 NEWLOGPATH2 現在稱為 DB2_NEWLOGPATH2 o 13.4 選擇 AIX 或 Solaris 上 DB2 Data Links Manager 的備份方法 o 13.5 Tivoli Storage Manager -- LAN Free Data Transfer * Data Movement Utilities Guide and Reference (無中文版) o 14.1 Change to LOB File Handling by Export, Import and Load + 14.1.1 IXF considerations o 14.2 Code Page Support for Import, Export and Load Utilities o 14.3 db2relocatedb (new command) + db2relocatedb - Relocate Database o 14.4 db2move -- New Options Available + Moving Data Using the db2move Tool o 14.5 Chapter 2. Import + 14.5.1 Using Import with Buffered Inserts o 14.6 Chapter 3. Load + 14.6.1 Pending States After a Load Operation + 14.6.2 Load Restrictions and Limitations + 14.6.3 totalfreespace File Type Modifier o 14.7 Chapter 4. AutoLoader + 14.7.1 rexecd Required to Run AutoLoader When Authentication Set to YES o 14.8 AutoLoader May Hang During a Fork o 14.9 Appendix C. Export/Import/Load Utility File Formats * Replication 指南與參考手冊 o 15.1 抄寫及非 IBM 伺服器 o 15.2 在 Windows 2000 上的抄寫 o 15.3 儲存 SQL 檔案時的已知錯誤 o 15.4 DB2 維護 o 15.5 Web 上的 Data Difference Utility o 15.6 第 3 章. 資料抄寫實務範例 + 15.6.1 抄寫實務 o 15.7 第 5 章. 抄寫規劃 + 15.7.1 表格及直欄名稱 + 15.7.2 DATALINK 抄寫 + 15.7.3 LOB 限制 + 15.7.4 規劃抄寫 o 15.8 第 6 章. 設定抄寫環境 + 15.8.1 隨處更新 (Update-anywhere) 先決條件 + 15.8.2 設定抄寫環境 o 15.9 第 8 章 問題判斷 o 15.10 第 9 章 AS/400 的擷取程式和引用程式 o 15.11 第 10 章 OS/390 的擷取程式和引用程式 + 15.11.1 DB2 DataPropagator for OS/390 的先決條件 + 15.11.2 OS/390 上的 UNICODE 和 ASCII 編碼方法 + 15.11.2.1 選擇編碼方法 + 15.11.2.2 設定編碼方法 o 15.12 第 11 章 UNIX 平台的擷取程式和引用程式 + 15.12.1 在 UNIX 和 Windows 上設定「擷取程式」和「引用程式」 的環境變數 o 15.13 第 14 章 表格結構 o 15.14 第 15 章 擷取程式和引用程式訊息 o 15.15 附錄 A. 從應用程式內啟動擷取程式和引用程式 * System Monitor Guide and Reference(無中文版) o 16.1 db2ConvMonStream * Troubleshooting Guide (無中文版) o 17.1 Starting DB2 on Windows 95, Windows 98, and Windows ME When the User Is Not Logged On o 17.2 Chapter 1. Good Troubleshooting Practices + 17.2.1 Problem Analysis and Environment Collection Tool + 17.2.1.1 Collection Outputs + 17.2.1.2 Viewing detailed_system_info.html + 17.2.1.3 Viewing DB2 Support Tool Syntax One Page at a Time o 17.3 Chapter 2. Troubleshooting the DB2 Universal Database Server o 17.4 Chapter 8. Troubleshooting DB2 Data Links Manager * 在 64 位元的平台上使用 DB2 Universal Database o 18.1 第 5 章 架構 + 18.1.1 LOCKLIST + 18.1.2 shmsys:shminfo_shmmax o 18.2 第 6 章 限制 * XML Extender Administration and Programming(無中文版) * MQSeries o 20.1 安裝與架構 DB2 MQSeries 函數 + 20.1.1 安裝 MQSeries + 20.1.2 安裝 MQSeries AMI + 20.1.3 啟用 DB2 MQSeries Function o 20.2 MQSeries 傳訊樣式 o 20.3 訊息結構 o 20.4 MQSeries 功能概觀 + 20.4.1 限制 + 20.4.2 錯誤碼 o 20.5 用法實務手冊 + 20.5.1 基本傳訊 + 20.5.2 傳送訊息 + 20.5.3 擷取訊息 + 20.5.4 應用程式對應用程式連接 + 20.5.4.1 Request/Reply 通信 + 20.5.4.2 發佈/訂閱 o 20.6 enable_MQFunctions + enable_MQFunctions o 20.7 disable_MQFunctions + disable_MQFunctions ------------------------------------------------------------------------ Administration Guide ------------------------------------------------------------------------ 7.1 可用更新 Administration Guide 已經更新成為 FixPak 4 的一部分。 您可以從 http://www.ibm.com/software/data/db2/udb/winos2unix/support 線上下載最新的 PDF。這些注意事項中的資訊是用以補充更新的參照。 您也可以在 CD 中取得所有已 更新的文件。透過 DB2 服務並使用 PTF 號碼 U478862,即可訂購此 CD。 您可以從 http://www.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/help.d2w/report 取得聯絡「DB2 服務」的相關資訊。 ------------------------------------------------------------------------ Administration Guide: Planning ------------------------------------------------------------------------ 8.1 Chapter 8. Physical Database Design 8.1.1 Table Space Design Considerations 8.1.1.1 Optimizing Table Space Performance when Data is Place on Raid DB2_PARALLEL_IO DB2_PARALLEL_IO also affects table spaces with more than one container defined. If you do not set the registry variable, the I/O parallelism is equal to the number of containers in the table space. If you set the registry variable, the I/O parallelism is equal to the result of prefetch size divided by extent size. You might want to set the registry variable if the individual containers in the table space are striped across multiple physical disks. For example, a table space has two containers and the prefetch size is four times the extent size. If the registry variable is not set, a prefetch request for this table space will be broken into two requests (each request will be for two extents). Provided that the prefetchers are available to do work, two prefetchers can be working on these requests in parallel. In the case where the registry variable is set, a prefetch request for this table space will be broken into four requests (one extent per request) with a possibility of four prefetchers servicing the requests in parallel. In this example, if each of the two containers had a single disk dedicated to it, setting the registry variable for this table space might result in contention on those disks since two prefetchers will be accessing each of the two disks at once. However, if each of the two containers was striped across multiple disks, setting the registry variable would potentially allow access to four different disks at once. ------------------------------------------------------------------------ 8.2 Appendix D. National Language Support (NLS) 8.2.1 Country/Region Code and Code Page Support: In the table of Supported Languages and Code Sets, code page 5488 is also known as GB 18030, and code page 1394 is also known as ShiftJISX 0213. 8.2.2 Import/Export/Load Considerations -- Restrictions for Code Pages 1394 and 5488 Data in code pages 1394 (ShiftJISX 0213) and 5488 (GB 18030) can be moved into a Unicode database using the load or import utilities. The export utility can be used to move data from a Unicode database to a data file in code pages 1394 and 5488. Only connections between a Unicode client and a Unicode server are supported, so you need to use either a Unicode client or set the DB2 registry variable DB2CODEPAGE to 1208 prior to using the load, import, or export utilities. Conversion from code page 1394 or 5488 to Unicode may result in expansion. For example, a 2-byte character may be stored as two 16-bit Unicode characters in the GRAPHIC columns. You need to ensure the target columns in the Unicode database are wide enough to contain any expanded Unicode byte. ------------------------------------------------------------------------ Administration Guide: Performance ------------------------------------------------------------------------ 9.1 System Temporary Table Schemas The schema for a system temporary table is determined by the application and authorization ID that create it. When this data is available, the schema in which the table is created is . Under some circumstances, the tables are created using only one of these IDs to determine the schema, and sometimes, none. This can result in a tables such as AUTHID.TEMPTABLENAME, or .TEMPTABLENAME. You can view the schema information for these tables by using the GET SNAPSHOT command. For information on this command, please refer to the Command Reference ------------------------------------------------------------------------ 9.2 Chapter 8. Operational Performance 9.2.1 Block- Based Buffer Pool This feature is only supported on the Sun Solaris Operating Environment. Due to I/O overhead, prefetching pages from disk is an expensive operation. DB2's prefetching significantly improves throughput when processing can be overlapped with I/O. Most platforms provide high performance primitives to read contiguous pages from disk into discontiguous portions of memory. These primitives are usually called "scattered read" or "vectored I/O". On some platforms, the performance of these primitives cannot compete with doing I/O in large block sizes. By default, the buffer pools are page-based. That is, contiguous pages on disk are prefetched into discontiguous pages in memory. Prefetching performance can be further enhanced on these platforms if pages can be read from disk into contiguous pages in a buffer pool. A registry variable, DB2_BLOCK_BASED_BP, allows you to create a section in the buffer pool that holds sets of contiguous pages. These sets of contiguous pages are referred to as "blocks". By setting this registry variable, a sequential prefetch will read the pages from disk directly into these blocks instead of reading each page individually. This will improve I/O performance. For more information on this registry variable, see the 'Registry and Environment Variables' section of the Administration Guide. Multiple table spaces of different extent sizes can be bound to a buffer pool of the same block size. There is a close relationship between extent sizes and block sizes even though they deal with separate concepts. An extent is the granularity at which table spaces are striped across multiple containers. A block is the only granularity at which I/O servers doing sequential prefetch requests will consider doing block-based I/O. Individual sequential prefetch requests use extent-size pages. When such a prefetch request is received, the I/O server determines the cost and benefit of doing each request as a block-based I/O (if there is a block-based area in the buffer pool) instead of the page-based I/O using the scattered read method. The benefit of doing any I/O as block-based I/O is the performance benefit from reading from contiguous disk into contiguous memory. The cost is the amount of wasted buffer pool memory that can result from using this method. Buffer pool memory can be wasted for two reasons when doing block-based I/O: * The number of pages in the prefetch request contains fewer pages than the number of pages in a block. That is, the extent size is smaller than the block size. * Some of the pages requested as part of the prefetch request are already in the page area of the buffer pool. Note: Each block in the block-based area of a buffer pool cannot be subdivided. The pages within the block must all be contiguous. As a result, there is a possibility of wasted space. The I/O server allows for some wasted pages within each block in order to gain the benefit of doing block-based I/O. However, when too much of a block is wasted, the I/O server will revert to using page-based prefetching into the page area of the buffer pool. As a result, some of the I/O done during prefetching will not be block-based. This is not an optimal condition. For optimal performance, you should have table spaces of the same extent size bound to a buffer pool of the same block size. Good performance can still be achieved if the extent size of some table spaces is greater than the block size of the buffer pool they are bound to. It is not advisable to bind table spaces to a buffer pool when the extent size is less than the block size. Note: The block area of a buffer pool is only used for sequential prefetching. If there is little or no sequential prefetching involved on your system, then the block area will be a wasted portion of the buffer pool. Both AWE and block-based support cannot be setup for a buffer pool at the same time. If both the DB2_AWE and DB2_BLOCK_BASED_BP registry variables refer to the same buffer pool, precedence will be given to AWE. Block-based support will be disabled in this case and will only be re-enabled once AWE is disabled. A buffer pool that is using extended storage does not support block-based I/O. 9.2.1.1 Block-based Buffer Pool Examples Before working with any of the examples, you will need to know the identifiers for the buffer pools on your system. The ID of the buffer pool can be seen in the BUFFERPOOLID column or the SYSCAT.BUFFERPOOLS system catalog view. Scenario 1 You have a buffer pool with an ID of 4 that has 1000 pages. You wish to create a block area which is made up of 700 pages where each block contains 32 pages. You must run the following: db2set DB2_BLOCK_BASED_BP=4,700,32 When the database is started, the buffer pool with ID 4 is created with a block area of 672 pages and a page area of 328 pages. In this example, 32 cannot be evenly divided into 700. This means that the block area size specified had to be reduced to the nearest block size boundary using the following formula: ((block area size)) FLOOR(-----------------) X block size ( (block size) ) ( 700 ) = FLOOR(-----------------) X 32 ( 32 ) = 21 x 32 = 672 Scenario 2 You have a buffer pool with an ID of 11 that has 3000 pages. You wish to create a block area which is made up of 2700 pages. You must run the following: db2set DB2_BLOCK_BASED_BP=11,2700 When the database is started, the buffer pool with ID 11 is created with a block area of 2688 pages and a page area of 312 pages. With no value explicitly given for the block size, the default value of 32 is used. In this example, 32 cannot be evenly divided into 2700. This means that the block area size specified had to be reduced to the nearest block size boundary using the following formula: ((block area size)) FLOOR(-----------------) X block size ( (block size) ) ( 2700 ) = FLOOR(-----------------) X 32 ( 32 ) = 84 x 32 = 2688 ------------------------------------------------------------------------ 9.3 Chapter 10. Scaling Your Configuration Through Adding Processors 9.3.1 Problems When Adding Nodes to a Partitioned Database When adding nodes to a partitioned database that has one or more system temporary table spaces with a page size that is different from the default page size (4 KB), you may encounter the error message: "SQL6073N Add Node operation failed" and an SQLCODE. This occurs because only the IBMDEFAULTBP buffer pool exists with a page size of 4 KB when the node is created. For example, you can use the db2start command to add a node to the current partitioned database: DB2START NODENUM 2 ADDNODE HOSTNAME newhost PORT 2 If the partitioned database has system temporary table spaces with the default page size, the following message is returned: SQL6075W The Start Database Manager operation successfully added the node. The node is not active until all nodes are stopped and started again. However, if the partitioned database has system temporary table spaces that are not the default page size, the returned message is: SQL6073N Add Node operation failed. SQLCODE = "<-902>" In a similar example, you can use the ADD NODE command after manually updating the db2nodes.cfg file with the new node description. After editing the file and running the ADD NODE command with a partitioned database that has system temporary table spaces with the default page size, the following message is returned: DB20000I The ADD NODE command completed successfully. However, if the partitioned database has system temporary table spaces that are not the default page size, the returned message is: SQL6073N Add Node operation failed. SQLCODE = "<-902>" One way to prevent the problems outlined above is to run: DB2SET DB2_HIDDENBP=16 before issuing db2start or the ADD NODE command. This registry variable enables DB2 to allocate hidden buffer pools of 16 pages each using a page size different from the default. This enables the ADD NODE operation to complete successfully. Another way to prevent these problems is to specify the WITHOUT TABLESPACES clause on the ADD NODE or the db2start command. After doing this, you will have to create the buffer pools using the CREATE BUFFERPOOL statement, and associate the system temporary table spaces to the buffer pool using the ALTER TABLESPACE statement. When adding nodes to an existing nodegroup that has one or more table spaces with a page size that is different from the default page size (4 KB), you may encounter the error message: "SQL0647N Bufferpool "" is currently not active.". This occurs because the non-default page size buffer pools created on the new node have not been activated for the table spaces. For example, you can use the ALTER NODEGROUP statement to add a node to a nodegroup: DB2START CONNECT TO mpp1 ALTER NODEGROUP ng1 ADD NODE (2) If the nodegroup has table spaces with the default page size, the following message is returned: SQL1759W Redistribute nodegroup is required to change data positioning for objects in nodegroup "" to include some added nodes or exclude some drop nodes. However, if the nodegroup has table spaces that are not the default page size, the returned message is: SQL0647N Bufferpool "" is currently not active. One way to prevent this problem is to create buffer pools for each page size and then to reconnect to the database before issuing the ALTER NODEGROUP statement: DB2START CONNECT TO mpp1 CREATE BUFFERPOOL bp1 SIZE 1000 PAGESIZE 8192 CONNECT RESET CONNECT TO mpp1 ALTER NODEGROUP ng1 ADD NODE (2) A second way to prevent the problem is to run: DB2SET DB2_HIDDENBP=16 before issuing the db2start command, and the CONNECT and ALTER NODEGROUP statements. Another problem can occur when the ALTER TABLESPACE statement is used to add a table space to a node. For example: DB2START CONNECT TO mpp1 ALTER NODEGROUP ng1 ADD NODE (2) WITHOUT TABLESPACES ALTER TABLESPACE ts1 ADD ('ts1') ON NODE (2) This series of commands and statements generates the error message SQL0647N (not the expected message SQL1759W). To complete this change correctly, you should reconnect to the database after the ALTER NODEGROUP... WITHOUT TABLESPACES statement. DB2START CONNECT TO mpp1 ALTER NODEGROUP ng1 ADD NODE (2) WITHOUT TABLESPACES CONNECT RESET CONNECT TO mpp1 ALTER TABLESPACE ts1 ADD ('ts1') ON NODE (2) Another way to prevent the problem is to run: DB2SET DB2_HIDDENBP=16 before issuing the db2start command, and the CONNECT, ALTER NODEGROUP, and ALTER TABLESPACE statements. ------------------------------------------------------------------------ 9.4 DB2 Registry and Environment Variables 9.4.1 Corrections to Performance Variables Table 5. Performance Variables Variable Name Operating Values System Description DB2_BLOCK_BASED_BP Solaris Default=None Values: dependant on parameters Specifies the values needed to create a block area within a buffer pool. The ID of the buffer pool is needed and can be seen in the BUFFERPOOLID column of the SYSCAT.BUFFERPOOLS system catalog view. The number of pages to be allocated in the buffer pool to block-based I/O must be given. The number of pages to include in a block is optional, with a default value of 32. The format for the use of this registry variable is: DB2_BLOCK_BASED_BP=BUFFER POOL ID,BLOCK AREA SIZE,[BLOCK SIZE];... Multiple buffer pools can be defined as block-based using the same variable with a semi-colon separating the entries. The value for BLOCK SIZE can range from 2 to 256. If no BLOCK SIZE is given, the default used is 32. If the BLOCK AREA SIZE specified is larger than 98% of the total buffer pool size, then the buffer pool will not be made block-based. It is a good idea to always have some portion of the buffer pool in the page-based area of the buffer pool because there is a possibility of individual pages being required even if the majority of the I/O on the system is sequential prefetching. If the value specified for BLOCK AREA SIZE is not a multiple of BLOCK SIZE, it is reduced to the nearest block size boundary. For more information on block-based I/O, see 9.2.1, Block- Based Buffer Pool. DB2_NO_FORK_CHECK UNIX Default=OFF Values: ON or OFF When this variable is "ON", the client process will not protect itself against an application making a copy of the process to be run (called forking). When forking occurs, the results are unpredictable. The results could range from no effect, to some bad results, to some error code being returned, to a trap in the application. If you are certain that your application does not fork and you want better performance, you should change the value of this variable to "ON". 9.4.2 Corrections and Additions to Miscellaneous Registry Variables The DB2_NEWLOGPATH2 registry variable is available for all operating systems. A new variable, DB2_ROLLFORWARD_NORETRIEVE, has been introduced. The correct information for both variables appears below. Table 6. Miscellaneous Variables Variable Name Operating Values System Description DB2_NEWLOGPATH2 ALL Default=NO Values: YES or NO This parameter allows you to specify whether a secondary path should be used to implement dual logging. The path used is generated by appending a "2" to the current value of the logpath database configuration parameter. DB2_ROLLFORWARD_NORETRIEVE ALL Default=(not set) Values: YES or NO If the database configuration parameter USEREXIT is enabled, log files are automatically retrieved from the archive during rollforward operations. The DB2_ROLLFORWARD_NORETRIEVE variable lets you specify that rollforward operations should not retrieve log files from the archive. This variable is disabled by default. Set this variable to YES if you do not want rollforward to retrieve log files automatically. For example, set the variable to YES in a hot-standby setup when want to keep log records created by a bad application from corrupting the backup system. 9.4.3 Corrections and Additions to General Registry Variables A new variable, DB2_REDUCED_OPTIMIZATION, has been introduced. Table 7. General Registry Variable Variable Name Operating Values System Description DB2_REDUCED_OPTIMIZATION ALL Default=NO Values: YES, NO, or any integer This registry variable lets you disable some of the optimization techniques used at specific optimization levels. If you reduce the number of optimization techniques used, you also reduce time and resource use during optimization. Note: Although optimization time and resource use might be reduced, the risk of producing a less-than-optimal data access plan is increased. * If set to NO The optimizer does not change its optimization techniques. * If set to YES If the optimization level is 5 (the default) or lower, the optimizer disables some optimization techniques that might consume significant prepare time and resources but that do not usually produce a better access plan. If the optimization level is exactly 5, the optimizer scales back or disables some additional techniques, which might further reduce optimization time and resource use, but also further increase the risk of a less-than-optimal access plan. For optimization levels lower than 5, some of these techniques might not be in effect in any case. If they are, however, they remain in effect. * If set to any integer The effect is the same as if the value is set to YES, with the following additional behavior for dynamically prepared queries optimized at level 5: If the total number of joins in any query block exceeds the setting, then the optimizer switches to greedy join enumeration instead of disabling additional optimization techniques as described above for optimization level 5, which implies that the query will be optimized at a level similar to optimization level 2. For information about greedy and dynamic join enumeration, see "Search Strategies for Selecting Optimal Join" in Administration Guide: Performance. Note that the dynamic optimization reduction at optimization level 5, as described in "Adjusting the Optimization Class" in Administration Guide: Performance, takes precedence over the behavior described for optimization level of exactly 5 when DB2_REDUCED_OPTIMIZATION is set to YES as well as over the behavior described for the integer setting. ------------------------------------------------------------------------ Administration Guide: Implementation ------------------------------------------------------------------------ 10.1 Chapter 8. Recovering a Database 10.1.1 How to Use Suspended I/O In Chapter 8."Recovering a Database", the following section on using the suspended I/O function has been added and updated: Note: The information below about the db2inidb utility supersedes the information in the Version 7.2 What's New book. db2inidb is a new tool shipped with DB2 that can perform crash recovery and put a database in roll forward pending state. Suspended I/O supports continuous system availability by providing a full implementation for online split mirror handling, that is, splitting a mirror without shutting down the database. If a customer cannot afford doing offline or online backups on a large database, backups or system copies can be done from a mirror image by using suspended I/O and split mirror. Suspended I/O prevents disk writes to ensure that the split mirror image of a database is consistent. All database operations, beside online backup and restore, should function normally while a database is suspended. However, some operations may hang while attempting to flush dirty pages from the buffer pool or log buffers to the logs. These operations should resume normally once the database I/O is resumed. It is important that the database I/O be resumed from the same connection that it was originally suspended. Otherwise, a subsequent connection attempt may hang if it requires flushing dirty pages from the buffer pool to disk. Mirroring a database primarily involves copying the entire contents of the database directory. It is also necessary to copy the log directory and any table space containers if they are not located in the database directory. Since the split mirrored database is dependent on these directory paths, the paths that these directories are copied to must be identical to those from the primary system. This implies that the instance must also be the same. As a result of this dependency, it is not possible to mirror a database on the same system as the primary unless the new "relocate" option of the db2inidb tool is used. The purpose of the "relocate" option is to relocate a database on a given system using a specified configuration file. This can involve changing the internal database directory, container directory names, and log directory, changing the instance name and changing the database name. Assuming the database directory, container directories and log directory were successfully mirrored to different directory paths on the same system as the primary database, the db2inidb tool can be used along with the "relocate" option to update the mirrored database's internal paths. A usage scenario with this option can be found below. Depending on how the storage devices are being mirrored, the uses of db2inidb will vary. The following uses assume that the entire database is mirrored consistently through the storage system. In a multi-node environment, the db2inidb tool must be run on every partition before the split image can be used from any of the partitions. The db2inidb tool can be run on all partitions simultaneously. 1. Making a Clone Database The objective here is to have a clone of the primary database to be used for read-only purposes. The following procedure describes how a clone database may be made: a. Suspend I/O writes on the primary database by entering the following command: db2 set write suspend for database b. Use operating system level commands to split the mirror from the primary database. c. Resume I/O writes on the primary database by entering the following command: db2 set write resume for database After running the command, the primary database should be back to a normal state. d. Mount the split mirror of the database from another system. e. Start the database instance by entering the following command: db2start f. Start the DB2 crash recovery by entering the following command: db2inidb database_name AS SNAPSHOT Note: This command will remove the suspend write state and rollback the changes made by transactions that were in-flight at the time of the split. You can also use this process for an offline backup, but if restored on the primary database, this backup cannot be used to roll forward, because the log chain will not match. 2. Using the Split Mirror as a Standby Database As the mirrored (standby) database is continually rolling forward through the logs, new logs that are being created by the primary database, are constantly fetched from the primary system. The following procedure describes how the split mirror can be used as a standby database: a. Suspend I/O writes on the primary database. db2 set write suspend for database b. Use the operating system level commands to split the mirror from the primary database. c. Resume the I/O writes on the primary database so that it goes back to normal processing. db2 set write resume for database d. Mount the split mirror of the database to another system. e. Place the mirror in roll forward pending and roll forward the mirror. db2inidb database_name AS STANDBY Note: This command will remove the suspend write state and place the mirrored database in roll forward pending state. f. Copy logs by setting up a user exit program to retrieve log files from the primary system to ensure that the latest logs will be available for this mirrored database. g. Roll forward the database to the end of the logs. h. Go back to step f and repeat this process until the primary database is down. 3. Using the Split Mirror as a Backup Image The following procedure describes how to use the mirrored database as a backup image to restore over the primary database: a. Use operating system commands to copy the mirrored data and logs on top of the primary database. b. Start the database instance by entering the following command: db2start c. Run the following command to place the mirrored database in a roll-forward pending state and to remove the suspend write state. db2inidb database_name AS MIRROR d. Roll forward the database to the end of the logs. 4. Splitting a Mirror onto the Same System as the Primary Database The following procedure describes how to use the "relocate" option of the db2inidb tool to mirror a database onto the same system as the primary database. The example assumes that the database will be used under a new instance. a. Create a new instance on the current system. b. Suspend I/O writes on the primary database. db2 set write suspend for database c. Use the operating system level commands to split the mirror from the primary database. Note: The database directory, container directories and log directory must be copied to different directories. If the container directories or the log directory exist under the database directory, then only the database directory needs to be copied. d. Resume I/O writes on the primary database so that it goes back to normal processing. db2 set write resume for database e. Create a configuration file with the following information: DB_NAME=, DB_PATH=, INSTANCE=, LOG_DIR=, CONT_PATH=, ... CONT_PATH=, NODENUM= Note: The LOG_DIR and the CONT_PATH fields are only required if the log directory and container directories exist outside of the database directory. All of the other fields are required, except for NODENUM which will default to zero if not specified. f. Start the database from the newly created instance. db2start g. Relocate the mirrored database, remove the suspended state and place the mirror in the roll forward pending state: db2inidb database_name as STANDBY relocate using config_file h. Copy logs by setting up a user exit program to retrieve log files from the primary database to ensure that the latest logs will be available for this mirrored database. i. Roll forward the database to the end of the logs. j. Go back to step h and repeat this process until the primary database is down. ------------------------------------------------------------------------ Administering Satellites Guide and Reference (無中文版) ------------------------------------------------------------------------ 11.1 Setting up Version 7.2 DB2 Personal Edition and DB2 Workgroup Edition as Satellites The sections that follow describe how to set up Windows-based Version 7.2 DB2 Personal Edition and DB2 Workgroup Edition systems so that they can be used as fully functional satellites in a satellite environment. For information about the terms and concepts used in the information that follows, refer to the Administering Satellites Guide and Reference. You can find this book at the following URL: http://www-4.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/v6pubs.d2w/en_main For Technotes that supplement the information in the Administering Satellites Guide and Reference, refer to the following URL: http://www-4.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/browse.d2w/ report?type=tech5udb&tech5udb=Y 11.1.1 Prerequisites To set up either DB2 Personal Edition or DB2 Workgroup Edition as satellites, you require the following: 1. A DB2 control server The DB2 control server is a DB2 Enterprise Edition system that runs on Windows NT or AIX, and has the Control Server component installed. The DB2 Enterprise Edition system that you use must be at Version 6 with FixPak 2 or higher, or Version 7 at any FixPak level. o If you have a Version 6 Enterprise Edition system that you want to use as the DB2 control server, see 11.1.3, Installing FixPak 2 or Higher on a Version 6 Enterprise Edition System. o If you are using Version 7 and do not have the Control Server component installed, install this component, re-install any FixPaks that you have already installed, then create the DB2 control server instance and satellite control database. Refer to the Administering Satellites Guide and Reference for instructions on creating these objects. Note: If you are installing a Version 7.2 Enterprise Edition system on Windows NT for use as the DB2 control server, and you want to perform a response file installation, see the Technote entitled DB2 Control Server Response File Keywords for information about the keywords to specify in the response file. 2. The DB2 control server instance and the satellite control database The DB2 control server instance is typically called DB2CTLSV, and the satellite control database is called SATCTLDB. The DB2 control server instance and the satellite control database are on the Enterprise Edition system, and, on Windows NT, are automatically created when you install DB2 with the Control Server component. If you install DB2 on AIX, see the Administering Satellites Guide and Reference for information about creating the DB2 control server instance and the satellite control database. 3. The Satellite Administration Center The Satellite Administration Center is the set of GUI tools that you use to set up and administer the satellite environment. You access this set of tools from the Control Center. For more information about the Satellite Administration Center and the satellite environment, see the Administering Satellites Guide and Reference, and the online help that is available from the Satellite Administration Center. If you are running a Version 6 Control Center, see 11.1.4, Upgrading a Version 6 Control Center and Satellite Administration Center. If you have not already used the Satellite Administration Center to set up the satellite environment and to create the object that represents the new satellite in the Satellite Administration Center, you should do so before installing the satellite. For more information, see the description of how to set up and test a satellite environment in the Administering Satellites Guide and Reference. 4. A Version 7.2 Personal Edition or Workgroup Edition system that you want to use as a satellite. 11.1.1.1 Installation Considerations When you install either DB2 Personal Edition or DB2 Workgroup Edition, you do not have to select any special component to enable either system to synchronize. If you intend to perform a response file installation, see Performing a Response File Installation for the keywords that you should specify when installing the Version 7.2 system. If you are performing an interactive installation of your Version 7.2 system, see 11.1.2, Configuring the Version 7.2 System for Synchronization after you finish installing DB2 for values that you must set at the Version 7.2 system to enable it to synchronize. Performing a Response File Installation If you are performing a response file installation of Version 7.2 DB2 Personal Edition or DB2 Workgroup Edition, you can set the following keywords in the response file. If you decide to not specify one or more of these keywords during the response file installation, see 11.1.2, Configuring the Version 7.2 System for Synchronization for additional steps that you must perform after installing DB2 to enable the Version 7.2 system to synchronize. You can also use the instructions in this section if you want to change any values that were specified during the response file installation. db2.db2satelliteid Sets the satellite ID on the system. Note: If you do not specify this keyword, the satellite ID is automatically set to the user ID that was used to install DB2. If you want to use this user ID as the satellite ID, you do not have to specify a value for this keyword. db2.db2satelliteappver Sets the application version on the system. Note: If you do not specify this keyword, the application version on the satellite is automatically set to V1R0M00. If you want to use this value as the application version, you do not have to specify a value for this keyword. db2.satctldb_username Sets the user name to be used for the system to connect to the satellite control database. db2.satctldb_password Sets the password that the user name passes to the DB2 control server when the user name connects to the satellite control database. After you complete the response file installation, the Version 7.2 system is ready to synchronize. You should issue the db2sync -t command on the satellite to verify that the values specified on the satellite are correct, and that the satellite can connect to the satellite control database. For additional information about performing a response file installation, refer to the Administering Satellites Guide and Reference. Note: 1. In Version 7, user IDs and passwords are required for the creation of all services on Windows NT and Windows 2000. These user IDs and passwords are specified in the response file by keyword pairs. The first keyword pair found in the response file becomes the default user ID and password for all services, unless you provide an override for a service by specifying the specific keyword pair for that service. In Version 6, the admin.userid and the admin.password keywords could be specified during a response file installation of DB2 Satellite Edition to specify the user ID and password that would be used by the Remote Command Service. For Version 7.2 Personal Edition and Workgroup Edition, if you specify these keywords, they are used for the DB2DAS00 instance on the Version 7.2 system. For a DB2 Version 7.2 system, the Remote Command Service will use the user ID and password that is used by the DB2 instance on the system. If you do not specify values for db2.userid and db2.password, the defaulting rule described above applies. 2. In Version 6, you could create a database when installing DB2 Satellite Edition using a response file installation. You cannot create a database during a response file installation on the Version 7.2 Personal Edition or Workgroup Edition system that you intend to use as a satellite. The following keywords (which are described in the Administering Satellites Guide and Reference), are not supported: o db2.userdb_name o db2.userdb_recoverable o db2.userdb_rep_src 11.1.2 Configuring the Version 7.2 System for Synchronization If you install the Version 7.2 system interactively, several values must be set on the DB2 Personal Edition or DB2 Workgroup Edition system after installing DB2 before the system can synchronize. Note: You can execute an operating system script on the system to set all values at the satellite except for the user ID and password that the satellite uses to connect to the satellite control database (see step 4). 1. Set the satellite ID by using the db2set command. If you install DB2 Personal Edition or DB2 Workgroup Edition interactively, the satellite ID is automatically set to the user ID that was used to install DB2. If you want to use this user ID as the satellite ID, you do not have to perform this step. For information about setting the satellite ID, see the Administering Satellites Guide and Reference. 2. Set the application version on the satellite by using the db2sync -s command. If you install DB2 Personal Edition or DB2 Workgroup Edition interactively, the application version on the satellite is automatically set to V1R0M00. If you want to use this value as the application version, you do not have to perform this step. You can use the db2sync -g command on the satellite to view the current setting of the application version. If you want to change this value, issue the db2sync -s command. You are prompted to provide a new value for the application version. For more information about setting the application version, see the Administering Satellites Guide and Reference. 3. Issue the catalog node and catalog database commands on the satellite to catalog the DB2 control server instance and the satellite control database, SATCTLDB, at the satellite. You can also use the db2sync -t command on the satellite to open the DB2 Synchronizer application in test mode. If the SATCTLDB database is not cataloged at the satellite when you issue the command, the Catalog Control Database window opens. You can either use the DB2 discovery feature that is available from the Catalog Control Database window to catalog the DB2 control server and the SATCTLDB database, or you can type the hostname and server name in this window. You will also be prompted to specify the user ID and password that the satellite will use to connect to the satellite control database, as described in step 4. Note: After you install Version 7.2 DB2 Personal Edition or DB2 Workgroup Edition interactively, the DB2 Synchronizer does not start automatically in test mode (as was the case for Version 6 DB2 Satellite Edition). 4. Issue the db2sync -t command on the satellite to: o Specify the user ID and the password that the satellite will use to connect to the satellite control database If synchronization credentials are not already stored at the satellite, the Connect to Control Database window opens. You must use this window to specify the user ID and password the satellite will use to connect to the satellite control database. o Verify the values that are set on the satellite are correct o Verify that the satellite can connect to the satellite control database After you complete these configuration tasks, the Version 7.2 system is ready to synchronize. 11.1.3 Installing FixPak 2 or Higher on a Version 6 Enterprise Edition System For a Version 6 Enterprise Edition system to be used as a DB2 control server, the system must be at FixPak 2 or higher. The sections that follow describe the tasks that you must perform to upgrade a Version 6 Enterprise Edition system on Windows NT or AIX for use as a DB2 control server. If you are using a Version 6 Control Center, also perform the steps in 11.1.4, Upgrading a Version 6 Control Center and Satellite Administration Center to verify that you have the correct level of the Control Center and the Satellite Administration Center to administer the satellite environment. 11.1.3.1 Upgrading Version 6 DB2 Enterprise Edition for Use as the DB2 Control Server For a Version 6 DB2 Enterprise Edition system to be used as the DB2 control server, it must be installed with the Control Server component, and DB2 Enterprise Edition should be at the FixPak 2 service level, or higher. Depending on whether the DB2 control server component is installed, and the service level of DB2 Enterprise Edition, you will have to perform one of the following tasks: * Install the DB2 control server component to an existing DB2 Enterprise Edition V6.1 system and install FixPak 2 or higher. Then update the satellite control database (SATCTLDB) on the system. * Upgrade an already installed DB2 control server to the FixPak 2 level or higher. Use the information that follows to identify which of the two preceding tasks you need to perform, and the steps that apply to your situation. The following is a summary of the steps that you will perform. 1. First, assess the current state of your DB2 Enterprise Edition installation. You will determine whether the Control Server component is installed, and the service level of DB2. 2. Second, based on the state information that you obtain, you will determine what needs to be done. 3. Third, you will perform the necessary steps to upgrade DB2 Enterprise Edition. The DB2 control server can only run on DB2 Enterprise Edition for Windows NT and AIX. Continue with the instructions that are appropriate for your platform: * Upgrading DB2 Enterprise Edition on Windows NT * Upgrading DB2 Enterprise Edition on AIX Upgrading DB2 Enterprise Edition on Windows NT Use the information in the sections that follow to determine the current service level of your Version 6 DB2 Enterprise Edition system, and the steps that you need to perform to update the system to the FixPak 2 service level or higher. You will need to perform the steps of one or more of the following sections: * Assessing DB2 Enterprise Edition on Windows NT * Determining What Needs to Be Done * Installing the Control Server Component on Windows NT * Installing FixPak 2 or Higher on Windows NT * Upgrading the SATCTLDB on Windows NT Assessing DB2 Enterprise Edition on Windows NT If you have DB2 Enterprise Edition installed on Windows NT, perform the following steps: 1. Check whether the Control Server component is installed. Use the Registry Editor to display the list of installed components: a. Enter regedit at a command prompt. b. Under the HKEY_LOCAL_MACHINE\SOFTWARE\IBM\DB2\Components registry key, check whether the Control Server is listed. If it is not listed, the control server is not installed. 2. Determine the service level of DB2 Enterprise Edition. Issue the db2level command from a command prompt. Use the table that follows to interpret the output: Values of Key Fields in the db2level output Your DB2 Release Level Informational Tokens system is at: SQL06010 01010104 db2_v6, n990616 Version 6.1 base SQL06010 01020104 DB2 V6.1.0.1, n990824, Version 6.1 WR21136 plus FixPak 1 SQL06010 01030104 DB2 V6.1.0.6, s991030, Version 6.1 WR21163 or DB2 V6.1.0.9, plus FixPak 2 s000101, WR21173 Note: If the level is greater than 01030104, your system is at a higher FixPak than FixPak 2. 3. Record the information that you find, and continue at Determining What Needs to Be Done. Determining What Needs to Be Done Using the information that you have gathered, find the row in the following table that applies to your situation, and follow the steps that are required to prepare your DB2 Enterprise Edition system to support the DB2 control server at the FixPak 2 level or higher. Sections that follow the table provide instructions for performing the required steps. Consider checking off each step as you perform it. Only perform the steps that apply to your situation. Control Server Service Level of DB2 Steps required to Component Installed Enterprise Edition prepare your DB2 System Enterprise Edition system No Version 6.1 base, or Perform the following Version 6.1 plus FixPak steps: 1, or Version 6.1 plus FixPak 2 or higher 1. Installing the Control Server Component on Windows NT 2. Installing FixPak 2 or Higher on Windows NT 3. Upgrading the SATCTLDB on Windows NT Yes Version 6.1 base, or Perform the following Version 6.1 plus FixPak steps: 1 1. Installing FixPak 2 or Higher on Windows NT 2. Upgrading the SATCTLDB on Windows NT Yes Version 6.1, plus FixPak Perform the following 2 or higher step: 1. Upgrading the SATCTLDB on Windows NT Installing the Control Server Component on Windows NT To install the Control Server component on Windows NT: 1. Ensure that all database activity on the system is complete before proceeding. 2. Insert the DB2 Universal Database Enterprise Edition Version 6.1 CD in the CD drive. If the installation program does not start automatically, run the setup command in the root of the CD to start the installation process. 3. When prompted, shut down all the processes that are using DB2. 4. On the Welcome window, select Next. 5. On the Select Products window, ensure that DB2 Enterprise Edition is selected. 6. On the Select Installation Type panel, click Custom. 7. On the Select Components panel, ensure that the Control Server component is selected, and click Next. Note: If you select other components that are not already installed on your system, these components will be installed too. You cannot alter the drive or directory in which DB2 is installed. 8. On the Configure DB2 Services panels, you can modify the protocol values and the start-up options for the Control Server instance, or take the default values. Either modify the defaults and click Next, or click Next to use the defaults. 9. Click Next on the Start Copy files window to begin the installation process. 10. When the file copying process is complete, you have the option of rebooting your system. You should reboot now. The changes made to the system for the Control Server do not take effect until the system is rebooted. When the installation process is complete and you have rebooted the system, the satellite control database (SATCTLDB) that was created as part of the Control Server installation must be cataloged in the DB2 instance if you want to use the Control Center and Satellite Administration Center locally on the system. To catalog the SATCTLDB database: 1. Open a DB2 Command Window by selecting Start>Programs>DB2 for Windows NT>Command Window 2. Ensure that you are in the db2 instance. Issue the set command and check the value of db2instance. If the value is not db2, issue the following command: set db2instance=db2 3. Catalog the db2ctlsv instance by entering the following command: db2 catalog local node db2ctlsv instance db2ctlsv 4. Catalog the SATCTLDB database by entering the following command db2 catalog database satctldb at node db2ctlsv 5. Commit the cataloging actions by entering the following command: db2 terminate 6. Close the DB2 Command Window. Installing FixPak 2 or Higher on Windows NT To upgrade an existing Version 6 DB2 Enterprise Edition system on Windows NT to FixPak 2 or higher, either: * Download the latest FixPak for DB2 Enterprise Edition for Windows NT V6.1 from the Web, along with its accompanying readme. The FixPak can be downloaded by following the instructions at URL: http://www-4.ibm.com/software/data/db2/db2tech/version61.html Install the FixPak following the instructions in the readme.txt file. * Use a DB2 Universal Database, Version 6.1 FixPak for Windows NT CD that is at FixPak 2 level or higher, and follow the instructions in the readme.txt file in the WINNT95 directory on the CD to complete the installation. Upgrading the SATCTLDB on Windows NT To upgrade the SATCTLDB database on Windows NT 1. Determine the level of the SATCTLDB database: a. Log on with a user ID that has local administrative authority on the Windows NT system. b. Open a DB2 Command Window by selecting Start>Programs>DB2 for Windows NT>Command Window. c. Connect to the SATCTLDB by entering the following command db2 connect to satctldb d. Determine if the trigger I_BATCHSTEP_TRGSCR exists in the database by issuing the following query: db2 select name from sysibm.systriggers where name='I_BATCHSTEP_TRGSCR' Record the number of rows that are returned. e. Enter the following command to close the connection to the database: db2 connect reset If step 1d returned one row, the database is at the correct level. In this situation, skip step 2, and continue at step 3. If zero (0) rows are returned, the database is not at the correct level, and must be upgraded, as described in step 2, before you can perform step 3. 2. To upgrade the SATCTLDB database, perform the following steps. Enter all commands in the DB2 Command Window: a. Switch to the directory \misc, where is the install drive and path, for example c:\sqllib. b. Ensure that you are in the db2ctlsv instance. Issue the set command and check the value of db2instance. If the value is not db2ctlsv, issue the following command: set db2instance=db2ctlsv c. Drop the SATCTLDB database by entering the following command: db2 drop database satctldb d. Create the new SATCTLDB database by entering the following command: db2 -tf satctldb.ddl -z satctldb.log e. Issue the following command: db2 terminate 3. Bind the db2satcs.dll stored procedure to the SATCTLDB database. Perform the following steps: a. Connect to the SATCTLDB database by entering the following command db2 connect to satctldb b. Switch to the directory \bnd, where is the install drive and path, for example c:\sqllib. c. Issue the bind command, as follows: db2 bind db2satcs.bnd 4. Enter the following command to close the connection to the database: db2 connect reset 5. Close the DB2 Command Window. Upgrading DB2 Enterprise Edition on AIX Use the information in the sections that follow to determine the current service level of your Version 6 DB2 Enterprise Edition system, and the steps that you need to perform to update the system to the FixPak 2 service level, or higher. You will need to perform the steps of one or more of the following sections: * Assessing DB2 Enterprise Edition on AIX * Determining What Needs to Be Done * Installing the Control Server Component on AIX * Installing FixPak 2 or Higher on AIX * Upgrading the SATCTLDB Database on AIX Assessing DB2 Enterprise Edition on AIX If you have Version 6 DB2 Enterprise Edition installed on AIX, perform the following steps: 1. Check whether the Control Server component is installed. Enter the following command: lslpp -l | grep db2_06_01.ctsr If no data is returned, the Control Server component is not installed. 2. Determine the service level of the DB2 Enterprise Edition. Log on as a DB2 instance owner, and issue the db2level command. Use the table that follows to interpret the output: Values of Key Fields in the db2level output Your DB2 Release Level Informational Tokens system is at: SQL06010 01010104 db2_v6, n990616 Version 6.1 base SQL06010 01020104 DB2 V6.1.0.1, n990824, Version 6.1 U465423 plus FixPak 1 SQL06010 01030104 DB2 V6.1.0.6, s991030, Version 6.1 U468276 or DB2 V6.1.0.9, plus FixPak 2 s000101, U469453 Note: If the level is greater than 01030104, your system is at a higher FixPak than FixPak 2. 3. Record the information that you find, and continue at Determining What Needs to Be Done. Determining What Needs to Be Done Using the information that you have gathered, find the row in the following table that applies to your situation, and follow the steps that are required to prepare your Version 6 DB2 Enterprise Edition system to support the DB2 control server at the FixPak 2 level. Sections that follow the table provide instructions for performing the required steps. Consider checking off each step as you perform it. Only perform the steps that apply to your situation. Control Server Service Level of DB2 Steps required to Component Installed Enterprise Edition prepare your DB2 System Enterprise Edition system No Version 6.1 base, or Perform the following Version 6.1 plus FixPak steps: 1, or Version 6.1 plus FixPak 2 or higher 1. Installing the Control Server Component on AIX 2. Installing FixPak 2 or Higher on AIX 3. Upgrading the SATCTLDB Database on AIX Yes Version 6.1 base, or Perform the following Version 6.1 plus FixPak steps: 1 1. Installing FixPak 2 or Higher on AIX 2. Upgrading the SATCTLDB Database on AIX Yes Version 6.1, plus FixPak Perform the following 2 or higher step: 1. Upgrading the SATCTLDB Database on AIX Installing the Control Server Component on AIX To install the Control Server component on AIX 1. Log on as a user with root authority. 2. Insert the DB2 Universal Database Enterprise Edition Version 6.1 CD in the CD drive. 3. Change to the directory where the CD is mounted, for example, cd /cdrom. 4. Type the following command to start the DB2 installer: ./db2setup 5. When the DB2 Installer window opens, use the tab key to select the Install option, and press Enter. 6. Locate the Enterprise Edition line and use the tab key to select the Customize option beside it. Press Enter. 7. Select the DB2 Control Server component, tab to OK, and press Enter. 8. Follow the instructions on the remaining windows to complete the installation of the DB2 Control Server component. When the installation process is complete, create the DB2CTLSV instance and the SATCTLDB database. To perform these tasks, follow the detailed instructions in "Setting up the DB2 Control Server on AIX" in Chapter 13 of the Administering Satellites Guide and Reference. Installing FixPak 2 or Higher on AIX To upgrade an existing DB2 Enterprise Edition system AIX to FixPak 2 or higher, either: * Download the latest FixPak for DB2 Enterprise Edition for AIX V6.1 from the Web, along with its accompanying FixPak readme. The FixPak can be downloaded by following the instructions at URL: http://www-4.ibm.com/software/data/db2/db2tech/version61.html Install the FixPak following the instructions in the FixPak readme file. * Use a DB2 Universal Database, Version 6.1 FixPak for AIX CD that is at FixPak 2 level or higher, and follow the instructions in the readme directory on the CD to complete the installation. Ensure that you have updated the DB2CTLSV instance by running the db2iupdt command as instructed in the FixPak readme file. Upgrading the SATCTLDB Database on AIX To upgrade the SATCTLDB database on AIX: 1. Determine the level of the SATCTLDB database: a. Log in as db2ctlsv. b. Ensure that the database server has been started. If the server is not started, issue the db2start command. c. Connect to the SATCTLDB database by entering the following command: db2 connect to satctldb d. Determine if the trigger I_BATCHSTEP_TRGSCR exists in the database by issuing the following query: db2 "select name from sysibm.systriggers where name='I_BATCHSTEP_TRGSCR'" Record the number of rows that are returned. e. Enter the following command to close the connection to the database: db2 connect reset If step 1d returned one row, the database is at the correct level. In this situation, skip step 2, and continue at step 3. If zero (0) rows are returned, the database is not at the correct level, and must be upgraded, as described in step 2, before you can perform step 3. 2. To upgrade the SATCTLDB database to the FixPak 2 level, perform the following steps. Enter all commands in the DB2 Command Window: a. Switch to the $HOME/sqllib/misc directory. b. Drop the SATCTLDB database by entering the following command: db2 drop database satctldb c. Create the new SATCTLDB database by entering the following command: db2 -tf satctldb.ddl -z $HOME/satctldb.log d. Issue the following command: db2 terminate 3. Bind the db2satcs.dll stored procedure to the SATCTLDB database. Perform the following steps: a. Connect to the SATCTLDB database by entering the following command db2 connect to satctldb b. Switch to the directory $HOME/sqllib/bnd. c. Issue the bind command, as follows: db2 bind db2satcs.bnd 4. Enter the following command to close the connection to the database: db2 connect reset 11.1.4 Upgrading a Version 6 Control Center and Satellite Administration Center To use a Version 6 Control Center and Satellite Administration Center with a Version 6 DB2 control server and satellite control database (SATCTLDB) that have been upgraded to FixPak 2 or higher, the tools must also be upgraded to FixPak 2 or higher. If the Control Center and the Satellite Administration Center are running on the same system as the DB2 control server, they were upgraded when the DB2 Enterprise Edition system was upgraded to FixPak 2. However, if you run these tools on another system, you must upgrade this system to the FixPak 2 level or higher. To upgrade this system to FixPak 2 or higher: * Download the latest FixPak for your product at the V6.1 level from the Web, along with its accompanying readme. FixPaks can be downloaded by following the instructions at URL: http://www-4.ibm.com/software/data/db2/db2tech/version61.html Install the FixPak following the instructions in the readme file. * Use a DB2 Universal Database, Version 6.1 FixPak CD for the operating system that you are running that is at FixPak 2 level or higher, and follow the instructions in the readme to complete the installation. ------------------------------------------------------------------------ Command Reference ------------------------------------------------------------------------ 12.1 可用更新 Command Reference 已經更新成為 FixPak 4 的一部分。 您可以從 http://www.ibm.com/software/data/db2/udb/winos2unix/support 線上下載最新的 PDF。這些注意事項中的資訊是用以補充更新的參照。 您也可以在 CD 中取得所有已 更新的文件。 透過 DB2 服務並使用 PTF 號碼 U478862,即可訂購此 CD。 您可以從 http://www.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/help.d2w/report 取得聯絡「DB2 服務」的相關資訊。 ------------------------------------------------------------------------ 12.2 db2updv7 - 更新資料庫為版本 7 現行修正程式層次 此指令會更新資料庫中的系統型錄,並以下列方式支援現行的 FixPak: * 啟用新內建函數(ABS、DECRYPT_BIN、DECRYPT_CHAR、 ENCRYPT、GETHINT、 MULTIPLY_ALT 及 ROUND)。 * 啟用新內建程序(GET_ROUTINE_SAR 及 PUT_ROUTINE_SAR)。 * 在 Windows 及 OS/2 資料庫上,新增或引用 WEEK_ISO 及 DAYOFWEEK_ISO 函數 的更正。 * 針對從版本 2 移轉到版本 6 的表格,引用表格壓縮描述子的更正。 * 建立概略表 SYSCAT.SEQUENCES。 授權 sysadm 必要的連線 資料庫。此指令會自動建立連線到指定的資料庫。 指令語法 >>-db2updv7---d--database_name--+--------------------------+----> '--u--userid---p--password-' >--+----+------------------------------------------------------>< '--h-' 指令參數 -d database-name 指定要更新的資料庫名稱。 -u userid 指定使用者 ID。 -p password 指定使用者的通行碼。 -h 顯示說明資訊。當指定此選項時,任何其它選項都會被忽略, 且只會顯示 說明資訊。 範例 安裝 FixPak 後,發出下列指令以更新範例資料庫中的系統型錄: db2updv7 -d sample 用法注意事項 只有在執行 DB2 版本 7.1 或版本 7.2 且至少安裝了 FixPak 2 的資料庫上才 能使用此工具。如果指令發出一次以上, 則不會報告任何錯誤,且每一個型錄 更新都只會引用一次。 若要啟用新的內建函數,必須切斷與此資料庫連接的所有應用程式,且如果資料 庫已經啟動, 則必須停用。 ------------------------------------------------------------------------ 12.3 REBIND REBIND 指令的語法圖應如下所示: Missing value 指令語法 >>-REBIND--+---------+--package-name----------------------------> '-PACKAGE-' .-ANY----------. >--RESOLVE--+-CONSERVATIVE-+----------------------------------->< ------------------------------------------------------------------------ 12.4 db2inidb - 起始設定鏡映資料庫 RELOCATE USING configfile 參數的說明應如下所示: 指定在起始設定資料庫作為 snapshot、待用 (standby) 或鏡映之前, 資料庫檔案會 依據架構檔中列出的資訊重新安置。 註: 如需架構檔格式的相關資訊, 請參閱 Data Movement Utilities Guide and Reference。 12.4.1 使用情況資訊 指定好 RELOCATE USING configfile 參數並且順利重新配置資料庫之後, 就會將架 構檔複製到資料庫目錄中,並且更名為 db2path.cfg。以後遇到損毀回復或向前回復 時,也會在日誌檔處理期間使用這個架構檔,動態更名配置區路徑。 如果您起始設定 Snapshot 或鏡映資料庫,當回復完成時,會自動除去架構檔。如果 您起始設定待用資料庫,當回復完成或是您取消回復程序時,會自動除去架構檔。 如果您在擱置狀態中使用待用資料庫以便繼續前進,現在您想在原始資料庫中新增一 個配置區, 請手動更新 db2path.cfg 檔,指出待用資料庫配置區的儲存位置。 如果 不指定新配置區的位置,DB2 會將它們和原始配置區儲存在一起。 ------------------------------------------------------------------------ 12.5 GET ROUTINE 指令中的額外選項 現在這個指令也支援 HIDE BODY 參數,也就是指定當您從型錄中取出常式文字時,常 式主體必須換成空白主體。 它只影響文字,並不影響已編譯的程式碼。 GET ROUTINE 指令語法 >>-GET ROUTINE--INTO--file_name--FROM--+----------+-------------> '-SPECIFIC-' >--PROCEDURE--routine_name--+-----------+---------------------->< '-HIDE BODY-' ------------------------------------------------------------------------ Data Recovery and High Availability Guide and Reference(無中文版) ------------------------------------------------------------------------ 13.1 可在線上取得 Data Recovery and High Availability Guide and Reference 現在您可以在線上取得新的 Data Recovery and High Availability Guide and Reference,HTML 及 PDF 格式皆有, 網址為 http://www.ibm.com/software/data/db2/udb/winos2unix/support。 這些注意事項 中的資訊是用以補充更新的參照。 您也可以在 CD 中取得所有已更新的文件。透過 DB2 服務並使用 PTF 號碼 U478862,即可訂購此 CD。 您可以從 http://www.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/help.d2w/report 取得聯絡「DB2 服務」的相關資訊。 ------------------------------------------------------------------------ 13.2 當 LOGRETAIN=CAPTURE 時的新備份與復置行為 如果資料庫是以 LOGRETAIN 設定為 CAPTURE 來架構的,則無法執行下列作業: * 線上資料庫備份 * 線上或離線表格空間層次備份 * 線上或離線表格空間層次復置 使用 LOGRETAIN 設定為 CAPTURE 時所做的離線備份映像檔來執行資料庫復置作業之 後, 資料庫不會在 Roll-Forward 擱置狀態。而使用 LOGRETAIN 設定為 CAPTURE 時 所做的線上 資料庫備份映像檔來執行資料庫復置作業 (FixPak 4 之前的版本 7.2) 是支援的。 ------------------------------------------------------------------------ 13.3 NEWLOGPATH2 現在稱為 DB2_NEWLOGPATH2 對 NEWLOGPATH2 登錄變數的參照已變更為 DB2_NEWLOGPATH2。 ------------------------------------------------------------------------ 13.4 選擇 AIX 或 Solaris 上 DB2 Data Links Manager 的備份方法 在 Tivoli Storage Manager 系統選項檔案中設定 PASSWORDACCESS 選項前, 您必須 確定 /usr/lib 含有 libApiDS.a 程式庫檔案的符號鏈結。 ------------------------------------------------------------------------ 13.5 Tivoli Storage Manager -- LAN Free Data Transfer 現在 DB2 Universal Database 容許使用者使用 Tivoli LAN Free Data Transfer 技 術來備份及復置 TSM 伺服器。如果您拿下列任一版本的 DB2 Universal Database 與 Tivoli ADSM 3.1.x X 從屬站一起使用, 可能會在備份或復置 TSM 伺服器時發生問 題: * DB2 for AIX (32 位元) * DB2 for Solaris 作業環境 (32 位元) * DB2 for HP-UX (32 位元) 若要解決這些問題,請執行下列步驟: 1. 發出 db2stop 指令。 2. 進入 DB2 UDB 伺服器上的 sqllib/adsm 目錄。 3. 備份 libtadsm.a,命名為 libtadsm.a.bak。 4. 將 libadsm.a 複製到 libtasdm.a。 5. 發出 db2start 指令。 6. 重新發出失敗的備份或復置指令。 ------------------------------------------------------------------------ Data Movement Utilities Guide and Reference (無中文版) ------------------------------------------------------------------------ 14.1 Change to LOB File Handling by Export, Import and Load DB2 UDB now makes use of LOB Location Specifiers (LLS) when importing, exporting and loading LOB information. This allows multiple LOBs to be stored in a single file. An LLS is a string indicating where LOB data can be found within a file. The format of the LLS is filename.ext:nnn:mmm/, where filename.ext is the name of the file that contains the LOB, nnn is the offset of the LOB within the file (measured in bytes), and mmm is the length of the LOB (in bytes). For example, an LLS of db2exp.001.123.456/ indicates that the lob is located in file db2exp.001, begins at an offset of 123 bytes into the file, and is 256 bytes long. If the indicated size in the LLS is 0, the LOB is considered to have a length of 0. If the length is --1, the LOB is considered to be NULL and the filename and offset do not matter. When exporting data using the lobsinfile modifier, the LOBs will not always be placed into separate files. There may be multiple lobs in each lob file, and multiple lobfiles per lobpath. The data file will now contain LLS records instead of just file names. Import and Load have also been changed to handle the changes to the Export function. When loading or importing data with the modified by lobsinfile option specified, LLSs will be expected for each of the corresponding LOB columns. If something other than an LLS is encountered for a LOB column, the database will treat it as a LOB file, and will load the entire file as the LOB. 14.1.1 IXF considerations There are three new IXF data types. These three types correspond to CLOBs, BLOBs and DBCLOBs when represented by LLSs. The values of these data types are 964, 960, and 968 respectively. IXF files now require each LOB column to have its own D record. This is created automatically by the export tool, but must be created manually if you are using a third party utility to create the IXF files. Additionally, an LLS is required for each LOB in the table, and not just the non-null LOBs. If a LOB column is null, you must write an LLS representing a null LOB. ------------------------------------------------------------------------ 14.2 Code Page Support for Import, Export and Load Utilities The import, export and load utilities can now be used to transfer data from the new Chinese code page GB 18030 (code page identifier 5488) and the new Japanese code page ShiftJISX 0213 (code page identifier 1394) to DB2 UDB Unicode databases. In addition, the export utility can be used to transfer data from DB2 UDB Unicode databases to GB 18030 or ShiftJIS X0213 code page data. For example, the following command will load the Shift_JISX0213 data file u/jp/user/x0213/data.del residing on a remotely connected client into MYTABLE: db2 load client from /u/jp/user/x0213/data.del of del modified by codepage=1394 insert into mytable where MYTABLE is located on a DB2 UDB Unicode database. ------------------------------------------------------------------------ 14.3 db2relocatedb (new command) db2relocatedb - Relocate Database Renames a database, or relocates a database or part of a database (e.g., container, log directory) as specified in the configuration file provided by the user. This tool makes the necessary changes to the DB2 instance and database support files. Authorization None Required Connection None Command Syntax >>-db2relocatedb---f--configFilename--------------------------->< Command Parameters -f configFilename Specifies the name of the file containing configuration information necessary for relocating the database. This can be a relative or absolute filename. The format of the configuration file is: DB_NAME=oldName,newName DB_PATH=oldPath,newPath INSTANCE=oldInst,newInst NODENUM=nodeNumber LOG_DIR=oldDirPath,newDirPath CONT_PATH=oldContPath1,newContPath1 CONT_PATH=oldContPath2,newContPath2 ... Where: DB_NAME Specifies the name of the database being relocated. If the database name is being changed, both the old name and the new name must be specified. This is a required field. DB_PATH Specifies the path of the database being relocated. This is the path where the database was originally created. If the database path is changing, both the old path and new path must be specified. This is a required field. INSTANCE Specifies the instance where the database exists. If the database is being moved to a new instance, both the old instance and new instance must be specified. This is a required field. NODENUM Specifies the node number for the database node being changed. The default is 0. LOG_DIR Specifies a change in the location of the log path. If the log path is being changed, then both the old path and new path must be specified. This specification is optional if the log path resides under the database path, in which case the path is updated automatically. CONT_PATH Specifies a change in the location of table space containers. Both the old and new container path must be specified. Multiple CONT_PATH lines can be provided if there are multiple container path changes to be made. This specification is optional if the container paths reside under the database path, in which case the paths are updated automatically. Note: Blank lines or lines beginning with a comment character (#) will be ignored. Examples Example 1 To change the name of the database TESTDB to PRODDB in the instance DB2INST1 that resides on the path /home/db2inst1, create the following configuration file: DB_NAME=TESTDB,PRODDB DB_PATH=/home/db2inst1 INSTANCE=db2inst1 NODENUM=0 Save the configuration file as relocate.cfg and use the following command to make the changes to the database files: db2relocatedb -f relocate.cfg Example 2 To move the database DATAB1 from the instance JSMITH on the path /dbpath to the instance PRODINST do the following: 1. Move the files in the directory /dbpath/jsmith to /dbpath/prodinst. 2. Use the following configuration file with the db2relocatedb command to make the changes to the database files: DB_NAME=DATAB1 DB_PATH=/dbpath INSTANCE=jsmith,prodinst NODENUM=0 Example 3 The database PRODDB exists in the instance INST1 on the path /databases/PRODDB. The location of two tablespace containers needs to be changed as follows: * SMS container /data/SMS1 needs to be moved to /DATA/NewSMS1. * DMS container /data/DMS1 needs to be moved to /DATA/DMS1. After the physical directories and files have been moved to the new locations, the following configuration file can be used with the db2relocatedb command to make changes to the database files so that they recognize the new locations: DB_NAME=PRODDB DB_PATH=/databases/PRODDB INSTANCE=inst1 NODENUM=0 CONT_PATH=/data/SMS1,/DATA/NewSMS1 CONT_PATH=/data/DMS1,/DATA/DMS1 Example 4 The database TESTDB exists in the instance DB2INST1 and was created on the path /databases/TESTDB. Table spaces were then created with the following containers: TS1 TS2_Cont0 TS2_Cont1 /databases/TESTDB/TS3_Cont0 /databases/TESTDB/TS4/Cont0 /Data/TS5_Cont0 /dev/rTS5_Cont1 TESTDB is to be moved to a new system. The instance on the new system will be NEWINST and the location of the database will be /DB2. When moving the database, all of the files that exist in the /databases/TESTDB/db2inst1 directory must be moved to the /DB2/newinst directory. This means that the first 5 containers will be relocated as part of this move. (The first 3 are relative to the database directory and the next 2 are relative to the database path.) Since these containers are located within the database directory or database path, they do not need to be listed in the configuration file. If the 2 remaining containers are to be moved to different locations on the new system, they must be listed in the configuration file. After the physical directories and files have been moved to their new locations, the following configuration file can be used with db2relocatedb to make changes to the database files so that they recognize the new locations: DB_NAME=TESTDB DB_PATH=/databases/TESTDB,/DB2 INSTANCE=db2inst1,newinst NODENUM=0 CONT_PATH=/Data/TS5_Cont0,/DB2/TESTDB/TS5_Cont0 CONT_PATH=/dev/rTS5_Cont1,/dev/rTESTDB_TS5_Cont1 Example 5 The database TESTDB has 2 partitions on nodes 10 and 20. The instance is SERVINST and the database path is /home/servinst on both nodes. The name of the database is being changed to SERVDB and the database path is being changed to /databases on both nodes. In addition, the log directory is being changed on node 20 from /testdb_logdir to /servdb_logdir. Since changes are being made to both nodes, a configuration file must be created for each node and db2relocatedb must be run on each node with the corresponding configuration file. On node 10, the following configuration file will be used: DB_NAME=TESTDB,SERVDB DB_PATH=/home/servinst,/databases INSTANCE=servinst NODE_NUM=10 On node 20, the following configuration file will be used: DB_NAME=TESTDB,SERVDB DB_PATH=/home/servinst,/databases INSTANCE=servinst NODE_NUM=20 LOG_DIR=/testdb_logdir,/servdb_logdir Usage Notes If the instance that a database belongs to is changing, the following must be done before running this command to ensure that changes to the instance and database support files will be made: * If a database is being moved to another instance, create the new instance. * Copy the files/devices belonging to the databases being copied onto the system where the new instance resides. The path names must be changed as necessary. * Change the permission of the files/devices that were copied so that they are owned by the instance owner. If the instance is changing, the tool must be run by the new instance owner. In a EEE environment, this tool must be run against every node that requires changes. A separate configuration file must be supplied for each node, that includes the NODENUM value of the node being changed. For example, if the name of a database is being changed, every node will be affected and the db2relocatedb command must be run with a separate configuration file on each node. If containers belonging to a single node are being moved, the db2relocatedb command only needs to be run once on that node. See Also For more information, see the db2inidb - Initialize a Mirrored Database command in the Command Reference. ------------------------------------------------------------------------ 14.4 db2move -- New Options Available The db2move tool now has two addtional options, --aw and --sn. Full documentation for this tool follows: Moving Data Using the db2move Tool This tool facilitates the movement of large numbers of tables between DB2 databases located on workstations. The tool queries the system catalog tables for a particular database and compiles a list of all user tables. It then exports these tables in PC/IXF format. The PC/IXF files can be imported or loaded to another local DB2 database on the same system, or can be transferred to another workstation platform and imported or loaded to a DB2 database on that platform. Note: Tables with structured type columns are not moved when this tool is used. Authorization This tool calls the DB2 export, import, and load APIs, depending on the action requested by the user. Therefore, the requesting user ID must have the correct authorization required by those APIs, or the request will fail. Command Syntax .-------------------------. V | >>-db2move--dbname--action----+---------------------+-+-------->< +--tc--table-creators-+ +--tn--table-names----+ +--sn--schema names---+ +--io--import-option--+ +--lo--load-option----+ +--l--lobpaths--------+ +--u--userid----------+ +--p--password--------+ '--aw-----------------' Command Parameters dbname Name of the database. action Must be one of: EXPORT, IMPORT, or LOAD. -tc table-creators. The default is all creators. This is an EXPORT action only. If specified, only those tables created by the creators listed with this option are exported. If not specified, the default is to use all creators. When specifying multiple creators, each must be separated by commas; no blanks are allowed between creator IDs. The maximum number of creators that can be specified is 10. This option can be used with the "-tn" and "-sn" options to select the tables for export. An asterisk (*) can be used as a wildcard character that can be placed anywhere in the string. -tn table-names. The default is all user tables. This is an EXPORT action only. If specified, only those tables whose names match exactly those in the specified string are exported. If not specified, the default is to use all user tables. When specifying multiple table names, each must be separated by commas; no blanks are allowed between table names. The maximum number of table names that can be specified is 10. This option can be used with the "-tc" and "-sn" options to select the tables for export. db2move will only export those tables whose names are matched with specified table names and whose creators are matched with specified table creators. An asterisk (*) can be used as a wildcard character that can be placed anywhere in the string. -sn schema names. The default is ALL SCHEMAS. This is an EXPORT action only. If specified, only those tables whose schemas match exactly those in the specified string are exported. If not specified, the default is to use all schemas. When specifying multiple schema names, each must be separated by commas; no blanks are allowed between schema names. The maximum number of schema names that can be specified is 10. This option can be used with the "-tc" and "-tn" options to select the tables for export. db2move will only export those tables whose names are matched with specified table names, whose schemas are matched with specific table schemas, and whose creators are matched with specified table creators. An asterisk (*) can be used as a wildcard character that can be placed anywhere in the string. Note: Schema names less than 8 characters in length are padded to be 8 characters long. For example, if you want to include the schemas "AUSER" and "BUSER"and use the wildcard character, you must specify -sn *USER*. -io import-option. The default is REPLACE_CREATE. Valid options are INSERT, INSERT_UPDATE, REPLACE, CREATE, and REPLACE_CREATE. -lo load-option. The default is INSERT. Valid options are INSERT and REPLACE. -l lobpaths. The default is the current directory. This option specifies the absolute path names where LOB files are created (as part of EXPORT) or searched for (as part of IMPORT or LOAD). When specifying multiple LOB paths, each must be separated by commas; no blanks are allowed between LOB paths. If the first path runs out of space (during EXPORT), or the files are not found in the path (during IMPORT or LOAD), the second path will be used, and so on. If the action is EXPORT, and LOB paths are specified, all files in the LOB path directories are deleted, the directories are removed, and new directories are created. If not specified, the current directory is used for the LOB path. -u userid. The default is the logged on user ID. Both user ID and password are optional. However, if one is specified, the other must be specified. If the command is run on a client connecting to a remote server, user ID and password should be specified. -p password. The default is the logged on password. Both user ID and password are optional. However, if one is specified, the other must be specified. If the command is run on a client connecting to a remote server, user ID and password should be specified. -aw allow warnings. Used for the EXPORT action only. If this option is specified, then any tables that receive warnings during export will be included in the db2move.lst file. If the option is omitted, then any tables that cause warnings during export are not included in the db2move.lst file. A table's .ixf file and .msg file are generated regardless of whether or not this option is used. Examples * db2move sample export This will export all tables in the SAMPLE database; default values are used for all options. * db2move sample export -tc userid1,us*rid2 -tn tbname1,*tbname2 This will export all tables created by "userid1" or user IDs LIKE "us%rid2", and with the name "tbname1" or table names LIKE "%tbname2". * db2move sample import -l D:\LOBPATH1,C:\LOBPATH2 This example is applicable to OS/2 or the Windows operating system only. The command will import all tables in the SAMPLE database; LOB paths "D:\LOBPATH1" and "C:\LOBPATH2" are to be searched for LOB files. * db2move sample load -l /home/userid/lobpath,/tmp This example is applicable to UNIX-based systems only. The command will load all tables in the SAMPLE database; both the /home/userid/lobpath subdirectory and the tmp subdirectory are to be searched for LOB files. * db2move sample import -io replace -u userid -p password This will import all tables in the SAMPLE database in REPLACE mode; the specified user ID and password will be used. Usage Notes This tool exports, imports, or loads user-created tables. If a database is to be duplicated from one operating system to another operating system, db2move facilitates the movement of the tables. It is also necessary to move all other objects associated with the tables, such as aliases, views, triggers, user-defined functions, and so on. db2look (DB2 Statistics and DDL Extraction Tool; see the Command Reference) can facilitate the movement of some of these objects by extracting the data definition language (DDL) statements from the database. When export, import, or load APIs are called by db2move, the FileTypeMod parameter is set to lobsinfile. That is, LOB data is kept in separate files from PC/IXF files. There are 26 000 file names available for LOB files. The LOAD action must be run locally on the machine where the database and the data file reside. When the load API is called by db2move, the CopyTargetList parameter is set to NULL; that is, no copying is done. If logretain is on, the load operation cannot be rolled forward later. The table space where the loaded tables reside is placed in backup pending state and is not accessible. A full database backup, or a table space backup, is required to take the table space out of backup pending state. When issued on a Version 5.2 client against a Version 6 database, this tool does not support table or column names that are greater than 18 characters in length. Files Required/Generated When Using EXPORT: * Input: None. * Output: EXPORT.out The summarized result of the EXPORT action. db2move.lst The list of original table names, their corresponding PC/IXF file names (tabnnn.ixf), and message file names (tabnnn.msg). This list, the exported PC/IXF files, and LOB files (tabnnnc.yyy) are used as input to the db2move IMPORT or LOAD action. tabnnn.ixf The exported PC/IXF file of a specific table. tabnnn.msg The export message file of the corresponding table. tabnnnc.yyy The exported LOB files of a specific table. "nnn" is the table number, "c" is a letter of the alphabet, "yyy" is a number ranging from 001 to 999. These files are created only if the table being exported contains LOB data. If created, these LOB files are placed in the lobpath directories. There are a total of 26 000 possible names for the LOB files. system.msg The message file containing system messages for creating or deleting file or directory commands. This is only used if the action is EXPORT and a LOB path is specified. Files Required/Generated When Using IMPORT: * Input: db2move.lst An output file from the EXPORT action. tabnnn.ixf An output file from the EXPORT action. tabnnnc.yyy An output file from the EXPORT action. * Output: IMPORT.out The summarized result of the IMPORT action. tabnnn.msg The import message file of the corresponding table. Files Required/Generated When Using LOAD: * Input: db2move.lst An output file from the EXPORT action. tabnnn.ixf An output file from the EXPORT action. tabnnnc.yyy An output file from the EXPORT action. * Output: LOAD.out The summarized result of the LOAD action. tabnnn.msg The LOAD message file of the corresponding table. ------------------------------------------------------------------------ 14.5 Chapter 2. Import 14.5.1 Using Import with Buffered Inserts The note at the end of this section should read: Note: In all environments except EEE, the buffered inserts feature is disabled during import operations in which the INSERT_UPDATE parameter is specified. ------------------------------------------------------------------------ 14.6 Chapter 3. Load 14.6.1 Pending States After a Load Operation The first two sentences in the last paragraph in this section have been changed to the following: The fourth possible state associated with the load process (check pending state) pertains to referential and check constraints, DATALINKS constraints, AST constraints, or generated column constraints. For example, if an existing table is a parent table containing a primary key referenced by a foreign key in a dependent table, replacing data in the parent table places both tables (not the table space) in check pending state. 14.6.2 Load Restrictions and Limitations The following restrictions apply to generated columns and the load utility: * It is not possible to load a table having a generated column in a unique index unless the generated column is an "include column" of the index or the generatedoverride file type modifier is used. If this modifier is used, it is expected that all values for the column will be supplied in the input data file. * It is not possible to load a table having a generated column in the partitioning key unless the generatedoverride file type modifier is used. If this modifier is used, it is expected that all values for the column will be supplied in the input data file. 14.6.3 totalfreespace File Type Modifier The totalfreespace file type modifier (LOAD) has been modified to accept a value between 0 and 2 147 483 647. ------------------------------------------------------------------------ 14.7 Chapter 4. AutoLoader 14.7.1 rexecd Required to Run AutoLoader When Authentication Set to YES In the AutoLoader Options section the following note will be added to the AUTHENTICATION and PASSWORD parameters description: In a Linux environment, if you are running the AutoLoader with the authentication option set to YES, rexecd must be enabled on all machines. If rexecd is not enabled the following error message will be generated: openbreeze.torolab.ibm.com: Connection refused SQL6554N An error occurred when attempting to remotely execute a process. The following error messages will be generated in the db2diag.log file: 2000-10-11-13.04.16.832852 Instance:svtdbm Node:000 PID:19612(db2atld) Appid: oper_system_services sqloRemoteExec Probe:31 ------------------------------------------------------------------------ 14.8 AutoLoader May Hang During a Fork AIX 4.3.3 contains a fix for a libc problem that could cause the AutoLoader to hang during a fork. The AutoLoader is a multithreaded program. One of the threads forks off another process. Forking off a child process causes an image of the parent's memory to be created in the child. It is possible that locks used by libc.a to manage multiple threads allocating memory from the heap within the same process have been held by a non-forking thread. Since the non-forking thread will not exist in the child process, this lock will never be released in the child, causing the parent to sometimes hang. ------------------------------------------------------------------------ 14.9 Appendix C. Export/Import/Load Utility File Formats The following update has been added to this Appendix: The export, import, and load utilities are not supported when they are used with a Unicode client connected to a non-Unicode database. Unicode client files are only supported when the Unicode client is connected to a Unicode database. ------------------------------------------------------------------------ Replication 指南與參考手冊 ------------------------------------------------------------------------ 15.1 抄寫及非 IBM 伺服器 使用 DataJoiner 版本 2 或更新版來抄寫資料至非 IBM 伺服器, 或自非 IBM 伺服 器抄寫資料,如 Informix、Microsoft SQL Server、Oracle、Sybase、 Sybase SQL Anywhere。 您不可以使用此類型抄寫的關聯式連接函數,因為 DB2 Relational Connect 版本 7 沒有更新的能力。對現存的 DB2 和 DataJoiner 版本所有的平台 (AS/400、OS/2、OS/390、UNIX 及 Windows),您必須使用 DJRA(DataJoiner 抄寫 管理)來管理特殊的抄寫。 ------------------------------------------------------------------------ 15.2 在 Windows 2000 上的抄寫 DB2 DataPropagator 版本 7 與 Windows 2000 作業系統相容。 ------------------------------------------------------------------------ 15.3 儲存 SQL 檔案時的已知錯誤 若在 DB2 Connect Personal Edition 中使用「控制中心」,您無法儲存 SQL 檔案。 若試圖儲存 SQL 檔案,您將收到一則指示 DAS 不在作用中的錯誤訊息,事實上 DAS 沒有作用,因為它並沒有隨 DB2 Connect PE 出貨。 ------------------------------------------------------------------------ 15.4 DB2 維護 建議您針對在抄寫環境中使用的各種 DB2 產品安裝最新的 DB2 維護。 ------------------------------------------------------------------------ 15.5 Web 上的 Data Difference Utility 您可以從 Web 下載 Data Difference utility (DDU),網址如下: ftp://ftp.software.ibm.com/ps/products/datapropagator/fixes/。 DDU 是一個範 例公用程式,供您比較相同檔案的兩個不同版本,以及產生輸出檔來顯示版本之間的 差異。詳細資訊,請參閱此範例公用程式所附的 README 檔。 ------------------------------------------------------------------------ 15.6 第 3 章. 資料抄寫實務範例 15.6.1 抄寫實務 請參閱 DataPropagator 網站的 Library 頁面 (http://www.ibm.com/software/data/dpropr/) 以取得不同的新資料抄寫實務範例。 遵照實務範例中的步驟,從 AIX 上的 Oracle 資料庫抄寫來源表格將變更複製到 DB2 for Windows NT 上資料庫中的目標表格。 那個實務範例使用 DB2 DataJoiner Replication Administration (DJRA) 工具、擷取觸發函式、引用程式及 DB2 DataJoiner。 在書的第 44 頁,步驟 6 中有關建立通行碼檔案的指示應該如下: 步驟 6:建立通行碼檔案 因為引用程式需要連接到來源伺服器,您必須建立一個通行碼檔案來做使用者身分驗 證。 請確定用來執行引用程式的使用者 ID 可以讀取通行碼檔案。 若要建立通行碼檔案: 1. 從 Windows NT 指令提示視窗,變更目錄到 C:\scripts。 2. 在此目錄中建立一個叫做 DEPTQUAL.PWD 的新檔案。 您可以使用任何文字編輯 程式來建立這個檔案,比如 Notepad。 通行碼檔案的命名慣例為 applyqual.pwd; 其中 applyqual 字串是區分大小寫的, 必須符合您在建立定 期抄寫設定時所用的引用限定元的字體和值。 在此實務範例中,引用限定元是 DEPTQUAL。 註: 也支援 DB2 DataPropagator 版本 5 以來的檔案命名慣例。 3. 通行碼檔案的內容格式如下: SERVER=server USER=userid PWD=password 其中: 伺服器 指來源、目標或控制伺服器的名稱,必須與定期抄寫設定表格中所顯示的 完全一致。 在此實務範例中,這些名稱為 SAMPLE 及 COPYDB。 userid 您計劃用來管理該特定資料庫的使用者 ID。 若是 Windows NT 及 UNIX 作業系統,則此值要區分大小寫。 password 與使用者 ID 相關的通行碼。 若是 Windows NT 及 UNIX 作業系統,則此 值要區分大小寫。 請不要在這個檔案中加入空白行或註解行。 僅新增伺服器名稱、使用者 ID 和 通行碼資訊。 4. 通行碼檔案的內容看起來應該類似: SERVER=SAMPLE USER=subina PWD=subpw SERVER=COPYDB USER=subina PWD=subpw 關於 DB2 身分驗證與機密保護的詳細資訊,請參閱 IBM DB2 Administration Guide。 ------------------------------------------------------------------------ 15.7 第 5 章. 抄寫規劃 15.7.1 表格及直欄名稱 在 Solaris 上,DATALINK 抄寫可作為版本 7.1 FixPak 1 的一部份。 它需要一個 FTP 常駐程式,在來源及目標 DATALINK 檔案系統中執行, 並支援 MDTM (modtime) 指令,來顯示給定檔案的前次修改時間。如果您用的是版本 2.6 的 Solaris 作業系 統,或任何不包括 MDTM 的 FTP 支援, 則您需要附加的軟體,比如 WU-FTPD。 您不能在 AS/400 和其他平台之間的 DB2 資料庫抄寫 DATALINK 直欄。 在 AS/400 平台沒有支援 DATALINK 值「註解」屬性的抄寫。 執行 AIX 4.2 時,在您執行預設的使用者跳出程式 (ASNDLCOPY) 之前,必須安裝 APAR IY03101 (AIX 4210-06 建議維護 AIX 4.2.1) 的 PTF。 這個 PTF 包括了 FTP 常駐程式內 "modtime/MDTM" 指令的 Y2K修正程式。 欲驗證該修正程式,請檢查由 "modtime " 指令所傳回來的前次修改時間,其中 為 2000 年 1 月 1 日之後所修改的檔案。 如果目標表格是外部 CCD 表格,DB2 DataPropagator 會呼叫 ASNDLCOPY 常式抄寫 DATALINK 檔案。 關於 ASNDLCOPY 和 ASNDLCOPYDF 的使用,請參閱各程式原始碼的 序言。 The following restrictions apply: * 內部 CCD 表格含有 DATALINK 指示符,但沒有 DATALINK 值。 * 壓縮外部 CCD 表格含有 DATALINK 值。 * 非壓縮 CCD 目標表格不能有 DATALINK 直欄。 * 來源和目標伺服器相同時,定期抄寫設定不能有 DATALINK 直欄的成員。 15.7.3 LOB 限制 壓縮內部 CCD 表格不能和 LOB 直欄和 LOB 指示符有關聯。 15.7.4 規劃抄寫 在第 65 頁,「連通性」應該包括下列情形: 如果引用程式和控制伺服器不能連接,引用程式會終止。 使用 AS/400 的資料區塊,請確定間隔期間所抄寫的資料總量不超出 4 百萬列數,不 能如本書內 69 頁中所提的 4 MB。 ------------------------------------------------------------------------ 15.8 第 6 章. 設定抄寫環境 15.8.1 隨處更新 (Update-anywhere) 先決條件 如果您要使用衝突偵測和定期抄寫設定內多達 150 個的定期抄寫設定成員來設定隨處 更新抄寫, 則必須執行下列的 DDL,以建立控制伺服器的 ASN.IBMSNAP_COMPENSATE 表格。 CREATE TABLE ASN.IBMSNAP_COMPENSATE ( APPLY_QUAL char(18) NOT NULL, MEMBER SMALLINT, INTENTSEQ CHAR(10) FOR BIT DATA, OPERATION CHAR(1)); 15.8.2 設定抄寫環境 第 95 頁,「自行設定 CD 表格、索引和表格空間名稱」說明: DPREPL.DFT 檔案不 是位於 \sqllib\bin 目錄, 就是位於 \sqllib\java 目錄。 這是不正確的, DPREPL.DFT 位於 \sqllib\cc 目錄。 第 128 頁,保留限制說明:陳述當「擷取程式」暖開機或使用「擷取程式」刪改指令 時,才使用保留限制來刪改列數。若以自動刪改選項啟動「擷取程式」,則它不會使 用保留限制來刪改列數。 ------------------------------------------------------------------------ 15.9 第 8 章 問題判斷 抄寫分析程式在 Windows 32 位元系統和 AIX 上執行。 欲在 AIX 上執行分析程式, 請確定 PATH 環境變數內 sqllib/bin 目錄出現在 /usr/local/bin 前,以避免和 /usr/local/bin/analyze 發生衝突。 抄寫分析程式有兩個附加選用的關鍵字: CT 和 ATT。 CT=n 只顯示擷取追蹤表格內 n 天之後的登錄。 此關鍵字為選用的。 若您沒有指定 此關鍵字,其預設值為 7 天。 AT=n 只顯示引用追蹤表格內 n 天之後的登錄。 此關鍵字為選用的。 若您沒有指定 此關鍵字,其預設值為 7 天。 範例: analyze mydb1 mydb2 f=mydirectory ct=4 at=2 deepcheck q=applyqual1 下列為「抄寫分析程式」之最新關鍵字資訊: deepcheck 指定分析程式執行較完整的分析包括下列資訊:CD 和 UOW 刪改資訊、 DB2 for OS/390 表格空間分割和壓縮細節、關於定期抄寫設定的目標索引之分析、 定期 抄寫時間,以及定期抄寫設定 SQL 陳述式錯誤。 分析包括所有的伺服器。 此 關鍵字為選用的。 lightcheck 指定自報告中除去下列資訊:ASN.IBMSNAP_SUBS_COLS 表格所有直欄明細、 定 期抄寫錯誤、不規則、遺漏,不正確或無效的索引。 此資訊中的縮減儲存資源 和產生一個較小的 HTML 輸出檔。 此關鍵字和 deepcheck 關鍵字相互排斥。 AS/400 平台的 PTF 抄寫有分析程式工具。這些工具收集有關抄寫環境的資訊,同 時,產生一個傳送到 IBM 服務中心代表的 HTML 檔案,以輔助問題的決定。 欲得到 AS/400 工具,下載適當的 PTF (例如,產品 5769DP2 就須下載 PTF SF61798 或更新 的版本)。 新增下列問題和解決方案至「疑難排解」一節中: 問題:沒有抄寫變更的情況下,引用程式形成迴圈; 引用追蹤表顯示 STATUS=2。 定期抄寫設定包括多個來源表格。若要改進設定中單一來源表格的熱點處理, 就會為該來源表格定義一個內部 CCD 表格 (但是在不同的定期抄寫設定中)。 會對來源表格做出變更,但移入內部 CCD 表格的「引用」程序會非同步的執行 (例如,引用程式可能尚未啟動或事件尚未觸發等)。從來源表格抄寫更新到 目標表格的引用程式會進入迴圈,因為它在等待內部 CCD 表格被更新。 若要停止迴圈,啟動內部 CCD 表格的引用程式 (或觸發會導致抄寫發生的事件)。 引用程式會移入內部 CCD 表格,並容許循環中的引用程式處理所有來源表格來的變更。 含有來源表格的定期抄寫設定會發生類似的狀況,其中內部 CCD 表格由多重的引用程式移入。 ------------------------------------------------------------------------ 15.10 第 9 章 AS/400 的擷取程式和引用程式 在 178 頁,「工作管理的備註」應如下所示: 您可以變更預設定義或提供個人定義。 建立個人子系統說明,必須替子系統 QZSNDPR 命名,並且在 QDPR 以外的檔案庫建立。 有關定義的變更,詳細資料請參閱「OS/400 工作管理 V4R3」。 新增下列至「驗證和自行設定 AS/400 下 DB2 DataPropagator 的安裝」(第 178 頁): 如果因為高量的異動而有鎖定競爭的問題,則您可將預設的等待逾時值從 30 增加到 120。 您可在每次擷取工作開始時變更工作,或您可使用下列程序來變更所有在子系統中執行的 工作的預設等待逾時值: 1. 發出下列指令,重複 QGPL/QBATCHI 以建立新的類別物件: CRTDUPOBJ OBJ(QBATCH) FROMLIB(QGPL) OBJTYPE(*CLS) TOLIB(QDPR) NEWOBJ(QZSNDPR) 2. 變更最新建類別的等待逾時值 (例如,變更至 300 秒): CHGCLS CLS(QDPR/QZSNDPR) DFTWAIT(300) 3. 利用新建類別更新子系統說明 QDPR/QZSNDPR 內的路徑登錄: CHGRTGE SBSD(QDPR/QZSNDPR) SEQNBR(9999) CLS(QDPR/QZSNDPR) 第 194 頁的「使用刪除異動日誌接收器結束常式」應併入這個句子: 若您移除刪除 異動日誌接收器結束常式,請確定用於來源表格的所有異動日誌皆有 DLTRCV(*NO)。 在 195 頁,ADDEXITPGM 指令參數應讀取下列所示: ADDEXITPGM EXITPNT(QIBM_QJO_DLT_JRNRCV) FORMAT(DRCV0100) PGM(QDPR/QZSNDREP) PGMNBR(*LOW) CRTEXITPNT(*NO) PGMDTA(65535 10 QSYS) ------------------------------------------------------------------------ 15.11 第 10 章 OS/390 的擷取程式和引用程式 在第 10 章中更新下列段落: 15.11.1 DB2 DataPropagator for OS/390 的先決條件 您必須具備 DB2 for OS/390 版本 5、DB2 for OS/390 版本 6 或 DB2 for OS/390 版本 7,才能執行 DB2 DataPropagator for OS/390 版本 7 (V7)。 15.11.2 OS/390 上的 UNICODE 和 ASCII 編碼方法 DB2 DataPropagator for OS/390 V7 支援 UNICODE 和 ASCII 編碼方法。 若要開發 新的編碼方法,您必須具備 DB2 for OS/390 V7, 而且必須手動建立或轉換 DB2 DataPropagator 來源、目標及控制表格, 我們將會在下列各節中說明。不過,即使 您沒有修改任何編碼方法,您現存的 抄寫環境將使用 DB2 DataPropagator for OS/390 V7。 15.11.2.1 選擇編碼方法 若您的來源、CD 及目標表格使用相同的編碼方法,您可以將抄寫環境中的資料轉換需 求降至最低。 對表格選擇編碼方法時,請遵循單一 CCSID 規則: 表格空間中的字元 資料可以用 ASCII、UNICODE 或 EBCDIC 來編碼。 表格空間內的所有表格必須使用相 同的編碼方法。SQL 陳述式中所有表格的編碼方法必須相同。同時,您在檢視及結合 中所用的全部表格必須相同的編碼方法。 若未遵循單一 CCSID 規則,則在連結或執行期間,DB2 將會偵測違規並傳回 SQLCODE -873。哪些表格應該是 ASCII 或 UNICODE,視您的主/從架構而定。 特別地,當選擇 表格的編碼方法時,請遵循這些規則: * DB2 for OS/390 上的來源或目標表格可以是 EBCDIC、ASCII 或 UNICODE。 它 們可以在使用任何支援的 DBMS (DB2 系列,或具有 DataJoiner 的非 DB2 系 列) 中相同或不同編碼方法的表格之間複製。 * 在 DB2 for OS/390 來源伺服器上,相同伺服器上所有 CD、UOW、登記及刪改控 制表格必須使用相同的編碼方法。為確保一致性,請務必明確指定編碼方法。 * 相同控制伺服器上的所有控制表格 (ASN.IBMSNAP_SUBS_xxxx) 必須使用相同的 編碼方法。 * 其它控制表格可使用任何編碼方法;不過,建議 ASN.IBMSNAP_CRITSEC 表格保 留 EBCDIC。 15.11.2.2 設定編碼方法 若要對表格指定適當的編碼方法,請修改用來產生表格的 SQL: * 以適當的編碼方法建立新的來源和目標表格, 或變更現存目標及來源表格的編 碼方法。建議您變更現存表格的編碼方法之前停止「擷取程式」和「引用程 式」,然後以冷開機方式啟動「擷取程式」並重新啟動「引用程式」。變更現存 表格的編碼方法: 1. 使用 Reorg 公用程式複製現存的表格。 2. 捨棄現存的表格。 3. 指定新編碼方法來重建表格。 4. 使用 Load 公用程式將原始資料載入新表格中。 有關 Load 和 Reorg 公用程式的詳細資訊,請參閱 DB2 Universal Database for OS/390 Utility Guide and Reference。 * 以適當的編碼方法建立新控制表格或修改現存表格的編碼方法。 DPCNTL.MVS 檢附於 DB2 for OS/390 的 sqllib\samples\repl 中, 它包含建 立控制表格的數個 CREATE TABLE 陳述式。對於必須是 ASCII 或 UNICODE 的表 格而言(例如 ASN.IBMSNAP_REGISTER 和 ASN.IBMSNAP_PRUNCNTL), 請加入 CCSID ASCII 或 CCSID UNICODE 關鍵字,如下列範例所示。 CREATE TABLE ASN.IBMSNAP_PRUNCNTL ( TARGET_SERVER CHAR( 18) NOT NULL, TARGET_OWNER CHAR( 18) NOT NULL, TARGET_TABLE CHAR( 18) NOT NULL, SYNCHTIME TIMESTAMP, SYNCHPOINT CHAR( 10) FOR BIT DATA, SOURCE_OWNER CHAR( 18) NOT NULL, SOURCE_TABLE CHAR( 18) NOT NULL, SOURCE_VIEW_QUAL SMALLINT NOT NULL, APPLY_QUAL CHAR( 18) NOT NULL, SET_NAME CHAR( 18) NOT NULL, CNTL_SERVER CHAR( 18) NOT NULL, TARGET_STRUCTURE SMALLINT NOT NULL, CNTL_ALIAS CHAR( 8) ) CCSID UNICODE DATA CAPTURE CHANGES IN TSSNAP02; 若要修改現存的控制表格和 CD 表格,請使用 Reorg 和 Load 公用程式。 * 當建立新抄寫來源或定期抄寫設定時,請修改管理工具所產生的 SQL 檔案, 以 指定適當的編碼方法。此 SQL 檔案具有數個 CREATE TABLE 陳述式, 可用來分 別針對抄寫來源及定期抄寫設定建立 CD 和目標表格。 請在適當位置加入關鍵 字 CCSID ASCII 或 CCSID UNICODE。 例如: CREATE TABLE user1.cdtable1 ( employee_name varchar, employee_age decimal ) CCSID UNICODE; DB2 UDB for OS/390 SQL Reference 包含 CCSID 的詳細資訊。 ------------------------------------------------------------------------ 15.12 第 11 章 UNIX 平台的擷取程式和引用程式 15.12.1 在 UNIX 和 Windows 上設定「擷取程式」和「引用程式」的環境變數 若您使用預設字碼頁值以外的字碼頁建立來源資料庫,請將 DB2CODEPAGE 環境變數設 為該字碼頁。 有關設定 DB2CODEPAGE 之前取得字碼頁值的詳細資訊,請參閱 DB2 Administration Guide。「擷取程式」必須在與資料庫 (擷取程式自其中擷取資料) 相同的字碼頁中執行。DB2 從「擷取程式」執行所在的作用中環境取得「擷取程式」 字碼頁。若未設定 DB2CODEPAGE,DB2 會從作業系統取得字碼頁值。 若您建立資料庫 時是使用預設字碼頁,則衍生自作業系統的值對「擷取程式」而言是正確值。 ------------------------------------------------------------------------ 15.13 第 14 章 表格結構 在 339 頁,添加下列句子至值為 2 的 STATUS 直欄說明: 如果您使用內部 CCD 表格,且持續在引用追蹤表的狀態直欄中得到 "2" 值, 請至「第 8 章:問題判定」參照「問題:沒有抄寫變更的情況下,引用程式形成迴圈; 引用追蹤表顯示 STATUS=2」。 ------------------------------------------------------------------------ 15.14 第 15 章 擷取程式和引用程式訊息 訊息 ASN0017E 應改為: ASN0017E 「擷取程式」發現嚴重的內部錯誤,無法發出正確的錯誤訊息。 常式名稱為 routine。回覆碼為 return_code。 新增下列資料至訊息 ASN1027S: ASN1027S 指定太多大型物件 (LOB) 直欄。錯誤碼為 。 說明:對定期抄寫設定成員指定了太多大型物件 (BLOB、CLOB 或 DBCLOB) 直欄。可 容許的最大直欄數為 10。 使用者回應:自定期抄寫設定成員除去過多的大型物件直欄。 訊息 ASN1048E 應如下所示: ASN1048E 「引用程式」循環的執行失敗。詳細資料,請參閱引用追蹤表: 說明:「引用程式」循環失敗。在訊息中, 定義 。 使用者回應:檢查審核追蹤表格的 APPERRM 欄位, 以確定「引用程式」循環的失敗 原因。 ------------------------------------------------------------------------ 15.15 附錄 A. 從應用程式內啟動擷取程式和引用程式 在 399 頁,錯誤出現在範例常式的說明內,該範例常式啟動擷取程式和引用程式, 但是,範例的字碼是正確的。範例的後半部與引用程式參數有關,雖然說明表示它和 擷取程式參數有關。 您可以自以下目錄獲得引用程式和擷取程式的範例及各自的 make 檔: For NT - sqllib\samples\repl For UNIX - sqllib/samples/repl ------------------------------------------------------------------------ System Monitor Guide and Reference(無中文版) ------------------------------------------------------------------------ 16.1 db2ConvMonStream In the Usage Notes, the structure for the snapshot variable datastream type SQLM_ELM_SUBSECTION should be sqlm_subsection. ------------------------------------------------------------------------ Troubleshooting Guide (無中文版) ------------------------------------------------------------------------ 17.1 Starting DB2 on Windows 95, Windows 98, and Windows ME When the User Is Not Logged On For a db2start command to be successful in a Windows 95, Windows 98, or Windows Millennium Edition (ME) environment, you must either: * Log on using the Windows logon window or the Microsoft Networking logon window * Issue the db2logon command (see note (NOTE_1) for information about the db2logon command). In addition, the user ID that is specified either during the logon or for the db2logon command must meet DB2's requirements (see note (NOTE2)). When the db2start command starts, it first checks to see if a user is logged on. If a user is logged on, the db2start command uses that user's ID. If a user is not logged on, the db2start command checks whether a db2logon command has been run, and, if so, the db2start command uses the user ID that was specified for the db2logon command. If the db2start command cannot find a valid user ID, the command terminates. During the installation of DB2 Universal Database Version 7 on Windows 95, Windows 98, and Windows ME, the installation software, by default, adds a shortcut to the Startup folder that runs the db2start command when the system is booted (see note (NOTE_1) for more information). If the user of the system has neither logged on nor issued the db2logon command, the db2start command will terminate. If you or your users do not normally log on to Windows or to a network, you can hide the requirement to issue the db2logon command before a db2start command by running commands from a batch file as follows: 1. Create a batch file that issues the db2logon command followed by the db2start.exe command. For example: @echo off db2logon db2local /p:password db2start cls exit 2. Name the batch file db2start.bat, and store it in the /bin directory that is under the drive and path where you installed DB2. You store the batch file in this location to ensure that the operating system can find the path to the batch file. The drive and path where DB2 is installed is stored in the DB2 registry variable DB2PATH. To find the drive and path where you installed DB2, issue the following command: db2set -g db2path Assume that the db2set command returns the value c:\sqllib. In this situation, you would store the batch file as follows: c:\sqllib\bin\db2start.bat 3. To start DB2 when the system is booted, you should run the batch file from a shortcut in the Startup folder. You have two options: o Modify the shortcut that is created by the DB2 installation program to run the batch file instead of db2start.exe. In the preceding example, the shortcut would now run the db2start.bat batch file. The shortcut that is created by DB2 installation program is called DB2 - DB2.lnk, and is located in c:\WINDOWS\Start Menu\Programs\Start\DB2 - DB2.lnk on most systems. o Add your own shortcut to run the batch file, and delete the shortcut that is added by the DB2 installation program. Use the following command to delete the DB2 shortcut: del "C:\WINDOWS\Start Menu\Programs\Startup\DB2 - DB2.lnk" If you decide to use your own shortcut, you should set the close on exit attribute for the shortcut. If you do not set this attribute, the DOS command prompt is left in the task bar even after the db2start command has successfully completed. To prevent the DOS window from being opened during the db2start process, you can create this shortcut (and the DOS window it runs in) set to run minimized. Note: As an alternative to starting DB2 during the boot of the system, DB2 can be started prior to the running of any application that uses DB2. See note (NOTE5) for details. If you use a batch file to issue the db2logon command before the db2start command is run, and your users occasionally log on, the db2start command will continue to work, the only difference being that DB2 will use the user ID of the logged on user. See note (NOTE_1) for additional details. Note: 1. The db2logon command simulates a user logon. The format of the db2logon command is: db2logon userid /p:password The user ID that is specified for the command must meet the DB2 naming requirements (see note (NOTE2) for more information). If the command is issued without a user ID and password, a window opens to prompt the user for the user ID and password. If the only parameter provided is a user ID, the user is not prompted for a password; under certain conditions a password is required, as described below. The user ID and password values that are set by the db2logon command are only used if the user did not log on using either the Windows logon window or the Microsoft Networking logon window. If the user has logged on, and a db2logon command has been issued, the user ID from the db2logon command is used for all DB2 actions, but the password specified on the db2logon command is ignored When the user has not logged on using the Windows logon window or the Microsoft Networking logon window, the user ID and password that are provided through the db2logon command are used as follows: o The db2start command uses the user ID when it starts, and does not require a password. o In the absence of a high-level qualifier for actions like creating a table, the user ID is used as the high-level qualifier. For example: 1. If you issue the following: db2logon db2local 2. Then issue the following: create table tab1 The table is created with a high-level qualifier as db2local.tab1. You should use a user ID that is equal to the schema name of your tables and other objects. o When the system acts as client to a server, and the user issues a CONNECT statement without a user ID and password (for example, CONNECT TO TEST) and authentication is set to server, the user ID and password from the db2logon command are used to validate the user at the remote server. If the user connects with an explicit user ID and password (for example, CONNECT TO TEST USER userID USING password), the values that are specified for the CONNECT statement are used. 2. In Version 7, the user ID that is either used to log on or specified for the db2logon command must conform to the following DB2 requirements: o It cannot be any of the following: USERS, ADMINS, GUESTS, PUBLIC, LOCAL, or any SQL reserved word that is listed in the SQL Reference. o It cannot begin with: SQL, SYS or IBM o Characters can include: + A through Z (Windows 95, Windows 98, and Windows ME support case-sensitive user IDs) + 0 through 9 + @, #, or $ 3. You can prevent the creation of the db2start shortcut in the Startup folder during a customized interactive installation, or if you are performing a response file installation and specify the DB2.AUTOSTART=NO option. If you use these options, there is no db2start shortcut in the Startup folder, and you must add your own shortcut to run the db2start.bat file. 4. On Windows 98 and Windows ME an option is available that you can use to specify a user ID that is always logged on when Windows 98 or Windows ME is started. In this situation, the Windows logon window will not appear. If you use this option, a user is logged on and the db2start command will succeed if the user ID meets DB2 requirements (see note (NOTE2) for details). If you do not use this option, the user will always be presented with a logon window. If the user cancels out of this window without logging on, the db2start command will fail unless the db2logon command was previously issued, or invoked from the batch file, as described above. 5. If you do not start DB2 during a system boot, DB2 can be started by an application. You can run the db2start.bat file as part of the initialization of applications that use DB2. Using this method, DB2 will only be started when the application that will use it is started. When the user exits the application, a db2stop command can be issued to stop DB2. Your business applications can start DB2 in this way, if DB2 is not started during the system boot. To use the DB2 Synchronizer application or call the synchronization APIs from your application, DB2 must be started if the scripts that are download for execution contain commands that operate either against a local instance or a local database. These commands can be in database scripts, instance scripts, or embedded in operating system (OS) scripts. If an OS script does not contain Command Line Processor commands or DB2 APIs that use an instance or a database, it can be run without DB2 being started. Because it may be difficult to tell in advance what commands will be run from your scripts during the synchronization process, DB2 should normally be started before synchronization begins. If you are calling either the db2sync command or the synchronization APIs from your application, you would start DB2 during the initialization of your application. If your users will be using the DB2 Synchronizer shortcut in the DB2 for Windows folder to start synchronization, the DB2 Synchronization shortcut must be modified to run a db2sync.bat file. The batch file should contain the following commands to ensure that DB2 is running before synchronization begins: @echo off db2start.bat db2sync.exe db2stop.exe cls exit In this example, it is assumed that the db2start.bat file invokes the db2logon and db2start commands as described above. If you decide to start DB2 when the application starts, ensure that the installation of DB2 does not add a shortcut to the Startup folder to start DB2. See note (NOTE3) for details. ------------------------------------------------------------------------ 17.2 Chapter 1. Good Troubleshooting Practices 17.2.1 Problem Analysis and Environment Collection Tool There is a utility that will help you identify some of the information associated with your problem and will collect other relevant information to assist DB2 Customer Support to understand your environment and your problem. Much of what is collected using this utility is discussed in the rest of this chapter. The utility is db2support. Details about the syntax and command line options is found in the Command Reference. The purpose of the utility is to collect environmental data about your client or server machine that is running DB2; and then to collect and package a large portion of the output as browsable XML, HTML, or a compressed file archive. The utility also has an option that allows for the collection of some data from you about the nature of your problem using an interactive question and answer process. This process will help you clarify the problem and also provide information to DB2 Customer Support when you finally contact them regarding your problem. Note: A thin or runtime client is not able to use this utility. The utility requires that the client have the DB2 engine libraries installed. 17.2.1.1 Collection Outputs The utility produces a compressed collection (single file archive) of important database system information. Included in this archive is an HTML report of the most essential information, which you can use to view the information. By default, db2support will not collect table data, schema (DDL), or logs in order to protect the security and sensitivity of customer data. With some options, the user may elect to include aspects of their schema and data (such as including archived logs). Options that expose database schema or data should be used carefully. When db2support is invoked, a message indicating how sensitive data is dealt with will be displayed. The following are the files to be collected and compressed into a single archive: Collected under all conditions 1. db2diag.log 2. All trap files 3. Lock list files (with -d) 4. Dump files 5. User exit (with -d) 6. Buffer pool and table space (SPCS) control files (with -d) 7. Various system related files 8. Output from various system commands 9. db config (with -d) 10. dbm config files 11. Log File Header file (with -d) 12. Recovery History File 13. db2cli.ini Optionally collected 1. Active log files 2. Contents of db2dump directory (i.e. what was not collected above) 3. Core files (-a for all core file, -r for only the most recent core file) 4. Extended system information (-s) The following files make up the content of the HTML report: Collected under all conditions 1. PMR number, if one exists. (if -n was specified) 2. Operating system and level. (e.g. AIX 4.2.1) 3. DB2 release information. 4. Engine library header information. 5. Detecting 32- or 64-bit 6. DB2 install path information. 7. For EEE report contents of db2nodes.cfg 8. How many CPUs, disks, and how much memory. 9. List of databases on this instance. 10. Registry information, environment, including path & libpath. 11. Disk freespace for current filesystem and inodes for Unix. 12. JDK level. 13. dbm config. 14. Listing of the database recovery history file. 15. 'ls -lR' (or windows equivilant) of the sqllib directory. 16. LIST NODE DIRECTORY 17. LIST ADMIN NODE DIRECTORY 18. LIST DCS DIRECTORY 19. LIST DCS APPLICATIONS EXTENDED 20. List of all installed software. Collected if '-s' is specified 1. Detailed disk information (partition layout, type, LVM information, etc.) 2. Detailed network information 3. Kernel statistics 4. Firmware versions 5. Other platform specific commands Collected if DB2 has been started 1. Client connection state 2. db/dbm config (db cfg require -d option) 3. CLI config 4. Memory pool info (size and consumed). Complete data if -d option used. 5. LIST ACTIVE DATABASES 6. LIST DATALINKS MANAGERS 7. LIST DCS APPLICATIONS Collected if -c has been specified and a connection to the database can be made 1. Number of user tables 2. Approximate size of DB data 3. Database snapshot 4. Application snapshot 5. Buffer pool information 6. LIST APPLICATIONS 7. LIST COMMAND OPTIONS 8. LIST DATABASE DIRECTORY 9. LIST INDOUBT TRANSACTIONS 10. LIST NODEGROUPS 11. LIST NODES 12. LIST ODBC DATA SOURCES 13. LIST PACKAGES/TABLES 14. LIST TABLESPACE CONTAINERS 15. LIST TABLESPACES 16. LIST DRDA IN DOUBT TRANSACTIONS If '-q' is specified, collect the following The interactive question and answer mode is started. With the exception of an optional "describe your problem" question and a small number of requests for customer information, all of the questions will have multiple choice answers from which to select. All of the questions, including follow up questions, and the answers will be collected. In some cases, the utility will ask you to carry out a task and place the results of that task in an additional directory. A small decision tree is used during the interactive mode to determine the questions to ask. These interactive questions assist in determining the category of the problem and based on the category a few other relevant questions may be asked and additional data collected. At the end of the questions, any data that would have been collected in the automatic mode, will also be collected. The answers to all questions are stored in preparation to be sent to service along with any data collected in automatic mode. 17.2.1.2 Viewing detailed_system_info.html If you are running db2support on a non-English installation and are experiencing difficulties properly viewing detailed_system_info.html, you may need to use Internet Explorer version 5 or later with DOS encoding. To change the encoding, select View --> Encoding --> Central European (DOS). If you do not already have the required encoding support, then Internet Explorer prompts you to download the required files from the Microsoft Updates web site. This information does not apply to double-byte languages (Simplified Chinese, Traditional Chinese, Japanese and Korean). 17.2.1.3 Viewing DB2 Support Tool Syntax One Page at a Time To view the syntax for the DB2 Support Tool one page at a time, run the following command: db2support | more ------------------------------------------------------------------------ 17.3 Chapter 2. Troubleshooting the DB2 Universal Database Server Under the "Locking and Deadlocks" section, under the "Applications Slow or Appear to Hang" subsection, change the description under "Lock waits or deadlocks are not caused by next key locking" to : Next key locking guarantees Repeatable Read (RR) isolation level by automatically locking the next key for all INSERT and DELETE statements and the next higher key value above the result set for SELECT statements. For UPDATE statements that alter key parts of an index, the original index key is deleted and the new key value is inserted. Next key locking is done on both the key insertion and key deletion. It is required to guarantee ANSI and SQL92 standard RR, and is the DB2 default. Examine snapshot information for the application. If the problem appears to be with next key locking, you can set the DB2_RR_TO_RS option on if none of your applications rely on Repeatable Read (RR) behavior and it is acceptable for scans to skip over uncommitted deletes. When DB2_RR_TO_RS is on, RR behavior cannot be guaranteed for scans on user tables because next key locking is not done during index key insertion and deletion. Catalog tables are not affected by this option. The other change in behavior is that with DB2_RR_TO_RS on, scans will skip over rows that have been deleted but not committed, even though the row may have qualified for the scan. For example, consider the scenario where transaction A deletes the row with column1=10 and transaction B does a scan where column1>8 and column1<12. With DB2_RR_TO_RS off, transaction B will wait for transaction A to commit or rollback. If it rolls back, the row with column1=10 will be included in the result set of transaction B's query. With DB2_RR_TO_RS on, transaction B will not wait for transaction A to commit or rollback. It will immediately receive query results that do not include the deleted row. Do not use this option if you require ANSI and SQL92 standard RR or if you do not want scans to skip uncommitted deletes. ------------------------------------------------------------------------ 17.4 Chapter 8. Troubleshooting DB2 Data Links Manager In Version 7 FixPak 2, an SQL1179W warning message is generated by the server when precompiling a source file or binding a bind file without specifying a value for the FEDERATED option. The same message is generated when the source file or bind file includes static SQL references to a nickname. There are two exceptions: * For clients that are at an earlier FixPak than Version 7 FixPak 2 or for downlevel clients, the sqlaprep() API does not report this SQL1179W warning in the message file. The Command Line Processor PRECOMPILE command also does not output the warning in this case. * For clients that are at an earlier FixPak than Version 7 FixPak 2 or for downlevel clients, the sqlabndx API does report this SQL1179W warning in the message file. However, the message file also incorrectly includes an SQL0092N message indicating that no package was created. This is not correct as the package is indeed created. The Command Line Processor BIND command returns the same erroneous warning. ------------------------------------------------------------------------ 在 64 位元的平台上使用 DB2 Universal Database ------------------------------------------------------------------------ 18.1 第 5 章 架構 18.1.1 LOCKLIST 下列資訊應該加到「表 2」。 參數 之前的上限 現行的上限 LOCKLIST 60000 524288 18.1.2 shmsys:shminfo_shmmax 在 64 位元 Solaris 作業系統上的 DB2 使用者應視需要增加 /etc/system 中 "shmsys:shminfo_shmmax" 的值, 以配置大的資料庫共用記憶體組。 DB2 for UNIX 快速入門 書中建議參數可設為 "機器中實體 RAM 的 90%,單位為位元組"。 這項建 議對於 64 位元施行一樣有效。 然而,在 DB2 for UNIX 快速入門 書中的下列建議有問題: 對於擁有超過 4 GB RAM 的 32 位元系統而言 (在 Solaris 作業系統上總共最多可到 64 GB), 如果使用者將 shmmax 值設定為一個大於 4 GB 的數字, 並且是使用 32 位元的核心,而核心只會 看到數字的後 32 位元, 有時會造成 shmmax 的值非常的小。 ------------------------------------------------------------------------ 18.2 第 6 章 限制 目前在 64 位元的作業系統上沒有 LDAP 支援。 32 位元及 64 位元的資料庫無法建立在相同的路徑上。 例如,如果有一個 32 位元 的資料庫位於 ,則: db2 create db on 如果是從 64 位元的案例發出指令,會得到這樣的錯誤訊息 "SQL10004C 存取資料庫 目錄時發生 I/O 錯誤。" ------------------------------------------------------------------------ XML Extender Administration and Programming(無中文版) Release Notes for the IBM DB2 XML Extender can be found on the DB2 XML Web site: http://www-4.ibm.com/software/data/db2/extenders/xmlext/library.html ------------------------------------------------------------------------ MQSeries 本節說明如何使用 DB2 及 MQSeries 來建構結合傳訊與資料庫存取的應用程式。 本 節的焦點在一系列的功能,與「使用者定義的功能 (UDF)」類似,它可能已在 DB2 Universal Database 版本 7.2 中選用性地啟用。 使用這些基本的功能,可能可以支 援大範圍的應用程式,從簡式事件通知到資料倉儲。 如需資料倉儲應用程式的相關資訊,請參閱新近彙整的「資料倉儲中心管理手冊」, 您可以從 http://www.ibm.com/software/data/db2/udb/winos2unix/support 取得該 書。 ------------------------------------------------------------------------ 20.1 安裝與架構 DB2 MQSeries 函數 本節說明如何架構 DB2 環境以使用 DB2 MQSeries Function。 只要您成功完成下列 程序,就可以從 SQL 使用 DB2 MQSeries Function。 關於這些功能的說明,請至 「版本注意事項」的 SQL Reference 一節。 架構與啟用 DB2 MQSeries Function 的基本程序為: 1. 安裝 MQSeries。 2. 安裝 MQSeries AMI。 3. 啟用與架構 DB2 MQSeries Function 此外,若要使用 DB2 MQSeries Function 提供的發佈/訂閱功能,您也必須安裝 MQSeries Integrator 或 MQSeries Publish/Subscribe Function。 關於 MQSeries Integrator 的資訊,請至 http://www.ibm.com/software/ts/mqseries/integrator。關於 MQSeries Publish/Subscribe 功能的資訊,請至種類 3 下的 http://www.ibm.com/software/ts/mqseries/txppacs。 20.1.1 安裝 MQSeries 第一個步驟是要確定您的 DB2 伺服器上是否已安裝了 MQSeries 版本 5.1 與最新的 Fixpak (最低標準)。若您已安裝此版本的 MQSeries,請跳至下一步驟「安裝 MQSeriesy AMI」。 DB2 版本 7.2 包括 DB2 使用的 MQSeries 伺服器之副本。 安裝 MQSeries 或升級現存的 MQSeries 安裝之特定平台指令,可在特定的平台「快速入 門」書籍中找到,其位在 http://www.ibm.com/software/ts/mqseries/library/manuals。請確定當您進行安裝 程序時,要設定預設佇列管理程式。 20.1.2 安裝 MQSeries AMI 下個步驟是安裝 MQSeries 應用程式傳訊介面 (AMI)。 這是 MQSeries 程式設計介面 的副檔名,它提供管理及程式設計一個清楚的隔離。 DB2 MQSeries Function 需要此 介面的安裝。若 MQSeries AMI 已安裝在您的 DB2 伺服器上,請跳至下一步驟 「啟 用 DB2 MQSeries Function」。若尚未安裝 MQSeries AMI,則您可以從 DB2 7.2 提 供的安裝套裝軟體來安裝,或從 MQSeries 支援套裝軟體網站 http://www.ibm.com/software/ts/mqseries/txppacs,下載 AMI 副本。 您可以在 「種類 3 - 產品副檔名」下找到 AMI。為了方便起見, 我們提供您 DB2 的 MQSeries AMI 之副本。此檔案位在 sqllib/cfg 目錄中。此檔案的名稱是作業系統相 依項: AIX 版本 4.3 及更新版本 ma0f_ax.tar.Z HP-UX ma0f_hp.tar.Z Solaris 作業環境 ma0f_sol7.tar.Z Windows 32 位元 ma0f_nt.zip 遵循 AMI Readme 檔中簡述的正常 AMI 安裝程序,該檔在壓縮安裝映像檔中。 20.1.3 啟用 DB2 MQSeries Function 在此步驟期間,您將架構並啟用 DB2 MQSeries Function 的資料庫。 enable_MQFunctions 公用程式是一個彈性的指令,會先檢查已設定適當的 MQSeries 環境,然後安裝並建立 DB2 MQSeries 功能的預設架構,以這些功能啟用指定的資料 庫,並確認架構運作正常。 1. 針對 Windows NT 或 Windows 2000,請至步驟 5。 2. 在 UNIX 設定群組:若您在 UNIX 上啟用這些功能,您必須先將 DB2 案例擁有 者 (通常是 de2inst1) 及與隔離 UDF 相關的使用者 ID (通常是 db2fenc1), 新增到 MQSeries 群組 mqm 中。 DB2 功能需要此設定以存取 MQSeries。 3. 在 UNIX 上設定 DB2 環境變數:將 AMT_DATA_PATH 環境變數新增到 DB2 瞭解 的列示中。 您可以編輯檔案 $INSTHOME/sqllib/profile.env,將 AMT_DATA_PATH 新增至 DB2ENVLIST。也可使用 db2set 指令。 4. 在 UNIX 上,重新啟動資料庫案例:若要讓環境變數變更生效,必須重新啟動資 料庫案例。 5. 在 UNIX 上將目錄變更為 $INSTHOME/sqllib/cfg,在 Windows 上將目錄變更為 %DB2PATH%/cfg。 6. 執行指令 enable_MQFunctions 以架構並啟用 DB2 MQSeries 功能的資料庫。請 參閱20.6, enable_MQFunctions,以取得此指令的完整說明。下列提供一些一般 範例。 在成功完成之後,將啟用指定的資料庫並測試架構。 7. 若要使用「命令行處理器」測試這些功能,請在您連接到已啟用的資料庫時,發 出下列指令: values DB2MQ.MQSEND('a test') values DB2MQ.MQRECEIVE() 第一個陳述式將傳送訊息 "a test" 至 DB2MQ_DEFAULT_Q 佇列,而第二個則將 其接收回來。 註: 執行 enable_MQFunctions 的結果,將建立預設 MQSeries 環境。將建立 MQSeries 佇列管理程式 DB2MQ_DEFAULT_MQM 及預設佇列 DB2MQ_DEFAULT_Q。若 檔案 amt.xml、amthost.xml 及 amt.dtd 已不存在於 AMT_DATA_PATH 指向的目 錄時,將建立這些檔案。 若 amthost.xml 檔案不存在,且不包含 connectionDB2MQ 的定義,則會將行新增到有適當資訊的檔案中。原來的檔案之 副本將被儲存為 DB2MQSAVE.amthost.xml。 ------------------------------------------------------------------------ 20.2 MQSeries 傳訊樣式 DB2 MQSeries 功能支援三種傳訊模型:資料圖、發佈/訂閱 (p/s) 及要求/回覆 (r/r)。 以資料圖來傳送的訊息會傳送到單一目的地,且不預期回覆。 在 p/s 模型中,一或 多個公布者將訊息傳送至公佈服務程式,分送訊息至一或多個用戶。 要求/回覆與資 料圖相似,但傳送者預期接收回應。 ------------------------------------------------------------------------ 20.3 訊息結構 MQSeries 本身不會要求或支援任何其傳送的訊息之特殊結構。 其它產品如 MQSeries Integrator (MQSI),就會提供以 C、COBOL 或 XML 字串形成 的訊息之支援。 在 MQSI 中的結構訊息是由訊息儲存庫定義。XML 訊息通常有一個自 行說明的訊息結構,且可能也透過儲存庫來管理。訊息也可能是沒有結構的,需要使 用者程式碼來剖析或建構訊息內容。這類訊息往往是不完全的結構,也就是說,它們 使用位元組位置或固定的定界符號來分隔訊息中的欄位。「MQSeries 輔助精靈」提供 這種不完全結構的訊息之支援。 透過某些新功能,將 XML 訊息支援提供給 DB2 XML 擴充元。 ------------------------------------------------------------------------ 20.4 MQSeries 功能概觀 MQSeries 功能集由 DB2 UDB 版本 7.2 提供,可讓 SQL 陳述式包括傳訊作業。 這表 示此支援可使用於以任何支援語言撰寫的應用程式,例如,使用任何資料庫介面的 C 、Java、SQL。下列顯示的所有範例均在 SQL 中。 可以用所有標準方式,從其他程式 設計語言使用此 SQL。 上述的所有 MQSeries 傳訊樣式都已支援。 有關 MQSeries 功能的詳細資訊,請參閱「版本注意事項」的 SQL Reference 一節。 在基本架構中,MQSeries 伺服器是位在與 DB2 一起的資料庫伺服器機器中。 MQSeries 功能安裝在 DB2上,並提供對 MQSeries 伺服器的存取權限。 DB2 從屬站 可位在可存取 DB2 Server 的任何機器上。 多個從屬站可同時透過資料庫存取 MQSeries 功能。 透過提供的功能,DB2 從屬站可在 SQL 陳述式內執行傳訊作業。 這些傳訊作業可讓 DB2 應用程式在它們之間通信,或與其他 MQSeries 應用程式通 信。 enable_MQFunctions 指令是用來啟用 MQSeries 功能的 DB2 資料庫。它將自動建立 簡式預設架構,從屬站應用程式會使用該架構,不需要管理動作。 如需說明,請參閱 20.6, enable_MQFunctions與20.7, disable_MQFunctions。 預設架構提供應用程式 設計師一個快速啟動的方法,及一個更簡易的開發介面。 若有需要,可增加架構其他 的功能。 範例 1:若要使用預設架構來傳送簡式訊息,SQL 陳述式如下: VALUES DB2MQ.MQSEND('simple message') 這會將訊息 simple message 傳送至 MQSeries 佇列管理程式及預設架構指定的佇 列。 MQSeries 的「應用程式傳訊介面 (AMI)」,在傳訊活動及指定那些活動的傳送方式之 定義之間,提供清楚的隔離。這些定義保留在外部儲存庫檔案中,並使用 AMI 管理工 具來管理。這可讓 AMI 應用程式容易發展並維護。DB2 提供的 MQSeries 功能是以 AMI MQSeries 介面為依據。AMI 支援外部架構檔的使用,該檔稱為「AMI 儲存庫」, 以儲存架構資訊。 預設架構包括 MQSeries AMI 儲存庫架構,以使用 DB2。 MQSeries AMI 的兩個主要概念,服務程式點及原則,被轉遞至 DB2 MQSeries 功能 中。 服務程式點是邏輯終點,即訊息可能傳送或接收的點。 在 AMI 儲存庫中,每一 個服務程式點是以 MQSeries 佇列名稱及佇列管理程式來定義。 原則定義服務程式選 項的品質,其應使用於給定的傳訊作業。 主要的服務程式品質包括訊息優先順序及持 續性。 提供預設服務程式點及原則定義,且可能由發展者使用,以進一步簡化應用程 式。 範例 1 可以下列方式重寫,以明確地指定預設服務程式點及原則名稱: 範例 2: VALUES DB2MQ.MQSEND('DB2.DEFAULT.SERVICE', 'DB2.DEFAULT.POLICY', 'simple message') 佇列可能由伺服器的一或多個應用程式服務,而佇列及應用程式即常駐於該伺服器 中。 在許多架構中,多重佇列將被定義為支援不同的應用程式及目的。 因為這個理 由,在進行 MQSeries 要求時,經常定義不同的服務程式點是很重要的。 在下列範例 中有說明: 範例 3: VALUES DB2MQ.MQSEND('ODS_Input', 'simple message') 註: 在此範例中,未指定原則,但將使用預設原則。 20.4.1 限制 MQSeries 提供訊息作業及資料庫作業的能力,以在單一工作單元中結合,作為被保護 交易。 Unix 及 Windows 上的 MQSeries 功能原本不支援此功能。 使用傳送或接收函數時,類型 VARCHAR 的最大訊息長度是 4000 個字元。在傳送或接 收 CLOB 類型的訊息時, 最大長度是 1 MB。這也是使用 MQPublish 來公佈訊息的訊 息大小上限。 在使用 CLOB 訊息與 VARCHAR 訊息時,有時需要不同的函數。 通常,MQ 函數的 CLOB 版本會使用與其副本相同的語法。 唯一的差別是其名稱在結尾處有字元 CLOB。 例如,MQREAD 的 CLOB 等於 MQREADCLOB。如需這些函數的詳細列示, 請參閱 42.3.3, CLOB data now supported in MQSeries functions。 20.4.2 錯誤碼 您可在「MQSeries 應用程式傳訊介面手冊」的附錄 B 中,找到 MQSeries 功能傳回 的回覆碼。 ------------------------------------------------------------------------ 20.5 用法實務手冊 MQSeries Function 可使用於大範圍的實務手冊。 本節將討論一些最普遍的實務,包 括「基本傳訊」、「應用程式連接」及「資料公布」。 20.5.1 基本傳訊 當所有資料庫應用程式連接到相同的 DB2 伺服器時,會發生 MQSeries DB2 功能的訊 息之最基本形式。從屬站可能是資料庫伺服器的本端或分散在網路環境中。 在簡式實務範例中,從屬站 A 呼叫 MQSEND 功能,傳送使用者定義至預設服務程式位 置。 MQSeries 功能隨後會在資料庫伺服器的 DB2 內執行。 稍後,從屬站 B 呼叫 MQRECEIVE 功能,移除預設服務程式定義的佇列中之最早記載記錄的訊息,並將其傳 回從屬站。 同樣的,執行此作業的 MQSeries 功能由 DB2 執行。 資料庫從屬站可以用許多方式來使用簡式傳訊。傳訊的某些一般用法如下: * 資料收集 -- 以來自一或多個可能不同的資訊來源之形式接收資訊。 資訊來源 可能是商業應用程式如 SAP,或組織內部發展的應用程式。 這類資料可從佇列 接收,並儲存在資料庫表格中,以供進一步的處理或分析。 * 工作負荷分送 -- 工作要求公布於佇列,由相同應用程式的多個案例共用。 當 案例備妥執行一些工作時,它會從佇列頂端接收到訊息,包含要執行的工作要 求。 使用此技術,多個案例可以共用儲存要求之單一佇列所代表的工作負荷。 * 應用程式信號 -- 在幾個程序合作的情況中,訊息通常用來協調其成果。 這些 訊息可能包含工作要執行的指令或要求。 通常,這種信號是單向的;也就是 說,起始訊息的一方並不預期回應。 請參閱20.5.4.1, Request/Reply 通信, 以取得詳細資訊。 * 應用程式通知 -- 通知與信號類似,資料從初始程式傳送出,且不預期回應。 但是,通知通常包含關於已發生之業務事件的資料。 20.5.4.2, 發佈/訂閱 是 通知的更進階之形式。 下列實務範例擴充了上述說明的簡式實務範例,以納入遠端傳訊。 也就是說,訊息在 機器 A 與機器 B 之間傳送。 步驟順序如下: 1. DB2 從屬站執行 MQSEND 呼叫,指定已定義的目標服務程式,以代表機器 B 的 遠端佇列。 2. MQSeries DB2 功能執行實際的 MQSeries 作業以傳送訊息。 在機器 A 上的 MQSeries 伺服器接受訊息及保證,將其傳送至服務程式點定義及機器 A 的現行 MQSeries 架構所定義的目的地。 伺服器決定這是機器 B 上的佇列。 然後它會 嘗試將訊息傳送至機器 B 的 MQSeries 伺服器,並在需要時透通地重試。 3. 機器 B 上的 MQSeries 伺服器接收來自機器 A 之伺服器的訊息,並將其放置在 機器 B 的目的地佇列。 4. 機器 B 上的 MQSeries 從屬站要求佇列的最早記載記錄之訊息。 20.5.2 傳送訊息 使用 MQSEND,DB2 使用者或發展者可選擇要傳送的資料,要傳送的位置,及要傳送的 時間。 在業界中,這通常叫做 "Send and Forget",表示傳送者只要傳送訊息,而依 據 MQSeries 的遞送通信協定保證,確保訊息可到達目的地。 下列範例會對此作說 明。 範例 4︰若要使用原則 highPriority 將使用者定義字串傳送至服務程式點 myPlace: VALUES DB2MQ.MQSEND('myplace','highPriority','test') 在這裡,原則 highPriority 參照 AMI 儲存庫所定義的原則,將 MQSeries 優先順序 設定為最高層次, 也可能調整其他服務程式的品質,例如持續性。 訊息內容可能由 SQL 的任何標準尺寸組合及使用者指定的資料組合而成。 這包括巢 狀功能、運算子及強制轉型。 例如,提供一表格 EMPLOYEE,有 VARCHAR 直欄 LASTNAME、FIRSTNAME 及 DEPARTMENT,針對每一個 DEPARTMENT 5LGA 中的員工傳送 包含此資訊之訊息,您可執行下列: 範例 5: SELECT DB2MQ.MQSEND(LASTNAME || ' ' || FIRSTNAME || ' ' || DEPARTMENT) FROM EMPLOYEE WHERE DEPARTMENT = '5LGA' 若此表格也有一個完整的 AGE 直欄,它可能也會被併入,如下所示: 範例 6: SELECT DB2MQ.MQSEND(LASTNAME || ' ' || FIRSTNAME || ' ' || DEPARTMENT|| ' ' || ch ar(AGE)) FROM EMPLOYEE WHERE DEPARTMENT = '5LGA' 如果表格 EMPLOYEE 有一個類型為 CLOB 的直欄 RESUME 而沒有 AGE 直欄, 則會傳 送一則訊息,其中含有 DEPARTMENT 5LGA 中每一位員工的資訊,如下所示: 範例 7: SELECT DB2MQ.MQSEND (clob(LASTNAME) || ' ' || clob(FIRSTNAME) || ' ' || clob(DEPARTMENT) || ' ' || RESUME)) FROM EMPLOYEE WHERE DEPARTMENT = '5LGA' 範例 8: 最後,下列範例顯示如何使用任何有效的 SQL 表示式來衍生訊息內容。 提供第二個 表格 DEPT,其中含有 VARCHAR 直欄 DEPT_NO 與 DEPT_NAME,可傳送含有員工 LASTNAME 及 DEPT_NAME 的訊息: 範例 8: SELECT DB2MQ.MQSEND(e.LASTNAME || ' ' || d.DEPTNAME) FROM EMPLOYEE e, DEPT d WHERE e.DEPARTMENT = d.DEPTNAME 20.5.3 擷取訊息 MQSeries DB2 功能可接收或讀取訊息。 讀取與接收之間的不同處,在於讀取傳回佇 列之最早記載記錄的訊息,不需從佇列移除,而接收作業會使訊息從佇列移除。 使用 接收作業來擷取的訊息,僅可以擷取一次,而使用讀取作業來擷取的訊息,可多次擷 取相同訊息。 下列範例會對此作說明: 範例 8: VALUES DB2MQ.MQREAD() 此範例使用服務程式原則的預設品質,傳回 VARCHAR 字串,該字串包含預設服務程式 定義的佇列之最早記載記錄的訊息。 重要事項:請注意若沒有可供讀取的訊息,將傳 回一個 NULL 值。 此作業不會變更佇列。 範例 9: VALUES DB2MQ.MQRECEIVE('Employee_Changes') 上述範例顯示如何使用預設原則,將訊息從 Employee_Changes 服務程式定義的佇列 之最早記載記錄移除。 DB2 的一個非常有力的功能,是從使用者定義 (或 DB2 提供的) 功能,產生表格的能 力。 您可以開發此表格功能,讓佇列內容可作為 DB2 表格。 下列範例說明這個最簡 易的形式: 範例 10: SELECT t.* FROM table ( DB2MQ.MQREADALL()) t 此查詢傳回一表格,由所有預設服務程式定義之佇列的所有訊息及有關這些訊息的描 述資料所組成。 當傳回的表格結構之完整定義是定義於附錄中,則第一直欄會反映訊 息內容,其餘直欄則包含描述資料。 若只要傳回訊息,可重新撰寫範例: 範例 11: SELECT t.MSG FROM table (DB2MQ.MQREADALL()) t 表格功能傳回的表格與資料庫直接擷取的表格相同。 這表示您可以用廣泛的方法使用 此表格。 例如,您可以結合一表格與另一表格的內容,或計算佇列中的訊息數量: 範例 12: SELECT t.MSG, e.LASTNAME FROM table (DB2MQ.MQREADALL() ) t, EMPLOYEE e WHERE t.MSG = e.LASTNAME 範例 13: SELECT COUNT(*) FROM table (DB2MQ.MQREADALL()) t 您可以透過表格功能來建立概略表,以隱藏表格來源是佇列的事實。 例如,下列範例 透過服務程式 NEW_EMPLOYEES 所參照的佇列,來建立名為 NEW_EMP 的概略表: 範例 14: CREATE VIEW NEW_EMP (msg) AS SELECT t.msg FROM table (DB2MQ.MQREADALL()) t 在此案例中,概略表僅以包含整個訊息的單一直欄來定義。 若訊息是簡式的架構,例 如包含固定長度的兩個欄位, 則它會直接向前以使用 DB2 內建功能,將訊息剖析至 兩直欄中。 例如,若您知道傳送至特殊佇列的訊息都包含一個 18 位元的姓氏,其後 則是一個 18 位元的名字,則您可以定義一個概略表,包含每一個個別直欄的欄位, 例如: 範例 15: CREATE VIEW NEW_EMP2 AS SELECT left(t.msg,18) AS LNAME, right(t.msg,18) AS FNAME FROM table(DB2MQ.MQREADALL()) t 「DB2 儲存程序建置器」的新特性「MQSeries 輔助精靈」,可用來建立新的 DB2 表 格功能及概略表,其將有定界符號的訊息結構對映至直欄。 最後,通常要將一或多個訊息內容儲存在資料庫中。 這可使用 SQL 的完整功能來完 成,以操作並儲存訊息內容。 最簡易的範例可能是: 範例 16: INSERT INTO MESSAGES SELECT t.msg FROM table (DB2MQ.MQRECEIVEALL()) t 提供包含 VARCHAR(2000) 單一直欄的表格 MESSAGES,上述的陳述式會從預設服務程 式佇列,將訊息插入表格中。 可修飾此技術,以涵蓋情況的廣泛種類。 20.5.4 應用程式對應用程式連接 應用程式整合是許多解決方案的一般元素。 不論將購買的應用程式整合到現存的基礎 架構中,或只將新開發的應用程式整合到現存環境中,我們通常會面對集中子系統之 不同集合的作業,以構成完整的工作。 MQSeries 通常被視為整合應用程式的基本工 具。 可在大部份硬體、軟體及語言環境中存取,MQSeries 提供交互連接應用程式的 不同集合之方法。 此節將討論部份應用程式整合實務及如何以 DB2 來使用它們。 因為主題相當廣泛, 「應用程式整合」的廣泛討論超越了此工作的範圍。 因此,重點僅在兩個簡單的主 題:Request/Reply 通信,及 MQSeries Integrator 及 Publish/Subscribe。 20.5.4.1 Request/Reply 通信 「Request/Reply (R/R)」通信方法是最普遍的技術,一個應用程式可向另一個應用程 式要求服務。 執行此動作的其中一種方法,是讓要求程式將訊息傳送至要求執行某些 工作的服務提供程式。一旦工作已完成,供應程式可決定將結果 (或完成確認) 傳回 要求器。 但使用上述的基本傳訊技術,就不能連接傳送者要求與服務提供程式回應。 除非要求程式在繼續執行之前,先等待回覆,否則某些機制必須用來結合每一個回覆 及其要求。MQSeries 不強制程式開發者建立這類機制, 而是提供一個相關 ID,使交 換處的訊息有相關性。 當有許多方法可供此機制使用時,最簡易的方法是讓要求器用已知的相關 ID 來標示 訊息,例如下列所示: 範例 17: DB2MQ.MQSEND ('myRequester','myPolicy','SendStatus:cust1','Req1') 此陳述式將最終參數 Req1 新增至上述的 MQSEND 陳述式中,以表示要求的相關 ID。 若要接收此特定要求的回覆,請使用相對應的 MQRECEIVE 陳述式, 選擇性地接收符 合此相關 ID 且由指示的服務程式所定義的第一則訊息,如下所示: 範例 18: DB2MQ.MQRECEIVE('myReceiver','myPolicy','Req1') 如果服務要求的應用程式忙線中,且要求器在回覆傳送之前發出上述的 MQRECEIVE, 則會找不到與此相關 ID 相符的訊息。 若要接收服務程式要求及相關 ID,請使用與下列類似的陳述式: 範例 19: SELECT msg, correlid FROM table (DB2MQ.MQRECEIVEALL('aServiceProvider','myPolicy',1)) t 這會傳回服務程式 aServiceProvider 的第一個要求之訊息及相關 ID。 一旦執行了服務程式,它會將回覆訊息傳送給 aReauester 說明的佇列。 在這期間, 服務要求程式仍會執行其他作業。 事實上,並不保證起始服務程式要求會在設定時間 內回應。 如同這類的應用程式層次逾時,必須由發展程式來管理;要求程式必須輪詢 偵測回覆的情況。 這種時間獨立非同步處理的優點,是要求程式及服務供應程式是完全獨立地執行。 這 可用於適合的環境,應用程式僅會斷續地連接,也可用於更批次導向的環境,多重要 求或回覆會在處理程序前先聚集起來。 這種集合體通常用於資料倉儲環境,以定期地 更新資料倉儲或作業資料儲存。 20.5.4.2 發佈/訂閱 簡式資料出版品 應用程式整合中的另一個一般實務範例,是一應用程式通知其他應用程式有關興趣的 事件。 您可容易地將訊息傳送到佇列,該佇列由另一個應用程式監督。 訊息內容可 以是使用者定義字串,或可以從資料庫直欄來撰寫。 簡式訊息往往是需要使用 MQSEND 功能來傳送的訊息。 當這類訊息需要同時傳送到多個接收者時,可以使用 MQSeries AMI 的「分送清單」機能。 分送清單是使用 AMI 管理工具來定義。分送清單包含個別服務程式的清單。 傳送到 分送清單的訊息,會轉遞到此清單中所定義的每一個服務程式。 當已知一些服務程式 一直對每個訊息有興趣時,這是特別有用的功能。 下列範例顯示傳送訊息至分送清單 interestedParties: 範例 20: DB2MQ.MQSEND('interestedParties','information of general interest'); 當特殊服務程式應接收的訊息需要更多控制時,則需要 Publish/Subscribe 能力。 Publish/Subscribe 系統通常提供一個可調整的、安全的環境,許多訂戶可在其中登 記,以從多個公布者接收訊息。 若要支援此能力,可使用 MQPublish 介面,與 MQSeries Integrator 或 MQ Series Publish/Subscribe 機能連接。 MQPublish 可讓使用者選用性地指定與訊息相關的主題。 主題可讓用戶更清楚地指定 要接受的訊息。 步驟順序如下: 1. MQSeries 管理者架構 MQSeries Integrator 發佈/訂閱功能。 2. 感興趣的應用程式在 MQSI 架構所定義的訂閱點訂閱,選用性地指定其有興趣的 主題。 每一個用戶選取相關的主題,並可以利用 MQSeries Integrator V2 之 以內容為基礎的訂閱技術。 重要事項:請注意,服務程式名稱代表的佇列有定 義用戶。 3. DB2 應用程式公布服務程式點 Weather 的訊息。 訊息指出天氣是 Sleet,且其 主題為 Austin,因此通知有興趣的用戶,告知 Austin 的天氣是 Sleet。 4. 實際公布訊息的機制是由 DB2 提供的 MQSeries 功能來處理。 使用服務程式名 稱 Weather,將訊息傳送至 MQSeries Integrator。 5. MQSI 從 Weather 服務程式接受訊息,執行 MQSI 架構定義的任何處理程序, 並決定其滿意的訂購。然後 MQSI 會將訊息轉遞至其符合的準則之用戶佇列。 6. 已訂閱 Weather 服務程式,並在 Austin 登記喜好的應用程式,將在接收服務 程式中接收到訊息 Sleet。 若要使用所有預設值及 NULL 主題來公布此資料,您可使用下列陳述式: 範例 21: SELECT DB2MQ.MQPUBLISH(LASTNAME || ' ' || FIRSTNAME || ' ' || DEPARTMENT|| ' ' ||cha r(AGE)) FROM EMPLOYEE WHERE DEPARTMENT = '5LGA' 完整的指定所有參數並簡化訊息,使其僅包含 LASTNAME,陳述式可能如下所示: 範例 22: SELECT DB2MQ.MQPUBLISH('HR_INFO_PUB', 'SPECIAL_POLICY', LASTNAME, 'ALL_EMP:5LGA', 'MANAGER') FROM EMPLOYEE WHERE DEPARTMENT = '5LGA' 此陳述式使用 SPECIAL_POLICY 服務程式,將訊息公布至 HR_INFO_PUB 公佈服務程式 中。 訊息指出傳送者是 MANAGER 主題。 主題字串說明可指定使用「:」連接的多重 主題。 在此範例中,使用這兩個主題可讓用戶登記 ALL_EMP 或只登記 5LGA,以接收 這些訊息。 若要接收公布的訊息,您必須先將您的喜好登記在訊息中, 訊息包含給定的主題並指 出訊息應該傳送的用戶服務程式之名稱。 重要事項:請注意 AMI 用戶服務程式有定 義分配管理系統服務程式及接收者服務程式。 分配管理系統服務程式是用戶與發布/ 訂閱分配管理系統通信的方式, 而接收者服務程式是符合訂閱要求將傳送的地方。 7 下列陳述式在主題 ALL_EMP 中登記喜好。 範例 23: DB2MQ.MQSUBSCRIBE('aSubscriber', 'ALL_EMP') 一旦訂閱了應用程式,以主題 ALL_EMP 公布的訊息,將轉遞到用戶服務程式所定義的 接收者服務程式中。 一個應用程式可以有多重的並行訂閱。若要取得符合您的訂閱的 訊息,您可以使用任何標準的訊息擷取功能。例如,若用戶服務程式 aSubscriber 將 接收者服務程式定義為 aSubscriberReceiver,而非下列陳述式,則將會非破壞性地 讀取第一個訊息: 範例 24: DB2MQ.MQREAD('aSubscriberReceiver') 若要決定以下要公布的訊息與主題,您可以使用其中一種表格功能。 下列陳述式會接 收 aSubscriberReceiver 的前五個訊息,並顯示訊息與主題: 範例 25: SELECT t.msg, t.topic FROM table (DB2MQ.MQRECEIVEALL('aSubscriberReceiver',5)) t 若要以主題 ALL_EMP 來讀取所有訊息,您可以影響 SQL 的能力,請發出: 範例 26: SELECT t.msg FROM table (DB2MQ.MQREADALL('aSubscriberReceiver')) t WHERE t.topic = 'ALL_EMP' 註: 重要的是您必須聊解若 MQRECEIVEALL 使用限制,而非使用整個佇列, 則並非 只有那些訊息會公布主題 ALL_EMP。 這是因為執行表格功能後,才引用限制。 當您不再有興趣訂閱特殊主題時,您必須使用陳述式,明確地取消訂閱,例如: 範例 27: DB2MQ.MQUNSUBSCRIBE('aSubscriber', 'ALL_EMP') 一旦發出此陳述式,發佈/訂閱分配管理系統將不再傳送符合訂閱的訊息。 自動化公佈 資料庫傳訊的另一個重要技術是自動化公布。 使用 DB2 中的觸發函式機能,您可以 自動公布訊息,作為觸發函式呼叫的一部份。 當其他的自動資料公布技術存在時,觸 發程式基礎的方法可讓管理者或開發者自由地建構訊息內容,並彈性地定義觸發動 作。請注意,任何觸發函式的使用,都必須給付執行頻率與成本的費用。 下列範例說 明觸發函式如何使用 MQSeries DB2 功能。 下列範例顯示每次雇用新員工時,公布訊息是很容易的。 任何訂閱 HR_INFO_PUB 服 務程式並在 NEW_EMP 中登記喜好的使用者或應用程式,將會接收到一訊息,包括每一 個新員工的日期、名稱及部門。 範例 28: CREATE TRIGGER new_employee AFTER INSERT ON employee REFERENCING NEW AS n FOR EACH ROW MODE DB2SQL VALUES DB2MQ.MQPUBLISH('HR_INFO_PUB&', 'NEW_EMP', current date || ' ' || LASTNAME || ' ' || DEPARTMENT) ------------------------------------------------------------------------ 20.6 enable_MQFunctions enable_MQFunctions 啟用指定的資料庫之 DB2 MQSeries 功能,並驗證 DB2 MQSeries 功能可以適當地執 行。 若未安裝與架構 MQSeries 和 MQSeries AMI,指令將會失敗。 授權 下列其中一項: * sysadm * dbadm * 若功能的隱含或明確的綱目名稱不存在,則 IMPLICIT_SCHEMA 在資料庫上。 * 若綱目名稱 DB2MQ 存在,則 CREATEIN 專用權在綱目上。 指令語法 >>-enable_MQFunctions---n--database---u--userid---p--password---> >--+-------+--+------------+----------------------------------->< '-force-' '-noValidate-' 指令參數 -n database 指定要啟用的資料庫名稱。 -u userid 指定使用者 ID 以連接到資料庫。 -p password 指定使用者 ID 的通行碼。 -force 指定重新安裝期間發現的警告應被忽略。 -noValidate 指定 DB2 MQSeries 功能的驗證將不執行。 範例 在下列範例中,已建立 DB2MQ 功能。使用者連線到資料庫 SAMPLE。 已使用預設綱目 DB2MQ。 enable_MQFunctions -n sample -u user1 -p password1 用法注意事項 DB2 MQ 功能在此指令自動建立的綱目 DB2MQ 下執行。 執行指令之前: * 請確定已安裝了 MQ 及 AMI,且 MQSeries 的版本是 5.1 或更高的版本。 * 確定已定義環境變數 $AMT_DATA_PATH。 * 將目錄變更為 DB2PATH 的 cfg 次目錄。 在 UNIX 上: * 使用 db2set,將 AMT_DATA_PATH 新增至 DB2ENVLIST。 * 確定與 UDF 執行相關的使用者帳戶是 mqm 群組的成員。 * 確定要呼叫此指令的使用者是 mqm 群組的成員。 註: MQSeries 5.2 不支援 ATX 4.2。 ------------------------------------------------------------------------ 20.7 disable_MQFunctions disable_MQFunctions 停用指定的資料庫之 DB2 MQSeries 功能。 授權 下列其中一項: * sysadm * dbadm * 若功能的隱含或明確的綱目名稱不存在,則 IMPLICIT_SCHEMA 在資料庫上。 * 若綱目名稱 DB2MQ 存在,則 CREATEIN 專用權在綱目上。 指令語法 >>-disable_MQFunctions---n--database---u--userid----------------> >---p--password------------------------------------------------>< 指令參數 -n database 指定資料庫名稱。 -u userid 指定用來連接資料庫的使用者 ID。 -p password 指定使用者 ID 的通行碼。 範例 在下列範例中,已停用資料庫 SAMPLE 的 DB2MQ 功能。 disable_MQFunctions -n sample -u user1 -p password1 ------------------------------------------------------------------------ 管理工具 部份目錄 * 執行工具之前的其它設置 o 21.1 停用 Linux 上的浮點堆疊 o 21.2 日文 Linux 環境需要特定的 Java 層次 * 控制中心 o 22.1 管理 DB2 Server for VSE & VM 伺服器能力 o 22.2 Java 1.2 支援控制中心 o 22.3 在 Windows 作業系統下使用線上說明的「無效捷徑」錯誤 o 22.4 快速鍵無效 o 22.5 OS/2 系統下的 Java 控制中心 o 22.6 在 Windows 作業系統之異動日誌檢視已完成工作的「檔案拒絕存 取」錯誤 o 22.7 多位置更新測試連接 o 22.8 DB2 for OS/390 的控制中心 o 22.9 OS/390 控制中心必要的修正程式 o 22.10 「建立空間層」對話框的變更 o 22.11 DB2 控制中心的疑難排解 o 22.12 UNIX 系統控制中心的疑難排解 o 22.13 OS/2 可能的 Infopop 問題 o 22.14 jdk11_path 架構參數的說明 o 22.15 使用「Script 中心」或「異動日誌」時發生的 Solaris 系統錯誤 (SQL10012N) o 22.16 DPREPL.DFT 檔案的說明 o 22.17 啟動多個控制中心 applet o 22.18 控制中心以 Applet 執行時的線上說明 o 22.19 在 Applet 模式 (Windows 95) 下執行控制中心 o 22.20 使用大量的查詢結果 * 命令中心 o 23.1 現在命令中心交談頁可以辨識陳述式結束字元 * 資訊中心 o 24.1 在 Windows 作業系統下的「無效捷徑」錯誤 o 24.2 當 Netscape 已開啟時,在 Netscape Navigator 中開啟外部 Web 鏈結(UNIX 系統) o 24.3 啟動「資訊中心」的問題 * 精靈 o 25.1 在建立資料庫精靈設定擴充大小 o 25.2 MQSeries 輔助精靈 o 25.3 OLE DB 輔助精靈 o 25.4 使用儲存程序建置器建置 OS/390 的 Java 儲存程序 ------------------------------------------------------------------------ 執行工具之前的其它設置 ------------------------------------------------------------------------ 21.1 停用 Linux 上的浮點堆疊 若是在含 Glibc 2.2.x 的 Linux 環境中,您必須先停用浮點堆疊,然後才能執行 「控制中心」等的 DB2 Java GUI 工具。 若要停用浮點堆疊,請執行下列步驟,將 LD_ASSUME_KERNEL 環境變數設定為 2.2.5: bash$ export LD_ASSUME_KERNEL=2.2.5 ------------------------------------------------------------------------ 21.2 日文 Linux 環境需要特定的 Java 層次 當您在日文 Linux 環境上使用「控制中心」等的 DB2 Java GUI 工具時, 就需要特 定的 IBMJava118-SDK-1.1.8-2.0.i386.rpm 層次。您可以從 www6.software.ibm.com/dl/dklx/dklx118-p 下載這個特定的 Java 層次。 ------------------------------------------------------------------------ 控制中心 ------------------------------------------------------------------------ 22.1 管理 DB2 Server for VSE & VM 伺服器能力 DB2 Universal Database 版本 7 「控制中心」增強對 DB2 伺服器 for VSE 和 VM 資料庫的支援。「控制中心」檢視所有 VSE 和 VM 資料庫物件的 DB2 伺服器。 同時 也支援建立索引、重組索引、更新統計值和重新連結指令。 重組索引和重新連結需要 儲存程序,而該儲存程序執行於 VSE 和 VM 主電腦上的 DB2 伺服器。 此儲存程序由 控制中心所提供,適用於 VSE 和 VM 下 DB2 伺服器的 VSE 和 VM 特性。 整合控制中心容許使用者管理 DB2,無論 DB2 伺服器執行於那一個平台。VSE 和 VM 物件的 DB2 伺服器顯示在控制中心主視窗,除了 DB2 Universal Database 物件。 選取物件時,會呼叫管理這些物件的相對應動作和公用程式。 範例,使用者可以列示 特別資料庫的索引,選取其中的一個索引並將之重組。 使用者也可以列示資料庫的表 格,並執行更新統計值,或定義表格為抄寫來源。 有關架構控制中心,並在 VSE 和 VM 物件的 DB2 伺服器執行管理作業的資訊,請參 照 DB2 Connect User's Guide或安裝與架構補充資料。 ------------------------------------------------------------------------ 22.2 Java 1.2 支援控制中心 使用 Java 1.2 中的雙向支援,控制中心可以支援雙向語言,如阿拉伯語和希伯來 語。 此支援只可用於 Windows NT 平台。 欲辨識和使用 Java 1.2,控制中心要進行安裝: 1. JDK 1.2.2 在 DB2 UDB CD 的 DB2\bidi\NT 目錄下。 ibm-inst-n122p-win32-x86.exe 是安裝程式, ibm-jdk-n122p-win32-x86.exe 是 JDK 分送。將兩個檔案複製到硬碟上的暫時目錄中, 然後從該目錄執行安裝 程式。 2. 將它安裝在 \java\Java12 下, 是 DB2 的安裝路徑。 3. JDK/JRE 安裝提示時,不要選取 JDK/JRE 為系統 VM。 Java 1.2 安裝成功後,以正常方式啟動控制中心時會使用 Java 1.2。 欲停止使用 Java 1.2,請在 \java\Java12 下解除安裝 JDK/JRE,或更改 \java\Java12 次目錄的名字。 註: 不要混淆 \java\Java12 和 \Java12。 \Java12 是 DB2 安裝的一部份,並且包括 Java 1.2 的 JDBC 支援。 ------------------------------------------------------------------------ 22.3 在 Windows 作業系統下使用線上說明的「無效捷徑」錯誤 使用控制中心線上說明,您可能會遇到這樣的錯誤:「無效的捷徑」。如果您最近安 裝了新的 Web 瀏覽器或 Web 瀏覽器新版,請確定 HTML 和 HTM 文件和更改過的瀏覽 器相結合。 請參閱視窗說明主題「開啟檔案時變更程式的啟動」。 ------------------------------------------------------------------------ 22.4 快速鍵無效 在某些語言中,針對 UNIX 系統與 OS/2 上的「控制中心」, 有些快速鍵(熱鍵)無 法運作。請使用滑鼠來選取選項。 ------------------------------------------------------------------------ 22.5 OS/2 系統下的 Java 控制中心 控制中心必須安裝在 HPFS 格式化的磁碟機上。 ------------------------------------------------------------------------ 22.6 在 Windows 作業系統之異動日誌檢視已完成工作的「檔案拒絕存取」錯誤 在 DB2 Universal Database for Windows NT 上, 在試圖開啟異動日誌來檢視在 「Script 中心」所建立的工作明細時,發生「檔案拒絕存取」的錯誤。 工作狀態顯 示完成。 若「Script 中心」中建立的工作含有 START 指令,便會發生這樣的行為。 為了避免這樣的行為,請在批次檔和工作內, 使用 START/WAIT 指令,而不要使用 START 指令。 ------------------------------------------------------------------------ 22.7 多位置更新測試連接 多位置更新測試連接在版本 7 「控制中心」的功能,為目標案例的版本所限制。「遠 端」測試連接功能欲執行的目標案例, 至少需要版本 7。 欲在版本 6 執行多位置更 新測試連接功能,請在目標案例中提到控制中心,並在那兒執行它。 ------------------------------------------------------------------------ 22.8 DB2 for OS/390 的控制中心 利用OS/390 的 DB2 UDB 控制中心來管理授權公用程式的使用。 對於 OS/390 的 DB2 UDB,公用程式函數是獨立有順序特性的元素,在它被 DB2 控制中心管理之前,必須 授權和安裝在環境內。 資料庫 DB2 for OS/390 子系統,控制中心會定義 "CC390" 資料庫,作為控制中心的 內部支援。 請不要修改此資料庫。 雖然在控制中心目錄或資訊中心作業資訊中,沒有特別提到 DB2 for OS/390 版本 7.1,但是,該文件支援 OS/390 版本 7.1 DB2 的函數。 很多 DB2 for OS/390 版本 6 的特殊函數,和 DB2 for OS/390 版本 7.1 相關。有些 DB2 for OS/390 版本 7.1 的特殊函數,在目錄中沒有版本名稱。 在控制中心架構 DB2 for OS/390 版本 7.1 子系統之後,對所有該版本的文件都有存取權限。 欲自控制中心存取和使用 Generate DDL 函數,請安裝 Generate DDL 函數: * 關於版本 5,使用 DB2 for OS/390 版本 5 來安裝 DB2Admin。 * 關於版本 6,安裝小的程式設計加強功能,對於 DB2 for OS/390 版本 7.1 管 理特性而言就如 PTF 般。 * 關於版本 7.1,Generate DDL 函數為獨立定價之 DB2 for OS/390 版本 7.1 管 理特性之一部份。 欲從控制中心存取儲存程序建置器,在啟動 DB2 UDB 控制中心時,必須進行安裝。 它是 DB2 應用程式開發從屬站的一部份。 欲在工作站為 OS/390 子系統編目 DB2,請選擇使用從屬站架構輔助程式工具。 1. 在「來源」頁面,指定自行架構與資料庫的連線圓鈕。 2. 在「通信協定」頁面,完成適當的通信資訊。 3. 在「資料庫」頁面,於資料庫名稱欄位指定子系統名稱。 4. 在「節點選項」頁面,選取架構節點選項 (選用的)勾選框。 5. 在作業系統欄位選取「MVS/ESA, OS/390」。 6. 按一下完成,以完成架構。 若要透過閘道機器來編目 DB2 for OS/390 子系統, 請遵循上述閘道機器的步驟 1-6。然後: 1. 在從屬站機器,啟動控制中心。 2. 在「系統」資料夾上按一下滑鼠右鍵,再選取新增。 3. 在「新增系統」對話框內,在系統名稱欄位鍵入閘道機器名稱。 4. 在遠端案例欄位鍵入 DB2DAS00。 5. 針對 TCP/IP 通信協定 (在「通信協定」參數裡), 請在主電腦名稱欄位指定閘 道機器的主電腦名稱。 6. 在服務程式名稱鍵入 523。 7. 按一下確定來新增系統。 您應該可以在系統資料夾下面看到新增的閘道機器。 8. 展開閘道機器名稱。 9. 在「案例」資料夾上按一下滑鼠右鍵,再選取新增。 10. 在「新增案例」對話框中,按一下復新, 列出閘道機器上可用的案例。 如果閘 道機器為 Windows NT 系統,則會在案例 DB2 下編目 DB2 for OS/390 子系 統。 11. 選取案例。 此案例會自動填寫通信協定參數。 12. 按一下確定來新增案例。 13. 開啟案例資料夾,可以看到剛才新增的案例。 14. 展開案例。 15. 在資料庫資料夾上按一下滑鼠右鍵, 再選取新增。 16. 按一下復新,顯示閘道機器上的本端資料庫。 如果您要在「新增資料庫」對話 框中新增 DB2 子系統, 請於「資料庫名稱」欄位鍵入子系統名稱。 選項:輸 入子系統 (或是資料庫) 的本端別名。 17. 按一下確定。 現在,您已經成功地在控制中心新增子系統。 開啟資料庫時,會顯示 DB2 for OS/390 子系統。 "控制中心 390" 章節的第一個段落指出: OS/390 的 DB2 UDB 控制中心可讓您管理已授權 IBM DB2 公用程式的使用。 若為 DB2 UDB for OS/390 個別訂購特性的元件中的公用程式函數, 在由 DB2 控制中心管理之前,必須經過授權且安裝在環境中。 此章節應改為: OS/390 的 DB2 控制中心可讓您管理已授權 IBM DB2 公用程式的使用。 若為個別訂購產品的元件中的公用程式函數必須經過授權且安裝在環境中, 才能由 DB2 控制中心來管理。 ------------------------------------------------------------------------ 22.9 OS/390 控制中心必要的修正程式 將 APAR PQ36382 引用到 DB2 for OS/390 版本 5 和 DB2 for OS/390 版本 6 的 390 賦能特性,使用 DB2 UDB 控制中心版本 7 來執行這些子系統的公用程式。 引用 APAR 至下列的 FMID: DB2 for OS/390 Version 5 390 Enablement: FMID JDB551D DB2 for OS/390 Version 6 390 Enablement: FMID JDB661D ------------------------------------------------------------------------ 22.10 「建立空間層」對話框的變更 "<<" 及 ">>" 按鈕已自「建立空間層」對話框中除去。 ------------------------------------------------------------------------ 22.11 DB2 控制中心的疑難排解 在「快速入門」一書的「控制中心的安裝與架構」一章中,其「疑難排解資訊」 一節 會告訴您在將「控制中心」用為 applet 時若發生問題,應如何從命令視窗 中重設您 從屬站瀏覽器的 CLASSPATH。 本節亦會說明如何從前述的命令視窗啟動瀏覽器, 但 卻未提供啟動瀏覽器的指令。 若要啟動 Internet Explorer,請鍵入 start iexplore, 然後按 Enter 鍵。 若要啟動 Netscape,請鍵入 start netscape,然後 按 Enter 鍵。 這些指令係假設瀏覽器已設在您的 PATH 中。 如若不然,請將其加入 您的 PATH 中, 或是切換到瀏覽器的安裝目錄,重新發出 start 指令。 ------------------------------------------------------------------------ 22.12 UNIX 系統控制中心的疑難排解 如果您無法在 UNIX 型系統啟動控制中心,則設定 JAVA_HOME 環境變數指向 Java 分 送: * Java 安裝在 /usr/jdk118,請設定 JAVA_HOME 到 /usr/jdk118。 * 對於 sh、ksh、bash shell: 匯出 JAVA_HOME=/usr/jdk118. * 對於 csh 或 tcsh shell: setenv JAVA_HOME /usr/jdk118 ------------------------------------------------------------------------ 22.13 OS/2 可能的 Infopop 問題 如果您是在 OS/2 上執行控制中心,使用解析度 1024x768 及 256 色, 並啟用了 WorkPlace Shell Palette Awareness,則超出現行視窗邊框的 Infopop 會以黑色文 字顯示在黑色背景下。 欲修正此問題,變更顯示設定為 256 色以上,或停止使用 Workplace Shell Palette Awareness。 ------------------------------------------------------------------------ 22.14 jdk11_path 架構參數的說明 在控制中心說明內,JDK 1.1 安裝路徑 (jdk11_path) 架構參數的說明, 於子標題引 用至下少了一行。 「引用至」下完整的列示為: * 本端和遠端從屬站的資料庫伺服器 * 從屬站 * 具有本端從屬站的資料庫伺服器 * 具有本端及遠端從屬站的分割資料庫伺服器 * 具有本端從屬站的衛星資料庫伺服器 ------------------------------------------------------------------------ 22.15 使用「Script 中心」或「異動日誌」時發生的 Solaris 系統錯誤 (SQL10012N) 在選取「Script 中心」或「異動日誌」中的 Solaris 系統時,可能會發生下列錯 誤: SQL10012N - 當載入指定的檔案庫 "/udbprod/db2as/sqllib/function/unfenced/ db2scdar!ScheduleInfoOpenScan"時,接收到非預期的作業系統錯誤。 SQLSTATE=42724。 這是由於 Solaris 執行鏈結器中的錯誤所導致。您只需引用下列的修補程式,即可更 正此問題: 105490-06 (107733 淘汰了 105490) for Solaris 2.6 ------------------------------------------------------------------------ 22.16 DPREPL.DFT 檔案的說明 在「控制中心」中,「工具設定」筆記本之「抄寫」頁的說明步驟 5d 寫道: 將檔案儲存到「控制中心」的工作目錄 (例如,SQLLIB\BIN), 如此一來,系統可以使用其作為預設檔案。 應改寫為: 將檔案儲存到「控制中心」的工作目錄 (SQLLIB\CC), 如此一來,系統可以使用其作為預設檔案。 ------------------------------------------------------------------------ 22.17 啟動多個控制中心 applet 您不能在一台機器上同時啟動一個以上的控制中心 applet。這項限制適用於所有支援 瀏覽器所執行的控制中心 applet。 ------------------------------------------------------------------------ 22.18 控制中心以 Applet 執行時的線上說明 當「控制中心」是以 applet 方式執行時,F1 鍵只能夠在具有 Infopop 功能的視窗 或筆記本中運作。 您可以在下列元件中按 F1 鍵,叫出 Infopop: * DB2 Universal Database for OS/390 * 精靈 除上述兩項以外的「控制中心」元件皆無法使用 F1 鍵叫出說明。 此時若要顯示其它 元件的說明,請使用「說明」按鈕或「說明」下拉功能表。 ------------------------------------------------------------------------ 22.19 在 Applet 模式 (Windows 95) 下執行控制中心 若指定的使用者 ID 和密碼無效,便無法開啟「Script 中心」。 登入「控制中心」 時,請確定使用者 ID 和密碼是否有效。 ------------------------------------------------------------------------ 22.20 使用大量的查詢結果 其方便使用者產生傳回大量列數的查詢。不太適合使用者用來預測實際傳回的列數。 關於可能傳回數以千計或數以萬計列數的查詢,有下列兩個問題: 1. 需要花費很多時間才能取得結果。 2. 需要大量的從屬站記憶體才能保存結果。 為了使這個處理更加便利,DB2 將大量結果集分割成許多片段。 以一次一個片段的方 式擷取及顯示查詢結果。 結果如下: 1. 當查詢的第一個片段可以檢視,同時已擷取剩餘片段時,會減少顯示時間。 2. 當在任何時指定時間上從屬站僅儲存查詢結果的一個片段,會減少從屬站的記憶 體需求。 控制記憶體中的查詢結果列數: 1. 開啟「工具設定」筆記本的「一般」頁面。 2. 在最大值區段中,選取: o 範例內容,可限制「範例內容」視窗中顯示的結果列數。 在輸入欄位中指 定結果集的片段大小 (列數)。 o 命令中心,可限制「命令中心」的「查詢結果」頁面上顯示的結果列數。 在輸入欄位中指定結果集的片段大小 (列數)。 當使用「範例內容」視窗或「命令中心」的「查詢結果」頁面上的查詢結果時, 記憶 體中列數欄位指示保留在記憶體中的查詢列數。 此數目絕不會大於最大值設定。按一 下下一步,擷取至結果集的下一個片段。 當下一步非作用中時,表示您已到達結果集 尾端。 ------------------------------------------------------------------------ 命令中心 ------------------------------------------------------------------------ 23.1 現在命令中心交談頁可以辨識陳述式結束字元 現在「命令中心」的「交談」頁可以辨識「工具設定」中指定的「陳述式」結束字 元。如果沒有指定「陳述式」結束字元,則會使用預設的換行字元。 ------------------------------------------------------------------------ 資訊中心 ------------------------------------------------------------------------ 24.1 在 Windows 作業系統下的「無效捷徑」錯誤 使用資訊中心,您會發現如下的錯誤:「無效捷徑」。 如果您最近安裝了新的 Web 瀏覽器或 Web 瀏覽器新版,請確定 HTML 和 HTM 文件和更改過的瀏覽器相結合。 請 參閱視窗說明主題「開啟檔案時變更程式的啟動」。 ------------------------------------------------------------------------ 24.2 當 Netscape 已開啟時,在 Netscape Navigator 中開啟外部 Web 鏈結(UNIX 系統) 如果已經開啟 Netscape Navigator,並顯示本端 DB2 HTML 文件或外部網站, 試圖 從「資訊中心」開啟外部網站將導致 Netscape 發生錯誤。 錯誤會提到 "Netscape 找不到名稱為 的檔案或目錄"。 若要解決這個問題,請在開啟外部網站之前,關閉開啟的 Netscape 瀏覽器。 Netscape 將重新啟動並起始外部網站。 請注意,利用已開啟的 Netscape 來開啟本端 DB2 HTML 文件不會發生這個錯誤。 ------------------------------------------------------------------------ 24.3 啟動「資訊中心」的問題 在某些系統上,若您使用「開始功能表」、「第一個步驟」或 db2ic 指令來呼叫「資 訊中心」,啟動速度會非常慢。 若遇到這個問題,請啟動「控制中心」, 然後選取 說明 --> 資訊中心。 ------------------------------------------------------------------------ 精靈 ------------------------------------------------------------------------ 25.1 在建立資料庫精靈設定擴充大小 可以使用建立資料庫精靈來設定新建資料庫之使用者表格空間的 (不是目錄或暫時表 格的表格空間) 擴充大小和預先提取大小參數。只有當使用者表格空間在「使用者表 格」精靈指定至少一個配置區時,才會啟用此特性。 ------------------------------------------------------------------------ 25.2 MQSeries 輔助精靈 DB2 版本 7.2 提供新的 MQSeries 輔助精靈。此精靈建立一個表格函數, 使用 DB2 MQSeries Functions 來讀取 MQSeries 佇列, DB2 MQSeries Functions 亦為版本 7.2 中的新功能。 根據您的設定,此精靈可將每一則 MQSeries 訊息視為一個有定界 符號的字串, 或一個固定長度的直欄字串。 建立的表格函數可根據您的設定來剖析 字串, 將每一則 MQSeries 訊息傳回成一列表格函數。 此精靈亦可讓您在表格函數 之上建立概略表,預覽 MQSeries 訊息和表格函數結果。 此精靈可從「儲存程序建置 器」或「資料倉儲中心」啟動。 本精靈的需求為: * MQSeries 版本 5.2 * MQSeries 應用程式傳訊介面 (AMI) * DB2 MQSeries Function 關於這些需求的詳細資訊,請參閱MQSeries。 關於範例與 MQSeries 輔助精靈的教學指導,請跳至 http://www.ibm.com/software/data/db2/udb/ide 的教學指導段落。 ------------------------------------------------------------------------ 25.3 OLE DB 輔助精靈 此精靈協助您建立一個表格函數,從支援 Microsoft OLE DB 標準的另一個資料庫提 供者來讀取資料。 另外,您可建立一個 DB2 表格,由 OLE DB 表格函數來提供備妥 的資料, 您亦可建立 OLE DB 表格函數的概略表。此精靈可從「儲存程序建置器」或 「資料倉儲中心」啟動。 本精靈的需求為: * OLE DB 提供者 (如 Oracle 或 Microsoft SQL Server) * OLE DB 支援功能 關於範例與 OLE DB 輔助精靈的教學指導, 請跳至 http://www.ibm.com/software/data/db2/udb/ide 上的教學指導段落。 ------------------------------------------------------------------------ 25.4 使用儲存程序建置器建置 OS/390 的 Java 儲存程序 現在 DB2 儲存程序建置器可以支援建置 OS/390 的 Java 儲存程序。 需求: * 開始之前,您必須先在 DB2 上執行 OS/390 的一連串設置作業。請跳至: http://www-4.ibm.com/software/data/db2/os390/sqlproc,以取得資訊。 * 如果您想使用分散式除錯器,則 OS/390 上的 WLM 位址空間,必須為 TEST 指 定 RUNOPTS 以及您的 TCP/IP 位址。 * 「集合 ID」必須符合您在 OS/390 上連結 JDBC 驅動程式時所使用的 ID。 * 修改 DB2SPB.ini 檔,以包含下列登錄項目: SPOPTION_WLM_JAVA_ENVIRONMENT = WLMENVJ SPOPTION_JAVAPROC_BUILDER = SYSPROC.DSNTJSPP SPOPTION_BIND_OPTIONS_JAVA = ACT(REP) SPOPTION_COLLIDJ = DSNJDBC SPOPTION_HPJ_COMPILE_OPTIONS_DEBUG = -g SPOPTION_HPJ_COMPILE_OPTIONS = -nog -O 若要使用儲存程序建置器來建立 OS/390 的 Java 儲存程序,請執行下列步驟: 1. 開啟「插入 Java 儲存程序」精靈: a. 在專案樹狀結構的 OS/390 資料庫連線下,以滑鼠右鍵按一下儲存程序資 料夾。 b. 選取使用精靈插入 -> Java 儲存程序。即可開啟精靈。 2. 指定 OS/390 選項,完成精靈: o 「集合 ID」必須符合您在 OS/390 上連結 JDBC 驅動程式時,於 BIND PACKAGE(collid) 上指定的 ID。 o 「Java 資料包」必須是唯一的。 3. 按一下確定。 即可建立儲存程序,並列入專案樹狀結構中。 4. 以滑鼠右鍵按一下儲存程序,並選取建置。 ------------------------------------------------------------------------ Business Intelligence 部份目錄 * Business Intelligence 教學指導 o 26.1 經過修訂的 Business Intelligence 教學指導 * DB2 Universal Database 快速導覽 * 資料倉儲中心 Administration Guide o 28.1 可用更新 o 28.2 倉儲伺服器加強功能 o 28.3 使用 OS/390 代理程式執行 Trillium 批次系統 JCL o 28.4 資料倉儲中心中的二個新範例程式 o 28.5 用 DB2 Warehouse Manager 來管理 ETI.Extract(R) 轉換程式已更 新 o 28.6 使用 Common Warehouse Metadata Interchange (CWMI) 匯入及匯出 描述資料 + 28.6.1 簡介 + 28.6.2 匯入描述資料 + 28.6.3 在執行匯入公用程式之後更新描述資料 + 28.6.4 匯出描述資料 o 28.7 標示語言描述資料匯入/匯出公用程式 + 28.7.1 鍵定義 + 28.7.2 步驟與程序排程 o 28.8 SAP 步驟資訊 + 28.8.1 指定 SAP 步驟的輸出參數時延遲 + 28.8.2 SAP 步驟間共用輸入參數值 + 28.8.3 執行 SAP 步驟時發生存取違規錯誤 o 28.9 SAP Connector 資訊 + 28.9.1 SAP Connector 安裝限制 + 28.9.2 GetDetail BAPI 的效能 * DB2 OLAP Starter Kit o 29.1 OLAP Server 網站 o 29.2 支援的作業系統服務程式等級 o 29.3 完成 DB2 OLAP Starter Kit 在 UNIX 上的安裝 o 29.4 Solaris 作業環境的附加架構 o 29.5 所有作業系統的附加架構 o 29.6 架構 OLAP Starter Kit 的 ODBC + 29.6.1 在 UNIX 系統上架構資料來源 + 29.6.1.1 架構 ODBC 環境變數 + 29.6.1.2 編輯 odbc.ini 檔案 + 29.6.1.3 新增資料來源到 odbc.ini 檔 + 29.6.1.4 ODBC 的 DB2 設定值範例 + 29.6.1.5 ODBC 的 Oracle 設定值範例 + 29.6.2 在 UNIX 系統上架構 OLAP 描述資料型錄 + 29.6.3 在 Windows 系統上架構資料來源 + 29.6.4 在 Windows 系統上架構 OLAP 描述資料型錄 + 29.6.5 在您架構資料來源之後 o 29.7 從 OLAP Starter Kit 桌上管理程式登入 + 29.7.1 Starter Kit 登入範例 o 29.8 自行建立及架構 OLAP Starter Kit 的範例資料庫 o 29.9 移轉應用程式至 OLAP Starter Kit 版本 7.2 o 29.10 已知問題與限制 o 29.11 OLAP 試算表增益集 EQD 檔案遺失 * 資訊型錄管理程式管理手冊 o 30.1 資訊型錄管理程式起始設定公用程式 + 30.1.1 + 30.1.2 版權問題 + 30.1.3 安裝問題 o 30.2 資訊型錄管理程式加強功能 o 30.3 在 Windows 環境中「資訊型錄管理程式」及 Sybase 之間的不相容 o 30.4 以 DB2 版本 7 資訊型錄管理程式存取 DB2 版本 5 資訊型錄 o 30.5 設置資訊型錄 o 30.6 與其它產品交換描述資料 o 30.7 使用 flgnxoln 指令交換描述資料 o 30.8 使用 MDISDGC 指令交換描述資料 o 30.9 呼叫程式 * Information Catalog Manager Programming Guide and Reference(無中文版) o 31.1 Information Catalog Manager Reason Codes * 資訊型錄管理程式使用手冊 * 資訊型錄管理程式:線上訊息 o 33.1 更正 FLG 訊息 + 33.1.1 訊息 FLG0260E + 33.1.2 訊息 FLG0051E + 33.1.3 訊息 FLG0003E + 33.1.4 訊息 FLG0372E + 33.1.5 訊息 FLG0615E * 資訊型錄管理程式:線上說明 o 34.1 Web 資訊型錄管理程式 * DB2 Warehouse Manager 安裝手冊 o 35.1 可以使用 DB2 Warehouse Manager 安裝手冊更新版 o 35.2 倉儲轉換程式的軟體需求 * Query Patroller Administration Guide(無中文版) o 36.1 DB2 Query Patroller Client is a Separate Component o 36.2 Changing the Node Status o 36.3 Migrating from Version 6 of DB2 Query Patroller Using dqpmigrate o 36.4 Enabling Query Management o 36.5 Location of Table Space for Control Tables o 36.6 New Parameters for dqpstart Command o 36.7 New Parameter for iwm_cmd Command o 36.8 New Registry Variable: DQP_RECOVERY_INTERVAL o 36.9 Starting Query Administrator o 36.10 User Administration o 36.11 Creating a Job Queue o 36.12 Using the Command Line Interface o 36.13 Query Enabler Notes o 36.14 DB2 Query Patroller Tracker may Return a Blank Column Page o 36.15 Query Patroller and Replication Tools o 36.16 Improving Query Patroller Performance o 36.17 Lost EXECUTE Privilege for Query Patroller Users Created in Version 6 o 36.18 Query Patroller Restrictions o 36.19 Appendix B. Troubleshooting DB2 Query Patroller Clients ------------------------------------------------------------------------ Business Intelligence 教學指導 ------------------------------------------------------------------------ 26.1 經過修訂的 Business Intelligence 教學指導 FixPak 2 包括了修訂過的 Business Intelligence 教學指導及資料倉儲中心範例資 料庫 (更正了許多版本 7.1 中所存在的問題)。為了引用修訂過的資料倉儲中心範例 資料庫, 請執行下列事項: 如果您尚未安裝範例資料庫,請使用「第一個步驟」發射台來建立新的範例資料庫。 按一下開始,然後選取程式集 --> IBM DB2 --> 第一個步驟。 如果您在先前已安裝了範例資料庫,請將範例資料庫 DWCTBC、TBC_MD 及 TBC 捨棄。 如果您對範例資料庫新增了任何要保存的資料,請在捨棄資料庫之前將資料備份。若 要捨棄這三個範例資料庫: 1. 開啟 DB2 命令視窗,按一下開始, 再選取 程式集 --> IBM DB2 --> 命令視窗 。 2. 在 DB2 命令視窗中,鍵入下列三行命令 (鍵入每一行後按 Enter): db2 drop database dwctbc db2 drop database tbc_md db2 drop database tbc 3. 關閉 DB2 命令視窗。 4. 使用「第一個步驟」發射台來建立新的範例資料庫。按一下 開始, 選取 程式 集 --> IBM DB2 --> 第一個步驟。 ------------------------------------------------------------------------ DB2 Universal Database 快速導覽 「快速導覽」不適用於 DB2 for Linux 或 Linux/390。 以小的系統字型執行「快速導覽」,可獲得最佳效果。您可能需要調整 Web 瀏覽器的 字型大小, 以正確地在 OS/2 上檢視「快速導覽」。請參照 Web 瀏覽器的說明,以 取得調整字型大小的資訊。 若要正確地檢視「快速導覽」(僅適用於 SBCS),建議您 使用 8 點的 Helv 字型。針對日本及韓國客戶,建議您使用 8 點的 Mincho 字型。 設定字型的喜好設定時,請確定選取「喜好設定」視窗「字型」頁的「使用預設字 型,置換文件指定的字型」選項。 在某些例子裡,可能會在第二個瀏覽器視窗後面啟動「快速導覽」。 若要更正這個問 題,請關閉「快速導覽」,並遵循 3.4, 啟動 Netscape 時產生的錯誤訊息 裡的步 驟。 啟動「快速導覽」時,您可能會接收到類似下列兩行的 JavaScript 錯誤: file:/C/Program Files/SQLLIB/doc/html/db2qt/index4e.htm,65 行: 視窗未定義。 這個 JavaScript 錯誤會阻止「快速導覽」啟動頁 index4e.htm, 在啟動「快速導 覽」後自動關閉。可藉由關閉顯示 index4e.htm 的瀏覽器視窗來關閉「快速導覽」啟 動頁。 在「新特性介紹」區段,「資料管理」主題的下方提到 在 7.1 版中支援「即時日誌 保存支援」。事實上並不是這樣。其中也提到: 日誌檔的大小從 4GB 增加到 32GB。 句子應改為: 全部的現行日誌空間已從 4GB 增加到 32GB。 說明 DB2 Data Links Manager 的區段中有一個句子如下: 而且,可支援 Veritas XBSA 介面的使用, 以便使用 NetBackup 作備份及復置。 句子應改為: 而且,可支援 XBSA 介面來做檔案歸檔及回復。 儲存體管理程式支援的 XBSA 介面包含 Legato NetWorker 及 Veritas NetBackup。 ------------------------------------------------------------------------ 資料倉儲中心 Administration Guide ------------------------------------------------------------------------ 28.1 可用更新 資料倉儲中心 Administration Guide 已經更新成為 FixPak 4 的一部分。 您可以從 http://www.ibm.com/software/data/db2/udb/winos2unix/support 線上下載最新的 PDF。這些注意事項中的資訊是用以補充更新的參照。您也可以在 CD 中取得所有已更 新的文件。 透過 DB2 服務並使用 PTF 號碼 U478862,即可訂購此 CD。 您可以從 http://www.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/help.d2w/report 取得聯絡「DB2 服務」的相關資訊。 ------------------------------------------------------------------------ 28.2 倉儲伺服器加強功能 在 FixPak 5 中,已對倉儲伺服器做了下列功能改進︰ 更新架構參數 伺服器不會再將服務程式名稱等重要的架構參數更新為空字串。 訊息 DWC7906 已更新 現在訊息 DWC7906 在報告相依關係問題時,會包含繼承根源步驟名稱。 追蹤變更 在 FixPak 4 中新增額外低層次 (層次 5),是為了供「資料倉儲中心」控制資 料庫存取之用。通常這項追蹤只有在 IBM 服務程式要求時才會開啟。FixPak 5 中的伺服器,只有在 DDD 追蹤層次設定為 5 時,才會輸出新的控制資料庫追 蹤。 在 FixPak 4 中,已對倉儲伺服器做了下列功能改進︰ 代理程式關機錯誤 (rc = 7170),次要 rc = 6106。 當代理程式是在伺服器傳送關機要求前即已關機,則會發生此錯誤。 此錯誤報 告不是必要的,且不會再報告。 將「系統訊息」與「註解」寫入日誌檔 當使用者定義程式執行完成時,「系統訊息」與「註解」會寫入倉儲日誌檔。 您現在可以在「進行中」顯示視窗中看到這些訊息。 增量確定 (Incremental commit) 現在可正確運作 如果某一步驟正在移入目標資料庫時發生錯誤,且「增量確定」的值大於 0, 則在錯誤發生之前已確定的所有結果將會出現在目標資料庫中。 在 FixPak 4 之前,會刪除部份結果。 變更追蹤層次後無法執行倉儲伺服器的錯誤已更正 倉儲伺服器會從系統環境變數 VWS_LOGGING 中擷取日誌目錄的名稱。如果遺漏 了 VWS_LOGGING, 或指向無效的目錄名稱,則會使用 TEMP 系統環境變數來代 替。 如果遺漏了 TEMP,或指向無效的目錄名稱, 則日誌器追蹤檔會寫入 c:\。這樣就可更正 FixPak 4 之前版本中, 由於從登錄中擷取無效的日誌目錄 名稱所造成的錯誤。 儲存程序中確定指令的附加支援 在執行使用者定義的儲存程序後, 倉儲伺服器會傳送確定指令給代理程式。 強化範例內容 倉儲伺服器不必再等待代理程式關機訊息, 所有「範例內容」可以更有效地執 行。 現在可以控制追蹤日誌檔的大小 您現在可以使用新的系統環境變數 VWS_SERVER_LOG_MAX 來控制追蹤日誌檔的大 小。如果您將 VWS_SERVER_LOG_MAX 的值設定為大於 0, 倉儲伺服器會在日誌 檔的大小大約達到等於 VWS_SERVER_LOG_MAX 值所指定的位元組數時, 停止加 大日誌檔的大小。 當日誌檔達到大小上限時,會保留最新的追蹤日誌登錄並改 寫最舊的登錄。 在執行大量追蹤時,VWS_SERVER_LOG_MAX=150000000 (150M) 是合理的大小。 ------------------------------------------------------------------------ 28.3 使用 OS/390 代理程式執行 Trillium 批次系統 JCL 現在 OS/390 代理程式可以支援由「資料倉儲匯入描述資料」筆記本建立的 Trillium 批次系統使用者定義程式。過去執行 Trillium 批次系統 JCL 檔時,必須使用 Windows、AIX 或 Solaris 作業環境代理程式來遠端執行 JCL。有了這項更新後,您 可以使用 OS/390 代理程式來啟動 JCL。 如果您使用 Trillium 批次系統的「匯入描述資料」筆記本來建立 Trillium 批次系 統使用者定義程式步驟, 就必須為 OS/390 代理程式連線選取遠端主電腦 (即使 JCL 和代理程式都在相同系統上)。同時,也必須輸入遠端主電腦連線的所有參數。 建立好 Trillium 批次系統使用者定義程式步驟之後, 接著請使用 Trillium 批次系 統步驟的「內容」筆記本,將代理程式端變更為您要使用的 OS/390 代理程式端。 如果 JCL 或輸出錯誤檔的名稱中有任何空白或括弧, 您在 Script 或 JCL 或輸出錯 誤檔欄位中輸入這些名稱時, 必須用雙引號包住這些名稱。 ------------------------------------------------------------------------ 28.4 資料倉儲中心中的二個新範例程式 資料倉儲中心有二個新範例程式:EEE_Load 和 File_Wait。您可以使用 EEE_Load 程 式,在資料倉儲程序中建立 DB2 UDB EEE 自動載入程式的執行步驟。您也可以使用 File_Wait 程式來建立等待檔案的步驟,當檔案可以使用時,再繼續執行程序中的下 一個步驟。如需這些程式的詳細資訊, 請到安裝了資料倉儲中心伺服器的系統中,參 閱 ..\SQLLIB\TEMPLATES\SAMPLES 目錄中的 README.UDP 檔。 ------------------------------------------------------------------------ 28.5 用 DB2 Warehouse Manager 來管理 ETI.Extract(R) 轉換程式已更新 用 DB2 Warehouse Manager 來管理 ETI.Extract(R) 轉換程式已經更新, 您可以從 http://www.ibm.com/software/data/db2/udb/winos2unix/support 連線下載。 ------------------------------------------------------------------------ 28.6 使用 Common Warehouse Metadata Interchange (CWMI) 匯入及匯出描述資料 28.6.1 簡介 除了目前支援的標示語言檔案,資料倉儲中心現在也可以匯入及匯出描述資料到符合 Common Warehouse Metamodel (CWM) 標準的 XML 檔案, 以及從 XML 檔案匯入及匯 出描述資料。匯入及匯出這些依照 CWM 的 XML 檔案 就是所指的 Common Warehouse Metadata Interchange (CWMI)。 您可以從下列資料倉儲中心物件匯入及匯出描述資料: * 倉儲來源 * 倉儲目標 * 主旨區域,包括程序、來源、目標、步驟及重疊關係。 * 使用者定義程式 CWMI 匯入及匯出公用程式目前不支援特定類型的描述資料, 包括:排程、倉儲綱目 、使用者及群組。 資料倉儲中心會建立一個包含匯入及匯出程序結果的日誌檔。通常日誌檔會建立在 x:\program files\sqllib\logging 目錄 (其中 x: 是安裝 DB2 的磁碟機),或是您 指定在 VWS_LOGGING 環境變數的目錄。日誌檔是純文字的;您可以用任何文字編輯程 式來檢視它。 28.6.2 匯入描述資料 您可以在資料倉儲中心中匯入描述資料,或者從命令行匯入描述資料。 透過匯入程序所建立的新物件會指派給預設的資料倉儲中心安全群組。若需詳細資 訊,請參閱版本注意事項中的「在匯入後更新機密保護」。 如果是匯入關於某步驟的描述資料,則可以將多個檔案與步驟相關聯。關於步驟的描 述資料會儲存在 XML 檔案中, 但是有時步驟會有相關聯的資料是儲存為 BLOB。BLOB 描述資料的檔名與 XML 檔案相同, 但是它是在個別的檔案中,其副檔名為數字。所 有相關的步驟檔案在匯入時必須在相同的目錄中。 當步驟在測試或生產模式時更新步驟 步驟必須在開發模式中,資料倉儲中心才能更新步驟的描述資料。如果步驟是在測試 或生產模式, 則在匯入描述資料之前將步驟降級為開發模式: 1. 登入資料倉儲中心。 2. 在要降級的步驟上按一下滑鼠右鍵,再按一下模式。 3. 按一下開發。 現在步驟就在開發模式了。在匯入描述資料之後,再將步驟變更回測試或生產模式。 從資料倉儲中心匯入資料 您可以在資料倉儲中心之中匯入描述資料: 1. 登入資料倉儲中心。 2. 按一下左窗格中的倉儲。 3. 按一下 選取的 -> 匯入描述資料 -> 交換檔案...。 4. 在「匯入描述資料」視窗中,指定包含要匯入的描述資料的檔名。您可以鍵入檔 名或用瀏覽來找檔案。 o 如果您知道位置,則請鍵入完整的路徑和要匯入的檔案名稱。請務必加上 .xml 副檔名, 以指定您要以 XML 格式來匯入描述資料,否則無法正確地 處理檔案。 o 若要用瀏覽來找檔案: a. 按一下 (...) 按鈕。 b. 在「檔案」視窗中,將檔案類型變更為 XML。 c. 移至正確的目錄,再選取要匯入的檔案。 註: 檔案必須為 .xml 副檔名。 d. 按一下確定。 5. 在匯入描述資料視窗中, 按一下確定來完成。在資料倉儲中心匯入檔案時會顯 示進度視窗。 使用命令行來匯入描述資料 您也可以使用命令行來匯入描述資料。下列為匯入的指令語法: CWMImport XML_file dwcControlDB dwcUserId dwcPW [PREFIX = DWCtbschema] XML_file 要匯入的 XML 檔案的完整路徑和檔案名 稱 (包括磁碟機及目錄)。此參數是必要 的。 dwcControlDB 描述資料所要匯入的倉儲控制資料庫名 稱。此參數是必要的。 dwcUserId 您用來連接倉儲控制資料庫的使用者 ID。 此參數是必要的。 dwcPW 您用來連接倉儲控制資料庫的使用者通行 碼。 此參數是必要的。 [PREFIX=DWCtbschema] 「資料倉儲中心」系統表格的資料庫綱目 名稱。 如果沒有指定值給 PREFIX=,則 預設綱目名稱為 IWH。此參數是可選用 的。 28.6.3 在執行匯入公用程式之後更新描述資料 在匯入後更新機密保護 作為安全上的考量,資料倉儲中心不會匯入或匯出通行碼。您必須視需要在新物件上 更新通行碼。若需匯入注意事項的詳細資訊, 請參閱資料倉儲中心管理手冊的第 12 章「匯出和匯入資料倉儲中心描述資料」。 在匯入描述資料時,所有物件都會指派給預設安全群組。您可以變更可存取物件的群 組: 1. 登入資料倉儲中心。 2. 在包含要變更的物件的資料夾上按一下滑鼠右鍵。 3. 按一下內容,再按一下機密保護標籤。 4. 從選取的倉儲群組列示中將群組除去, 或者從可用的倉儲群組列示中新增群 組。 5. 按一下確定。 28.6.4 匯出描述資料 您可以在資料倉儲中心中匯出描述資料,或者從命令行匯出描述資料。 部份步驟的描述資料是儲存為 BLOB。BLOB 描述資料會匯出到個別檔案中, 其檔名與 步驟的 XML 檔案相同,但是副檔名是數字 (.1、.2 等等)。 從資料倉儲中心匯出資料 您可以在資料倉儲中心之中匯出描述資料: 1. 登入資料倉儲中心。 2. 按一下左窗格中的倉儲。 3. 按一下 選取的 -> 匯出描述資料 -> 交換檔案。 4. 在「匯出描述資料」視窗中,指定將包含匯出的描述資料的檔名。您可以輸入檔 名或用瀏覽來找檔案: o 如果您知道完整的路徑及要使用的檔名, 請輸入到檔名輸入欄位。請確定 加上 .xml 副檔名, 以指定要以 XML 格式來匯出描述資料。 o 若要用瀏覽來找檔案: a. 按一下 (...) 按鈕。 b. 在檔案視窗中,將檔案類型變更為 XML。 c. 移至正確的目錄,再選取要匯出的檔案。 註: 任何您所選取的現存檔案會被匯出的描述資料覆寫。 d. 按一下確定。 5. 當「匯出描述資料」視窗顯示了正確的檔名, 在可用的物件列示中按一下要匯 出其描述資料的物件。 6. 按一下 > 符號將選取的物件從 可用的物件列示中移動到選取的物件列示。重複 以上步驟,直到所有要匯出的物件都列示在選取的物件列示中。 7. 按一下確定。 資料倉儲中心會建立一個輸入檔案 (它包含與要匯出的資料倉儲中心物件的相關資 訊),然後匯出有關那些物件的描述資料。 在資料倉儲中心匯出描述資料時會顯示進 度視窗。 使用命令行來匯出描述資料 在從命令行匯出描述資料之前,您必須先建立一個輸入檔案。輸入檔是一個副檔名為 .INP 的文字檔, 它會依照要匯出的物件類型列出所有物件。當您在資料倉儲中心之 中匯出時, 輸入檔是自動建立的,但是從命令行匯出,您必須先建立輸入檔。您可以 使用任何文字編輯程式來建立輸入檔。鍵入所有的物件名稱 (與顯示在資料倉儲中心 中的名稱相同)。請確定檔案是建立在一個可讀寫的目錄中。當您執行匯出公用程式 時, 資料倉儲中心會將 XML 檔案寫入到輸入檔所在的相同目錄中。 下列為一個範例輸入檔: 教學指導事實表格程序 教學指導檔案來源 教學指導目標 新建程式群組 在 (程序) 區段,列出所有要匯出的程序。在 (資訊資源) 區段,列出 所有要匯出的倉儲來源及目標。 資料倉儲中心會自動併入與這些來源及目標相關聯的 表格和直欄。在 (使用者定義程式) 區段, 列出所有要匯出的程式群組。 若要匯出描述資料,在 DOS 提示符號下輸入下列指令: CWMExport INPcontrol_file dwcControlDB dwcUserID dwcPW [PREFIX=DWCtbschema] INPcontrol_file 包含要匯出物件的 .INP 檔案的完整路徑 和檔案名稱 (包括磁碟機及目錄)。此參 數是必要的。 dwcControlDB 要從其匯出的倉儲控制資料庫名稱。此參 數是必要的。 dwcUserID 您用來連接倉儲控制資料庫的使用者 ID。 此參數是必要的。 dwcPW 您用來連接倉儲控制資料庫的通行碼。 此參數是必要的。 [PREFIX=DWCtbschema] 「資料倉儲中心」系統表格的資料庫綱目 名稱。 如果沒有指定值給 PREFIX=,則 預設值為 IWH。此參數是可選用的。 ------------------------------------------------------------------------ 28.7 標示語言描述資料匯入/匯出公用程式 28.7.1 鍵定義 如果在標示語言檔中所定義的主要鍵與外來鍵和控制資料庫中已經定義的主要鍵與外 來鍵是相同的, 則系統不處理。如果這些鍵與已定義的不同,則會發生錯誤。 28.7.2 步驟與程序排程 28.8.1 指定 SAP 步驟的輸出參數時延遲 可能需要數秒鐘的時間才能將 SAP 步驟中「內容」筆記本之「輸出參數」頁上的參 數, 從「可用的」參數列示移到「選取的」參數列示。 28.8.2 SAP 步驟間共用輸入參數值 如果已指定 SAP 步驟的新輸入參數值, 則鏈結到同一 SAP 來源作為更新步驟的其它 SAP 步驟也會具有新的輸入參數值。 例如,已指定 SAP 步驟 1 的新輸入參數值。 SAP 步驟 1 是鏈結到 SAP 來源 A。 SAP 步驟 2 也是鏈結到 SAP 來源 A。則 SAP 步驟 2 具有與 SAP 步驟 1 相同的輸入參數值。 28.8.3 執行 SAP 步驟時發生存取違規錯誤 如果符合下列所有條件,則 SAP 步驟會當機或會發生存取違規錯誤。 1. 所有鍵值欄位均已對映到 SAP 來源之「內容」筆記本中「參數對映」頁上的匯 出參數。 2. 在 SAP 來源之「內容」筆記本的「輸出參數」頁上, 未選取 GetList 匯出參 數,該參數的 SAP 參數名稱與用於參數對映的參數相同。 3. 在 SAP 步驟之「內容」筆記本的「輸出參數」頁上, 已選取的 GetList 匯出 參數, 其 SAP 參數名稱與用於參數對映的參數不相同。 4. 條件 3 中選取的參數是一個簡式或結構參數,或者, 如果它是表格參數,其名 稱會依照字母順序排列在用於參數對映的參數名稱之前。 其中 "SAP 參數名稱" 是指出現參數中句點前的參數部份。 例如,在參數 DocumentList.DOCNUMBER 中, DocumentList 是 SAP 參數。 範例︰ DocumentNumber 是鍵值欄位,且 DocumentList.DOCUMENTNUMBER、 DocumentList.USERNAME 及 DocNumberSelection.OPTION 是匯出參數。 如果鍵值欄位 DocumentNumber 對映到匯出參數 DocumentList.DOCUMENTNUMBER(條 件 1), 且沒有選取 GetList 匯出參數 DocumentList.USERNAME(條件 2),則如 果 GetList 匯出參數 DocNumberSelection.OPTION 已選取(條件 3),且依照字母 順序排列,DocNumberSelection.OPTION" 是在 DocumentList.DOCUMENTNUMBER 之前 (條件 4), 四個條件均符合且會發生錯誤。 ------------------------------------------------------------------------ 28.9 SAP Connector 資訊 SAP Connector 僅支援英文版的 SAP R/3 系統。 28.9.2 GetDetail BAPI 的效能 如果 GetDetail 有大量的輸入參數,則 GetDetail BAPI 效能會很緩慢。 ------------------------------------------------------------------------ DB2 OLAP Starter Kit IBM DB2 OLAP Starter Kit 7.2 在一些作業系統上增加 Oracle、MS-SQL、Sybase 及 Informix 關聯式資料庫管理系統 (RDBMS) 的支援。 版本 7.2 包含所有支援的 RDBMS 的 Script 和工具,包括 DB2。 它們有一些限制,詳細資訊請參閱29.10, 已 知問題與限制。 DB2 OLAP Starter Kit for DB2 Universal Database 版本 7.2 的服務程式等級相當 於 Hyperion Essbase 6.1 修補程式 2 加上 Hyperion Integration Server 2.0 修 補程式 2。 ------------------------------------------------------------------------ 29.1 OLAP Server 網站 若需 DB2 OLAP Starter Kit 最新的安裝及使用秘訣, 請造訪 DB2 OLAP Server 網 站的 Library 網頁: http://www.ibm.com/software/data/db2/db2olap/library.html ------------------------------------------------------------------------ 29.2 支援的作業系統服務程式等級 OLAP Starter Kit for Version 7.2 的伺服器元件支援下列作業系統和服務程式等 級: * 安裝 SP 5 的 Windows NT 4.0 與 Windows 2000 * AIX 版本 4.3.3 或以上 * Solaris 作業系統版本 2.6、7 與 8 (Sun OS 5.6、5.7 或 5.8) 從屬站元件執行於 Windows 95、Windows 98、Windows NT 4.0 SP5 與 Windows 2000。 ------------------------------------------------------------------------ 29.3 完成 DB2 OLAP Starter Kit 在 UNIX 上的安裝 安裝 DB2 OLAP Starter Kit 請依照 DB2 Universal Database for UNIX 的安裝基本 程序進行。 產品檔案會由安裝程式放到系統目錄: (AIX: /usr/lpp/db2_07_01; Solaris: /opt/IBMdb2/V7.1)。 建立案例的階段,會建立兩個 DB2 OLAP 目錄 (essbase 與 is) 位於案例使用者起始 目錄下 sqllib的目錄下。同一時間機器僅允許執行一個 OLAP 伺服器案例。 若要完 成安裝,使用者必須手動設定 is/bin 目錄, 因為它無法鏈結到系統的 is/bin 目 錄。它必須鏈結到案例的起始目錄下的可寫入目錄。 若要完成在 Solaris 上的安裝,請以案例 ID 登入切換到 sqllib/is 目錄, 然後輸 入下列指令: rm bin mkdir bin cd bin ln -s /opt/IBMdb2/V7.1/is/bin/ismesg.mdb ismesg.mdb ln -s /opt/IBMdb2/V7.1/is/bin/olapicmd olapicmd ln -s /opt/IBMdb2/V7.1/is/bin/olapisvr olapisvr ln -s /opt/IBMdb2/V7.1/is/bin/essbase.mdb essbase.mdb ln -s /opt/IBMdb2/V7.1/is/bin/libolapams.so libolapams.so ------------------------------------------------------------------------ 29.4 Solaris 作業環境的附加架構 在 Solaris 作業環境中,如果 OLAP Starter Kit 未鏈結到適當的 ODBC 驅動程式, 則會發生錯誤。為了避免這些錯誤,請執行下列指令, 該指令會在 $ARBORPATH/bin 中建立鏈結, 以指向 OLAP 驅動程式 sqllib/lib/libdb2.so︰ ln -s $HOME/sqllib/lib/libdb2.so libodbcinst.so ------------------------------------------------------------------------ 29.5 所有作業系統的附加架構 從 DB2 Universal database 版本 7 的 FixPak 3 開始, DB2 OLAP Starter Kit 包 含了需要使用 Java 的函數。安裝 FixPak 3 或更新版本後, 您會在 OLAP Server 主控台上看到下列錯誤訊息: Can not find [directory] [/export/home/arbor7sk/sqllib/essbase/java/], required to load JVM. 若要更正此錯誤,請採取下列步驟: 1. 以 DB2 案例擁有者的身份登入。 2. 尋找安裝 DB2 OLAP Starter Kit 的目錄。此目錄的預設名稱是 essbase。 3. 在 essbase 目錄中,建立一個名稱為 java 的子目錄。 4. 在 java 子目錄中,建立下列空白檔案︰ o essbase.jar o essdefs.dtd o jaxp.jar o parser.jar o udf.policy ------------------------------------------------------------------------ 29.6 架構 OLAP Starter Kit 的 ODBC IBM DB2 OLAP Starer Kit 7.2 需要一個 ODBC.ini 檔案, 讓 ODBC 作業從 OLAP Integration Server 連接至關聯式資料來源和「OLAP 描述資料型錄」。 * 在 Windows 系統上,此檔案位於系統登錄的 HKEY_LOCAL_MACHINE/SOFTWARE/ODBC 內。 請使用 ODBC Data Source Administrator 來儲存有關如何連接至關聯式資料來源的資訊。 * 在 UNIX 系統上,安裝程式建立一個模型檔 odbc.ini。欲儲存有關如何連接至 關聯式資料來源的資訊,請使用您喜好的編輯器來編輯此檔案。 此 ODBC.ini 檔案由 ODBC 軟體套件提供,亦內含於 Microsoft Office 軟體內。如 需安裝 ODBC 驅動程式或「ODBC 管理者」的應用程式相關資訊, 請造訪下列網站: http://support.microsoft.com/。 AIX 機器上的 Oracle 使用者:欲架構 ODBC for Oracle,您必須更新 ODBC.ini 檔 案來指向 MERANT 3.6 驅動程式。 在版本 7.2 中,OLAP Starter Kit 管理 ODBC 連線來連接至關聯式資料來源和 「OLAP 描述資料型錄」。為了支援這些 ODBC 連接, OLAP Starter Kit 在 Windows NT 4.0、Windows 2000、AIX 及 Solaris 上使用 ODBC 驅動程式。 * DB2 Universal Database 版本 6 資料庫從屬站: 在 Windows NT 4.0 SP5 或 Windows 2000、AIX 4.3.3 及 Solaris 作業系統 2.6、7 或 8 (Sun OS 5.6、 5.7 或 5.8)上是 DB2 版本 6 ODBC 驅動程式。 * DB2 Universal Database 7.1 資料庫從屬站: 在 Windows NT 4.0 SP5 或 Windows 2000、AIX 4.3.3 及 Solaris 作業系統 2.6、7 或 8 (Sun OS 5.6、 5.7 或 5.8) 上是 DB2 版本 7 ODBC 驅動程式。 * Oracle 8.04 和 8i SQL*Net 8.0 資料庫從屬站: 在 Windows NT 4.0 SP5 或 Windows 2000、AIX 4.3.3、Solaris 作業系統 2.6、7 或 8 (Sun OS 5.6、5.7 或 5.8) 上是 MERANT 3.6 ODBC 驅動程式。 * MS SQL Server 6.5.201 (不需要「資料庫從屬站」):在 Windows NT 4.0 SP5 或 Windows 2000 上是 MS SQL Server 6.5 ODBC 驅動程式。 * MS SQL Server 7.0 (不需要「資料庫從屬站」):在 Windows NT 4.0 SP5 或 Windows 2000 上是 MS SQL Server 7.0 ODBC 驅動程式。 29.6.1 在 UNIX 系統上架構資料來源 在 AIX 和 Solaris 上,您必須手動設定 ODBC 的環境變數,並編輯 odbc.ini 檔案 來架構關聯式資料來源和「OLAP 描述資料型錄」。若您新增或變更驅動程式或資料來 源, 請務必編輯 odbc.ini 檔案。 如果您是要在 AIX 或 Solaris 上使用 DB2 OLAP Starter Kit 來存取 Merant ODBC 來源及 DB2 資料庫, 請在 .odbc.ini 檔案的 DB2 來源區段中變更 "Driver=" 屬性 的值, 如下所示: AIX:驅動程式名稱為 /usr/lpp/db2_07_01/lib/db2_36.o AIX 的範例 ODBC 來源登錄: [SAMPLE] Driver=/usr/lpp/db2_07_01/lib/db2_36.o Description=DB2 ODBC Database Database=SAMPLE Solaris 作業環境︰驅動程式名稱為 /opt/IBMdb2/V7.1/lib/libdb2_36.so Solaris 的範例 ODBC 來源登錄︰ [SAMPLE] Driver=/opt/IBMdb2/V7.1/lib/libdb2_36.so Description=DB2 ODBC Database Database=SAMPLE 29.6.1.1 架構 ODBC 環境變數 在 UNIX 系統上,您必須設定環境變數才能存取 ODBC 核心元件。Starter Kit 起始 目錄中提供 is.sh 和 is.csh Shell Script 來設定必要的變數。 在使用 ODBC 來連 接資料來源之前,您必須執行其中一個 Script。 對於您用來執行 OLAP Starter Kit 的使用者名稱,您應該在登入 Script 中包含這些 Script。 29.6.1.2 編輯 odbc.ini 檔案 欲於 odbc.ini 檔案中架構資料來源,您必須新增 ODBC 資料來源的名稱和說明, 在 您針對此資料來源名稱所建立的區段中提供 ODBC 驅動程式路徑、檔名及其他驅動程 式設定值。 安裝程式在 ISHOME 目錄中安裝一個範例檔 odbc.ini。 此檔案包含通用 ODBC 連接和所支援的 ODBC 驅動程式的架構資訊。 請使用此檔案做為起點,將您使 用的 ODBC 驅動程式對映至關聯式資料來源和「OLAP 描述資料型錄」。 若您使用的檔案不是 odbc.ini, 請將 ODBCINI 環境變數設定成您使用的檔名。 29.6.1.3 新增資料來源到 odbc.ini 檔 1. 在執行 OLAP Starter Kit 伺服器的系統上,請使用諸如 vi 的文字編輯程式來 開啟 odbc.ini 檔案。 2. 找到 [ODBC Data Sources] 為首的區段,新增一行資料來源名稱和說明, 例 如: mydata=data source for analysis。為了避免混淆,資料來源的名稱應該 符合 RDBMS 中的資料庫名稱。 3. 新增一行以方括弧含括新資料來源的名稱,例如 [mydata],在檔案中新增一個 新的區段。 4. 在資料來源名稱接下來的幾行中,新增此資料來源名稱及任何必要的 ODBC 驅動 程式資訊所需的 ODBC 驅動程式之完整路徑和檔案名稱。 根據下列幾節所示的 範例來對映至您 RDBMS 上的資料來源。 請確定 ODBC 驅動程式檔案確實存在於 您在 Driver= 設定中指定的位置。 5. 當您編輯 odbc.ini 完成後,請儲存檔案,結束文字編輯程式。 29.6.1.4 ODBC 的 DB2 設定值範例 下列範例顯示如何編輯 odbc.ini,使用 IBM DB2 原始 ODBC 驅動程式來連接至 AIX 上的 DB2 Universal Database 版本 6.1 的關聯式資料來源 db2data。 在 vi 編輯 器中,使用 $ODBCINI 指令來編輯 odbc.ini, 並插入下列陳述式: [ODBC Data Sources] db2data=DB2 Source Data on AIX ... [db2data] Driver=/home/db2inst1/sqllib/lib/db2.o Description=DB2 Data Source - AIX, native 29.6.1.5 ODBC 的 Oracle 設定值範例 以下範例說明如何編輯 odbc.ini,使用 MERANT Version 3.6 ODBC 驅動程式來連接 至 Oracle 版本 8 (在 Solaris) 的關聯式資料來源 oradata。 此範例中,LogonID 和 Password 以 OLAP Starter Kit 使用者名稱和通行碼的實際值來填入。 [ODBC Data Sources] oradata=Oracle8 Source Data on Solaris ... [myoracle] Driver= /export/home/users/dkendric/is200/odbclib/ARor815.so Description=my oracle source 29.6.2 在 UNIX 系統上架構 OLAP 描述資料型錄 在 AIX 和 Solaris 上架構 OLAP Metadata Catalog 類似架構一個資料來源。 若要 OLAP Metadata Catalog 資料庫,請在 odbc.ini 檔案中新增一個資料來源名稱和區 段, 如 29.6.1.2, 編輯 odbc.ini 檔案 所述。不需要其它變更。 您必須先在支援的 RDBMS 中建立一個「OLAP 描述資料型錄」資料庫, 才能將它架構 成 ODBC 資料來源。 以下範例說明如何編輯 odbc.ini,使用原始 ODBC 驅動程式來連接至 DB2 版本 6.1 (在 Solaris 上) 的「OLAP 描述資料型錄」TBC_MD。 [ODBC Data Sources] ocd6a5a=db2 v6 ... [ocd6a5a] Driver=/home/db2instl/sqllib/lib/db2.0 Description=db2 29.6.3 在 Windows 系統上架構資料來源 欲於 Windows NT 或 Windows 2000 系統上架構關聯式資料來源, 您必須啟動「ODBC 管理程式」,然後建立連線來連接至您要用來建立 OLAP 模型和 metaoutline 的資料 來源。從 Windows 控制台執行「ODBC 管理程式」公用程式。下列範例建立一個 DB2 資料來源;其他 RDBMS 的對話框會不同。 欲使用「ODBC 管理程式」來架構關聯式資料來源,請完成下列步驟: 1. 在 Windows 桌上管理程式,開啟「控制台」視窗。 2. 在「控制台」視窗中,執行下列其中一項步驟: a. 在 Windows NT 上,按兩下 ODBC 圖示, 開啟「ODBC 資料來源管理程 式」對話框。 b. 在 Windows 2000,按兩下系統管理工具圖示, 再按兩下資料來源 (ODBC) 圖示, 開啟「ODBC 資料來源管理員」對話框。 3. 在「ODBC 資料來源管理程式」對話框中,按一下系統資源來源名稱標籤。 4. 按一下新增來開啟「建立新資料來源」對話框。 5. 在「ODBC 管理程式」的「建立新資料來源」對話框的驅動程式列示框中,選取 適當的驅動程式,例如 IBM DB2 ODBC 驅動程式, 按一下完成來開啟「ODBC IBMDB2 驅動程式 - 新增」對話框。 6. 在「ODBC IBM DB2 驅動程式 - 新增」對話框中,在資料庫別名下拉列示中,選 取您的關聯式來源 (例如,此範例應用程式中的 TBC) 的資料庫名稱。 7. 在說明文字框中,輸入選用的說明來表示您要如何使用此驅動程式,按一下新增 。 例如,輸入下列文字來說明 My Business 資料庫: Customers, products, markets 您可輸入下列文字來說明範例應用程式資料庫: Sample relational data source 這些說明可在您從 OLAP Starter Kit Desktop 連線時,協助您識別可選擇的資 料來源。 8. 按一下「確定」來返回「ODBC 資料來源管理員」對話框。 您輸入的資料來源名 稱及您對映的驅動程式顯示在系統資源來源名稱標籤的系統資料來源列示框中。 欲編輯資料來源的架構資訊: 1. 選取資料來源名稱,按一下架構來開啟「ODBC IBM DB2 - 新增」對話框。 2. 修正您要變更的任何資訊。 3. 按兩次確定以結束。 29.6.4 在 Windows 系統上架構 OLAP 描述資料型錄 欲於 Windows NT 或 Windows 2000 上架構「OLAP 描述資料型錄」, 請啟動「ODBC 管理程式」,然後建立連線來連接至含有「OLAP 描述資料型錄」資料庫的資料來源。 下列範例建立一個 DB2 資料來源;其他 RDBMS 的對話框會不同。 欲建立「OLAP 描 述資料型錄」的資料來源,請完成下列步驟: 1. 在桌上管理程式,開啟「控制台」視窗。 2. 在「控制台」視窗中,執行下列其中一項步驟: a. 在 Windows NT 上,按兩下 ODBC 圖示, 開啟「ODBC 資料來源管理程 式」對話框。 b. 在 Windows 2000,按兩下系統管理工具圖示, 再按兩下資料來源 (ODBC) 圖示, 開啟「ODBC 資料來源管理員」對話框。 3. 在「ODBC 資料來源管理程式」對話框中,按一下系統資源來源名稱標籤。 4. 按一下新增來開啟「建立新資料來源」對話框。 5. 在「ODBC 管理程式」的「建立新資料來源」對話框的驅動程式列示框中,選取 適當的驅動程式,例如 IBM DB2 ODBC 驅動程式, 按一下完成來開啟「ODBC IBMDB2 驅動程式 - 新增」對話框。 6. 在「ODBC IBM DB2 驅動程式 - 新增」對話框中, 在資料庫別名下拉列示中, 選取您的「OLAP 描述資料型錄」(例如,此範例應用程式中的 TBC_MD) 的資料 庫名稱。選取的資料庫名稱會自動顯示在資料來源名稱文字框中。 7. 若您要變更資料來源的名稱,請選取資料來源名稱文字框中顯示的名稱,輸入新 的名稱來表示您要如何使用此驅動程式,按一下新增。 例如,您可輸入下列名 稱來表示您要使用此驅動程式來連接至第一個「OLAP 描述資料型錄」: OLAP Catalog first 您可輸入下列名稱來表示您要連接至範例應用程式「OLAP 描述資料型錄」資料 庫: TBC_MD 8. 在說明文字框中,輸入說明來表示您要如何使用此驅動程式。 例如,您可輸入 下列文字來說明「OLAP 描述資料型錄」: My first models and metaoutlines 您可輸入下列文字來說明範例應用程式「OLAP 描述資料型錄」資料庫: Sample models and metaoutlines 這些說明可在您從 OLAP Starter Kit Desktop 連接至「OLAP 描述資料型錄」 時, 協助您識別想要選擇的型錄。 9. 按一下「確定」來返回「ODBC 資料來源管理員」對話框。 您輸入的資料來源名 稱及您對映的驅動程式顯示在系統資源來源名稱標籤的系統資料來源列示框中。 欲編輯資料來源的架構資訊: 1. 選取資料來源名稱,按一下架構來開啟「ODBC IBM DB2 - 新增」對話框。 2. 修正您要變更的任何資訊。 3. 按兩次確定以結束。 29.6.5 在您架構資料來源之後 在架構關聯式資料來源和「OLAP 描述資料型錄」之後,即可從 OLAP Starter Kit 來 連接。然後可以建立、修改及儲存 OLAP 模型和 metaoutline。 在呼叫 SQL Server 資料庫期間,SQL Server ODBC 驅動程式可能會逾時。 請於資料 庫非忙線時重試。增加驅動程式逾時期間可避免此問題。 詳細資訊,請參閱您所使用 的驅動程式的 ODBC 文件。 關於 ODBC 連接問題與解決方案,請參閱 OLAP Integration Server System Administrator's Guide。 ------------------------------------------------------------------------ 29.7 從 OLAP Starter Kit 桌上管理程式登入 使用 OLAP Starter Kit 桌上管理程式來建立 OLAP 模型和 Metaoutline,請將從屬 站軟體連接到兩個伺服器:DB2 OLAP 整合伺服器和 DB2 OLAP 伺服器。登入對話提示 桌上管理程式連接到這兩個伺服器的必要資訊。在對話的左邊,請輸入有關 DB2 OLAP 整合伺服器的資訊。在對話的右邊,請輸入有關 DB2 OLAP 伺服器的資訊。 欲連接到 DB2 OLAP 整合伺服器: * 伺服器:輸入整合伺服器的主電腦名稱或 IP 位址。 如果您已安裝整合伺服器 和桌上管理程式於同一個工作站,典型的值為 "localhost" 或 "127.0.0.1"。 * OLAP 描述資料目錄:連接 OLAP 整合伺服器,必須指定描述資料目錄。 OLAP 整合伺服器儲存有關 OLAP 模型和名為 Metadata Catalog 關聯式資料庫所建立 的 metaoutline 的資訊。 此關聯式資料庫必須登記給 ODBC。 目錄資料庫有一 組 OLAP 整合伺服器能辨識的關聯式表格。 在登入對話中,指定整合伺服器, 並展開 OLAP 描述資料目錄欄位的下拉功能表, 您可以看到 OLAP 整合伺服器 所知道的 ODBC 資料來源名稱之列表。 選擇含有描述資料型錄表格的 ODBC 資 料庫。 * 使用者名稱和通行碼:使用您在畫面所指定的使用者名稱和通行碼,OLAP 整合 伺服器將與描述資料目錄連結。 這是登入帳戶,存在於伺服器 (不是從屬站, 除非伺服器和從屬站在同一台機器執行)。使用者名稱必須為建立 OLAP 描述資 料目錄的使用者。 否則,OLAP 整合伺服器將找不到目錄資料庫內的關聯式表 格,因為表格綱目的名稱不一樣。 DB2 OLAP 伺服器資訊為選用的,所以,在登入對話的右邊之輸入欄位可能是空白的。 但是,有些桌上管理程式和管理程式的作業需要和 DB2 OLAP 伺服器連接。 如果您把 這些欄位空下來,當整合伺服器需要和 DB2 OLAP 伺服器連接以完成您所要求的作業 時,桌上管理程式會再一次顯示登入對話。 建議您在登入對話的 DB2 OLAP 伺服器欄 位填入資料。 欲連接到 DB2 OLAP 伺服器: * 伺服器:輸入 DB2 OLAP 伺服器的主電腦名稱或 IP 位址。 如果您在執行 OLAP Starter Kit,則 OLAP 伺服器和整合伺服器相同。 如果整合伺服器和 OLAP 伺 服器安裝在不同的主電腦,請輸入定義於 OLAP 整合伺服器內的主電腦名稱或 IP 位址。 * 使用者名稱和通行碼:使用您在畫面所指定的使用者名稱和通行碼, OLAP 整合 伺服器將與 DB2 OLAP 伺服器連結。 此使用者名稱和通行碼必須已經定義在 DB2 OLAP 伺服器內。 OLAP 伺服器自作業系統另外地管理它所擁有的使用者名 稱和通行碼。 29.7.1 Starter Kit 登入範例 下列範例假設,在 OLAP Starter Kit 安裝期間,您建立了 OLAP 範例, 並選取了 db2admin 作為管理者使用者 ID,password 為管理者通行碼。 * OLAP 整合伺服器:伺服器是 localhost, OLAP 描述資料目錄是 TBC_MD,使用 者名稱是 db2admin,通行碼是 password * DB2 OLAP 伺服器:伺服器是 localhost,使用者名稱是 db2admin ------------------------------------------------------------------------ 29.8 自行建立及架構 OLAP Starter Kit 的範例資料庫 安裝 OLAP Starter Kit 時,範例資料庫會自動建立。下列指示解譯,必要時,如何 自行安裝目錄和範例資料庫。 1. 在視窗下,按一下 開始 -->程式集-->DB2 for Windows NT--> 命令視窗,以開 啟「命令中心」視窗。 2. 建立目錄資料庫: a. 輸入 db2 create db OLAP_CAT b. 輸入 db2 connect to OLAP_CAT 3. 建立資料庫內的表格: a. 導覽 \SQLLIB\IS\ocscript\ocdb2.sql b. 輸入 db2 -tf ocdb2.sql 4. 建立範例來源資料庫: a. 輸入 db2 connect reset b. 輸入 db2 create db TBC c. 輸入 db2 connect to TBC 5. 建立資料庫內的表格: a. 導覽 \SQLLIB\IS\samples\ b. 複製 tbcdb2.sql 到 \SQLLIB\samples\db2sampl\tbc c. 複製 lddb2.sql 到 \SQLLIB\samples\db2sampl\tbc d. 導覽 \SQLLIB\samples\db2sampl\tbc e. 輸入 db2 -tf tbcdb2.sql f. 輸入 db2 - vf lddb2.sql ,以載入範例來源資料到表格內。 6. 建立範例目錄資料庫: a. 輸入 db2 connect reset b. 輸入 db2 create db TBC_MD c. 輸入 db2 connect to TBC_MD 7. 建立資料庫內的表格: a. 導覽 \SQLLIB\IS\samples\tbc_md b. 複製 ocdb2.sql 到 \SQLLIB\samples\db2sampl\tbcmd c. 複製 lcdb2.sql 到 \SQLLIB\samples\db2sampl\tbcmd d. 導覽 \SQLLIB\samples\db2sampl\tbcmd e. 輸入 db2 -tf ocdb2.sql f. 輸入 db2 -vf lcdb2.sql,以載入範例描述資料到表格。 8. 架構 ODBC for TBC_MD, TBC, AND OLAP_CAT: a. 按一下開始-->設定-->控制台,以開啟 NT 控制台 b. 從列示中選取 ODBC (或 ODBC 資料來源)。 c. 選取「系統 DSN」標籤。 d. 按一下「新增」。 建立新的資料來源視窗開啟。 e. 從列示中選取 IBM DB2 ODBC DRIVER。 f. 按一下「完成」。 ODBC IBM D2 驅動程式 - 新增視窗開啟。 g. 在資料來源名稱欄位中,輸入資料來源 (OLAP_CAT) 的名稱。 h. 在資料庫別名欄位中,輸入別名,或是按一下↓,並在列示中選取 OLAP_CAT。 i. 按一下「確定」。 j. 對於 TBC_MD 和 TBC 資料庫,請重複以上步驟。 ------------------------------------------------------------------------ 29.9 移轉應用程式至 OLAP Starter Kit 版本 7.2 安裝程式不重新安裝 OLAP Starter Kit 範例應用程式、資料庫及資料檔。 您的現存 應用程式和資料庫不受影響。 然而,在安裝之前,最好先備份您的應用程式和資料 庫。 您的應用程式在開啟時會自動移轉至版本 7.2。 ------------------------------------------------------------------------ 29.10 已知問題與限制 本段落列示 DB2 OLAP Starter Kit 的已知限制。 Windows 平台的 Informix RDBMS 和 Merant 驅動程式的相容性 為了讓 Windows 平台的 Merant 驅動程式能夠和 Informix RDBMS 一起運作, PATH 陳述式中必須新增下列兩個項目: o C:\Informix o C:\Informix\bin 這兩個項目必須位於 PATH 的開頭。 OLAP 模型中的維度和相關 Metaoutline 之間可能的不一致情形 在某些情況下,您建立的維度在 OLAP 模型中無相對應的維度。 在下列實務中 會發生這些情形: 1. 建立並儲存一個新的 OLAP 模型。 2. 根據此模型來建立一個 metaoutline,但並未儲存 metaoutline。 3. 返回 OLAP 模型,刪除其中一個 metaoutline 維度所依賴的維度。 4. 返回 metaoutline,開啟、關閉,再重新開啟。metaoutline 將包含一個 維度,此維度在 OLAP 模型中無相對應的維度。 OLAP Starter Kit 無法區分這種情況下建立的不一致維度和 metaoutlin 中的 使用者定義維度。 因此,不一致維度會顯示在 metaoutline 中,但 metaoutline 視它為一個使用者定義維度,因為 OLAP 模型中無相對應的維度存 在。 在 Windows 2000 平台上,TMP 的環境變數設定導致成員和資料載入失敗 因為 Windows 2000 和 Windows NT 之間,TMP 的預設系統和使用者環境變數設 定有所差異, 當 OLAP Starter Kit 在 Windows 2000 平台上執行時,成員和 資料載入會失敗。 造成的錯誤訊息告訴使用者無法建立暫存檔。 您可採取下列 步驟來解決此 Windows 2000 的限制: 1. 建立一個目錄 C:\TEMP 2. 將系統和使用者的環境變數 TMP 設定為 TMP=C:\TEMP 安裝 ODBC 不取代現存的 Merant 驅動程式 現存的 3.6 Merant ODBC 驅動程式不隨此安裝而更新。 若您從 OLAP Starter Kit 版本 7.1 修正套件 2 或更高版本來升級, 您應該繼續使用先前安裝的 ODBC 驅動程式 在 UNIX 平台上使用 Merant Informix ODBC 驅動程式 欲於 UNIX 平台上使用 Merant Informix ODBC 驅動程式,您必須執行下列其中 一項動作: o 在啟動 Starter Kit 之前,將 LANG 環境變數設為 en_US。例如,若是 korn shell,請鍵入: export LANG='en_US' 每次啟動 OLAP Starter Kit 時皆設定此變數。 o 若您的 LANG 環境變數已設定成不同值, 請於安裝之後建立下列符號鏈 結: ln -s $ISHOME/locale/en_US $ISHOME/locale/$LANG 混合 OLAP 從屬站和伺服器的服務程式等級 IBM 建議您將 DB2 OLAP Starter Kit 的從屬站和伺服器元件保持在相同版本和 修正套件層次。 但在某些狀況下,您可混合從屬站和伺服器元件的服務程式等 級: 使用同一版本但不同服務程式等級的從屬站和伺服器 IBM 不支援和建議同時使用較新的從屬站和較舊的伺服器。 不過,雖然 IBM 不支援,您仍可同時使用較舊的從屬站和較新的伺服器。 您可能會遭 遇一些問題。例如: + 來自伺服器的訊息可能不正確。您可升級從屬站的 message.MDB 檔 案來符合伺服器的層次,即可解決此問題。 + 新的伺服器特性沒有作用。當您嘗試使用新特性時,從屬站、伺服器 或兩者可能失效。 + 從屬站可能無法適當地連接伺服器。 在同一個版本中使用多重伺服器和單一從屬站 若您需要將一個從屬站連接至不同機器或作業系統上的幾個 OLAP 伺服 器,IBM 建議您這些伺服器全部使用相同版本和服務程式等級。 您的從屬 站至少應該與最低層次的伺服器相同。 若您遭遇問題,則可能需要使用不 同從屬站機器來配合適當的主電腦, 或將所有從屬站和伺服器升級成相同 的服務程式等級。 混合不同版本的從屬站和伺服器 IBM 不支援同時使用 OLAP Starter Kit 從屬站和伺服器版本 7.1 與從屬 站和伺服器版本 7.2。當 IBM OLAP 產品升級為較新版本層次時, 網路更 新和資料格式變更通常要求從屬站和伺服器為相同的版本層次。 混合 IBM 產品 (DB2 OLAP Starter Kit) 和 Hyperion 產品 (Hyperion Essbase 和 Hyperion Integration Server) IBM 不支援混合 IBM 的 OLAP 從屬站和伺服器與 Hyperion Solutions 的 OLAP 從屬站和伺服器。雖然混合這些元件在某些情況下可以運作, 但特 性上的部份差異可能會造成問題。 ------------------------------------------------------------------------ 29.11 OLAP 試算表增益集 EQD 檔案遺失 在 DB2 OLAP Starter Kit 中的試算表增益集具有 Query Designer (EQD) 元件。 EQD 線上說明功能表中所含的教學指導按鈕,不會顯示任何內容。 其所應顯示的教材 為 OLAP Spreadsheet Add-in User's Guide for Excel 的第 2 章,以及 OLAP Spreadsheet Add-in User's Guide for 1-2-3。 EQD 教學指導中的所有資訊,可以 從「資訊中心」這些書籍的 HTML 版及 PDF 版查到。 ------------------------------------------------------------------------ 資訊型錄管理程式管理手冊 ------------------------------------------------------------------------ 30.1 資訊型錄管理程式起始設定公用程式 30.1.1 使用起始設定資訊型錄管理程式 (ICM) 公用程式, 您現在可以利用下列指令,添加 SQL 陳述式至 CREATE TABLE 陳述式的結尾: CREATEIC \DBTYPE dbtype \DGNAME dgname \USERID userid \PASSWORD password \KA1 userid \TABOPT "directory:\tabopt.file" 您可以從安裝 DB2 的目錄,在 CREATEIC 公用程式中指定 TABOPT 關鍵字。 TABOPT 關鍵字之後的值是 tabopt.file,檔案名稱是含有完整的路徑。如果目錄名稱有空 白, 請以引號括住該名稱。tabopt.file 檔案的內容必須含有資訊,才能添加至 CREATE TABLE 陳述式。您可以使用下列任一種 SQL 陳述式寫入此 tabopt.file 檔 案。ICM 公用程式將讀取此檔案,然後將它添加到 CREATE TABLE 陳述式。 表 8. SQL 陳述式 IN MYTABLESPACE 以其 MYTABLESPACE 資料建立表格 DATA CAPTURE CHANGES 以擴充格式建立表格並記載 SQL 變更 IN ACCOUNTING INDEX IN 以其 ACCOUNTING 資料及 ACCOUNT_IDX 索引建立表 ACCOUNT_IDX 格 內容檔案的最大值大小是 1000 單一位元組字元。 這個新功能只能在 Windows 及 UNIX 系統上使用。 30.1.2 版權問題 如果您得到了下列訊息: FLG0083E:您沒有「IBM 資訊型錄管理程式起始設定」公用程式的有效授權。 請洽詢您當地的軟體經銷商或 IBM 業務代表。 您必須購買 DB2 Warehouse Manager 或 IBM DB2 OLAP Server, 並安裝「資訊型錄 管理程式」元件,當中包含了「資訊型錄起始設定」公用程式。 30.1.3 安裝問題 若您在安裝了 DB2 Warehouse Manager 或 IBM DB2 OLAP Server 之後,又在相同的 工作站上安裝 其它「資訊型錄管理程式管理者」元件 (利用 DB2 Universal Database CD-ROM), 便會覆寫原有的資訊型錄起始設定公用程式。此時,您可以從 \sqllib\bin 目錄下,找出 createic.bak 與 flgnmwcr.bak 檔案,將其分別更名為 createic.exe 及 flgnmwcr.exe。 若您要另外安裝 DB2 Universal Database 上的「資訊型錄管理程式」元件,則這些 元件 不能安裝在 Data Warehouse Manager 所安裝的同一部工作站上。您可以參閱 「DB2 Warehouse Manager 安裝手冊」的第 3 章「安裝資訊型錄管理程式元件」,查 看進一步的資訊。 ------------------------------------------------------------------------ 30.2 資訊型錄管理程式加強功能 「資訊型錄管理程式」含有下列加強功能︰ ICM 現在支援來源或目標資料庫、表格或直欄的 ETI 過濾資訊匯入。 對「倉儲」進 行登記時,您可以使用新的 ICM 物件類型「ETI 轉換資料」來儲存過濾器資訊。然 後, 這些物件會鏈結到定義的來源或目標資料庫、表格或直欄。 將不同的「ETI 轉換」登記到相同的 ICM 型錄, 則 ICM 就可以使用多重「ETI 轉換 資料」物件來鏈結特定的來源或目標資料庫、表格或直欄。 相同的功能也可以引用到「轉換」,將不同的「ETI 轉換」登記到相同的 ICM 型錄, 則特定的目標直欄現在即可含有多重「轉換」。 如欲執行此動作,ICM 在匯入 ETI*Extract 對映時會變更「轉換」鍵。 如欲啟用這些特性,請使用 ETI*Extract 4.2.1 與 MetaScheduler 4.1.0 來登記 「資料倉儲管理程式」。 請參閱 http://www.ibm.com/software/data/db2/datawarehouse/support.html 上的 DB2 Warehouse Manager, 您可以在 Hints and Tips 章節中取得啟用這些特性的相關資 訊。請搜尋關鍵字 "ETI" 或 "Application Data"。 ------------------------------------------------------------------------ 30.3 在 Windows 環境中「資訊型錄管理程式」及 Sybase 之間的不相容 「資訊型錄管理程式」版本 7 和 Sybase Open Client 安裝在同一台 Windows NT 或 Windows 2000 機器會造成錯誤, 且 Sybase 公用程式會停止運作。會出現類似下列 的錯誤訊息: 無法起始 LIBTCL.DLL。請確定 SYBASE 環境 變數已正確設定。 避免這種情境的方法是從 Windows 環境參數中將環境參數 LC_ALL 除去。 LC_ALL 是 一個語言環境種類參數。 語言環境種類是本土化常式所使用的明顯的常數, 以指定 程式要使用的語言環境資訊的部份。 語言環境是指地區(國家/地區),程式的某些 方面可以針對地區自訂。 語言環境相關區域包括, 例如日期格式或貨幣符號的顯示 格式。 LC_ALL 會影響所有的語言環境特定行為 (所有種類)。 如果您將 LC_ALL 環境參數除去,這樣 ICM 就可和 Sybase 同時存在 Windows NT 平 台上, 下列機能會無法運作: * 資訊型錄使用者 * 資訊型錄管理者 * 資訊型錄管理程式 除去 LC_ALL 參數,並不影響 ICM 以外的其他項目。 ------------------------------------------------------------------------ 30.4 以 DB2 版本 7 資訊型錄管理程式存取 DB2 版本 5 資訊型錄 由 DB2 版本 7 安裝程序所架構的 DB2 版本 7 資訊型錄管理程式次元件,支援存取 儲存在 DB2 版本 6 和 DB2 版本 7 資料庫的資訊型錄。修改次元件的架構,存取儲 存在 DB2 版本 5 資料庫的資訊型錄。DB2 版本 7 資訊型錄管理程式次成份並不支援 存取 DB2 版本 2 或之前版本的資料。 設定資訊型錄管理者,存資訊型錄的資訊型錄使用者和資訊型錄起始設定公用程式, 儲存在 DB2 版本 5 資料庫: 1. 在沒有安裝 DB2 版本 7 資訊型錄管理程式的工作站,安裝 DB2 Connect Enterprise Edition 版本 6。 DB2 Connect Enterprise Edition 是 DB2 Universal Database Enterprise Edition 和 DB2 Universal Database Enterprise - Extended Edition 的一部 分。 如果安裝這些 DB2 產品的版本 6,無須另外安裝 DB2 Connect。 限制: 在相同的 Windows NT 或 OS/2 工作站,不能安裝 DB2 多重版本。您可以 在其它 Windows NT 工作站、 OS/2 工作站或 UNIX 工作站上安裝 DB2 Connect。 2. 架構資訊型錄管理程式和 DB2 Connect 版本 6,存取 DB2 版本 5 的資料。詳 細資訊,請參閱 DB2 Connect User's Guide。以下為必要步驟的概觀: a. 在 DB2 版本 5 系統,使用 DB2 命令行處理器編目版本 5 的資料庫,存 取資訊型錄管理程式。 b. 在 DB2 Connect 系統,使用 DB2 命令行處理器進行編目: + DB2 版本 5 系統的 TCP/IP 節點 + DB2 版本 5 系統的資料庫 + DB2 版本 5 系統的 DCS 登錄項目 c. 在資訊型錄管理程式的工作站,使用 DB2 命令行處理器進行編目: + DB2 Connect 系統的 TCP/IP 節點 + DB2 Connect 系統的資料庫 有關編目資料庫的資訊,請參閱 DB2 Universal Database 安裝與架構補充 3. 於資訊型錄管理程式的倉儲,將 DB2 CLI 套裝軟體和透過 DB2 Connect 所存取 的各個資料庫進行連結。 下列 DB2 指令提供連結到 v5database 的範例, 一個假設性的 DB2 版本 5 的 資料庫。使用 DB2 命令行處理器發出下列指令。db2cli.lst 及 db2ajgrt 的位 置在 \sqllib\bnd 目錄中。 db2 connect to v5database user 使用者 ID using 通行碼 db2 bind db2ajgrt.bnd db2 bind @db2cli.lst blocking all grant public 使用者 ID 是 v5database 的使用者, 通行碼是指使用者 ID 的通行碼。 db2cli.list 被連結到 DB2 版本 5 資料庫時,會發生錯誤。發生錯誤,是因為 此架構並不支援大型物件。這項錯誤不會影響倉儲代理程式對 DB2 版本 5 資料 庫的存取。 需要有 DB2 Universal Database 版本 5 的 FixPak 14 (於 2000 年 6 月發 行), 才能透過 DB2 Connect 來存取 DB2 版本 5 的資料。請參照 FixPak 內 的 APAR 編號 JR14507。 ------------------------------------------------------------------------ 30.5 設置資訊型錄 在第 1 章第 1 段的步驟 2「設置資訊型錄」提到: 當您安裝了 DB2 Warehouse Manager 或 DB2 OLAP Server, 即會在 DB2 Universal Database for Windows NT 中建立預設的資訊型錄。 這個陳述式是不正確的。您必須定義新的資訊型錄。詳細資訊,請參閱「建立資訊型 錄」部份。 ------------------------------------------------------------------------ 30.6 與其它產品交換描述資料 在第 6 章「與其它產品交換描述資料」的「識別要公佈的 OLAP 物件」區段, 在第 二段有一個句子提到: 當您公佈 DB2 OLAP 整合伺服器描述資料時, 會在資訊型錄的「多重維度資料庫間的維度」與 OLAP 整合伺服器的表格物件間建立鏈結關係。 這段說明應如下所示: 當您公佈 DB2 OLAP 整合伺服器描述資料時, 會在資訊型錄「多重維度資料庫物件及表格物件中的維度」 之間建立鏈結關係。 這一句也出現在附錄 C 「描述資料對映」的「資訊型錄管理程式與 OLAP 伺服器間的 描述資料對映」區段。 ------------------------------------------------------------------------ 30.7 使用 flgnxoln 指令交換描述資料 在第 6 章「交換描述資料」中有一個段落的標題是 「識別要公佈的 OLAP 物件」。 在段落的最後面有使用 flgnxoln 指令來公佈 OLAP 伺服器描述資料到資訊型錄的範 例。此範例顯示 db2olap.ctl 和 db2olap.ff 檔案的目錄為 x:\Program Files\sqllib\logging, 這是不正確的。目錄應該如第 87 頁所說: x:\Program Files\sqllib\exchange。 ------------------------------------------------------------------------ 30.8 使用 MDISDGC 指令交換描述資料 第 6 章「與其它產品交換描述資料」的「將符合 MDIS 的描述資料轉換到標示語言 檔」(第 89 頁)。您不可以從 MS-DOS 命令提示下發出 MDISDGC 指令,而應該從 DB2 命令視窗中發出該指令。該章節的第一句寫道:「將 MDIS 格式的描述資料轉換成標 示語言檔」中亦提到您必 從 MS-DOS 命令提示發出 DGMDISC 指令。您必須從 DB2 命 令視窗中發出 DGMDISC 指令。 ------------------------------------------------------------------------ 30.9 呼叫程式 「資訊型錄管理手冊」中部分的範例中的指令包含了 Program Files 的目錄名稱。當 您呼叫一個包含 Program Files 目錄名稱的指令時, 您必須將程式呼叫包在雙引號 內。 例如在附錄 B 「預先定義的資訊型錄管理程式物件類型」 的「以預先定義的物 件類型起始設定您的資訊型錄」段落中有一個範例。如果您使用這裡 的範例,當您從 DOS 提示符號執行它時會得到錯誤訊息。下列是正確的範例: "X:Program Files\SQLLIB\SAMPLES\SAMPDATA\DGWDEMO" /T userid password dgname ------------------------------------------------------------------------ Information Catalog Manager Programming Guide and Reference(無中文版) ------------------------------------------------------------------------ 31.1 Information Catalog Manager Reason Codes In Appendix D: Information Catalog Manager reason codes, some text might be truncated at the far right column for the following reason codes: 31014, 32727, 32728, 32729, 32730, 32735, 32736, 32737, 33000, 37507, 37511, and 39206. If the text is truncated, please see the HTML version of the book to view the complete column. ------------------------------------------------------------------------ 資訊型錄管理程式使用手冊 在第 2 章,有一個段落稱為「登記伺服器節點與遠端資訊型錄」。此區段列出了您在 使用「資訊型錄管理程式」登記遠端資訊型錄時可從「DB2 控制中心」 完成的步驟。 這個章節的最後一個段落提到在從「DB2 控制中心」完成這些步驟之後 (新增系統、 新增案例及新增資料庫),在開啟「資訊型錄管理程式」之前必須關閉 「控制中 心」。這項資訊並不正確。在開啟「資訊型錄管理程式」之前並不需要關閉 「控制中 心」。 同樣的修正也適用於「登記伺服器節點及遠端資訊型錄」作業的線上說明,以及「登 記 伺服器節點及資訊型錄」視窗的線上說明。 ------------------------------------------------------------------------ 資訊型錄管理程式:線上訊息 ------------------------------------------------------------------------ 33.1 更正 FLG 訊息 33.1.1 訊息 FLG0260E 訊息說明的第二句應為: 錯誤造成資訊型錄失敗的 rollback。 資訊型錄的狀況不穩定,但是,沒有製造任何的變更。 33.1.2 訊息 FLG0051E 訊息說明內的第二項目符號應為: 資訊型錄含有太多物件或物件類型。 管理者回應為: 使用匯入函數從目前資訊型錄刪除部份物件或物件類型。 33.1.3 訊息 FLG0003E 訊息說明應為: 資訊型錄必須在使用前進行登記。 資訊型錄可能登記錯誤。 33.1.4 訊息 FLG0372E 訊息說明的第一句應為: ATTACHMENT-IND 值為物件所忽略,因為該物件是 Attachment 物件。 33.1.5 訊息 FLG0615E 訊息的第二句應為: 「資訊型錄管理程式」遇到非預期的資料庫錯誤, 或者在目前的目錄或路徑裡找不到連結檔。 ------------------------------------------------------------------------ 資訊型錄管理程式:線上說明 資訊型錄視窗:選取的功能表開啟項目的線上說明錯誤地說「開啟選取的物件」。它 應該說「開啟定義搜尋視窗」。 ------------------------------------------------------------------------ 34.1 Web 資訊型錄管理程式 使用位於 DB2 UDB for OS/390 system 的資訊型錄,沒有不區分大小寫搜尋的功能。 簡式搜尋和進階搜尋的情況都是如此。線上說明並沒有解譯,對於簡式搜尋,DB2 UDB for OS/390 資訊型錄的所有搜尋為區分大小寫的。此外,所有分組種類物件都可以擴 充,即使它們不是基礎物件。 ------------------------------------------------------------------------ DB2 Warehouse Manager 安裝手冊 ------------------------------------------------------------------------ 35.1 可以使用 DB2 Warehouse Manager 安裝手冊更新版 「DB2 Warehouse Manager 安裝手冊」已經更新, 而您可以從 http://www.ibm.com/software/data/db2/udb/winos2unix/support 線上下載最新的 .pdf。 您也可以在 CD 中取得所有已更新的文件。 透過服務程式並使用 PTF 號碼 U478862,即可訂購此 CD。 這些附註中的資訊會新增至更新的參照。 ------------------------------------------------------------------------ 35.2 倉儲轉換程式的軟體需求 在您計劃要使用倉儲轉換程式的資料庫上,必須先安裝 Java Developer's Kit (JDK) 版本 1.1.8 (或以上)。 ------------------------------------------------------------------------ Query Patroller Administration Guide(無中文版) ------------------------------------------------------------------------ 36.1 DB2 Query Patroller Client is a Separate Component The DB2 Query Patroller client is a separate component that is not part of the DB2 Administration client. This means that it is not installed during the installation of the DB2 Administration Client, as indicated in the Query Patroller Installation Guide. Instead, the Query Patroller client must be installed separately. The version and level of the Query Patroller client and the Query Patroller server must be the same. ------------------------------------------------------------------------ 36.2 變更節點狀態 下面是 Query Patroller Administration Guide 中「節點管理」章節的更新內容。 您可以使用下列程序來變更節點狀態: 1. 在「節點管理」頁上,選取一個節點。 2. 按一下檢視/編輯。 即可開啟「節點詳細資訊」視窗。 3. 在所要求的狀態欄位中,選取新的狀態。 註: 所要求的狀態是「節點詳細資訊」視窗中唯一可以變更的欄位,其它欄位 只顯示DB2 Query Patroller提供的值。 4. 按一下確定。 下面列出每一個節點參數的資訊: 節點 ID 提供節點 ID。 節點狀態 包含目前的節點狀態: o 作用中,指出節點可以執行工作。 o 非作用中,指出節點的DB2 Query Patroller元件已經關閉。DB2 Query Patroller無法使用節點。若要重新啟動節點,請使用 iwm 管理使用者帳 戶發出 dqpstart 指令。 o 靜止中,指出節點正要轉移到靜止狀態。執行中的工作會繼續完成,但節 點不再安排新的工作。 o 已靜止,指出節點已經靜止。 DB2 Query Patroller可以使用節點,但節 點不再安排新的工作。 所要求的狀態 指出節點將變更為何種狀態: o 作用中,指出節點將成為作用中。 o 非作用中,指出節點將成為非作用中。執行中的工作會繼續完成,但不再 安排新的工作。 o 強制終止,指出節點將立即成為非作用中。執行中的工作會立即終止,也 不再安排新的工作。 o 已靜止,指出節點將成為靜止。執行中的工作會繼續完成。 日期/時間的前次狀態 指出前次變更的日期和時間節點狀態。 已排定工作 提供這個節點上安排執行的加上正在執行的工作數目。 CPU 使用率 提供節點使用 CPU 的百分比 (0 - 100)。 如果沒有收集 CPU 使用率資訊,此 值為 -1。 可用的磁碟 指出產生結果後,檔案系統中可用的位元組數。 如果沒有監督磁碟使用率,此 值為 -1。 節點管理程式 PID 指出節點管理程式程序的程序 ID。 ------------------------------------------------------------------------ 36.3 Migrating from Version 6 of DB2 Query Patroller Using dqpmigrate The dqpmigrate command must be used if the Version 7 Query Patroller Server was installed over the Version 6 Query Patroller Server. For FixPak 2 or later, you do not have to run dqpmigrate manually as the installation of the FixPak runs this command for you. Without using this command, the existing users defined in v6 have no EXECUTE privileges on several new stored procedures added in Version 7. Note: dqpmigrate.bnd is found in the sqllib/bnd directory and dqpmigrate.exe is found in the sqllib/bin directory. To use dqpmigrate manually to grant the EXECUTE privileges, perform the following after installing the FixPak: 1. Bind the /sqllib/bnd/dqpmigrate.bnd package file to the database where the Query Patroller server has been installed by entering the following command: db2 bind dqpmigrate.bnd 2. Execute dqpmigrate by entering the following: dqpmigrate dbalias userid passwd ------------------------------------------------------------------------ 36.4 Enabling Query Management In the "Getting Started" chapter under "Enabling Query Management", the text should read: You must be the owner of the data base, or you must have SYSADM, SYSCTRL, or SYSMAINT authority to set database configuration parameters. ------------------------------------------------------------------------ 36.5 Location of Table Space for Control Tables In Chapter 1, System Overview, under DB2 Query Patroller Control Tables, the following text is to be added at the end of the section's first paragraph: The table space for the DB2 Query Patroller control tables must reside in a single-node nodegroup, or DB2 Query Patroller will not function properly. ------------------------------------------------------------------------ 36.6 New Parameters for dqpstart Command In Chapter 2, Getting Started, under Starting and Stopping DB2 Query Patroller, the following text is to be added following the last paragraph: New Parameters for the dqpstart command: RESTART parameter: Allows the user to replace the host name and/or the node type of the specified node in the dqpnodes.cfg file. DB2 Query Patroller will be started on this node. Note: Before running the DQPSTART command with the RESTART parameter, ensure the following: 1. DB2 Query Patroller is already stopped on the host that is going to be replaced. 2. DB2 Query Patroller is not already running on the new host. The syntax is as follows: dqpstart nodenum node_num restart hostname server | agent | none ADDNODE parameter: Allows the user to add a new node to the dqpnodes.cfg file. DB2 Query Patroller will be started on this node after the new node entry is added to the dqpnodes.cfg file. The syntax is as follows: dqpstart nodenum node_num addnode hostname server | agent | none DROPNODE parameter: Allows the user to drop a node from the dqnodes.cfg file. DB2 Query Patroller will be stopped on this node before the node entry is dropped from the dqpnodes.cfg file. The syntax is as follows: dqpstop nodenum node_num dropnode ------------------------------------------------------------------------ 36.7 New Parameter for iwm_cmd Command A new -v parameter has been added to the iwm_cmd command to allow the user to recover the status of the jobs that were running on the node specified. Only jobs on an inactive node are allowed to be recovered. This command should be issued when there is a node failure and there are some jobs running on that node or being cancelled at the time. Jobs that were in "Running" state will be resubmitted and set back to "Queued" state. Jobs that were in "Cancelling" state will be set to "Cancelled" state. The partial syntax is as follows: >>-iwm_cmd--+-------------------------------+-------------------> '--u--user_id--+--------------+-' '--p--password-' >---v--node_id_to_recover-------------------------------------->< node_id_to_recover Specifies the node on which the jobs are to be recovered. ------------------------------------------------------------------------ 36.8 New Registry Variable: DQP_RECOVERY_INTERVAL There is a new registry variable called DQP_RECOVERY_INTERVAL which is used to set the interval of time in minutes that the iwm_scheduler searches for recovery files. The default is 60 minutes. ------------------------------------------------------------------------ 36.9 Starting Query Administrator In the "Using QueryAdministrator to Administer DB2 Query Patroller" chapter, instructions are provided for starting QueryAdministrator from the Start menu on Windows. The first step provides the following text: If you are using Windows, you can select DB2 Query Patroller --> QueryAdministrator from the IBM DB2 program group. The text should read: DB2 Query Patroller --> QueryAdmin. ------------------------------------------------------------------------ 36.10 User Administration In the "User Administration" section of the "Using QueryAdministrator to Administer DB2 Query Patroller" chapter, the definition for the Maximum Elapsed Time parameter indicates that if the value is set to 0 or -1, the query will always run to completion. This parameter cannot be set to a negative value. The text should indicate that if the value is set to 0, the query will always run to completion. The Max Queries parameter specifies the maximum number of jobs that the DB2 Query Patroller will run simultaneously. Max Queries must be an integer within the range of 0 to 32767. ------------------------------------------------------------------------ 36.11 Creating a Job Queue In the "Job Queue Administration" section of the "Using QueryAdministrator to Administer DB2 Query Patroller" chapter, the screen capture in the steps for "Creating a Job Queue" should be displayed after the second step. The Information about new Job Queue window opens once you click New on the Job Queue Administration page of the QueryAdministrator tool. References to the Job Queues page or the Job Queues tab should read Job Queue Administration page and Job Queue Administration tab, respectively. ------------------------------------------------------------------------ 36.12 Using the Command Line Interface For a user with User authority on the DB2 Query Patroller system to submit a query and have a result table created, the user may require CREATETAB authority on the database. The user does not require CREATETAB authority on the database if the DQP_RES_TBLSPC profile variable is left unset, or if the DQP_RES_TBLSPC profile variable is set to the name of the default table space. The creation of the result tables will succeed in this case because users have the authority to create tables in the default table space. ------------------------------------------------------------------------ 36.13 Query Enabler Notes * When using third-party query tools that use a keyset cursor, queries will not be intercepted. In order for Query Enabler to intercept these queries, you must modify the db2cli.ini file to include: [common] DisableKeySetCursor=1 * For AIX clients, please ensure that the environment variable LIBPATH is not set. Library libXext.a, shipped with the JDK, is not compatible with the library in the /usr/lib/X11 subdirectory. This will cause problems with the Query Enabler GUI. ------------------------------------------------------------------------ 36.14 DB2 Query Patroller Tracker may Return a Blank Column Page FixPak 3 includes a fix for the DB2 Query Patroller Tracker. The Tracker will now correctly report queries which hit no columns. An example of such a query is "SELECT COUNT(*) FROM ...". Since this kind of query does not hit any column in the table, the Tracker will present a blank page for the column page. This blank column page is not a defect. ------------------------------------------------------------------------ 36.15 Query Patroller and Replication Tools Query Patroller Version 7 will intercept the queries of the replication tools (asnapply, asnccp, djra and analyze) and cause these tools to malfunction. A workaround is to disable dynamic query management when running these tools. ------------------------------------------------------------------------ 36.16 Improving Query Patroller Performance The following text should appear at the end of Chapter 6, Performance Tuning: Using the BIND Option, INSERT BUF to Improve DB2 Query Patroller Performance By default, DB2 Query Patroller creates result tables to store the results of the queries it manages. To increase the performance of inserts to these result tables, include the INSERT BUF option when binding one of the DB2 Query Patroller bind files. Bind the DB2 Query Patroller bind files to the database as follows: From the DB2_RUNTIME\bnd directory on Windows, or the DB2_RUNTIME/bnd path on UNIX, enter the following commands: db2 connect to database user iwm using password db2 bind @db2qp.lst blocking all grant public db2 bind iwmsx001.bnd insert buf db2 bind @db2qp_sp.lst db2 commit where database is the database the replacement database that will be managed by DB2 Query Patroller, and password is the password for the administrative user account, iwm. ------------------------------------------------------------------------ 36.17 Lost EXECUTE Privilege for Query Patroller Users Created in Version 6 Because of some new stored procedures (IWM.DQPGROUP, IWM.DQPVALUR, IWM.DQPCALCT, and IWM.DQPINJOB) added in Query Patroller Version 7, existing users created in Query Patroller Version 6 do not hold the EXECUTE privilege on those packages. An application to automatically correct this problem has been added to FixPak 1. When you try to use DQP Query Admin to modify DQP user information, please do not try to remove existing users from the user list. ------------------------------------------------------------------------ 36.18 Query Patroller Restrictions Because of JVM (Java Virtual Machine) platform restrictions, the Query Enabler is not supported on HP-UX and NUMA-Q. In addition, the Query Patroller Tracker is not supported on NUMA-Q. If all of the Query Patroller client tools are required, we recommend the use of a different platform (such as Windows NT) to run these tools against the HP-UX or NUMA-Q server. ------------------------------------------------------------------------ 36.19 Appendix B. Troubleshooting DB2 Query Patroller Clients In Appendix B, Troubleshooting DB2 Query Patroller Clients, section: Common Query Enabler Problems, problem #2, the text of the first bullet is replaced with: Ensure that the path setting includes jre. ------------------------------------------------------------------------ 應用程式開發 部份目錄 * Administrative API Reference (無中文版) o 37.1 db2ArchiveLog (new API) + db2ArchiveLog o 37.2 db2ConvMonStream o 37.3 db2DatabasePing (new API) + db2DatabasePing - Ping Database o 37.4 db2HistData o 37.5 db2HistoryOpenScan o 37.6 db2XaGetInfo (new API) + db2XaGetInfo - Get Information for Resource Manager o 37.7 db2XaListIndTrans (new API that supercedes sqlxphqr) + db2XaListIndTrans - List Indoubt Transactions o 37.8 db2GetSnapshot - Get Snapshot o 37.9 Forget Log Record o 37.10 sqlaintp - Get Error Message o 37.11 sqlbctcq - Close Tablespace Container Query o 37.12 sqleseti - Set Client Information o 37.13 sqlubkp - Backup Database o 37.14 sqlureot - Reorganize Table o 37.15 sqlurestore - Restore Database o 37.16 Documentation Error Regarding AIX Extended Shared Memory Support (EXTSHM) o 37.17 SQLFUPD + 37.17.1 locklist o 37.18 SQLEDBDESC * 應用程式開發手冊 o 38.1 可用更新 * Application Development Guide o 39.1 Update Available o 39.2 IBM OLE DB Provider for DB2 UDB * CLI Guide and Reference (無中文版) o 40.1 Binding Database Utilities Using the Run-Time Client o 40.2 Using Static SQL in CLI Applications o 40.3 Limitations of JDBC/ODBC/CLI Static Profiling o 40.4 ADT Transforms o 40.5 Chapter 1. Introduction to CLI + 40.5.1 Differences Between DB2 CLI and Embedded SQL o 40.6 Chapter 3. Using Advanced Features + 40.6.1 Writing Multi-Threaded Applications + 40.6.2 Writing a DB2 CLI Unicode Application + 40.6.2.1 Unicode Functions + 40.6.2.2 New datatypes and Valid Conversions + 40.6.2.3 Obsolete Keyword/Patch Value + 40.6.2.4 Literals in Unicode Databases + 40.6.2.5 New CLI Configuration Keywords + 40.6.3 Microsoft Transaction Server (MTS) as Transaction Monitor + 40.6.4 Scrollable Cursors + 40.6.4.1 Server-side Scrollable Cursor Support for OS/390 + 40.6.5 Using Compound SQL + 40.6.6 Using Stored Procedures + 40.6.6.1 Writing a Stored Procedure in CLI + 40.6.6.2 CLI Stored Procedures and Autobinding o 40.7 Chapter 4. Configuring CLI/ODBC and Running Sample Applications + 40.7.1 Configuration Keywords + 40.7.1.1 CURRENTFUNCTIONPATH + 40.7.1.2 SKIPTRACE o 40.8 Chapter 5. DB2 CLI Functions + 40.8.1 SQLBindFileToParam - Bind LOB File Reference to LOB Parameter + 40.8.2 SQLColAttribute -- Return a Column Attribute + 40.8.3 SQLGetInfo - Get General Information + 40.8.4 SQLGetLength - Retrieve Length of A String Value + 40.8.5 SQLNextResult - Associate Next Result Set with Another Statement Handle + 40.8.5.1 Purpose + 40.8.5.2 Syntax + 40.8.5.3 Function Arguments + 40.8.5.4 Usage + 40.8.5.5 Return Codes + 40.8.5.6 Diagnostics + 40.8.5.7 Restrictions + 40.8.5.8 References + 40.8.6 SQLSetEnvAttr - Set Environment Attribute + 40.8.7 SQLSetStmtAttr -- Set Options Related to a Statement o 40.9 Appendix C. DB2 CLI and ODBC + 40.9.1 ODBC Unicode Applications + 40.9.1.1 ODBC Unicode Versus Non-Unicode Applications o 40.10 Appendix D. Extended Scalar Functions + 40.10.1 Date and Time Functions o 40.11 Appendix K. Using the DB2 CLI/ODBC/JDBC Trace Facility * 訊息參考手冊 o 41.1 可用更新 o 41.2 訊息更新 + 41.2.1 SQL2554N 新原因碼 12 + 41.2.2 其它新訊息和 SQLSTATE * SQL Reference (無中文版) o 42.1 SQL Reference Update Available o 42.2 Enabling the New Functions and Procedures o 42.3 MQSeries Information + 42.3.1 Scalar Functions + 42.3.1.1 MQPUBLISH + 42.3.1.2 MQREADCLOB + 42.3.1.3 MQRECEIVECLOB + 42.3.1.4 MQSEND + 42.3.2 Table Functions + 42.3.2.1 MQREADALLCLOB + 42.3.2.2 MQRECEIVEALLCLOB + 42.3.3 CLOB data now supported in MQSeries functions o 42.4 Data Type Information + 42.4.1 Promotion of Data Types + 42.4.2 Casting between Data Types + 42.4.3 Assignments and Comparisons + 42.4.3.1 String Assignments + 42.4.3.2 String Comparisons + 42.4.4 Rules for Result Data Types + 42.4.4.1 Character and Graphic Strings in a Unicode Database + 42.4.5 Rules for String Conversions + 42.4.6 Expressions + 42.4.6.1 With the Concatenation Operator + 42.4.7 Predicates o 42.5 Unicode Information + 42.5.1 Scalar Functions and Unicode o 42.6 Larger Index Keys for Unicode Databases + 42.6.1 ALTER TABLE + 42.6.2 CREATE INDEX + 42.6.3 CREATE TABLE o 42.7 Additional Options in the GET DIAGNOSTICS Statement + GET DIAGNOSTICS Statement o 42.8 ORDER BY in Subselects + 42.8.1 fullselect + 42.8.2 subselect + 42.8.3 order-by-clause + 42.8.4 select-statement + SELECT INTO statement + 42.8.5 OLAP Functions (window-order-clause) o 42.9 New Input Argument for the GET_ROUTINE_SAR Procedure o 42.10 Required Authorization for the SET INTEGRITY Statement * Unicode 更新 o 43.1 簡介 + 43.1.1 DB2 Unicode 資料庫及應用程式 + 43.1.2 文件更新 ------------------------------------------------------------------------ Administrative API Reference (無中文版) ------------------------------------------------------------------------ 37.1 db2ArchiveLog (new API) db2ArchiveLog Closes and truncates the active log file for a recoverable database. If user exit is enabled, issues an archive request. Authorization One of the following: * sysadm * sysctrl * sysmaint * dbadm Required Connection This API automatically establishes a connection to the specified database. If a connection to the specified database already exists, the API will return an error. API Include File db2ApiDf.h C API Syntax /* File: db2ApiDf.h */ /* API: Archive Active Log */ SQL_API_RC SQL_API_FN db2ArchiveLog ( db2Uint32 version, void *pDB2ArchiveLogStruct, struct sqlca * pSqlca); typedef struct { char *piDatabaseAlias; char *piUserName; char *piPassword; db2Uint16 iAllNodeFlag; db2Uint16 iNumNodes; SQL_PDB_NODE_TYPE *piNodeList; db2Uint32 iOptions; } db2ArchiveLogStruct Generic API Syntax /* File: db2ApiDf.h */ /* API: Archive Active Log */ SQL_API_RC SQL_API_FN db2gArchiveLog ( db2Uint32 version, void *pDB2ArchiveLogStruct, struct sqlca * pSqlca); typedef struct { db2Uint32 iAliasLen; db2Uint32 iUserNameLen; db2Uint32 iPasswordLen; char *piDatabaseAlias; char *piUserName; char *piPassword; db2Uint16 iAllNodeFlag; db2Uint16 iNumNodes; SQL_PDB_NODE_TYPE *piNodeList; db2Uint32 iOptions; } db2ArchiveLogStruct API Parameters version Input. Specifies the version and release level of the variable passed in as the second parameter, pDB2ArchiveLogStruct. pDB2ArchiveLogStruct Input. A pointer to the db2ArchiveLogStruct structure. pSqlca Output. A pointer to the sqlca structure. iAliasLen Input. A 4-byte unsigned integer representing the length in bytes of the database alias. iUserNameLen A 4-byte unsigned integer representing the length in bytes of the user name. Set to zero if no user name is used. iPasswordLen Input. A 4-byte unsigned integer representing the length in bytes of the password. Set to zero if no password is used. piDatabaseAlias Input. A string containing the database alias (as cataloged in the system database directory) of the database for which the active log is to be archived. piUserName Input. A string containing the user name to be used when attempting a connection. piPassword Input. A string containing the password to be used when attempting a connection. iAllNodeFlag MPP only. Input. Flag indicating whether the operation should apply to all nodes listed in the db2nodes.cfg file. Valid values are: DB2ARCHIVELOG_NODE_LIST Apply to nodes in a node list that is passed in piNodeList. DB2ARCHIVELOG_ALL_NODES Apply to all nodes. piNodeList should be NULL. This is the default value. DB2ARCHIVELOG_ALL_EXCEPT Apply to all nodes except those in the node list passed in piNodeList. iNumNodes MPP only. Input. Specifies the number of nodes in the piNodeList array. piNodeList MPP only. Input. A pointer to an array of node numbers against which to apply the archive log operation. iOptions Input. Reserved for future use. ------------------------------------------------------------------------ 37.2 db2ConvMonStream In the Usage Notes, the structure for the snapshot variable datastream type SQLM_ELM_SUBSECTION should be sqlm_subsection. ------------------------------------------------------------------------ 37.3 db2DatabasePing (new API) db2DatabasePing - Ping Database Tests the network response time of the underlying connectivity between a client and a database server. This API can be used by an application when a host database server is accessed via DB2 Connect either directly or through a gateway. Authorization None Required Connection Database API Include File db2ApiDf.h C API Syntax /* File: db2ApiDf.h */ /* API: Ping Database */ /* ... */ SQL_API_RC SQL_API_FN db2DatabasePing ( db2Uint32 versionNumber, void *pParmStruct, struct sqlca *pSqlca); /* ... */ typedef SQL_STRUCTURE db2DatabasePingStruct { char iDbAlias[SQL_ALIAS_SZ + 1]; db2Uint16 iNumIterations; db2Uint32 *poElapsedTime; } Generic API Syntax /* File: db2ApiDf.h */ /* API: Ping Database */ /* ... */ SQL_API_RC SQL_API_FN db2gDatabasePing ( db2Uint32 versionNumber, void *pParmStruct, struct sqlca *pSqlca); /* ... */ typedef SQL_STRUCTURE db2gDatabasePingStruct { db2Uint16 iDbAliasLength; char iDbAlias[SQL_ALIAS_SZ]; db2Uint16 iNumIterations; db2Uint32 *poElapsedTime; } API Parameters versionNumber Input. Version and release of the DB2 Universal Database or DB2 Connect product that the application is using. Note: Constant db2Version710 or higher should be used for DB2 Version 7.1 or higher. pParmStruct Input. A pointer to the db2DatabasePingStruct Structure. iDbAliasLength Input. Length of the database alias name. Note: This parameter is not currently used. It is reserved for future use. iDbAlias Input. Database alias name. Note: This parameter is not currently used. It is reserved for future use. iNumIterations Input. Number of test request iterations. The value must be between 1 and 32767 inclusive. poElapsedTime Output. A pointer to an array of 32-bit integers where the number of elements is equal to iNumIterations. Each element in the array will contain the elapsed time in microseconds for one test request iteration. Note: The application is responsible for allocating the memory for this array prior to calling this API. pSqlca Output. A pointer to the sqlca structure. For more information about this structure, see the Administrative API Reference. Usage Notes A database connection must exist before invoking this API, otherwise an error will result. This function can also be invoked using the PING command. For a description of this command, see the Command Reference. ------------------------------------------------------------------------ 37.4 db2HistData The following entries should be added to Table 11. Fields in the db2HistData Structure: Field Name Data Type Description oOperation char See Table 12. oOptype char See Table 13. The following table will be added following Table 11. Table 12. Valid event values for oOperation in the db2HistData Structure Value Description C Definition COBOL/FORTRAN Definition A add DB2HISTORY_OP_ADD_TABLESPACE DB2HIST_OP_ADD_TABLESPACE tablespace B backup DB2HISTORY_OP_BACKUP DB2HIST_OP_BACKUP C load-copy DB2HISTORY_OP_LOAD_COPY DB2HIST_OP_LOAD_COPY D dropped DB2HISTORY_OP_DROPPED_TABLE DB2HIST_OP_DROPPED_TABLE table F roll DB2HISTORY_OP_ROLLFWD DB2HIST_OP_ROLLFWD forward G reorganize DB2HISTORY_OP_REORG DB2HIST_OP_REORG table L load DB2HISTORY_OP_LOAD DB2HIST_OP_LOAD N rename DB2HISTORY_OP_REN_TABLESPACE DB2HIST_OP_REN_TABLESPACE tablespace O drop DB2HISTORY_OP_DROP_TABLESPACEDB2HIST_OP_DROP_TABLESPACE tablespace Q quiesce DB2HISTORY_OP_QUIESCE DB2HIST_OP_QUIESCE R restore DB2HISTORY_OP_RESTORE DB2HIST_OP_RESTORE S run DB2HISTORY_OP_RUNSTATS DB2HIST_OP_RUNSTATS statistics T alter DB2HISTORY_OP_ALT_TABLESPACE DB2HIST_OP_ALT_TBS tablespace U unload DB2HISTORY_OP_UNLOAD DB2HIST_OP_UNLOAD The following table will also be added. Table 13. Valid oOptype values db2HistData Structure oOperationoOptype Description C/COBOL/FORTRAN Definition B F Offline DB2HISTORY_OPTYPE_OFFLINE N Online DB2HISTORY_OPTYPE_ONLINE I Incremental offline DB2HISTORY_OPTYPE_INCR_OFFLINE O Incremental online DB2HISTORY_OPTYPE_INCR_ONLINE D Delta offline DB2HISTORY_OPTYPE_DELTA_OFFLINE E Delta online DB2HISTORY_OPTYPE_DELTA_ONLIN F E End of log DB2HISTORY_OPTYPE_EOL P Point in time DB2HISTORY_OPTYPE_PIT L I Insert DB2HISTORY_OPTYPE_INSERT R Replace DB2HISTORY_OPTYPE_REPLACE Q S Quiesce share DB2HISTORY_OPTYPE_SHARE U Quiesce update DB2HISTORY_OPTYPE_UPDATE X Quiesce exclusive DB2HISTORY_OPTYPE_EXCL Z Quiesce reset DB2HISTORY_OPTYPE_RESET R F Offline DB2HISTORY_OPTYPE_OFFLINE N Online DB2HISTORY_OPTYPE_ONLINE I Incremental offline DB2HISTORY_OPTYPE_INCR_OFFLINE O Incremental online DB2HISTORY_OPTYPE_INCR_ONLINE T C Add containers DB2HISTORY_OPTYPE_ADD_CONT R Rebalance DB2HISTORY_OPTYPE_REB ------------------------------------------------------------------------ 37.5 db2HistoryOpenScan The following value will be added to the iCallerAction parameter. DB2HISTORY_LIST_CRT_TABLESPACE Select only the CREATE TABLESPACE and DROP TABLESPACE records that pass the other filters. ------------------------------------------------------------------------ 37.6 db2XaGetInfo (new API) db2XaGetInfo - Get Information for Resource Manager Extracts information for a particular resource manager once an xa_open call has been made. Authorization None Required Connection Database API Include File sqlxa.h C API Syntax /* File: sqlxa.h */ /* API: Get Information for Resource Manager */ /* ... */ SQL_API_RC SQL_API_FN db2XaGetInfo ( db2Uint32 versionNumber, void * pParmStruct, struct sqlca * pSqlca); typedef SQL_STRUCTURE db2XaGetInfoStruct { db2int32 iRmid; struct sqlca oLastSqlca; } db2XaGetInfoStruct; API Parameters versionNumber Input. Specifies the version and release level of the structure passed in as the second parameter, pParmStruct. pParmStruct Input. A pointer to the db2XaGetInfoStruct structure. pSqlca Output. A pointer to the sqlca structure. For more information about this structure, see the Administrative API Reference. iRmid Input. Specifies the resource manager for which information is required. oLastSqlca Output. Contains the sqlca for the last XA API call. Note: Only the sqlca that resulted from the last failing XA API can be retrieved. ------------------------------------------------------------------------ 37.7 db2XaListIndTrans (new API that supercedes sqlxphqr) db2XaListIndTrans - List Indoubt Transactions Provides a list of all indoubt transactions for the currently connected database. Scope This API affects only the node on which it is issued. Authorization One of the following: * sysadm * dbadm Required Connection Database API Include File db2ApiDf.h C API Syntax /* File: db2ApiDf.h */ /* API: List Indoubt Transactions */ /* ... */ SQL_API_RC SQL_API_FN db2XaListIndTrans ( db2Uint32 versionNumber, void * pParmStruct, struct sqlca * pSqlca); typedef SQL_STRUCTURE db2XaListIndTransStruct { db2XaRecoverStruct * piIndoubtData; db2Uint32 iIndoubtDataLen; db2Uint32 oNumIndoubtsReturned; db2Uint32 oNumIndoubtsTotal; db2Uint32 oReqBufferLen; } db2XaListIndTransStruct; typedef SQL_STRUCTURE db2XaRecoverStruct { sqluint32 timestamp; SQLXA_XID xid; char dbalias[SQLXA_DBNAME_SZ]; char applid[SQLXA_APPLID_SZ]; char sequence_no[SQLXA_SEQ_SZ]; char auth_id[SQL_USERID_SZ]; char log_full; char connected; char indoubt_status; char originator; char reserved[8]; } db2XaRecoverStruct; API Parameters versionNumber Input. Specifies the version and release level of the structure passed in as the second parameter, pParmStruct. pParmStruct Input. A pointer to the db2XaListIndTransStruct structure. pSqlca Output. A pointer to the sqlca structure. For more information about this structure, see the Administrative API Reference. piIndoubtData Input. A pointer to the application supplied buffer where indoubt data will be returned. The indoubt data is in db2XaRecoverStruct format. The application can traverse the list of indoubt transactions by using the size of the db2XaRecoverStruct structure, starting at the address provided by this parameter. If the value is NULL, DB2 will calculate the size of the buffer required and return this value in oReqBufferLen. oNumIndoubtsTotal will contain the total number of indoubt transactions. The application may allocate the required buffer size and issue the API again. oNumIndoubtsReturned Output. The number of indoubt transaction records returned in the buffer specified by pIndoubtData. oNumIndoubtsTotal Output. The Total number of indoubt transaction records available at the time of API invocation. If the piIndoubtData buffer is too small to contain all the records, oNumIndoubtsTotal will be greater than the total for oNumIndoubtsReturned. The application may reissue the API in order to obtain all records. Note: This number may change between API invocations as a result of automatic or heuristic indoubt transaction resynchronisation, or as a result of other transactions entering the indoubt state. oReqBufferLen Output. Required buffer length to hold all indoubt transaction records at the time of API invocation. The application can use this value to determine the required buffer size by calling the API with pIndoubtData set to NULL. This value can then be used to allocate the required buffer, and the API can be issued with pIndoubtData set to the address of the allocated buffer. Note: The required buffer size may change between API invocations as a result of automatic or heuristic indoubt transaction resynchronisation, or as a result of other transactions entering the indoubt state. The application may allocate a larger buffer to account for this. timestamp Output. Specifies the time when the transaction entered the indoubt state. xid Output. Specifies the XA identifier assigned by the transaction manager to uniquely identify a global transaction. dbalias Output. Specifies the alias of the database where the indoubt transaction is found. applid Output. Specifies the application identifier assigned by the database manager for this transaction. sequence_no Output. Specifies the sequence number assigned by the database manager as an extension to the applid. auth_id Output. Specifies the authorization ID of the user who ran the transaction. log_full Output. Indicates whether or not this transaction caused a log full condition. Valid values are: SQLXA_TRUE This indoubt transaction caused a log full condition. SQLXA_FALSE This indoubt transaction did not cause a log full condition. connected Output. Indicates whether or not the application is connected. Valid values are: SQLXA_TRUE The transaction is undergoing normal syncpoint processing, and is waiting for the second phase of the two-phase commit. SQLXA_FALSE The transaction was left indoubt by an earlier failure, and is now waiting for resynchronisation from the transaction manager. indoubt_status Output. Indicates the status of this indoubt transaction. Valid values are: SQLXA_TS_PREP The transaction is prepared. The connected parameter can be used to determine whether the transaction is waiting for the second phase of normal commit processing or whether an error occurred and resynchronisation with the transaction manager is required. SQLXA_TS_HCOM The transaction has been heuristically committed. SQLXA_TS_HROL The transaction has been heuristically rolled back. SQLXA_TS_MACK The transaction is missing commit acknowledgement from a node in a partitioned database. SQLXA_TS_END The transaction has ended at this database. This transaction may be re-activated, committed, or rolled back at a later time. It is also possible that the transaction manager encountered an error and the transaction will not be completed. If this is the case, this transaction requires heuristic actions, because it may be holding locks and preventing other applications from accessing data. Usage Notes A typical application will perform the following steps after setting the current connection to the database or to the partitioned database coordinator node: 1. Call db2XaListIndTrans with piIndoubtData set to NULL. This will return values in oReqBufferLen and oNumIndoubtsTotal. 2. Use the returned value in oReqBufferLen to allocate a buffer. This buffer may not be large enough if there are additional indoubt transactions because the initial invocation of this API to obtain oReqBufferLen. The application may provide a buffer larger than oReqBufferLen. 3. Determine if all indoubt transaction records have been obtained. This can be done by comparing oNumIndoubtsReturned to oNumIndoubtTotal. If oNumIndoubtsTotal is greater than oNumIndoubtsReturned, the application can repeat the above steps. See Also "sqlxhfrg - Forget Transaction Status", "sqlxphcm - Commit an Indoubt Transaction", and "sqlxphrl - Roll Back an Indoubt Transaction" in the Administrative API Reference. ------------------------------------------------------------------------ 37.8 db2GetSnapshot - Get Snapshot The syntax for the db2GetSnapshot API should be as follows: int db2GetSnapshot( unsigned char version; db2GetSnapshotData *data, struct sqlca *sqlca); The parameters described in data are: typedef struct db2GetSnapshotData{ sqlma *piSqlmaData; sqlm_collected *poCollectedData void *poBuffer; db2uint32 iVersion; db2int32 iBufferSize; db2uint8 iStoreResult; db2uint16 iNodeNumber; db2uint32 *poOutputFormat; }db2GetSnapshotData; ------------------------------------------------------------------------ 37.9 Forget Log Record The following information will be added to Appendix F following the MPP Subordinator Prepare section. This log record is written after a rollback of indoubt transactions or after a commit of two-phase commit. The log record is written to mark the end of the transaction and releases any log resources held. In order for the transaction to be forgotten, it must be in a heuristically completed state. Table 9. Forget Log Record Structure Description Type Offset (Bytes) Log header LogManagerLogRecordHeader 0(20) time sqluint64 20(8) Total Length: 28 bytes ------------------------------------------------------------------------ 37.10 sqlaintp - Get Error Message The following usage note is to be added to the description of this API: In a multi-threaded application, sqlaintp must be attached to a valid context; otherwise, the message text for SQLCODE -1445 cannot be obtained. ------------------------------------------------------------------------ 37.11 sqlbctcq - Close Tablespace Container Query Load is not a valid Authorization level for this API. ------------------------------------------------------------------------ 37.12 sqleseti - Set Client Information The data values provided with the API can also be accessed by SQL special register. The values in these registers are stored in the database code page. Data values provided with this API are converted to the database code page before being stored in the special registers. Any data value that exceeds the maximum supported size after conversion to the database code page will be truncated before being stored at the server. These truncated values will be returned by the special registers. The original data values will also be stored at the server and are not converted to the database code page. The unconverted values can be returned by calling the sqleqryi API. ------------------------------------------------------------------------ 37.13 sqlubkp - Backup Database For the BackupType parameter the SQLUB_FULL value will be replaced by the SQLUB_DB. A backup of all tablespaces in the database will be taken. To support the new incremental backup functionality the SQLUB_INCREMENTAL and SQLUB_DELTA parameters will also be added. An incremental backup image is a copy of all database data which has changed since the most recent successful, full backup. A delta backup image is a copy of all database data that has changed since the most recent successful backup of any type ------------------------------------------------------------------------ 37.14 sqlureot - Reorganize Table The following sentence will be added to the Usage Notes: REORGANIZE TABLE cannot use an index that is based on an index extension. ------------------------------------------------------------------------ 37.15 sqlurestore - Restore Database For the RestoreType parameter the SQLUD_FULL value will be replaced by the SQLUD_DB. A restore of all table spaces in the database will be taken. This will be run offline. To support the new incremental restore functionality the SQLUD_INCREMENTAL parameter will also be added. An incremental backup image is a copy of all database data which has changed since the most recent successful full backup. ------------------------------------------------------------------------ 37.16 Documentation Error Regarding AIX Extended Shared Memory Support (EXTSHM) In "Appendix E. Threaded Applications with Concurrent Access", Note 2 should now read: 2. By default, AIX does not permit 32-bit applications to attach to more than 11 shared memory segments per process, of which a maximum of 10 can be used for local DB2 connections. To use EXTSHM with DB2, do the following: In client sessions: export EXTSHM=ON When starting the DB2 server: export EXTSHM=ON db2set DB2ENVLIST=EXTSHM db2start On EEE, also add the following lines to sqllib/db2profile: EXTSHM=ON export EXTSHM ------------------------------------------------------------------------ 37.17 SQLFUPD 37.17.1 locklist The name of the token has changed from SQLF_DBTN_LOCKLIST to SQLF_DBTN_LOCK_LIST. The locklist parameter has been changed from a SMALLINT to a 64-bit unsigned INTEGER. The following addition should be made to the table of Updatable Database Configuration Parameters. Parameter Name Token Token Value Data Type locklist SQLF_DBTN_LOCK_LIST704 Uint64 The new maximum for this parameter is 524 288. Additionally, in "Chapter 3. Data Structures", Table 53. Updatable Database Configuration Parameters incorrectly lists the token value for dbheap as 701. The correct value is 58. ------------------------------------------------------------------------ 37.18 SQLEDBDESC Two values will be added to the list of valid values for SQLDBCSS (defined in sqlenv). They are: SQL_CS_SYSTEM_NLSCHAR Collating sequence from system using the NLS version of compare routines for character types. SQL_CS_USER_NLSCHAR Collating sequence from user using the NLS version of compare routines for character types. ------------------------------------------------------------------------ 應用程式開發手冊 ------------------------------------------------------------------------ 38.1 可用更新 應用程式開發手冊 已經更新成為 FixPak 4 的一部分。 您可以從 http://www.ibm.com/software/data/db2/udb/winos2unix/support 線上下載最新的 PDF。您也可以在 CD 中取得所有已更新的文件。透過 DB2 服務並使用 PTF 號碼 U478862,即可訂購此 CD。 您可以從 http://www.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/help.d2w/report 取得聯絡「DB2 服務」的相關資訊。 ------------------------------------------------------------------------ Application Development Guide ------------------------------------------------------------------------ 39.1 可用更新 Application Development Guide 已經更新成為 FixPak 4 的一部分。 您可以從 http://www.ibm.com/software/data/db2/udb/winos2unix/support 線上下載最新的 PDF。這些注意事項中的資訊是用以補充更新的參照。您也可以在 CD 中取得所有已更 新的文件。 透過 DB2 服務並使用 PTF 號碼 U478862,即可訂購此 CD。 您可以從 http://www.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/help.d2w/report 取得聯絡「DB2 服務」的相關資訊。 ------------------------------------------------------------------------ 39.2 IBM OLE DB Provider for DB2 UDB 使用 IBM OLE DB Provider for DB2 的相關資訊, 請參照 http://www.ibm.com/software/data/db2/udb/ad/v71/oledb.html。 ------------------------------------------------------------------------ CLI Guide and Reference (無中文版) ------------------------------------------------------------------------ 40.1 Binding Database Utilities Using the Run-Time Client The Run-Time Client cannot be used to bind the database utilities (import, export, reorg, the command line processor) and DB2 CLI bind files to each database before they can be used with that database. You must use the DB2 Administration Client or the DB2 Application Development Client instead. You must bind these database utilities and DB2 CLI bind files to each database before they can be used with that database. In a network environment, if you are using multiple clients that run on different operating systems, or are at different versions or service levels of DB2, you must bind the utilities once for each operating system and DB2-version combination. ------------------------------------------------------------------------ 40.2 Using Static SQL in CLI Applications For more information on using static SQL in CLI applications, see the Web page at: http://www.ibm.com/software/data/db2/udb/staticcli/ ------------------------------------------------------------------------ 40.3 Limitations of JDBC/ODBC/CLI Static Profiling JDBC/ODBC/CLI static profiling currently targets straightforward applications. It is not meant for complex applications with many functional components and complex program logic during execution. An SQL statement must have successfully executed for it to be captured in a profiling session. In a statement matching session, unmatched dynamic statements will continue to execute as dynamic JDBC/ODBC/CLI calls. An SQL statement must be identical character-by-character to the one that was captured and bound to be a valid candidate for statement matching. Spaces are significant: for example, "COL = 1" is considered different than "COL=1". Use parameter markers in place of literals to improve match hits. When executing an application with pre-bound static SQL statements, dynamic registers that control the dynamic statement behavior will have no effect on the statements that are converted to static. If an application issues DDL statements for objects that are referenced in subsequent DML statements, you will find all of these statements in the capture file. The JDBC/ODBC/CLI Static Profiling Bind Tool will attempt to bind them. The bind attempt will be successful with DBMSs that support the VALIDATE(RUN) bind option, but it fail with ones that do not. In this case, the application should not use Static Profiling. The Database Administrator may edit the capture file to add, change, or remove SQL statements, based on application-specific requirements. ------------------------------------------------------------------------ 40.4 ADT Transforms The following supercedes existing information in the book. * There is a new descriptor type (smallint) SQL_DESC_USER_DEFINED_TYPE_CODE, with values: SQL_TYPE_BASE 0 (this is not a USER_DEFINED_TYPE) SQL_TYPE_DISTINCT 1 SQL_TYPE_STRUCTURED 2 This value can be queried with either SQLColAttribute or SQLGetDescField (IRD only). The following attributes are added to obtain the actual type names: SQL_DESC_REFERENCE_TYPE SQL_DESC_STRUCTURED_TYPE SQL_DESC_USER_TYPE The above values can be queried using SQLColAttribute or SQLGetDescField (IRD only). * Add SQL_DESC_BASE_TYPE in case the application needs it. For example, the application may not recognize the structured type, but intends to fetch or insert it, and let other code deal with the details. * Add a new connection attribute called SQL_ATTR_TRANSFORM_GROUP to allow an application to set the transform group (rather than use the SQL "SET CURRENT DEFAULT TRANSFORM GROUP" statement). * Add a new statement/connection attribute called SQL_ATTR_RETURN_USER_DEFINED_TYPES that can be set or queried using SQLSetConnectAttr, which causes CLI to return the value SQL_DESC_USER_DEFINED_TYPE_CODE as a valid SQL type. This attribute is required before using any of the transforms. o By default, the attribute is off, and causes the base type information to be returned as the SQL type. o When enabled, SQL_DESC_USER_DEFINED_TYPE_CODE will be returned as the SQL_TYPE. The application is expected to check for SQL_DESC_USER_DEFINED_TYPE_CODE, and then to retrieve the appropriate type name. This will be available to SQLColAttribute, SQLDescribeCol, and SQLGetDescField. * The SQLBindParameter does not give an error when you bind SQL_C_DEFAULT, because there is no code to allow SQLBindParameter to specify the type SQL_USER_DEFINED_TYPE. The standard default C types will be used, based on the base SQL type flowed to the server. For example: sqlrc = SQLBindParameter (hstmt, 2, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, 30, 0, &c2, 30, NULL); ------------------------------------------------------------------------ 40.5 Chapter 1. Introduction to CLI 40.5.1 Differences Between DB2 CLI and Embedded SQL Disregard the third item from the end of the list in the "Advantages of Using DB2 CLI" section. The correct information is as follows: DB2 CLI provides the ability to retrieve multiple rows and result sets generated from a stored procedure residing on a DB2 Universal Database server, a DB2 for MVS/ESA server (Version 5 or later), or an OS/400 server (Version 5 or later). Support for multiple result sets retrieval on OS/400 requires that PTF (Program Temporary Fix) SI01761 be applied to the server. Contact your OS/400 system administrator to ensure that this PTF has been applied. ------------------------------------------------------------------------ 40.6 Chapter 3. Using Advanced Features 40.6.1 Writing Multi-Threaded Applications The following should be added to the end of the "Multi-Threaded Mixed Applications" section: Note: It is recommended that you do not use the default stack size, but instead increase the stack size to at least 256 000. DB2 requires a minimum stack size of 256 000 when calling a DB2 function. You must ensure therefore, that you allocate a total stack size that is large enough for both your application and the minimum requirements for a DB2 function call. 40.6.2 Writing a DB2 CLI Unicode Application The following is a new section for this chapter. There are two main areas of support for DB2 CLI Unicode Applications: 1. The addition of a set of functions that can accept Unicode string arguments in place of ANSI string arguments. 2. The addition of new C and SQL data types to describe data as ANSI or Unicode data. The following sections provide more information for both of these areas. To be considered a Unicode application, the application must set the SQL_ATTR_ANSI_APP connection attribute to SQL_AA_FALSE, before a connection is made. This will ensure that CLI will connect as a Unicode client, and all Unicode data will be sent in either UTF-8 for CHAR data or UCS-2 for GRAPHIC data. 40.6.2.1 Unicode Functions The following is a list of the ODBC API functions that support both Unicode (W) and ANSI (A) versions (the function name will have a W for Unicode): SQLBrowseConnect SQLForeignKeys SQLPrimaryKeys SQLColAttribute SQLGetConnectAttr SQLProcedureColumns SQLColAttributes SQLGetConnectOption SQLProcedures SQLColumnPrivileges SQLGetCursorName SQLSetConnectAttr SQLColumns SQLGetDescField SQLSetConnectOption SQLConnect SQLGetDescRec SQLSetCursorName SQLDataSources SQLGetDiagField SQLSetDescField SQLDescribeCol SQLGetDiagRec SQLSetStmtAttr SQLDriverConnect SQLGetInfo SQLSpecialColumns SQLDrivers SQLGetStmtAttr SQLStatistics SQLError SQLNativeSQL SQLTablePrivileges SQLExecDirect SQLPrepare SQLTables Unicode functions that always return, or take, string length arguments are passed as count-of-characters. For functions that return length information for server data, the display size and precision are described in number of characters. When the length (transfer size of the data) could refer to string or nonstring data, the length is described in octet lengths. For example, SQLGetInfoW will still take the length as count-of-bytes, but SQLExecDirectW will use count-of-characters. CLI will return result sets in either Unicode or ANSI, depending on the application's binding. If an application binds to SQL_C_CHAR, the driver will convert SQL_WCHAR data to SQL_CHAR. The driver manager maps SQL_C_WCHAR to SQL_C_CHAR for ANSI drivers but does no mapping for Unicode drivers. 40.6.2.2 New datatypes and Valid Conversions There are two new CLI or ODBC defined data types, SQL_C_WCHAR and SQL_WCHAR. SQL_C_WCHAR indicates that the C buffer contains UCS-2 data. SQL_WCHAR indicates that a particular column or parameter marker contains Unicode data. For DB2 Unicode Servers, graphic columns will be described as SQL_WCHAR. Conversion will be allowed between SQL_C_WCHAR and SQL_CHAR, SQL_VARCHAR, SQL_LONGVARCHAR and SQL_CLOB, as well as between the graphic data types. Table 10. Supported Data Conversions S S Q Q L S S L _ Q Q _ C L L C S S _ _ _ _ Q Q T C C D S L L Y _ _ B S Q S _ _ P S S C B C S Q S S L S Q C C E Q Q L L L Q L S Q S Q _ Q L _ _ _ L L O O O L _ Q L Q L C L _ T T T _ S _ B B B _ C L _ L _ _ _ C Y Y I C Q C _ _ _ C _ _ C _ C T C _ P P M _ L _ L L L _ N C _ C _ I _ D E E E B _ D O O O B U _ W _ S N F O _ _ S I C B C C C I M C C L H Y L U D T T N _ C A A A G E H H O O I O B A I A A B H T T T I R A A N R N A L T M M R I A O O O N I SQL Data Type R R G T T T E E E P Y T R R R R T C BLOB X X D X CHAR D X X X X X X X X X X X X X CLOB D X X X DATE X X D X DBCLOB X X D X DECIMAL D X X X X X X X X X X DOUBLE X X X X X X D X X X FLOAT X X X X X X D X X X GRAPHIC X X D (Non-Unicode) GRAPHIC X X X X X X X X X X X X D X (Unicode) INTEGER X X D X X X X X X X LONG D X X VARCHAR LONG X X X D VARGRAPHIC (Non-Unicode) LONG X X X D VARGRAPHIC (Unicode) NUMERIC D X X X X X X X X REAL X X X X X D X X X SMALLINT X X X D X X X X X X BIGINT X X X X X X X X X D X TIME X X D X TIMESTAMP X X X X D VARCHAR D X X X X X X X X X X X X X VARGRAPHIC X X D (Non-Unicode) VARGRAPHIC X X X X X X X X X X X X D X (Unicode) Note: D Conversion is supported. This is the default conversion for the SQL data type. X All IBM DBMSs support the conversion. blank No IBM DBMS supports the conversion. o Data is not converted to LOB Locator types, rather locators represent a data value, refer to Using Large Objects for more information. o SQL_C_NUMERIC is only available on 32-bit Windows operating systems. 40.6.2.3 Obsolete Keyword/Patch Value Before Unicode applications were supported, applications that were written to work with single-byte character data could be made to work with double-byte graphic data by a series of cli ini file keywords, such as GRAPHIC=1,2 or 3, Patch2=7. These workarounds presented graphic data as character data, and also affected the reported length of the data. These keywords are no longer required for Unicode applications, and should not be used due to the risk of potential side effects. If it is not known if a particular application is a Unicode application, we suggest you try without any of the keywords that affect the handling of graphic data. 40.6.2.4 Literals in Unicode Databases In non-unicode databases, data in LONG VARGRAPHIC and LONG VARCHAR columns cannot be compared. Data in GRAPHIC/VARGRAPHIC and CHAR/VARCHAR columns can only be compared, or assigned to each other, using explicit cast functions since no implicit code page conversion is supported. This includes GRAPHIC/VARGRAPHIC and CHAR/VARCHAR literals where a GRAPHIC/VARGRAPHIC literal is differentiated from a CHAR/VARCHAR literal by a G prefix. For Unicode databases, casting between GRAPHIC/VARGRAPHIC and CHAR/VARCHAR literals is not required. Also, a G prefix is not required in front of a GRAPHIC/VARGRAPHIC literal. Provided at least one of the arguments is a literal, implicit conversions occur. This allows literals with or without the G prefix to be used within statements that use either SQLPrepareW() or SQLExecDirect(). Literals for LONG VARGRAPHICs still must have a G prefix. For more information, see "Casting Between Data Types" in "Chapter 3. Language Elements" of the SQL Reference. 40.6.2.5 New CLI Configuration Keywords The following three keywords have been added to avoid any extra overhead when Unicode applications connect to a database. 1. DisableUnicode Keyword Description: Disables the underlying support for Unicode. db2cli.ini Keyword Syntax: DisableUnicode = 0 | 1 Default Setting: 0 (false) DB2 CLI/ODBC Settings Tab: This keyword cannot be set using the CLI/ODBC Settings notebook. The db2cli.ini file must be modified directly to make use of this keyword. Usage Notes: With Unicode support enabled, and when called by a Unicode application, CLI will attempt to connect to the database using the best client code page possible to ensure there is no unnecessary data loss due to code page conversion. This may increase the connection time as code pages are exchanged, or may cause code page conversions on the client that did not occur before this support was added. Setting this keyword to True will cause all Unicode data to be converted to the application's local code page first, before the data is sent to the server. This can cause data loss for any data that cannot be represented in the local code page. 2. ConnectCodepage Keyword Description: Specifies a specific code page to use when connecting to the data source to avoid extra connection overhead. db2cli.ini Keyword Syntax: ConnectCodepage = 0 | 1 Default Setting: 0 DB2 CLI/ODBC Settings Tab: This keyword cannot be set using the CLI/ODBC Settings notebook. The db2cli.ini file must be modified directly to make use of this keyword. Usage Notes: Non-Unicode applications always connect to the database using the application's local code page, or the DB2Codepage environment setting. By default, CLI will ensure that Unicode applications will connect to Unicode databases using UTF-8 and UCS-2 code pages, and will connect to non-Unicode databases using the database's code page. This ensures that there is no unnecessary data loss due to code page conversion. This keyword allows the user to specify the database's code page when connecting to a non-Unicode database in order to avoid any extra overhead on the connection. Specify a value of 1 to cause SQLDriverConnect() to return the correct value in the output connection string, so the value can be used on future SQLDriverConnect() calls. 3. UnicodeServer Keyword Description: Indicates that the data source is a unicode server. Equivalent to setting ConnectCodepage=1208. db2cli.ini Keyword Syntax: UnicodeServer = 0 | 1 Default Setting: 0 DB2 CLI/ODBC Settings Tab: This keyword cannot be set using the CLI/ODBC Settings notebook. The db2cli.ini file must be modified directly to make use of this keyword. Usage Notes: This keyword is equivalent to ConnectCodepage=1208, and is added only for convenience. Set this keyword to avoid extra connect overhead when connecting to DB2 for OS/390 Version 7 or higher. There is no need to set this keyword for DB2 for Windows, DB2 for Unix or DB2 for OS/2 databases, since there is no extra processing required. 40.6.3 Microsoft Transaction Server (MTS) as Transaction Monitor The following corrects the default value for the DISABLEMULTITHREAD configuration keyword in the "Installation and Configuration" sub-section: * DISABLEMULTITHREAD keyword (default 0) 40.6.4 Scrollable Cursors The following information should be added to the "Scrollable Cursors" section: 40.6.4.1 Server-side Scrollable Cursor Support for OS/390 The UDB client for the Unix, Windows, and OS/2 platforms supports updatable server-side scrollable cursors when run against OS/390 Version 7 databases. To access an OS/390 scrollable cursor on a three-tier environment, the client and the gateway must be running DB2 UDB Version 7.1, FixPak 3 or later. There are two application enablement interfaces that can access scrollable cursors: ODBC and JDBC. The JDBC interface can only access static scrollable cursors, while the ODBC interface can access static and keyset-driven server-side scrollable cursors. Cursor Attributes The table below lists the default attributes for OS/390 Version 7 cursors in ODBC. Table 11. Default attributes for OS/390 cursors in ODBC Cursor Type Cursor Cursor Cursor Cursor Sensitivity Updatable Concurrency Scrollable forward-onlya unspecified non-updatable read-only non-scrollable concurrency static insensitive non-updatable read-only scrollable concurrency keyset-driven sensitive updatable values scrollable concurrency a Forward-only is the default behavior for a scrollable cursor without the FOR UPDATE clause. Specifying FOR UPDATE on a forward-only cursor creates an updatable, lock concurrency, non-scrollable cursor. Supported Fetch Orientations All ODBC fetch orientations are supported via the SQLFetchScroll or SQLExtendedFetch interfaces. Updating the Keyset-Driven Cursor A keyset-driven cursor is an updatable cursor. The CLI driver appends the FOR UPDATE clause to the query, except when the query is issued as a SELECT ... FOR READ ONLY query, or if the FOR UPDATE clause already exists. The keyset-driven cursor implemented in DB2 for OS/390 is a values concurrency cursor. A values concurrency cursor results in optimistic locking, where locks are not held until an update or delete is attempted. When an update or delete is attempted, the database server compares the previous values the application retrieved to the current values in the underlying table. If the values match, then the update or delete succeeds. If the values do not match, then the operation fails. If failure occurs, the application should query the values again and re-issue the update or delete if it is still applicable. An application can update a keyset-driven cursor in two ways: * Issue an UPDATE WHERE CURRENT OF "" or DELETE WHERE CURRENT OF "" using SQLPrepare() with SQLExecute() or SQLExecDirect(). * Use SQLSetPos() or SQLBulkOperations() to update, delete, or add a row to the result set. Note: Rows added to a result set via SQLSetPos() or SQLBulkOperations() are inserted into the table on the server, but are not added to the server's result set. Therefore, these rows are not updatable nor are they sensitive to changes made by other transactions. The inserted rows will appear, however, to be part of the result set, since they are cached on the client. Any triggers that apply to the inserted rows will appear to the application as if they have not been applied. To make the inserted rows updatable, sensitive, and to see the result of applicable triggers, the application must issue the query again to regenerate the result set. Troubleshooting for Applications Created Before Scrollable Cursor Support Since scrollable cursor support is new, some ODBC applications that were working with previous releases of UDB for OS/390 or UDB for Unix, Windows, and OS/2 may encounter behavioral or performance changes. This occurs because before scrollable cursors were supported, applications that requested a scrollable cursor would receive a forward-only cursor. To restore an application's previous behavior before scrollable cursor support, set the following configuration keywords in the db2cli.ini file: Table 12. Configuration keyword values restoring application behavior before scrollable cursor support Configuration Keyword Setting Description PATCH2=6 Returns a message that scrollable cursors (both keyset-driven and static) are not supported. CLI automatically downgrades any request for a scrollable cursor to a forward-only cursor. DisableKeysetCursor=1 Disables both the server-side and client-side keyset-driven scrollable cursors. This can be used to force the CLI driver to give the application a static cursor when a keyset-driven cursor is requested. UseServerKeysetCursor=0 Disables the server-side keyset-driven cursor for applications that are using the client-side keyset-driven cursor library to simulate a keyset-driven cursor. Only use this option when problems are encountered with the server-side keyset-driven cursor, since the client-side cursor incurs a large amount of overhead and will generally have poorer performance than a server-side cursor. 40.6.5 Using Compound SQL The following note is missing from the book: Any SQL statement that can be prepared dynamically, other than a query, can be executed as a statement inside a compound statement. Note: Inside Atomic Compound SQL, savepoint, release savepoint, and rollback to savepoint SQL statements are also disallowed. Conversely, Atomic Compound SQL is disallowed in savepoint. 40.6.6 Using Stored Procedures 40.6.6.1 Writing a Stored Procedure in CLI Following is an undocumented limitation on CLI stored procedures: If you are making calls to multiple CLI stored procedures, the application must close the open cursors from one stored procedure before calling the next stored procedure. More specifically, the first set of open cursors must be closed before the next stored procedure tries to open a cursor. 40.6.6.2 CLI Stored Procedures and Autobinding The following supplements information in the book: The CLI/ODBC driver will normally autobind the CLI packages the first time a CLI/ODBC application executes SQL against the database, provided the user has the appropriate privilege or authorization. Autobinding of the CLI packages cannot be performed from within a stored procedure, and therefore will not take place if the very first thing an application does is call a CLI stored procedure. Before running a CLI application that calls a CLI stored procedure against a new DB2 database, you must bind the CLI packages once with this command: UNIX db2 bind /@db2cli.lst blocking all Windows and OS/2 db2bind "%DB2PATH%\bnd\@db2cli.lst" blocking The recommended approach is to always bind these packages at the time the database is created to avoid autobind at runtime. Autobind can fail if the user does not have privilege, or if another application tries to autobind at the same time. ------------------------------------------------------------------------ 40.7 Chapter 4. Configuring CLI/ODBC and Running Sample Applications 40.7.1 Configuration Keywords 40.7.1.1 CURRENTFUNCTIONPATH Disregard the last paragraph in the CURRENTFUNCTIONPATH keyword. The correct information is as follows: This keyword is used as part of the process for resolving unqualified function and stored procedure references that may have been defined in a schema name other than the current user's schema. The order of the schema names determines the order in which the function and procedure names will be resolved. For more information on function and procedure resolution, refer to the SQL Reference. 40.7.1.2 SKIPTRACE The following describes this new configuration keyword: Keyword Description: Allows CLI applications to be excluded from the trace function. db2cli.ini Keyword Syntax: SKIPTRACE = 0 | 1 Default Setting: Do not skip the trace function. DB2 CLI/ODBC Settings Tab: This keyword cannot be set using the CLI/ODBC Settings notebook. The db2cli.ini file must be modified directly to make use of this keyword. Usage Notes: This keyword can improve performance by allowing the trace function to bypass CLI applications. Therefore, if the DB2 trace facility db2trc is turned on and this keyword is set to 1, the trace will not contain information from the execution of the CLI application. Turning SKIPTRACE on is recommended for production environments on the UNIX platform where trace information is not required. Test environments may benefit, however, from having trace output, so this keyword can be turned off (or left at its default setting) when detailed execution information is desired. SKIPTRACE must be set in the [COMMON] section of the db2cli.ini configuration file. ------------------------------------------------------------------------ 40.8 Chapter 5. DB2 CLI Functions 40.8.1 SQLBindFileToParam - Bind LOB File Reference to LOB Parameter The last parameter - IndicatorValue - in the SQLBindFileToParam() CLI function is currently documented as "output (deferred)". It should be "input (deferred)". 40.8.2 SQLColAttribute -- Return a Column Attribute The following updates are additions to the "Description" column for the SQL_DESC_AUTO_UNIQUE_VALUE and SQL_DESC_UPDATABLE arguments: SQL_DESC_AUTO_UNIQUE_VALUE SQL_FALSE is returned in NumericAttributePtr for all DB2 SQL data types. Currently DB2 CLI is not able to determine if a column is an identity column, therefore SQL_FALSE is always returned. This limitation does not fully conform to the ODBC specifications. Future versions of DB2 CLI for Unix and Windows servers will provide auto-unique support. SQL_DESC_UPDATABLE Indicates if the column data type is an updateable data type: o SQL_ATTR_READWRITE_UNKNOWN is returned in NumericAttributePtr for all DB2 SQL data types. It is returned because DB2 CLI is not currently able to determine if a column is updateable. Future versions of DB2 CLI for Unix and Windows servers will be able to determine if a column is updateable. 40.8.3 SQLGetInfo - Get General Information The following corrects the information in the "Usage" section under "Information Returned by SQLGetInfo": SQL_DATABASE_NAME (string) The name of the current database in use. Note: This string is the same as that returned by the SELECT CURRENT SERVER statement on non-host systems. For host databases, such as DB2 for OS/390 or DB2 for OS/400, the string returned is the DCS database name that was provided when the CATALOG DCS DATABASE DIRECTORY command was issued at the DB2 Connect gateway. 40.8.4 SQLGetLength - Retrieve Length of A String Value The following corrects the footnote in "Table 113. SQLGetLength Arguments" : Note: a This is in characters for DBCLOB data. 40.8.5 SQLNextResult - Associate Next Result Set with Another Statement Handle The following text should be added to Chapter 5, "DB2 CLI Functions": 40.8.5.1 Purpose Specification: DB2 CLI 7.x 40.8.5.2 Syntax SQLRETURN SQLNextResult (SQLHSTMT StatementHandle1 SQLHSTMT StatementHandle2); 40.8.5.3 Function Arguments Table 13. SQLNextResult Arguments Data Type Argument Use Description SQLHSTMT StatementHandle input Statement handle. SQLHSTMT StatementHandle input Statement handle. 40.8.5.4 Usage A stored procedure returns multiple result sets by leaving one or more cursors open after exiting. The first result set is always accessed by using the statement handle that called the stored procedure. If multiple result sets are returned, either SQLMoreResults() or SQLNextResult() can be used to describe and fetch the result set. SQLMoreResults() is used to close the cursor for the first result set and allow the next result set to be processed, whereas SQLNextResult() moves the next result set to StatementHandle2, without closing the cursor on StatementHandle1. Both functions return SQL_NO_DATA_FOUND if there are no result sets to be fetched. Using SQLNextResult() allows result sets to be processed in any order once they have been transferred to other statement handles. Mixed calls to SQLMoreResults() and SQLNextResult() are allowed until there are no more cursors (open result sets) on StatementHandle1. When SQLNextResult() returns SQL_SUCCESS, the next result set is no longer associated with StatementHandle1. Instead, the next result set is associated with StatementHandle2, as if a call to SQLExecDirect() had just successfully executed a query on StatementHandle2. The cursor, therefore, can be described using SQLNumResultSets(), SQLDescribeCol(), or SQLColAttribute(). After SQLNextResult() has been called, the result set now associated with StatementHandle2 is removed from the chain of remaining result sets and cannot be used again in either SQLNextResult() or SQLMoreResults(). This means that for 'n' result sets, SQLNextResult() can be called successfully at most 'n-1' times. If SQLFreeStmt() is called with the SQL_CLOSE option, or SQLFreeHandle() is called with HandleType set to SQL_HANDLE_STMT, all pending result sets on this statement handle are discarded. SQLNextResult() returns SQL_ERROR if StatementHandle2 has an open cursor or StatementHandle1 and StatementHandle2 are not on the same connection. If any errors or warnings are returned, SQLError() must always be called on StatementHandle1. Note: SQLMoreResults() also works with a parameterized query with an array of input parameter values specified with SQLParamOptions() and SQLBindParameter(). SQLNextResult(), however, does not support this. 40.8.5.5 Return Codes * SQL_SUCCESS * SQL_SUCCESS_WITH_INFO * SQL_STILL_EXECUTING * SQL_ERROR * SQL_INVALID_HANDLE * SQL_NO_DATA_FOUND 40.8.5.6 Diagnostics Table 14. SQLNextResult SQLSTATEs SQLSTATE Description Explanation 40003 Communication Link The communication link between the 08S01 failure. application and data source failed before the function completed. 58004 Unexpected system Unrecoverable system error. failure. HY001 Memory allocation DB2 CLI is unable to allocate the memory failure. required to support execution or completion of the function. HY010 Function sequence The function was called while in a error. data-at-execute (SQLParamData(), SQLPutData()) operation. StatementHandle2 has an open cursor associated with it. The function was called while within a BEGIN COMPOUND and END COMPOUND SQL operation. HY013 Unexpected memory DB2 CLI was unable to access the memory handling error. required to support execution or completion of the function. HYT00 Time-out expired. The time-out period expired before the data source returned the result set. Time-outs are only supported on non-multitasking systems such as Windows 3.1 and Macintosh System 7. The time-out period can be set using the SQL_ATTR_QUERY_TIMEOUT attribute for SQLSetConnectAttr(). 40.8.5.7 Restrictions Only SQLMoreResults() can be used for parameterized queries. 40.8.5.8 References * "SQLMoreResults - Determine If There Are More Result Sets" on page 535 * "Returning Result Sets from Stored Procedures" on page 120 40.8.6 SQLSetEnvAttr - Set Environment Attribute The following is an additional environment attribute that belongs in the "Environment Attributes" section under "Usage": SQL_ATTR_KEEPCTX A 32-bit integer value that specifies whether the context should be kept when the environment handle is freed. This attribute should be set at the environment level. It can be used by mutli-threaded applications to manage contexts associated with each thread's connections, database resources, and data transmission. The possible values are: o SQL_FALSE: The application will release the context when a thread's environment handle is freed. This is the default value. o SQL_TRUE: The context will remain valid when a thread's environment handle is freed, making the context available for other existing threads on the same connection. Setting SQL_ATTR_KEEPCTX to SQL_TRUE may resolve some problems associated with conflicting contexts in multi-threaded applications. Note: This is an IBM extension. 40.8.7 SQLSetStmtAttr -- Set Options Related to a Statement The following replaces the existing information for the statement attribute SQL_ATTR_QUERY_TIMEOUT: SQL_ATTR_QUERY_TIMEOUT (DB2 CLI v2) A 32-bit integer value that is the number of seconds to wait for an SQL statement to execute between returning to the application. This option can be set and used to terminate long running queries. The value of 0 means there is no time out. DB2 CLI supports non-zero values for all platforms that support multithreading. ------------------------------------------------------------------------ 40.9 Appendix C. DB2 CLI and ODBC The following is a new section added to this appendix. 40.9.1 ODBC Unicode Applications A Unicode ODBC application sends and retrieves character data primarily in UCS-2. It does this by calling Unicode versions of the ODBC functions (those with a 'W' suffix) and by indicating Unicode data types. The application does not explicitly specify a local code page. The application can still call the ANSI functions and pass local code page strings. For example, the application may call SQLConnectW() and pass the DSN, User ID and Password as Unicode arguments. It may then call SQLExecDirectW() and pass in a Unicode SQL statement string, and then bind a combination of ANSI local code page buffers (SQL_C_CHAR) and Unicode buffers (SQL_C_WCHAR). The database data types may be local code page or UCS-2 and UTF-8. If a CLI application calls SQLConnectW or calls SQLSetConnectAttr with SQL_ATTR_ANSI_APP set to SQL_AA_FALSE, the application is considered a Unicode application. This means all CHAR data is sent and received from the database in UTF-8 format. The application can then fetch CHAR data into SQL_C_CHAR buffers in local code page (with possible data loss), or into SQL_C_WCHAR buffers in UCS-2 without any data loss. If the application does not do either of the two calls above, CHAR data is converted to the applications local code page at the server. This means CHAR data fetched into SQL_C_WCHAR may suffer data loss. If the DB2CODEPAGE instance variable is set (using db2set) to code page 1208 (UTF-8), the application will receive all CHAR data in UTF-8 since this is now the local code page. The application must also ensure that all CHAR input data is also in UTF-8. ODBC also assumes that all SQL_C_WCHAR data is in the native endian format. CLI will perform any required byte-reversal for SQL_C_WCHAR. 40.9.1.1 ODBC Unicode Versus Non-Unicode Applications This release of DB2 Universal Database contains the SQLConnectW() API. A Unicode driver must export SQLConnectW in order to be recognized as a Unicode driver by the driver manager. It is important to note that many ODBC applications (such as Microsoft Access and Visual Basic) call SQLConnectW(). In previous releases of DB2 Universal Database, DB2 CLI has not supported this API, and thus was not recognized as a Unicode driver by the ODBC driver manager. This caused the ODBC driver manager to convert all Unicode data to the application's local code page. With the added support of the SQLConnectW() function, these applications will now connect as Unicode applications and DB2 CLI will take care of all required data conversion. DB2 CLI now accepts Unicode APIs (with a suffix of "W") and regular ANSI APIs. ODBC defines a set of functions with a suffix of "A", but the driver manager does not pass ANSI functions with the "A" suffix to the driver. Instead, it converts these functions to ANSI function calls without the suffix, and then passes them to the driver. An ODBC application that calls the SQLConnectW() API is considered a Unicode application. Since the ODBC driver manager will always call the SQLConnectW() API regardless of what version the application called, ODBC introduced the SQL_ATTR_ANSI_APP connect attribute to notify the driver if the application should be considered an ANSI or UNICODE application. If SQL_ATTR_ANSI_APP is not set to SQL_AA_FALSE, DB2 CLI converts all Unicode data to the local code page before sending it to the server. ------------------------------------------------------------------------ 40.10 Appendix D. Extended Scalar Functions 40.10.1 Date and Time Functions The following functions are missing from the Date and Time Functions section of Appendix D "Extended Scalar Functions": DAYOFWEEK_ISO( date_exp ) Returns the day of the week in date_exp as an integer value in the range 1-7, where 1 represents Monday. Note the difference between this function and the DAYOFWEEK() function, where 1 represents Sunday. WEEK_ISO( date_exp ) Returns the week of the year in date_exp as an integer value in the range of 1-53. Week 1 is defined as the first week of the year to contain a Thursday. Therefore, Week1 is equivalent to the first week that contains Jan 4, since Monday is considered to be the first day of the week. Note that WEEK_ISO() differs from the current definition of WEEK(), which returns a value up to 54. For the WEEK() function, Week 1 is the week containing the first Saturday. This is equivalent to the week containing Jan. 1, even if the week contains only one day. DAYOFWEEK_ISO() and WEEK_ISO() are automatically available in a database created in Version 7. If a database was created prior to Version 7, these functions may not be available. To make DAYOFWEEK_ISO() and WEEK_ISO() functions available in such a database, use the db2updb system command. For more information about db2updb, see the "Command Reference" section in these Release Notes. ------------------------------------------------------------------------ 40.11 Appendix K. Using the DB2 CLI/ODBC/JDBC Trace Facility The sections within this appendix have been updated. See the "Traces" chapter in the Troubleshooting Guide for the most up-to-date information on this trace facility. ------------------------------------------------------------------------ 訊息參考手冊 ------------------------------------------------------------------------ 41.1 可用更新 訊息參考手冊 已經更新成為 FixPak 4 的一部分。 您可以從 http://www.ibm.com/software/data/db2/udb/winos2unix/support 線上下載最新的 PDF。您也可以在 CD 中取得所有已更新的文件。透過 DB2 服務並使用 PTF 號碼 U478862,即可訂購此 CD。 您可以從 http://www.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/help.d2w/report 取得聯絡「DB2 服務」的相關資訊。 ------------------------------------------------------------------------ 41.2 訊息更新 41.2.1 SQL2554N 新原因碼 12 說明: DB2 Data Links Manager 上的一致處理程序,無法在指定時間內完成。詳細資 訊,請參閱診斷日誌檔 db2diag.log。 使用者回應: reconcile 指令等待 DB2 Data Links Manager 驗證時逾時。請再執行一次 reconcile 指令。 41.2.2 其它新訊息和 SQLSTATE SQL0490N您直接在 SQL 陳述式中指定的 "" 數字,超出這個環境定義容許 的值範圍 ("", "")。 解說: 您指定的數字 (""),在指定此數的環境定義中並不適用。這個環境定 義中容許的最小值是 ""。 這個環境定義中容許的最大值是 ""。n 必須在 "" 和 "" ("" =< n =< "") 的指定範圍 內。 使用者回應: 請將陳述式中的 n 值,變更為有效值。 sqlcode: -490 sqlstate: 428B7 SQL20214N您指定了 ORDER OF ""。但是這個表格指定元並未排 序。 解說: ORDER OF 子句可以指定根據 "" 的次序來排序結果表格, 但是它並未排序。"" 的相關查詢上並沒有 ORDER BY 子句, 或 是 ORDER BY 子句的排序鍵是一個常數表示式。 使用者回應: 請在 " 的相關查詢上新增一個有效的 ORDER BY 子 句, 或是以排序鍵規格來取代 ORDER OF 子句。 sqlcode: -20210 sqlstate: 428FI SQL20211N規格 ORDER BY 和 FETCH FIRST n ROWS ONLY 無效。 解說: ORDER BY 或 FETCH FIRST n ROWS ONLY 不適用於下列各項: * 概略表的外面全選 * SQL 表格函數的 RETURN 陳述式中的外面全選 * 摘要表格定義 使用者回應: 請除去 ORDER BY 或 FETCH FIRST n ROWS ONLY 子句。查詢採用概略表 、摘要表格或 SQL 表格函數時,才能使用 ORDER BY。 ROW_NUMBER() OVER() 子句結 合 WHERE 子句中的述詞一起使用,也能產生 FETCH FIRST n ROWS ONLY 的效果。例 如: SELECT name FROM (SELECT ROW_NUMBER() OVER() AS rn name FROM emp) AS e WHERE rn<10 sqlcode: -20211 sqlstate: 428FJ 表 15. 新 SQLSTATE 訊息 SQLSTATE 值 意義 428B7 您在 SQL 陳述式中指定的數字,超出有 效範圍。 428FI 您指定了 ORDER OF,但是表格指定元中 並沒有 ORDER BY 子句。 428FJ ORDER BY 不適用於摘要表格或概略表的 外面全選。 ------------------------------------------------------------------------ SQL Reference (無中文版) ------------------------------------------------------------------------ 42.1 SQL Reference Update Available The SQL Reference has been updated and the latest .pdf is available for download online at http://www.ibm.com/software/data/db2/udb/winos2unix/support. The information in these notes is in addition to the updated reference. All updated documentation is also available on CD. This CD can be ordered through DB2 service using the PTF number U478862. Information on contacting DB2 Service is available at http://www.ibm.com/cgi-bin/db2www/data/db2/udb/winos2unix/support/help.d2w/report. ------------------------------------------------------------------------ 42.2 Enabling the New Functions and Procedures Version 7 FixPaks deliver new SQL built-in scalar functions. Refer to the SQL Reference updates for a description of these new functions. The new functions are not automatically enabled on each database when the database server code is upgraded to the new service level. To enable these new functions, the system administrator must issue the command db2updv7, specifying each database at the server. This command makes an entry in the database that ensures that database objects created prior to executing this command use existing function signatures that may match the new function signatures. For information on enabling the MQSeries functions (those defined in the DB2MQ schema), see MQSeries. ------------------------------------------------------------------------ 42.3 MQSeries Information 42.3.1 Scalar Functions 42.3.1.1 MQPUBLISH >>-MQPUBLISH--(-------------------------------------------------> >--+---------------------------------------------+--msg-data----> '-publisher-service--,--+-------------------+-' '-service-policy--,-' >--+---------------------------------+--)---------------------->< '-,--topic--+-------------------+-' | (1) | '-,--correl-id------' Note: 1. The correl-id cannot be specified unless a service and a policy are previously defined. The schema is DB2MQ. The MQPUBLISH function publishes data to MQSeries. This function requires the installation of either MQSeries Publish/Subscribe or MQSeries Integrator. Please consult www.ibm.com/software/MQSeries for further details. The MQPUBLISH function publishes the data contained in msg-data to the MQSeries publisher specified in publisher-service, and using the quality of service policy defined by service-policy. An optional topic for the message can be specified, and an optional user-defined message correlation identifier may also be specified. The function returns a value of '1' if successful or a '0' if unsuccessful. publisher-service A string containing the logical MQSeries destination where the message is to be sent. If specified, the publisher-service must refer to a publisher Service Point defined in the AMT.XML repository file. A service point is a logical end-point from which a message is sent or received. Service point definitions include the name of the MQSeries Queue Manager and Queue. See the MQSeries Application Messaging Interface for further details. If publisher-service is not specified, then the DB2.DEFAULT.PUBLISHER will be used. The maximum size of publisher-service is 48 bytes. service-policy A string containing the MQSeries AMI Service Policy to be used in handling of this message. If specified, the service-policy must refer to a Policy defined in the AMT.XML repository file. A Service Policy defines a set of quality of service options that should be applied to this messaging operation. These options include message priority and message persistence. See the MQSeries Application Messaging Interface manual for further details. If service-policy is not specified, then the default DB2.DEFAULT.POLICY will be used. The maximum size of service-policy is 48 bytes. msg-data A string expression containing the data to be sent via MQSeries. The maximum size if the string of type VARCHAR is 4000 bytes. If the string is a CLOB, it can be up to 1MB in size. topic A string expression containing the topic for the message publication. If no topic is specified, none will be associated with the message. The maximum size of topic is 40 bytes. Multiple topics can be specified in one string (up to 40 characters long). Each topic must be separated by a colon. For example, "t1:t2:the third topic" indicates that the message is associated with all three topics: t1, t2, and "the third topic". correl-id An optional string expression containing a correlation identifier to be associated with this message. The correl-id is often specified in request and reply scenarios to associate requests with replies. If not specified, no correlation id will be added to the message. The maximum size of correl-id is 24 bytes. Examples Example 1: This example publishes the string "Testing 123" to the default publisher service (DB2.DEFAULT.PUBLISHER) using the default policy (DB2.DEFAULT.POLICY). No correlation identifier or topic is specified for the message. VALUES MQPUBLISH('Testing 123') Example 2: This example publishes the string "Testing 345" to the publisher service "MYPUBLISHER" under the topic "TESTS". The default policy is used and no correlation identifier is specified. VALUES MQPUBLISH('MYPUBLISHER','Testing 345', 'TESTS') Example 3: This example publishes the string "Testing 678" to the publisher service "MYPUBLISHER" using the policy "MYPOLICY" with a correlation identifier of "TEST1". The message is published with topic "TESTS". VALUES MQPUBLISH('MYPUBLISHER','MYPOLICY','Testing 678','TESTS','TEST1') Example 4: This example publishes the string "Testing 901" to the publisher service "MYPUBLISHER" under the topic "TESTS" using the default policy (DB2.DEFAULT.POLICY) and no correlation identifier. VALUES MQPUBLISH('Testing 901','TESTS') All examples return the value '1' if successful. 42.3.1.2 MQREADCLOB >>-MQREADCLOB--(--+----------------------------------------+----> '-receive-service--+-------------------+-' '-,--service-policy-' >--)----------------------------------------------------------->< The schema is DB2MQ. The MQREADCLOB function returns a message from the MQSeries location specified by receive-service, using the quality of service policy defined in service-policy. Executing this operation does not remove the message from the queue associated with receive-service, but instead returns the message at the head of the queue. The return value is a CLOB of 1MB maximum length, containing the message. If no messages are available to be returned, a NULL is returned. receive-service A string containing the logical MQSeries destination from where the message is to be received. If specified, the receive-service must refer to a Service Point defined in the AMT.XML repository file. A service point is a logical end-point from where a message is sent or received. Service points definitions include the name of the MQSeries Queue Manager and Queue. See the MQSeries Application Messaging Interface for further details. If receive-service is not specified, then the DB2.DEFAULT.SERVICE will be used. The maximum size of receive-service is 48 bytes. service-policy A string containing the MQSeries AMI Service Policy used in handling this message. If specified, the service-policy must refer to a Policy defined in the AMT.XML repository file. A Service Policy defines a set of quality of service options that should be applied to this messaging operation. These options include message priority and message persistence. See the MQSeries Application Messaging Interface manual for further details. If service-policy is not specified, then the default DB2.DEFAULT.POLICY will be used. The maximum size of service-policy is 48 bytes. Examples: Example 1: This example reads the message at the head of the queue specified by the default service (DB2.DEFAULT.SERVICE), using the default policy (DB2.DEFAULT.POLICY). VALUES MQREADCLOB() Example 2: This example reads the message at the head of the queue specified by the service "MYSERVICE" using the default policy (DB2.DEFAULT.POLICY). VALUES MQREADCLOB('MYSERVICE') Example 3: This example reads the message at the head of the queue specified by the service "MYSERVICE", and using the policy "MYPOLICY". VALUES MQREADCLOB('MYSERVICE','MYPOLICY') All of these examples return the contents of the message as a CLOB with a maximum size of 1MB, if successful. If no messages are available, then a NULL is returned. 42.3.1.3 MQRECEIVECLOB >>-MQRECEIVECLOB------------------------------------------------> >--(--+----------------------------------------------------------+--)->< '-receive-service--+-------------------------------------+-' '-,--service-policy--+--------------+-' '-,--correl-id-' The schema is DB2MQ. The MQRECEIVECLOB function returns a message from the MQSeries location specified by receive-service, using the quality of service policy service-policy. Performing this operation removes the message from the queue associated with receive-service. If the correl-id is specified, then the first message with a matching correlation identifier will be returned. If correl-id is not specified, then the message at the head of the queue will be returned. The return value is a CLOB with a maximum length of 1MB containing the message. If no messages are available to be returned, a NULL is returned. receive-service A string containing the logical MQSeries destination from which the message is received. If specified, the receive-service must refer to a Service Point defined in the AMT.XML repository file. A service point is a logical end-point from which a message is sent or received. Service points definitions include the name of the MQSeries Queue Manager and Queue. See the MQSeries Application Messaging Interface for further details. If receive-service is not specified, then the DB2.DEFAULT.SERVICE is used. The maximum size of receive-service is 48 bytes. service-policy A string containing the MQSeries AMI Service Policy to be used in the handling of this message. If specified, the service-policy must refer to a Policy defined in the AMT.XML repository file 1 . If service-policy is not specified, then the default DB2.DEFAULT.POLICY is used. The maximum size of service-policy is 48 bytes. correl-id A string containing an optional correlation identifier to be associated with this message. The correl-id is often specified in request and reply scenarios to associate requests with replies. If not specified, no correlation id will be used. The maximum size of correl-id is 24 bytes. Examples: Example 1: This example receives the message at the head of the queue specified by the default service (DB2.DEFAULT.SERVICE), using the default policy (DB2.DEFAULT.POLICY). VALUES MQRECEIVECLOB() Example 2: This example receives the message at the head of the queue specified by the service "MYSERVICE" using the default policy (DB2.DEFAULT.POLICY). VALUES MQRECEIVECLOB('MYSERVICE') Example 3: This example receives the message at the head of the queue specified by the service "MYSERVICE" using the policy "MYPOLICY". VALUES MQRECEIVECLOB('MYSERVICE','MYPOLICY') Example 4: This example receives the first message with a correlation id that matches '1234' from the head of the queue specified by the service "MYSERVICE" using the policy "MYPOLICY". VALUES MQRECEIVECLOB('MYSERVICE',MYPOLICY','1234') All these examples return the contents of the message as a CLOB with a maximum size of 1MB, if successful. If no messages are available, a NULL will be returned. 42.3.1.4 MQSEND >>-MQSEND--(--+----------------------------------------+--------> '-send-service--,--+-------------------+-' '-service-policy--,-' >--msg-data--+-------------------+--)-------------------------->< | (1) | '-,--correl-id------' Note: 1. The correl-id cannot be specified unless a service and a policy are previously defined. The schema is DB2MQ. The MQSEND function sends the data contained in msg-data to the MQSeries location specified by send-service, using the quality of service policy defined by service-policy. An optional user defined message correlation identifier may be specified by correl-id. The function returns a value of '1' if successful or a '0' if unsuccessful. msg-data A string expression containing the data to be sent via MQSeries. The maximum size is 4000 bytes if the data is of type VARCHAR, and 1MB if the data is of type CLOB. send-service A string containing the logical MQSeries destination where the message is to be sent. If specified, the send-service refers to a service point defined in the AMT.XML repository file. A service point is a logical end-point from which a message may be sent or received. Service point definitions include the name of the MQSeries Queue Manager and Queue. See the MQSeries Application Messaging Interface manual for further details. If send-service is not specified, then the value of DB2.DEFAULT.SERVICE is used. The maximum size of send-service is 48 bytes. service-policy A string containing the MQSeries AMI Service Policy used in handling of this message. If specified, the service-policy must refer to a service policy defined in the AMT XML repository file. A Service Policy defines a set of quality of service options that should be applied to this messaging operation. These options include message priority and message persistence. See the MQSeries Application Messaging Interface manual for further details. If service-policy is not specified, then a default value of DB2.DEFAULT.POLICY will be used. The maximum size of service-policy is 48 bytes. correl-id An optional string containing a correlation identifier associated with this message. The correl-id is often specified in request and reply scenarios to associate requests with replies. If not specified, no correlation id will be sent. The maximum size of correl-id is 24 bytes. Examples: Example 1: This example sends the string "Testing 123" to the default service (DB2.DEFAULT.SERVICE), using the default policy (DB2.DEFAULT.POLICY), with no correlation identifier. VALUES MQSEND('Testing 123') Example 2: This example sends the string "Testing 345" to the service "MYSERVICE", using the policy "MYPOLICY", with no correlation identifier. VALUES MQSEND('MYSERVICE','MYPOLICY','Testing 345') Example 3: This example sends the string "Testing 678" to the service "MYSERVICE", using the policy "MYPOLICY", with correlation identifier "TEST3". VALUES MQSEND('MYSERVICE','MYPOLICY','Testing 678','TEST3') Example 4: This example sends the string "Testing 901" to the service "MYSERVICE", using the default policy (DB2.DEFAULT.POLICY), and no correlation identifier. VALUES MQSEND('MYSERVICE','Testing 901') All examples return a scalar value of '1' if successful. 42.3.2 Table Functions 42.3.2.1 MQREADALLCLOB >>-MQREADALLCLOB--(---------------------------------------------> >--+----------------------------------------+--+----------+-----> '-receive-service--+-------------------+-' '-num-rows-' '-,--service-policy-' >--)----------------------------------------------------------->< The schema is DB2MQ. The MQREADALLCLOB function returns a table containing the messages and message metadata from the MQSeries location specified by receive-service, using the quality of service policy service-policy. Performing this operation does not remove the messages from the queue associated with receive-service. If num-rows is specified, then a maximum of num-rows messages will be returned. If num-rows is not specified, then all available messages will be returned. The table returned contains the following columns: * MSG - a CLOB column containing the contents of the MQSeries message. * CORRELID - a VARCHAR(24) column holding a correlation ID used to relate messages. * TOPIC - a VARCHAR(40) column holding the topic that the message was published with, if available. * QNAME - a VARCHAR(48) column holding the queue name where the message was received. * MSGID - a CHAR(24) column holding the assigned MQSeries unique identifier for this message. * MSGFORMAT - a VARCHAR(8) column holding the format of the message, as defined by MQSeries. Typical strings have an MQSTR format. receive-service A string containing the logical MQSeries destination from which the message is read. If specified, the receive-service must refer to a service point defined in the AMT.XML repository file. A service point is a logical end-point from which a message is sent or received. Service point definitions include the name of the MQSeries Queue Manager and Queue. See the MQSeries Application Messaging Interface for further details. If receive-service is not specified, then the DB2.DEFAULT.SERVICE will be used. The maximum size of receive-service is 48 bytes. service-policy A string containing the MQSeries AMI Service Policy used in the handling of this message. If specified, the service-policy refers to a Policy defined in the AMT XML repository file. A service policy defines a set of quality of service options that should be applied to this messaging operation. These options include message priority and message persistence. See the MQSeries Application Messaging Interface manual for further details. If service-policy is not specified, then the default DB2.DEFAULT.POLICY will be used. The maximum size of service-policy is 48 bytes. num-rows A positive integer containing the maximum number of messages to be returned by the function. Examples: Example 1: This example receives all the messages from the queue specified by the default service (DB2.DEFAULT.SERVICE), using the default policy (DB2.DEFAULT.POLICY). The messages and all the metadata are returned as a table. SELECT * FROM table (MQREADALLCLOB()) T Example 2: This example receives all the messages from the head of the queue specified by the service MYSERVICE, using the default policy (DB2.DEFAULT.POLICY). Only the MSG and CORRELID columns are returned. SELECT T.MSG, T.CORRELID FROM table (MQREADALLCLOB('MYSERVICE')) T Example 3: This example reads the head of the queue specified by the default service (DB2.DEFAULT.SERVICE), using the default policy (DB2.DEFAULT.POLICY). Only messages with a CORRELID of '1234' are returned. All columns are returned. SELECT * FROM table (MQREADALLCLOB()) T WHERE T.CORRELID = '1234' Example 4: This example receives the first 10 messages from the head of the queue specified by the default service (DB2.DEFAULT.SERVICE), using the default policy (DB2.DEFAULT.POLICY). All columns are returned. SELECT * FROM table (MQREADALLCLOB(10)) T 42.3.2.2 MQRECEIVEALLCLOB >>-MQRECEIVEALLCLOB--(------------------------------------------> >--+----------------------------------------------------------+--> '-receive-service--+-------------------------------------+-' '-,--service-policy--+--------------+-' '-,--correl-id-' >--+-----------------+--)-------------------------------------->< '-+---+--num-rows-' '-,-' The schema is DB2MQ. The MQRECEIVEALLCLOB function returns a table containing the messages and message metadata from the MQSeries location specified by receive-service, using the quality of service policy service-policy. Performing this operation removes the messages from the queue associated with receive-service. If a correl-id is specified, then only those messages with a matching correlation identifier will be returned. If correl-id is not specified, then the message at the head of the queue will be returned. If num-rows is specified, then a maximum of num-rows messages will be returned. If num-rows is not specified, then all available messages are returned. The table returned contains the following columns: * MSG - a CLOB column containing the contents of the MQSeries message. * CORRELID - a VARCHAR(24) column holding a correlation ID used to relate messages. * TOPIC - a VARCHAR(40) column holding the topic that the message was published with, if available. * QNAME - a VARCHAR(48) column holding the queue name where the message was received. * MSGID - a CHAR(24) column holding the assigned MQSeries unique identifier for this message. * MSGFORMAT - a VARCHAR(8) column holding the format of the message, as defined by MQSeries. Typical strings have an MQSTR format. receive-service A string containing the logical MQSeries destination from which the message is received. If specified, the receive-service must refer to a service point defined in the AMT.XML repository file. A service point is a logical end-point from which a message is sent or received. Service point definitions include the name of the MQSeries Queue Manager and Queue. See the MQSeries Application Messaging Interface manual for further details. If receive-service is not specified, then the DB2.DEFAULT.SERVICE will be used. The maximum size of receive-service is 48 bytes. service-policy A string containing the MQSeries AMI Service Policy used in the handling of this message. If specified, the service-policy refers to a Policy defined in the AMT XML repository file. A service policy defines a set of quality of service options that should be applied to this messaging operation. These options include message priority and message persistence. See the MQSeries Application Messaging Interface manual for further details. If service-policy is not specified, then the default DB2.DEFAULT.POLICY will be used. The maximum size of service-policy is 48 bytes. correl-id An optional string containing a correlation identifier associated with this message. The correl-id is often specified in request and reply scenarios to associate requests with replies. If not specified, no correlation id is specified. The maximum size of correl-id is 24 bytes. num-rows A positive integer containing the maximum number of messages to be returned by the function. Examples: Example 1: This example receives all the messages from the queue specified by the default service (DB2.DEFAULT.SERVICE), using the default policy (DB2.DEFAULT.POLICY). The messages and all the metadata are returned as a table. SELECT * FROM table (MQRECEIVEALLCLOB()) T Example 2: This example receives all the messages from the head of the queue specified by the service MYSERVICE, using the default policy (DB2.DEFAULT.POLICY). Only the MSG and CORRELID columns are returned. SELECT T.MSG, T.CORRELID FROM table (MQRECEIVEALLCLOB('MYSERVICE')) T Example 3: This example receives all of the message from the head of the queue specified by the service "MYSERVICE", using the policy "MYPOLICY". Only messages with a CORRELID of '1234' are returned. Only the MSG and CORRELID columns are returned. SELECT T.MSG, T.CORRELID FROM table (MQRECEIVEALLCLOB('MYSERVICE','MYPOLICY','1234')) T Example 4: This example receives the first 10 messages from the head of the queue specified by the default service (DB2.DEFAULT.SERVICE), using the default policy (DB2.DEFAULT.POLICY). All columns are returned. SELECT * FROM table (MQRECEIVEALLCLOB(10)) T 42.3.3 CLOB data now supported in MQSeries functions The MQSeries functions (those defined in the DB2MQ schema) now include functionality that allow them to be used with CLOB data in addition to VARCHAR data. In some cases, a new function now exists to handle the CLOB data type, in others, the already existing function now handles both CLOB and VARCHAR data. In either case, the syntax of the CLOB function is identical to that of its VARCHAR equivalent. The functions that support the use of CLOB data, and their equivalent VARCHAR functions, are listed in the following table: Table 16. MQSeries Functions that support the CLOB data type Function to use for VARCHAR data Function to use for CLOB data MQPUBLISH MQPUBLISH MQREAD MQREADCLOB MQRECEIVE MQRECEIVECLOB MQSEND MQSEND MQREADALL MQREADALLCLOB MQRECEIVEALL MQRECEIVEALLCLOB For information on enabling the MQSeries functions (those defined in the DB2MQ schema), see MQSeries. ------------------------------------------------------------------------ 42.4 Data Type Information 42.4.1 Promotion of Data Types In this section table 5 shows the precedence list for each data type. Please note: 1. For a Unicode database, the following are considered to be equivalent data types: o CHAR and GRAPHIC o VARCHAR and VARGRAPHIC o LONG VARCHAR and LONG VARGRAPHIC o CLOB and DBCLOB 2. In a Unicode database, it is possible to create functions where the only difference in the function signature is between equivalent CHAR and GRAPHIC data types, for example, foo(CHAR(8)) and foo(GRAPHIC(8)). We strongly recommend that you do not define such duplicate functions since migration to a future release will require one of them to be dropped before the migration will proceed. If such duplicate functions do exist, the choice of which one to invoke is determined by a two-pass algorithm. The first pass attempts to find a match using the same algorithm as is used for resolving functions in a non-Unicode database. If no match is found, then a second pass will be done taking into account the following promotion precedence for CHAR and GRAPHIC strings: GRAPHIC-->CHAR-->VARGRAPHIC-->VARCHAR-->LONG VARGRAPHIC-->LONG VARCHAR-->DBCLOB-->CLOB 42.4.2 Casting between Data Types The following entry has been added to the list introduced as: "The following casts involving distinct types are supported": * For a Unicode database, cast from a VARCHAR or VARGRAPHIC to distinct type DT with a source data type CHAR or GRAPHIC. The following are updates to "Table 6. Supported Casts between Built-in Data Types". Only the affected rows of the table are included. Table 17. Supported Casts between Built-in Data Types L O N L G Target Data Type O V V > N A A G R R V V G G G A A R R R D R R A A A B C C C C P P P C H H H L H H H L Source Data Type A A A O I I I O V R R R B C C C B CHAR Y Y Y Y Y1 Y1 - - VARCHAR Y Y Y Y Y1 Y1 - - LONGVARCHAR Y Y Y Y - - Y1 Y1 CLOB Y Y Y Y - - - Y1 GRAPHIC Y1 Y1 - - Y Y Y Y VARGRAPHIC Y1 Y1 - - Y Y Y Y LONGVARGRAPHIC - - Y1 Y1 Y Y Y Y DBCLOB - - - Y1 Y Y Y Y 1 Cast is only supported for Unicode databases. 42.4.3 Assignments and Comparisons Assignments and comparisons involving both character and graphic data are only supported when one of the strings is a literal. For function resolution, graphic literals and character literals will both match character and graphic function parameters. The following are updates to "Table 7. Data Type Compatibility for Assignments and Comparisons". Only the affected rows of the table, and the new footnote 6, are included: Binary Decimal Floating CharacterGraphic Time- Binary Operands Integer Number Point String String Date Time stamp String UDT CharacterNo No No Yes Yes 6 1 1 1 No 3 2 String Graphic No No No Yes 6 Yes No No No No 2 String 6 Only supported for Unicode databases. 42.4.3.1 String Assignments Storage Assignment The last paragraph of this subsectoin is modified as follows: When a string is assigned to a fixed-length column and the length of the string is less than the length attribute of the target, the string is padded to the right with the necessary number of single-byte, double-byte, or UCS-22 blanks. The pad character is always a blank even for columns defined with the FOR BIT DATA attribute. Retrieval Assignment The third paragraph of this subsectoin is modified as follows: When a character string is assigned to a fixed-length variable and the length of the string is less than the length attribute of the target, the string is padded to the right with the necessary number of single-byte, double-byte, or UCS-22 blanks. The pad character is always a blank even for strings defined with the FOR BIT DATA attribute. 2 UCS-2 defines several SPACE characters with different properties. For a Unicode database, the database manager always uses the ASCII SPACE at position x'0020' as UCS-2 blank. For an EUC database, the IDEOGRAPHIC SPACE at position x'3000' is used for padding GRAPHIC strings. Conversion Rules for String Assignments The following paragraph has been added to the end of this subsectoin: For Unicode databases, character strings can be assigned to a graphic column, and graphic strings can be assigned to a character column. DBCS Considerations for Graphic String Assignments The first paragraph of this subsectoin has been modified as follows: Graphic string assignments are processed in a manner analogous to that for character strings. For non-Unicode databases, graphic string data types are compatible only with other graphic string data types, and never with numeric, character string, or datetime data types. For Unicode databases, graphic string data types are compatible with character string data types. 42.4.3.2 String Comparisons Conversion Rules for Comparison This subsection has been modified as follows: When two strings are compared, one of the strings is first converted, if necessary, to the encoding scheme and code page of the other string. For details, see the "Rules for String Conversions" section of "Chapter 3. Language Elements" in the SQL Reference. 42.4.4 Rules for Result Data Types 42.4.4.1 Character and Graphic Strings in a Unicode Database This is a new subsection inserted after the subsection "Graphic Strings". In a Unicode database, character strings and graphic strings are compatible. If one operand is... And the other operand The data type of the is... result is... GRAPHIC(x) CHAR(y) or GRAPHIC(y) GRAPHIC(z) where z = max(x,y) VARGRAPHIC(x) CHAR(y) or VARCHAR(y) VARGRAPHIC(z) where z = max(x,y) VARCHAR(x) GRAPHIC(y) or VARGRAPHIC(z) where z = VARGRAPHIC max(x,y) LONG VARGRAPHIC CHAR(y) or VARCHAR(y) LONG VARGRAPHIC or LONG VARCHAR LONG VARCHAR GRAPHIC(y) or LONG VARGRAPHIC VARGRAPHIC(y) DBCLOB(x) CHAR(y) or VARCHAR(y) DBCLOB(z) where z = or CLOB(y) max(x,y) DBCLOB(x) LONG VARCHAR DBCLOB(z) where z = max(x,16350) CLOB(x) GRAPHIC(y) or DBCLOB(z) where z = VARGRAPHIC(y) max(x,y) CLOB(x) LONG VARGRAPHIC DBCLOB(z) where z = max(x,16350) 42.4.5 Rules for String Conversions The third point has been added to the following list in this section: For each pair of code pages, the result is determined by the sequential application of the following rules: * If the code pages are equal, the result is that code page. * If either code page is BIT DATA (code page 0), the result code page is BIT DATA. * In a Unicode database, if one code page denotes data in an encoding scheme different from the other code page, the result is UCS-2 over UTF-8 (that is, the graphic data type over the character data type).1 * Otherwise, the result code page is determined by Table 8 of the "Rules for String Conversions" section of "Chapter 3. Language Elements" in the SQL Reference. An entry of "first" in the table means the code page from the first operand is selected and an entry of "second" means the code page from the second operand is selected. 1 In a non-Unicode database, conversion between different encoding schemes is not supported. 42.4.6 Expressions The following has been added: In a Unicode database, an expression that accepts a character or graphic string will accept any string types for which conversion is supported. 42.4.6.1 With the Concatenation Operator The following has been added to the end of this subsection: In a Unicode database, concatenation involving both character string operands and graphic string operands will first convert the character operands to graphic operands. Note that in a non-Unicode database, concatenation cannot involve both character and graphic operands. 42.4.7 Predicates The following entry has been added to the list introduced by the sentence: "The following rules apply to all types of predicates": * In a Unicode database, all predicates that accept a character or graphic string will accept any string types for which conversion is supported. ------------------------------------------------------------------------ 42.5 Unicode Information 42.5.1 Scalar Functions and Unicode In a Unicode database, all scalar functions that accept a character or graphic string will accept any string types for which conversion is supported. ------------------------------------------------------------------------ 42.6 Larger Index Keys for Unicode Databases 42.6.1 ALTER TABLE The length of variable length columns that are part of any index, including primary and unique keys, defined when the registry variable DB2_INDEX_2BYTEVARLEN was on, can be altered to a length greater than 255 bytes. The fact that a variable length column is involved in a foreign key will no longer prevent the length of that column from being altered to larger than 255 bytes, regardless of the registry variable setting. However, data with length greater than 255 cannot be inserted into the table unless the column in the corresponding primary key has length greater than 255 bytes, which is only possible if the primary key was created with the registry variable ON. 42.6.2 CREATE INDEX Indexes can be defined on variable length columns whose length is greater than 255 bytes if the registry variable DB2_INDEX_2BYTEVARLEN is ON. 42.6.3 CREATE TABLE Primary and unique keys with variable keyparts can have a size greater than 255 if the registry variable DB2_INDEX_2BYTEVARLEN is ON. Foreign keys can be defined on variable length columns whose length is greater than 255 bytes. ------------------------------------------------------------------------ 42.7 Additional Options in the GET DIAGNOSTICS Statement GET DIAGNOSTICS Statement The GET DIAGNOSTICS statement is used to obtain information about the previously executed SQL statement. The syntax of this statement has been updated as follows. Command Syntax >>-GET DIAGNOSTICS----------------------------------------------> >--+-SQL-variable-name--=--+-ROW_COUNT-----+-+----------------->< | '-RETURN_STATUS-' | '-| condition-information |---------------' condition-information |--EXCEPTION--1-------------------------------------------------> .-,------------------------------------------. V | >----SQL-variable-name--=--+-MESSAGE_TEXT-----+-+---------------| '-DB2_TOKEN_STRING-' Command Parameters SQL-variable-name Identifies the variable that is the assignment target. If ROW_COUNT or RETURN_STATUS is specified, the variable must be an integer variable. Otherwise, the variable must be CHAR or VARCHAR. SQL variables can be defined in a compound statement. ROW_COUNT Identifies the number of rows associated with the previous SQL statement. If the previous SQL statement is a DELETE, INSERT, or UPDATE statement, ROW_COUNT identifies the number of rows deleted, inserted, or updated by that statement, excluding rows affected by triggers or referential integrity constraints. If the previous statement is a PREPARE statement, ROW_COUNT identifies the estimated number of result rows in the prepared statement. RETURN_STATUS Identifies the status value returned from the stored procedure associated with the previously executed SQL statement, provided that the statement was a CALL statement invoking a procedure that returns a status. If the previous statement is not such a statement, then the value returned has no meaning and could be any integer. condition-information Specifies that the error or warning information for the previously executed SQL statement is to be returned. If information about an error is needed, the GET DIAGNOSTICS statement must be the first statement specified in the handler that will handle the error. If information about a warning is needed, and if the handler will get control of the warning condition, the GET DIAGNOSTICS statement must be the first statement specified in that handler. If the handler will not get control of the warning condition, the GET DIAGNOSTICS statement must be the next statement executed. MESSAGE_TEXT Identifies any error or warning message text returned from the previously executed SQL statement. The message text is returned in the language of the database server where the statement is processed. If the statement completes with an SQLCODE of zero, an empty string or blanks are returned. DB2_TOKEN_STRING Identifies any error or warning message tokens returned from the previously executed SQL statement. If the statement completes with an SQLCODE of zero, or if the SQLCODE has no tokens, then an empty string or blanks is returned. ------------------------------------------------------------------------ 42.8 ORDER BY in Subselects DB2 now supports ORDER BY in subselects and fullselects. 42.8.1 fullselect Following is a partial syntax diagram of the modified fullselect showing the location of the order-by-clause. >>-+-subselect---------+----------------------------------------> +-(fullselect)------+ '-| values-clause |-' .----------------------------------------------. V | >----+------------------------------------------+-+-------------> '-+-UNION---------+--+-subselect---------+-' +-UNION ALL-----+ +-(fullselect)------+ +-EXCEPT--------+ '-| values-clause |-' +-EXCEPT ALL----+ +-INTERSECT-----+ '-INTERSECT ALL-' >--+-----------------+----------------------------------------->< '-order-by-clause-' A fullselect that contains an ORDER BY clause cannot be specified in: * A summary table * The outermost fullselect of a view (SQLSTATE 428FJ SQLCODE -20211) An ORDER BY clause in a fullselect does not affect the order of the rows returned by a query. An ORDER BY clause only affects the order of the rows returned if it is specified in the outermost fullselect. 42.8.2 subselect Following is the complete syntax diagram of the modified subselect showing the location of the order-by-clause and the fetch-first-clause. >>-select-clause--from-clause--+--------------+-----------------> '-where-clause-' >--+-----------------+--+---------------+-----------------------> '-group-by-clause-' '-having-clause-' >--+-----------------+----------------------------------------->< '-order-by-clause-' The clauses of the subselect are processed in the following sequence: 1. FROM clause 2. WHERE clause 3. GROUP BY clause 4. HAVING clause 5. SELECT clause 6. ORDER BY clause A subselect that contains an ORDER BY cannot be specified: * In the outermost fullselect of a view * In a summary table * Unless the subselect is enclosed in parentheses For example, the following is not valid (SQLSTATE 428FJ SQLCODE -20211): SELECT * FROM T1 ORDER BY C1 UNION SELECT * FROM T2 ORDER BY C1 The following example is valid: (SELECT * FROM T1 ORDER BY C1) UNION (SELECT * FROM T2 ORDER BY C1) An ORDER BY clause in a subselect does not affect the order of the rows returned by a query. An ORDER BY clause only affects the order of the rows returned if it is specified in the outermost fullselect. 42.8.3 order-by-clause Following is the complete syntax diagram of the modified order-by-clause. .-,------------------------------. V .-ASC--. | >>-ORDER BY----+-sort-key--+------+---------+-+---------------->< | '-DESC-' | '-ORDER OF--table-designator-' sort-key |--+-simple-column-name--+--------------------------------------| +-simple-integer------+ '-sort-key-expression-' ORDER OF table-designator Specifies that the same ordering used in table-designator should be applied to the result table of the subselect. There must be a table reference matching table-designator in the FROM clause of the subselect that specifies this clause (SQLSTATE 42703). The subselect (or fullselect) corresponding to the specified table-designator must include an ORDER BY clause that is dependant on the data (SQLSTATE 428FI SQLCODE -20210). The ordering that is applied is the same as if the columns of the ORDER BY clause in the nested subselect (or fullselect) were included in the outer subselect (or fullselect), and these columns were specified in place of the ORDER OF clause. For more information on table designators, see "Column Name Qualifiers to Avoid Ambiguity" in the SQL Reference. Note that this form is not allowed in a fullselect (other than the degenerative form of a fullselect). For example, the following is not valid: (SELECT C1 FROM T1 ORDER BY C1) UNION SELECT C1 FROM T2 ORDER BY ORDER OF T1 The following example is valid: SELECT C1 FROM (SELECT C1 FROM T1 UNION SELECT C1 FROM T2 ORDER BY C1 ) AS UTABLE ORDER BY ORDER OF UTABLE 42.8.4 select-statement Following is the complete syntax diagram of the modified select-statement: >>-+-----------------------------------+--fullselect------------> | .-,-----------------------. | | V | | '-WITH----common-table-expression-+-' >--fetch-first-clause--*--+--------------------+----------------> +-read-only-clause---+ | (1) | '-update-clause------' >--*--+---------------------+--*--+--------------+------------->< '-optimize-for-clause-' '-WITH--+-RR-+-' +-RS-+ +-CS-+ '-UR-' Note: 1. The update-clause cannot be specified if the fullselect contains an order-by-clause. SELECT INTO statement Syntax .-,-------------. V | >>-select-clause--INTO----host-variable-+--from-clause----------> >--+--------------+--+-----------------+--+---------------+-----> '-where-clause-' '-group-by-clause-' '-having-clause-' >--+-----------------+--+--------------+----------------------->< '-order-by-clause-' '-WITH--+-RR-+-' +-RS-+ +-CS-+ '-UR-' 42.8.5 OLAP Functions (window-order-clause) Following is a partial syntax diagram for the OLAP functions showing the modified window-order-clause. window-order-clause .-,--------------------------------------------. V .-| asc option |--. | |--ORDER BY----+-sort-key-expression--+-----------------+-+-+---| | '-| desc option |-' | '-ORDER OF--table-designator---------------' asc option .-NULLS LAST--. |--ASC--+-------------+-----------------------------------------| '-NULLS FIRST-' desc option .-NULLS FIRST-. |--DESC--+-------------+----------------------------------------| '-NULLS LAST--' ORDER BY (sort-key-expression,...) Defines the ordering of rows within a partition that determines the value of the OLAP function or the meaning of the ROW values in the window-aggregation-group-clause (it does not define the ordering of the query result set). sort-key-expression An expression used in defining the ordering of the rows within a window partition. Each column name referenced in a sort-key-expression must unambiguously reference a column of the result set of the subselect, including the OLAP function (SQLSTATE 42702 or 42703). The length of each sort-key-expression must not be more than 255 bytes (SQLSTATE 42907). A sort-key-expression cannot include a scalar fullselect (SQLSTATE 42822) or any function that is not deterministic or that has an external action (SQLSTATE 42845). This clause is required for the RANK and DENSE_RANK functions (SQLSTATE 42601). ASC Uses the values of the sort-key-expression in ascending order. DESC Uses the values of the sort-key-expression in descending order. NULLS FIRST The window ordering considers null values before all non-null values in the sort order. NULLS LAST The window ordering considers null values after all non-null values in the sort order. ORDER OF table-designator Specifies that the same ordering used in table-designator should be applied to the result table of the subselect. There must be a table reference matching table-designator in the FROM clause of the subselect that specifies this clause (SQLSTATE 42703). The subselect (or fullselect) corresponding to the specified table-designator must include an ORDER BY clause that is dependent on the data (SQLSTATE 428FI SQLCODE -20210). The ordering that is applied is the same as if the columns of the ORDER BY clause in the nested subselect (or fullselect) were included in the outer subselect (or fullselect), and these columns were specified in place of the ORDER OF clause. For more information on table designators, see "Column Name Qualifiers to Avoid Ambiguity" in the SQL Reference. ------------------------------------------------------------------------ 42.9 New Input Argument for the GET_ROUTINE_SAR Procedure This procedure now supports hide_body_flag, an input argument of type INTEGER that specifies (using one of the following values) whether or not the routine body should be hidden when the routine text is extracted from the catalogs: 0 Leave the routine text intact. This is the default value. 1 Replace the routine body with an empty body when the routine text is extracted from the catalogs. >>-GET_ROUTINE_SAR----------------------------------------------> >--(--sarblob--,--type--,--routine_name_string--+-------------------+--)->< '-,--hide_body_flag-' ------------------------------------------------------------------------ 42.10 Required Authorization for the SET INTEGRITY Statement When this statement is used to turn off integrity checking, the privileges of the authorization ID of the statement must include at least one of the following: * CONTROL privilege on: o The specified tables, and o The descendent foreign key tables that will have integrity checking turned off by the statement, and o The descendent immediate summary tables that will have integrity checking turned off by the statement * SYSADM or DBADM authority * LOAD authority ------------------------------------------------------------------------ Unicode 更新 ------------------------------------------------------------------------ 43.1 簡介 Unicode 標準是書寫字元及文字方面全球通用的字元編碼方法。 它非常精確地定義了 字集,以及少數的 Unicode 編碼。 它定義了一種一致的方式來將多國語言文字編 碼, 使得文字資料可在國際間交換,並創立世界級軟體的基礎。 Unicode 提供了兩種編碼方法:UTF-16 及 UTF-8。 預設的編碼方法是 UTF-16 (16 位元的編碼格式)。UCS-2 是 UTF-16 的子集, 它使 用兩個位元組來表示一個字元。UCS-2 通常被認可為全球性的字碼頁, 它能夠表示目 前所有單位元組字碼頁及雙位元組字碼頁的全部必需字元。UCS-2 在 IBM 中註冊為字 碼頁 1200。 另一個 Unicode 編碼格式是 UTF-8,它是位元組導向的, 且是被設計來方便現有 ASCII 系統的使用。UTF-8 使用不定數目的位元組 (通常為 1-3,有時是 4) 來儲存 每個字元。 無變化的 ASCII 字元就儲存為單位元組。所有其它字元就使用多個位元 組來儲存。通常 UTF-8 資料可依據非設計為多位元組字碼頁的字碼來視為擴充的 ASCII 資料。 UTF-8 在 IBM 中註冊為字碼頁 1208。 應用程式要考慮到資料在區域字碼頁、UCS-2 和 UTF-8 之間做轉換時的需求, 這是 很重要的。例如,20 個字元在 UCS-2 中需要完整的 40 個位元組, UTF-8 則介於 20 到 60 個位元組之間 (視原先使用的字碼頁及文字而定)。 43.1.1 DB2 Unicode 資料庫及應用程式 指定 UTF-8 字碼集所建立的 DB2 Universal Database for Unix、Windows 或 OS/2, 可用來儲存 UCS-2 及 UTF-8 兩種格式的資料。 這樣的資料庫可被視為 Unicode 資料庫。 SQL 字元資料是使用 UTF-8 進行編碼, 而 SQL 圖形資料是使用 UCS-2 進行編碼。這表示 MBCS 字元(包括單一位元組及雙位元組字元)儲存在字元 直欄中, 而 DBCS 字元則儲存在圖形直欄中。 應用程式的字碼頁可能和 DB2 用來儲存資料的字碼頁不一樣。 在非 Unicode 資料庫 中,在字碼頁不一樣時, 資料庫管理程式會轉換從屬站及伺服器之間傳送的字元及圖 形 (pure DBCS) 資料。 在 Unicode 資料庫中,從屬站字碼頁與 UTF-8 之間的字元 資料轉換會自動由資料庫管理程式來執行, 但是所有的圖形 (UCS-2) 資料不經過轉 換就在從屬站及伺服器之間傳送。 圖 1. 資料庫管理程式所執行的字碼頁轉換 [資料庫管理程式所執行的字碼頁轉換] 註: 1. 當連接到 Unicode 資料庫,如果應用程式設定 DB2CODEPAGE=1208, 則區域字 碼頁是 UTF-8,所以不需要做字碼頁轉換。 2. 當已連接到 Unicode 資料庫,CLI 應用程式也可將字元資料當作圖形資料接 收, 以及將圖形資料當作字元資料。 應用程式是可以指定 UTF-8 字碼頁,以指出它將用 UCS-2 來傳送及接收圖形資料, 並用 UTF-8 來傳送及接收字元資料。 此應用程式字碼頁只支援 Unicode 資料庫。 使用 Unicode 時要考慮的其它項目為: 1. 資料庫字碼頁是在建立資料庫的時候決定的, 且它的值預設會從作業系統語言 環境 (或字碼頁) 來決定。 CODESET 及 TERRITORY 關鍵字可用來明確地建立 Unicode DB2 資料庫。 例如: CREATE DATABASE unidb USING CODESET UTF-8 TERRITORY US 2. 應用程式字碼頁也預設為區域字碼頁,但是這可用下列方法由 UTF-8 來置換: o 使用此指令將應用程式字碼頁設定為 UTF-8 (1208): db2set DB2CODEPAGE=1208 o 對於 CLI/ODBC 應用程式,可呼叫 SQLSetConnectAttr() 及設定 SQL_ATTR_ANSI_APP 為 SQL_AA_FALSE。 預設設定是 SQL_AA_TRUE。 3. GRAPHIC 直欄中的資料對於每個 Unicode 字元會使用完整的兩個位元組, 而 CHAR 直欄中的資料對於每個 Unicode 字元會使用 1 到 3 個位元組。 在 GRAPHIC 直欄字元方面的 SQL 限制通常是 CHAR 直欄字元的一半, 但在位元組 方面是一樣的。 例如,CHAR 直欄的最大字元長度是 254,且 GRAPHIC 直欄的 最大字元長度是 127。 詳細資訊,請參閱 SQL Reference 一書 "Functions" 章節中的 MAX。 4. 圖形文字用 G 字首來與字元文字區別。 例如: SELECT * FROM mytable WHERE mychar = 'utf-8 data' AND mygraphic = G'ucs-2 data' 註: 對於 Unicode 資料庫而言,G 字首是選用的。 請參閱40.6.2.4, "Literals in Unicode Databases",取得其餘資訊及更新的 支援。 5. 支援 CLI/ODBC 和 JDBC 應用程式不同於支援內含的應用程式。 若需 CLI/ODBC 支援的相關資訊,請參閱"CLI Guide and Reference (無中文版)"。 6. UCS-2 資料的位元組次序可能因平台而異。 DB2 在內部是使用 big-endian 格 式。 43.1.2 文件更新 這些版本注意事項中含有下列在 DB2 版本 7.1 中使用 Unicode 相關資訊的更新: * SQL Reference: Chapter 3. Language Elements Chapter 4. Functions Chapter 6. SQL Statements * CLI Guide and Reference: Chapter 3. Using Advanced Features Appendix C. DB2 CLI and ODBC * Data Movement Utilities Guide and Reference, Appendix C. Export/Import/Load Utility File Formats 如需在 DB2 中使用 Unicode 的相關資訊,請參照 Administration Guide 的 National Language Support (NLS) appendix: "Unicode Support in DB2 UDB"。 ------------------------------------------------------------------------ 連接到主電腦系統 部份目錄 * DB2 Connect User's Guide (無中文版) o 44.1 Increasing DB2 Connect data transfer rate + 44.1.1 Extra Query Blocks + 44.1.2 RFC-1323 Window Scaling * 連接環境補充資料 o 45.1 在 VM 環境下安裝應用程式伺服器 o 45.2 CLI/ODBC/JDBC 架構 PATCH1 和 PATCH2 設定值 ------------------------------------------------------------------------ DB2 Connect User's Guide (無中文版) While the blocking of rows for a query result set is nothing new, DB2 for z/OS (formerly called DB2 for OS/390) since its Version 6.1 release has had the capability of returning multiple query blocks in response to an OPEN or FETCH request to a remote client, such as DB2 Connect. Rather than repeatedly sending requests to the DB2 for z/OS server requesting one block of row data at a time, the client can now optionally request that the server send back an additional number of query blocks. Such additional query blocks are called extra query blocks. This new feature allows the client to minimize the number of network line turnarounds, which has a major impact on network performance. The decrease in the number of requests sent by the client to the server for query blocks translates into a significant performance boost because switching between a send and receive is an expensive operation in terms of performance. DB2 Connect can now exploit this performance enhancement by requesting extra query blocks by default from a DB2 for z/OS server. To take full advantage of the return of extra query blocks (each can be up to 32K bytes long) for the preferred network protocol of TCP/IP, Window Scaling extensions are also enabled as architected under RFC-1323 in DB2 Connect. This feature allows TCP/IP to dynamically and efficiently adjust the send and receive window sizes to accommodate the potentially large amounts of data returned by way of the extra query blocks. 44.1.1 Extra Query Blocks Extra query block support in DB2 for z/OS servers on Versions 6.1 or later is configured via the EXTRA BLOCKS SRV parameter on the DB2 DDF installation panel. This parameter controls the maximum number of extra query blocks that DB2 can send back to a client for a request and can be set to a value between 0 and 100. Setting the parameter value to 0 disables the return of extra query blocks. The default value of 100 should be used to get the most benefit out of this feature, barring any idiosyncrasies in the network that would render this setting less than ideal. On the client side where the application accesses DB2 for z/OS either directly through a co-located DB2 Connect installation, or through a separate DB2 Connect server installation, there are various means for activating the corresponding DB2 Connect support on a per cursor or statement basis through the use of: * A query rowset size for a cursor * The 'OPTIMIZE for N ROWS' clause on the select statement associated with a cursor * The 'FETCH FIRST N ROWS ONLY' clause on the select statement associated with a cursor. Option 1 is not covered under in this section because it was already implemented as part of DB2 for z/OS Scrollable Support in DB2 Connect Version 7.1 FixPak 2. Our focus is on the use of options 2 and 3 instead to enabling extra query block support using different SQL APIs as follows: 1. Embedded SQL o Invoke extra query block support for a query by specifying the 'OPTIMIZE for N ROWS' clause and/or the 'FETCH FIRST N ROWS ONLY' clause on the select statement itself. o With the 'OPTIMIZE for N ROWS' clause, DB2 for z/OS will attempt to block the desired number of rows to return to DB2 Connect, subject to the EXTRA BLOCKS SRV DDF installation parameter setting. The application can choose to fetch beyond N rows as DB2 for z/OS does not limit the total number of rows that could ultimately be returned for the query result set to N. o The 'FETCH FIRST N ROWS ONLY' clause works similarly, except that the query result set is limited to N rows by DB2 for z/OS. Fetching beyond N rows would result in SQL code +100 (end of data). 2. CLI/ODBC o Invoke extra query block support for a query through its SQL_MAX_ROWS statement attribute. o DB2 Connect will tag on the 'OPTIMIZE for N ROWS' clause for a DB2 for z/OS 6.x server. Even though the number of rows that could ultimately be returned for the query result set is not limited to N by DB2 for z/OS, CLI/ODBC would return SQL_NO_DATA_FOUND to the application if an attempt is made to fetch beyond N rows. o The 'FETCH FIRST N ROWS ONLY' clause is used instead for a DB2 for z/OS 7.1 or above server. Similar to the embedded SQL case, the query result set is limited to N rows by DB2 for z/OS. Fetching beyond N rows would result in SQL_NO_DATA_FOUND. 3. JDBC o Invoke extra query block support for a query through the setMaxRows method. Similar to the CLI/ODBC enablement, DB2 Connect will tag on the 'OPTIMIZE for N ROWS' clause for a DB2 for z/OS server Version 6.x , and the 'FETCH FIRST N ROWS ONLY' clause for a DB2 for z/OS server Version 7.1 or later. 44.1.2 RFC-1323 Window Scaling Window Scaling is supported as of FixPak 4 on all Windows and UNIX platforms that support the RFC-1323 extensions for TCP/IP. This feature can be enabled on DB2 for Windows and UNIX via the DB2 registry variable DB2SORCVBUF. To enable Window Scaling, set the DB2 registry variable DB2SORCVBUF to any value above 64K (for example, on DB2 for Windows or UNIX, you can issue db2set DB2SORCVBUF =65537). The maximum send and receive buffer sizes are dependent on the specific operating system. To ensure that buffer sizes configured have been accepted, the user can set the database manager configuration parameter DIAGLEVEL to 4 (informational) and check the db2diag.log file for messages. For Window Scaling to take effect, it must be enabled on both ends of a connection. For example, to enable Window Scaling between the DB2 Connect workstation and the host, this feature must be active on both the workstation and the host, either directly through the operating system TCP/IP stack, or indirectly through the DB2 product. For instance, for DB2 for z/OS, Window Scaling can currently only be activated through the operating system by setting TCPRCVBUFRSIZE to any value above 64K. If a remote DB2 client is used for accessing host DB2 through a DB2 Connect server workstation, Window Scaling can be enabled on the client also. By the same token, Window Scaling can also be enabled between a remote DB2 client and a workstation DB2 server when no host DB2 is involved. While Window Scaling is designed to enhance network performance, the expected network performance improvement does not always materialize. Interaction among factors such as the frame size used for the Ethernet or token ring LAN adapter, the IP MTU size, and other settings at routers throughout the communication link could even result in performance degradation once Window Scaling has been enabled. By default, Window Scaling is disabled with both the send and receive buffers set to 64K. The user should be prepared to assess the impact of turning on Window Scaling and perform any necessary adjustments to the network. For an introduction to tuning the network for improved network performance, refer to the white paper at http://www.networking.ibm.com/per/per10.html. ------------------------------------------------------------------------ 連接環境補充資料 ------------------------------------------------------------------------ 45.1 在 VM 環境下安裝應用程式伺服器 新增下列句子到「提供區段資訊」章節,「定義應用程式伺服器」次章節的第一句子 之後: RDB_NAME 由 SQLSTART EXEC 提供,可作為 DBNAME 參數。 ------------------------------------------------------------------------ 45.2 CLI/ODBC/JDBC 架構 PATCH1 和 PATCH2 設定值 CLI/ODBC/JDBC 驅動程式的架構可以由從屬站架構輔助程式、ODBC 驅動程式管理程式 (若系統有安裝此程式)、編輯 db2cli.ini 檔來完成。 詳細資料,請參閱安裝與架 構補充資料或 CLI Guide and Reference。 您可以透過 db2cli.ini 檔,或者透過 SQLDriverConnect() 或 SQLBrowseConnect() CLI API, 指定 PATCH1 及 PATCH2 關鍵字的值,來修改 DB2 CLI/ODBC 驅動程式的 預設行為。 您可以將使用者想要設定的所有關鍵字加在一起, 來指定 PATCH1 關鍵字。 例如, 如果指定修補程式 1、2 及 8,則 PATCH1 的值將是 11。 下列是驅動程式上每一關 鍵字值及其效果的說明: 1 - 這使得驅動程式將搜尋 "count(exp)",並以 "count(distinct exp)" 置換它。因為有些版本的 DB2 支援 "count(exp)" 語法,且該語法 是由某些 ODBC 應用程式所建立的,所以需要這種效果。 當伺服器不支援 "count(exp)" 語法時,Microsoft 應用程式需要它。 2 - 部份 ODBC 應用程式會被設陷,當 SQLGetTypeInfo() 函數中對於 LITERAL_PREFIX 或 LITERAL_SUFFIX 直欄傳回 SQL_NULL_DATA 時。這會強制驅動程式改而傳回一個 空字串。Impromptu 2.0 會需要用到。 4 - 這會強制驅動程式將輸入時間戳記資料視為日期資料,如果時間和時間戳記的小數 部份是零。Microsoft Access 會需要用到。 8 - 如果時間戳記的日期部份為 1899-12-30,這會強制驅動程式 將輸入時間戳記資料視為時間資料。Microsoft Access 需要這種效果。 16 - 不使用。 32 - 這會強制驅動程式不傳回關於 SQL_LONGVARCHAR、SQL_LONGVARBINARY 及 SQL_LONGVARGRAPHIC 直欄的資訊。在應用程式看來,就好像並不支援長欄位。 Lotus 123 會需要用到。 64 - 這會強制驅動程式以 NULL 值終止圖形輸出字串。 雙位元組環境中的 Microsoft Access 需要這種效果。 128 - 這會強制驅動程式讓 "SELECT Config, nValue FROM MSysConf" 查詢到伺服器去。 目前驅動程式會傳回錯誤,相關 SQLSTATE 值是 S0002 (找不到表格)。如果使用者 已在資料庫中建立了此架構表格且希望應用程式可以存取時會需要用到。 256 - 這會強制驅動程式在 SQLStatistics() 呼叫中先傳回主要鍵直欄。目前,驅動程式 會依照索引名稱傳回已排序的索引,那是標準的 ODBC 行為。 512 - 這會強制驅動程式在 SQLGetFunctions() 中對 SQL_API_SQLTABLEPRIVILEGES 及 SQL_API_SQLCOLUMNPRIVILEGES 兩者傳回 FALSE。 1024 - 這會強制驅動程式在 SQLExecute() 或 SQLExecDirect() 中傳回 SQL_SUCCESS, 而非 SQL_NO_DATA_FOUND,如果執行的 UPDATE 或 DELETE 陳述式沒有對任何橫列 發生作用。Visual Basic 應用程式會需要用到。 2048 - 不使用。 4096 - 在自動 COMMIT 模式中時,於關閉游標後,這會強制驅動程式 不發出 COMMIT。 8192 - 這會強制驅動程式在呼叫儲存程序後傳回額外的結果集。這個結果集是一個單一 橫列的結果集,由儲存程序的輸出值組成。可被 Powerbuild 應用程式來存取。 32768 - 這會強制驅動程式使 Microsoft Query 應用程式能使用 DB2 MVS 同義字。 65536 - 這會強制驅動程式自行插入一個 "G" 到實際上為圖形文字的字元文字前面。 這個修補程式在雙位元組環境中工作時一定要提供。 131072 - 這會強制驅動程式將時間戳記直欄視為一個 CHAR(26) 直欄,在它是一個唯一 索引的一部份時。Microsoft 應用程式會需要用到。 262144 - 這會強制驅動程式使用 pseudo-catalog 表格 db2cli.procedures,而非 SYSCAT.PROCEDURES 及 SYSCAT.PROCPARMS 表格。 524288 - 這會強制驅動程式使用 SYSTEM_TABLE_SCHEMA,而非 TABLE_SCHEMA, 在對 DB2/400 V3.x 系統作系統查詢時。這樣可提昇效能。 1048576 - 這會強制驅動程式透過 SQLPutData() 將零長度的字串視為 SQL_NULL_DATA。 PATCH2 關鍵字不同於 PATCH1 關鍵字。 在這種情況中,將使用逗點分隔字元來指定 多個修補程式。 例如,如果指定了修補程式 1、4 及 5,則 PATCH2 將具有值 "1,4,5"。 下列是驅動程式上每一關鍵字值及其效果的說明: 1 - 這會強制驅動程式將 CALL 陳述式中的儲存程序名稱轉換為大寫字體。 2 - 不使用。 3 - 這會強制驅動程式將綱目呼叫的所有引數轉換為大寫字體。 4 - 這會強制驅動程式對於綱目呼叫 (也就是 SQLColumns()、SQLProcedureColumns() 等等) 傳回類似版本 2.1.2 的結果集,而非類似版本 5 的結果集。 5 - 這會強制驅動程式不要最佳化輸入 VARCHAR 直欄的處理,指向資料的指標和指向長度的 指標在記憶體中是連續的。 6 - 這會強制驅動程式傳回不支援可捲動游標的訊息。Visual Basic 程式會需要用到,如果 DB2 從屬站是版本 5,且伺服器是 DB2 UDB 版本 5。 7 - 這會強制驅動程式將所有 GRAPHIC 直欄資料類型對映到 CHAR 直欄資料類型。在雙位元組環境中需要這種效果。 8 - 這會強制驅動程式忽略綱目呼叫中的目錄搜尋引數。 9 - 游標提早關閉時不要 COMMIT 10 - 不使用 11 - 報告支援目錄名稱, (VB 儲存程序) 12 - 從綱目呼叫引數除去雙引號, (Visual Interdev) 13 - 請勿將 db2cli.ini 的關鍵字添加到輸出連接字串 14 - 忽略 SQLProcedures() 及 SQLProcedureColumns() 上的綱目名稱 15 - 使用句點代表字元輸出中的小數點符號 16 - 強迫傳回每一開啟的說明資訊 17 - 請勿在說明上傳回直欄名稱 18 - 嘗試以參數記號取代文字 19 - 目前,DB2 MVS V4.1 不支援 ODBC 語法,因為它容許在外部結合子句中的 ON 子句可有括弧。 開啟這個 PATCH2 會導致 IBM DB2 ODBC 驅動程式在外部結合子句在 ODBC ESC 序列中時將連字號除去。這個 PATCH2 只有在不利於 DB2 MVS 4.1 時才使用。 20 - 目前,MVS 上的 DB2 不支援參數記號為兩個運算元 (expression ? BETWEEN ?) 的 BETWEEN 述詞。開啟這個修補程式會導致 IBM ODBC 驅動程式將述詞覆寫為 (expression >= ? and expression <= ?)。 21 - 將儲存程序的所有僅 OUTPUT 參數設定為 SQL_NULL_DATA 22 - 這個 PATCH2 會導致 IBM ODBC 驅動程式報告不支援外部結合 (OUTER Join)。 這適用於在使用外部結合時陳述式時會產生 SELECT DISTINCT col1 或 ORDER BY col1 的應用程式,其中 col1 的長度大於 254 個字元,且造成 DB2 UDB 傳回錯誤 (因為 DB2 UDB 在此用法上不支援大於 254 個位元組的直欄 23 - 請勿最佳化透過 cbColDef=0 結合的參數之輸入 24 - 存取對映時間的實例為字元 25 - 存取小數直欄的實例 - 除去字元陳述尾端的零 26 - 不將 SQL 程式 464 傳回給應用程式 - 表示已傳回結果集 27 - 迫使 SQLTables 使用 TABLETYPE 關鍵字值,即使應用程式指定了一個有效值 28 - 說明實際的直欄為雙倍直欄 29 - 小數直欄的 ADO 實例 - 除去 x 值的前導零,其中 x 為 1 > x > -1(某些 MDAC 版本需要此效果) 30 - 快取最佳化時,停止使用儲存程序 31 - 回報 SQLStatistics 呼叫別名的統計值 32 - 置換 SQL 程式 -727 原因碼 4 處理程序 33 - 在轉換成字元時,傳回時間戳記的 ISO 版本 (相對於 ODBC 版本) 34 - 以 CHAR 名稱來回報 CHAR FOR BIT DATA 直欄 35 - SQL_DESC_BASE_TABLE_NAMER 被要求下回報一個無效的表格名稱 - ADO 唯讀最佳化 36 - 保留 37 - 保留 ------------------------------------------------------------------------ 附加資訊 部份目錄 * 附加資訊 o 46.1 DB2 Everywhere 已改為 DB2 Everyplace o 46.2 DB2 UDB 版本 7 的存取特性 + 46.2.1 鍵盤之輸入和導引 + 46.2.1.1 鍵盤輸入 + 46.2.1.2 鍵盤焦點 + 46.2.2 方便顯示特性 + 46.2.2.1 明顯對照模式 + 46.2.2.2 字型設定值 + 46.2.2.3 無關顏色 + 46.2.3 選擇式警告提示 + 46.2.4 支援技術的相容性 + 46.2.5 可存取的文件 o 46.3 滑鼠需求 o 46.4 試圖從 DB2 Run-time Client 連結導致「找不到連結檔案」錯誤 o 46.5 Search 探索 (Search Discovery) o 46.6 HP-UX 11 的記憶體視窗 o 46.7 解除安裝 DB2 DFS 從屬站啟動程式 o 46.8 Windows NT 從屬站身分驗證 o 46.9 聯合系統的限制 o 46.10 MPP 分割區表格的聯合限制 o 46.11 DataJoiner 限制 o 46.12 Windows NT 的希伯來文資訊型錄管理程式 o 46.13 啟動 Windows 之後無法啟動 DB2 的 SNA SPM o 46.14 Windows NT 及 Windows 2000 上的 DB2 服務帳戶需求 o 46.15 需要確定所有會在資料倉儲中心(DWC)中使用的使用者定義程式 o 46.16 Windows NT 上的從屬站端快取 o 46.17 Life Sciences Data Connect + 46.17.1 新外層 + 46.17.2 注意- o 46.18 SQL 輔助程式的加強功能 o 46.19 備份與復置指令的說明 o 46.20 "Warehouse Manager" 應為 "DB2 Warehouse Manager" ------------------------------------------------------------------------ 附加資訊 ------------------------------------------------------------------------ 46.1 DB2 Everywhere 已改為 DB2 Everyplace DB2 Everywhere 的名稱現在已改為 DB2 Everyplace。 ------------------------------------------------------------------------ 46.2 DB2 UDB 版本 7 的存取特性 DB2 UDB 系列產品包括了一些讓行動不便人士容易使用的特性。這些特性是: * 易於輸入和導引的鍵盤特性 * 增強內容顯示的特性 * 音效和視覺警示之提示選項 * 支援技術的相容性 * 作業系統相容的存取特性 * 可存取文件之格式 46.2.1 鍵盤之輸入和導引 46.2.1.1 鍵盤輸入 只要使用鍵盤便可以操作 DB2 控制中心。 功能表項目和控制項提供存取鍵,讓使用 者可以直接從鍵盤啟動控制項或選取某一功能表項目。 在控制項或是功能表內出現的 存取鍵畫有底線,以方便我們的辨識。 46.2.1.2 鍵盤焦點 在 UNIX 作業系統內,鍵盤焦點的位置以高亮度顯示,顯示視窗內該區處於作用中, 使用者的按鍵會產生影響。 46.2.2 方便顯示特性 DB2 控制中心有一些特性,可以增強使用者介面,以及改善弱視使用者對電腦使用的 能力。 這些增強的功能亦支援明顯對照的設定值,以及為客戶量身定做的字型內容。 46.2.2.1 明顯對照模式 控制中心介面支援由作業系統所提供的明顯對照模式選項。 使用者可以設定背景顏色 和前景顏色,使它形成強烈的對比。 46.2.2.2 字型設定值 控制中心介面允許使用者自功能表和對話視窗內選取文字的顏色、大小和字型。 46.2.2.3 無關顏色 使用者不需要去分辨顏色以使用此產品的各項功能。 46.2.3 選擇式警告提示 使用者可以選擇聲音警示或視覺警示。 46.2.4 支援技術的相容性 DB2 控制中心介面和螢幕讀取器應用程式相容,例如透過聲音存取。 在應用程式模式 內,控制中心介面有一些特性,可以幫助視障使用者得到螢光幕上的資訊。 46.2.5 可存取的文件 DB2 系列產品之文件為 HTML 格式。 這可讓使用者以瀏覽器中的喜好設定來檢視文 件。 它也容許螢幕讀取器和其它協助技術的使用。 ------------------------------------------------------------------------ 46.3 滑鼠需求 除了視窗之外,所有的平台都需要滑鼠來使用其中的工具。 ------------------------------------------------------------------------ 46.4 試圖從 DB2 Run-time Client 連結導致「找不到連結檔案」錯誤 因為 DB2 Run-time Client 沒有整組的連結檔案,所以無法完成 GUI 工具的連結, 只可以從 DB2 Administration Client 完成 GUI 工具的連結。 ------------------------------------------------------------------------ 46.5 Search 探索 (Search Discovery) Search 探索只支援廣播媒體。例如,Search 探索將無法透過 ATM 配接卡來作用。但 是,此項限制並不適用於 Known 探索。 ------------------------------------------------------------------------ 46.6 HP-UX 11 的記憶體視窗 記憶體視窗是供大型 HP 64 位元機器的使用者所用, 因他們想要利用 32 位元應用 程式超過 1.75GB 的共用記憶體。 如果您是執行 64 位元版本的 DB2,就不需要記憶 體視窗。 記憶體視窗可使每一程序或程序群組各有一個 1 GB 的共用記憶體可用。 這將容許案例具有自己的 1GB 共用記憶體,再加上 0.75GB 的廣域共用記憶體。 如 果使用者想要善用這個優點,他們可以執行多個案例,每一案例均在自己的視窗中執 行。 下列是使用記憶體視窗的先決條件: * DB2 EE 環境 o 修補程式:Extension Software 12/98 及 PHKL_17795。 o 必須對案例設定 $DB2INSTANCE 變數。 o 您在記憶體視窗下執行的每一個 DB2 案例,在 /etc/services.window 檔 案中都有登錄。例如: db2instance1 50 db2instance2 60 備註:名稱及 ID 之間僅能有一個空格。 o 您必須使用 TCP/IP 迴路方法,執行任何您要在伺服器上執行且需要多個 單一陳述式的 DB2 指令。 這是因為當記憶體視窗完成第一個陳述式的程 序時,shell 將終止執行。「DB2 服務程式」知道如何完成此項作業。 o 任何要在記憶體視窗下所執行的案例內執行 DB2 指令,必須以 db2win (位在 sqllib/bin 中) 作為字首。例如: db2win db2start db2win db2stop o 記憶體視窗外執行的任何 DB2 指令 (但記憶體視窗正在執行時) 應該傳回 1042。 例如: db2win db2start <== OK db2 connect to db <==SQL1042 db2stop <==SQL1042 db2win db2stop <== OK * DB2 EEE 環境 o 修補程式:Extension Software 12/98 及 PHKL_17795。 o 必須對案例設定 $DB2INSTANCE 變數。 o DB2_ENABLE_MEM_WINDOWS 登錄變數必須設定為 TRUE。 o 您在記憶體視窗下所執行的每一個案例的每一個邏輯節點,在 /etc/services.window 檔案中都有登錄。 每一個登錄的第一欄將成為與 埠號連接的案例名稱。例如: === $HOME/sqllib/db2nodes.cfg for db2instance1 === 5 host1 0 7 host1 1 9 host2 0 === $HOME/sqllib/db2nodes.cfg for db2instance2 === 1 host1 0 2 host2 0 3 host2 1 === /etc/services.window on host1 === db2instance10 50 db2instance11 55 db2instance20 60 === /etc/services.window on host2 === db2instance10 30 db2instance20 32 db2instance21 34 o 您不能用 db2win 作 DB2 指令的開頭,它只適用在 EE 環境下。 ------------------------------------------------------------------------ 46.7 解除安裝 DB2 DFS 從屬站啟動程式 解除安裝 DB2 DFS 從屬站啟動程式之前,root 應該確定 DFS 檔案不在使用中, 而 且沒有使用者在 DFS 檔案空間開啟 Shell。 以 root 身分發出下列指令: stop.dfs dfs_cl 檢查 /... 不再被裝載: mount | grep -i dfs 如果沒有這樣做,DB2 DFS 從屬站啟動程式解除安裝時,該機器需要重新啟動。 ------------------------------------------------------------------------ 46.8 Windows NT 從屬站身分驗證 Windows NT 的環境下,新的 DB2 登錄變數 DB2DOMAINLIST 與現存的從屬站身分驗證 機制相結合。Windows NT 伺服器的 DB2 可使用此變數定義一個或多個 Windows NT 網域。只有定義於此列示中的網域使用者的連線或連接要求才會被接受。 只有在單純的 Windows NT 網域環境下執行 DB2 伺服器和從屬站版本 7 的情況下, 才可使用此登錄變數。 有關此登錄變數的設定,請參考 Administration Guide: Performance 內的「DB2 Registry and Environment Variables」部份。 ------------------------------------------------------------------------ 46.9 聯合系統的限制 下列是適用於聯合系統的限制: * 包含暱名的查詢不支援 Oracle 資料類型 NCHAR、NVARCHAR2、NCLOB 及 BFILE。 * 「控制中心」不支援「建立伺服器選項」、「變更伺服器選項」及「捨棄伺服器 選項」指令。若要發出以上任一指令,必須使用命令行處理器 (CLP)。 * 針對包含暱名的查詢,DB2 UDB 不是永遠遵照 DFT_SQLMATHWARN 資料庫的架構 選項。反之,DB2 UDB 直接從遠端資料來源傳回運算表示式錯誤或警告,而忽略 DFT_SQLMATHWARN 設定。 * 針對具有不區分大小寫對照順序的資料來源, CREATE SERVER 陳述式不容許 COLSEQ 伺服器選項設定為 'I'。 * 指定無效的選項時,將傳回 ALTER NICKNAME 陳述式。 * 針對 Oracle、Microsoft SQL Server 及 Sybase 資料來源,數值資料類型無法 對映到 DB2 的 BIGINT 資料類型。 依預設值,Oracle 的數字 (p,s) 資料類型 (10 <= p <= 18 而 s = 0) 會對映到 DB2 的 DECIMAL 資料類型。 ------------------------------------------------------------------------ 46.10 MPP 分割區表格的聯合限制 當您嘗試使用一個 SQL 陳述式從資料來源中選取資料, 並在 DB2 聯合伺服器上的 MPP 分割區表格中直接插入、更新或刪除資料時, 您會收到 SQL0901N 錯誤。聯合功 能性不會讓您從暱名中選取及插入 MPP 分割區表格。 一旦您引用 FixPak 4(或更新版本),即可使用這些步驟來選取資料, 並將資料插 入 MPP 分割區表格: 1. 在客戶應用程式環境中,請匯出 DB2NODE 環境變數以指定應用程式一定要連接 的節點。 EXPORT DB2NODE=x 其中 x 是節點號碼。 2. 請建立一節點群組,其中只包含指定的節點。 CREATE NODEGROUP nodegroup_name ON NODE(x) 其中 x 是節點號碼。 3. 在節點群組中建立表格空間。 CREATE TABLESPACE tablespace_name IN NODEGROUP nodegroup_name 4. 在表格空間中建立暫時表格。 CREATE TABLE temp_table_name IN tablespace_name 5. 將應用程式中的 INSERT 作業分成兩個步驟: o INSERT INTO temp_table_name SELECT * FROM nickname o INSERT INTO MPP_partitioned_table SELECT * from temp_table_name 將 INSERT 陳述式分成兩個陳述式會變更陳述式層次確定 (commit) 與 Rollback 語 意。 例如,不只要 Rollback 一個陳述式,現在您必須要 Rollback 兩個陳述式。 此外,如果您變更與 DB2NODE 環境變數相關的節點號碼, 就必須讓應用程式資料包 失效,然後重新連結。 這些步驟可以讓您從資料來源中選取資料,並將資料插入 MPP 分割區表格。當您嘗試 使用一個陳述式從資料來源中選取資料, 並更新或刪除 MPP 分割區表格中的資料 時,仍會收到 SQL0901N 錯誤。 此限制在 DB2 Universal Database 版本 8 中將會 刪除。 ------------------------------------------------------------------------ 46.11 DataJoiner 限制 「資訊型錄管理程式」元件可適用於希伯來文, 並且在 DB2 Warehouse Manager for Windows NT CD 上提供。 希伯來文的翻譯提供於 IL_ICM.ZIP 這個壓縮檔中, 位於 DB2 Warehouse Manager for Windows NT CD 的 DB2\IL 目錄裡。 若要安裝希伯來文翻譯的「資訊型錄管理程式」, 請先安裝英文版的 DB2 Warehouse Manager for Windows NT, 以及 Windows NT 希伯來文版的所有先決條件。 安裝 DB2 Warehouse Manager for Windows NT 之後, 從 DB2\IL 目錄將 IL_ICM.ZIP 檔案解壓縮到安裝 DB2 Warehouse Manager for Windows NT 的目錄上。 請確定解壓縮程式已選擇正確的選項,以在壓縮檔案裡建立目錄結構。 檔案解壓縮後,全域環境變數 LC_ALL 必須從 En_US 變更為 Iw_IL。 若要變更設 定: 1. 開啟 Windows NT 控制台,並在系統圖示上按兩下。 2. 在系統內容視窗,按一下環境標籤, 然後尋找系統變數區段中的 LC_ALL 變 數。 3. 按一下變數,以顯示數值編輯方框裡的值。將值從 En_US 變更為 Iw_IL。 4. 按一下設定按鈕。 5. 關閉系統內容視窗及控制台。 現在已安裝希伯來文版的「資訊型錄管理程式」。 ------------------------------------------------------------------------ 46.13 啟動 Windows 之後無法啟動 DB2 的 SNA SPM 若您使用 Microsoft SNA Server 版本 4 SP3 或以上的版本, 請驗證 DB2 的 SNA SPM 可在重新啟動之後正常啟動。檢查 \sqllib\<案例名稱>\db2diag.log 檔案, 以 取得類似下列所示的項目: 2000-04-20-13.18.19.958000 Instance:DB2 Node:000 PID:291(db2syscs.exe) TID:316 Appid:none common_communication sqlccspmconnmgr_APPC_init Probe:19 SPM0453C 因為 Microsoft SNA Server 未啟動,所以同步點管理程式未啟動。 2000-04-20-13.18.23.033000 Instance:DB2 Node:000 PID:291(db2syscs.exe) TID:302 Appid:none common_communication sqlccsna_start_listen Probe:14 DIA3001E 未成功啟動 "SNA SPM"。 2000-04-20-13.18.23.603000 Instance:DB2 Node:000 PID:291(db2syscs.exe) TID:316 Appid:none common_communication sqlccspmconnmgr_listener Probe:6 DIA3103E APPC 通信協定支援時發生錯誤。APPC verb "APPC(DISPLAY 1 BYTE)". 主要傳回碼 "F004"。次要傳回碼 "00000000"。 若 db2diag.log 檔裡有這些項目, 且時間戳記和您最近重新啟動的時間相符,您必 須: 1. 呼叫 db2stop。 2. 啟動 SnaServer 服務程式 (若尚未啟動)。 3. 呼叫 db2start。 再次檢查 db2diag.log 檔,以確定沒有再添加其他項目。 ------------------------------------------------------------------------ 46.14 Windows NT 及 Windows 2000 上的 DB2 服務帳戶需求 在 DB2 for Windows NT 或 Windows 2000 的安裝期間,安裝程式會建立數個 Windows 服務, 並指定每一個服務的服務帳戶。若要適當地執行 DB2,安裝程式會授 與下列使用者權利給與 DB2 服務有關聯的服務帳戶: * 作為作業系統的一部份 * 建立 token 物件 * 增加配額 * 以服務方式登入 * 更換程序層 token。 如果您要使用不同的服務帳戶供 DB2 服務使用,您必須將這些使用者權利授與服務帳 戶。 除了這些使用者權利,服務帳戶對於安裝 DB2 產品的目錄也必須有寫入的權利。 DB2 Administration Server 服務 (DB2DAS00 服務) 的服務帳戶也必須擁有啟動及停 止 其它 DB2 服務 (也就是說,服務帳戶必須隸屬於 Power Users 群組) 的權限,以 及對於 任何它所管理的 DB2 案例擁有 DB2 SYSADM 權限。 ------------------------------------------------------------------------ 46.15 需要確定所有會在資料倉儲中心(DWC)中使用的使用者定義程式 如果您要將「DB2 儲存程序建置器」所建立的儲存程序當作「資料倉儲中心(DWC)」中 的 使用者定義程式來使用,您必須插入下列陳述式到儲存程序 con.close(); 陳述式 前面: con.commit(); 如果沒有插入這個陳述式,儲存程序所做的變更會在儲存程序從 DWC 執行時被 Rollback。 對於 DWC 中所有的使用者定義程式,必須要明確地 COMMIT 任何內含的 DB2 函數, 以使變更能在資料庫中生效;也就是說,您必須將 COMMIT 陳述式 加到使用者定義程 式中。 ------------------------------------------------------------------------ 46.16 Windows NT 上的從屬站端快取 如果使用者嘗試去存取一台 Windows NT Server 機器上的 READ PERM DB 檔案, 而 在機器上是使用含有效符記的共用磁碟機來建立 DB2 資料鏈結, 檔案會如預期開 啟。然而,在此之後,使用相同符記的後續開啟要求並不會送到伺服器, 而是由從屬 站上的快取來服務。即使在符記到期之後, 使用者仍可以看到檔案的內容,因為項目 仍然在快取之中。但是, 如果檔案是在 Windows NT 工作站上,則不會發生此問題。 解決方案是在 Windows NT 伺服器上將登錄項目 \\HKEY_LOCAL_MACHINE\SYSTEM \CurrentControlSet\Services\Lanmanserver\Parameters\EnableOpLocks 設定為 0。藉由此登錄設定,每當透過共用磁碟機從從屬工作站存取伺服器上的檔案時, 要 求一定會送到伺服器,而不會由從屬站快取來服務。因此,所有要求都會重新驗證符 記。 此解決方案的負面影響是這樣會影響所有透過共用磁碟機從伺服器存取檔案的整體效 能。即使有此設定,如果檔案是透過對映到伺服器本身的共用磁碟機來存取的 (當無 法從不同的從屬站機器),結果是仍會從快取來服務要求。因此,符記過期並沒有生 效。 註: 在所有的情況下,如果檔案存取是本端存取, 而非透過共用磁碟機,符記驗證 及後續的符記過期會如預期發生。 ------------------------------------------------------------------------ 46.17 Life Sciences Data Connect 46.17.1 新外層 兩個新外層已新增至 FixPak 4 的 Life Sciences Data Connect。一個是用於 AIX 上的 Documentum, 一個是用於 Windows NT 上的 Excel。此外,表格結構的檔案外 層已從 AIX 移轉至 Windows NT、 Solaris、Linux 及 HP-UX。 FixPak 5 在 AIX 上的 BLAST 外層,已新增至 DB2 Life Sciences Data Connect。 Documentum 外層已從 AIX 移轉至 Windows NT、Windows 2000、HP-UX 和 Solaris 作業環境。 46.17.2 注意- Life Sciences Data Connect 包括 Apache Software 和 ICU 的程式碼。此程式碼是 依「現況」提供,不附帶任何明示或默示之擔保,包括商業適售性、特定用途之適用 性和不侵權等之擔保。此外,IBM 不負賠償之責。 Apache Software License, 版本 1.1 Copyright (c) 1999-2001 The Apache Software Foundation。版權所有。 ICU 1.8.1 和更新版本 Copyright (c) 1995-2001 International Business Machines Corporation 和其 它,版權所有。 ------------------------------------------------------------------------ 46.18 SQL 輔助程式的加強功能 SQL 輔助程式工具現在允許使用者為表格結合指定不同於 "=" 的結合運算子。 加強 功能的「結合類型」對話框 (在 SQL 輔助程式工具的「結合」頁上按一下「結合類 型」按鈕就能啟動該對話框), 包含結合運算子的下拉列示。 可用的運算子有 "="、"<>"、"<"、">"、"<=" 及 ">="。 SQL 輔助程式是協助使用者 建立簡式 SQL 陳述式的工具。 它可用於「命令中心」(「交談式」標籤)、「控制中 心」(「建立概略表」及「建立觸發函式」對話框)、 儲存程序建置器 (「插入 SQL 儲存程序」精靈) 及「資料倉儲中心」(SQL 處理步驟)。 ------------------------------------------------------------------------ 46.19 備份與復置指令的說明 當您鍵入 db2 ? backup 時會出現不正確的資訊。正確的輸出為: BACKUP DATABASE database-alias [USER username [USING password]] [TABLESPACE (tblspace-name [ {,tblspace-name} ... ])] [ONLINE] [INCREMENTAL [DELTA]] [USE TSM [OPEN num-sess SESSIONS]] | TO dir/dev [ {,dir/dev} ... ] | LOAD lib-name [OPEN num-sess SESSIONS]] [WITH num-buff BUFFERS] [BUFFER buffer-size] [PARALLELISM n] [WITHOUT PROMPTING] 當您鍵入 db2 ? restore 時會出現不正確的資訊。正確的輸出為: RESTORE DATABASE source-database-alias { restore-options | CONTINUE | ABORT }"; restore-options:"; [USER username [USING password]] [{TABLESPACE [ONLINE] |"; TABLESPACE (tblspace-name [ {,tblspace-name} ... ]) [ONLINE] |"; HISTORY FILE [ONLINE]}] [INCREMENTAL [ABORT]]"; [{USE TSM [OPEN num-sess SESSIONS] |"; FROM dir/dev [ {,dir/dev} ... ] | LOAD shared-lib"; [OPEN num-sess SESSIONS]}] [TAKEN AT date-time] [TO target-directory]"; [INTO target-database-alias] [NEWLOGPATH directory]"; [WITH num-buff BUFFERS] [BUFFER buffer-size]"; [DLREPORT file-name] [REPLACE EXISTING] [REDIRECT] [PARALLELISM n]"; [WITHOUT ROLLING FORWARD] [WITHOUT DATALINK] [WITHOUT PROMPTING]"; ------------------------------------------------------------------------ 46.20 "Warehouse Manager" 應為 "DB2 Warehouse Manager" 所有出現在產品螢幕和產品文件的 "Warehouse Manager" 都應讀為 "DB2 Warehouse Manager"。 ------------------------------------------------------------------------ 附錄與後記 ------------------------------------------------------------------------ 附錄 A. 注意事項 而在其它國家中,IBM 不見得有提供本書中所提的各項產品、服務或功能。 要知道在 您所在之區是否可用到這些產品與服務時,請向當地的 IBM 服務代表查詢。本書在提 及 IBM 產品、程式或服務時,不表示或暗示只能使用 IBM 的產品、程式或服務。只 要未侵犯 IBM 的智慧財產權,任何功能相當的產品、程式或服務都可以取代 IBM 的 產品、程式或服務。不過,其它非 IBM 產品、程式、或服務在運作上的評價與驗證, 其責任屬於使用者。 在這本書或文件中可能包含著 IBM 所擁有之專利或專利申請案。 本書使用者並不享 有前述專利之任何授權。 您可以用書面方式來查詢授權,來函請寄到: IBM Director of Licensing IBM Corporation North Castle Drive Armonk, NY 10504-1785 U.S.A. 若要查詢有關二位元組 (DBCS) 資訊的特許權限事宜, 請聯絡您國家的 IBM 智慧財 產部門,或者用書面方式寄到: IBM World Trade Asia Corporation Licensing 2-31 Roppongi 3-chome, Minato-ku Tokyo 106, Japan 下列段落若與該國之法律條款抵觸,即視為不適用: IBM 僅以現狀提供本書,而不提 供任何明示或默示之保證 (包括但不限於可售 性或符合特定效用的保證)。若有些地 區在某些交易上並不允許排除上述保證, 則該排除無效。 本書中可能會有技術上或排版印刷上的訛誤。因此,IBM 會定期修訂; 並將修訂後的 內容納入新版中。同時,IBM 得隨時改進並 (或) 變動本書中所提及的產品及 (或) 程式。 本書對於非 IBM 網站的援引只是為了方便而提供,並不對這些網站作任何認可。該些 網站上的內容並非本 IBM 產品內容的一部份,用戶使用該網站時應自行承擔風險。 當您提供資訊給 IBM 時,您即授權予 IBM 以其認為適當的方式來使用或分送資訊, 而不必對您負起任何責任。 本程式之獲授權者若希望取得相關資料, 以便使用下列資訊者可洽詢 IBM。 其下列 資訊指的是: (1) 獨立建立的程式與其它程式 (包括此程式) 之間更換資訊的方式 (2) 相互使用已交換之資訊方法。 若有任何問題請聯絡: IBM Canada Limited Office of the Lab Director 1150 Eglinton Ave. East North York, Ontario M3C 1H7 CANADA 上述資料的取得有其特殊要件,在某些情況下必須付費方得使用。 本書所描述的任何程式及其所有可用的授權著作是由 IBM 所提供,並受到「IBM 客戶 合約」、「國際程式授權合約」或雙方之間任何同等合約條款之規範。 此間所含之任何效能資料,皆是得自控制的環境之下;因此不同作業環境之下所得的 結果,可能會有很大的差異。部份測量可能是在開發中的系統上執行,因此不保證可 以從一般的系統獲致相同的結果。 甚至有部份的測量,是利用插補法而得的估計值, 其實際結果可能會有所不同。本書的使用者應根據其特有的環境,驗證出適用的資 料。 本書所提及之非 IBM 產品資訊,係一由產品的供應商,或其出版的聲明或其它 公開 管道取得。IBM 並未測試過這些產品,也無法確認這些非 IBM 產品的執行效能、 相 容性、或任何對產品的其它主張是否完全無誤。 如果您對非 IBM 產品的性能有任何 的疑問,請逕向該產品的供應商查詢。 有關 IBM 未來動向的任何陳述,僅代表 IBM 的目標而已,並可能於未事先聲明的情 況下有所變動或撤回。 本書中含有日常商業活動所用的資料及報告範例。為了提供完整的說明, 這些範例包 括個人、公司、廠牌和產品的名稱。這些名稱全屬虛構, 若與任何公司的名稱和住址 雷同,純屬巧合。 著作權授權: 本書包含原始語言的範例應用程式,用以說明各種作業平台上的程式設計技術。您可 以基於研發、使用、銷售或散佈符合作業平台 (用於執行所撰寫的範例程式) 之應用 程式設計介面的應用程式等目 的,以任何形式複製、修改及散佈這些範例程式,而無 需付費給 IBM。但這些範例皆未經過完整的測試。 因此,IBM 不會保證或暗示這些程 式的穩定性、服務能力或功能。 這些範例程式或是任何衍生著作的每一份拷貝或任何部份,都必須具有下列的著作權 聲明: (c) (your company name) (year). Portions of this code are derived from IBM Corp. Sample Programs. (c) Copyright IBM Corp. _enter the year or years_. All rights reserved. ------------------------------------------------------------------------ A.1 商標 下列術語 (以星號 (*) 標示) 是 IBM 公司在美國、其它國家或兩者的商標。 ACF/VTAM IBM AISPO IMS AIX IMS/ESA AIX/6000 LAN DistanceMVS AIXwindows MVS/ESA AnyNet MVS/XA APPN Net.Data AS/400 OS/2OS/390 BookManager OS/400 CICS PowerPC C Set++ QBIC C/370 QMF DATABASE 2 RACF DataHub RISC System/6000 DataJoiner RS/6000 DataPropagator S/370 DataRefresher SP DB2 SQL/DS DB2 Connect SQL/400 DB2 Extenders System/370 DB2 OLAP Server System/390 DB2 Universal Database SystemView Distributed Relational VisualAge Database Architecture VM/ESA DRDA VSE/ESA eNetwork VTAM Extended Services WebExplorer FFST WIN-OS/2 First Failure Support Technology 下列術語是其它公司的商標或註冊商標: Microsoft、Windows、Windows NT 是微軟公司的商標或註冊商標。 Java 以及所有與 Java 有關的商標與標章,以及 Solaris 是 Sun Microsystems, Inc. 在美國、其它國家或兩者的商標。 Tivoli 與 NetView 是 Tivoli Systems Inc. 在美國、其它國家或兩者的商標。 UNIX 是 X/Open Company Limited 在美國、其它國家或兩者的註冊商標,須經該公司 授權始可使用。 其它公司、產品或服務名稱 (以兩顆星號 (*) 標示) 可能是其它公司的商標或服務標 誌。 ------------------------------------------------------------------------ 索引 三劃 四劃 六劃 七劃 八劃 九劃 十劃 十一劃 十二劃 十三劃 十四劃 十五劃 十六劃 十七劃 十八劃 A B C D E F G H I J L M N O P Q R S T U V W X ------------------------------------------------------------------------ 三劃 * 工具 o 在 Linux 上使用 (849) 四劃 * 中文 o 顯示在 Linux 上的限制 (680) * 日文 o 顯示在 Linux 上的限制 (679) o Linux 上的語言環境設定 (674) 六劃 * 多位置更新測試連接 o 案例版本不相容 (862) * 安裝 o 必要的服務帳戶於 Windows (1023) o 在使用可移除式磁碟機時中斷 (707) o 停止 DB2 程序於 (712) * 安裝先決條件 o 適用 UDB EE 及 CEE 於 Linux/390 (717) * 安裝錯誤 o AIX (719) 七劃 * 快速導覽 (883) * 快速鍵 o 問題 (858) * 抄寫 o 表格及直欄名稱的限制 (822) o 非 IBM 伺服器 (820) o 問題判斷 (827) o 規劃 (825) o 實務範例 (821) o 隨處更新(update-anywhere)先決條件 (826) o DATALINK (823) * 抄寫分析程式 (828) * 更新的書籍 o 訊息參考手冊 (666) o 資料倉儲中心管理手冊 (665) o 應用程式開發手冊 (660) o Administration Guide (661) o Application Development Guide (662) o Command Reference (663) o Data Recovery and High Availability Guide and Reference (664) o DB2 Warehouse Manager 安裝手冊 (667) o SQL reference (668) * 步驟 o 排程 (891) * 身分驗證 o 使用 DB2DOMAINLIST 依據網域 (1018) 八劃 * 使用者設定檔 o 變更節點狀態 (900) * 協助工具 o 快速鍵 (856) * 協助工具特性 (1009) * 表格結構 (831) 九劃 * 建立資料庫精靈 o 設定擴充大小 (877) * 查詢結果, 檢視 (873) * 紅旗 Linux o 簡體中文語言環境 (671) * 限制 o SAP Connector (895) 十劃 * 修補層次 o 於 Solaris 版本 2.6 (702) * 記憶體視窗 o 於 HP-UX 11 (1013) * 訊息 o 擷取程式和引用程式 (832) 十一劃 * 從屬站 o 下載 (700) * 控制中心 o 工具設定筆記本 (870) o 用來管理 VM 及 VSE 資料庫 (851) o 並行 Applet 的限制 (871) o 使用 Internet Explorer 的錯誤 (685) o 使用日文 (677) o 使用簡體中文 (676) o 於 OS/390 平台 (863) o 無法運作 (687) o 疑難排解 (865) o 雙向支援 + 於 Windows NT (852) o OS/2 上的 Infopop 顯示問題 (867) o OS/390 必要的修正程式 (864) o UNIX 平台上的疑難排解 (866) o Version 6, using to administer satellite environment (803) o Windows 95 上的 Script 中心問題 (872) * 排程 o 步驟與程序 (889) o 重複 (890) * 移轉 o 於 Windows 2000 (704) o 執行 db2iupdt 來更新案例 (715) o 發生錯誤於 (722) o 概略表的問題 (708) 十二劃 * 備份 o 當 LOGRETAIN=CAPTURE 時 (807) * 備份方法 o 針對 Data Links Manager (812) * 復置 o 當 LOGRETAIN=CAPTURE 時 (808) o DATALINK 直欄的問題 (725) * 復置檔案 o Data Links Manager (728) * 無效的捷徑錯誤 (854) * 登記變數 o DB2DOMAINLIST (1017) * 程序 o 排程 (892), (893) * 程序,安裝前停止 (713) 十三劃 * 搜尋線上資訊 o 於 Solaris 作業系統 (691) * 概略表 o 移轉後無法使用 (709) * 解除安裝 o DB2 DFS 從屬站啟動程式 (1015) * 資料倉儲中心 o 使用儲存程序 (1024) o 標示語言檔 (888) o 鍵定義 (887) * 資訊型錄管理程式 o 公用程式 (897) o 適用於希伯來文 (1021) 十四劃 * 精靈 o 建立資料庫 (878) o MQSeries 輔助 (880) o OLE DB 輔助 (882) * 語言支援 o SAP Connector (896) * 語言環境 o 紅旗 Linux 上的簡體中文 (670) o Linux 上的日文及簡體中文 (672) * 遠端從屬站存取 o 架構 Communication Server for NT (706) 十五劃 * 標示語言檔 o 鍵定義 (886) * 熱鍵 o 問題 (857) * 範例內容, 檢視 (874) * 線上資訊 o 搜尋 + 於 Solaris 作業系統 (693) * Satellite Administration Center o Version 6, using to administer satellite environment (804) 十六劃 * 錯誤,安裝 o AIX (718) * 錯誤訊息 o 找不到連結檔案 (1010) o 移轉期間 (721) o 無效的捷徑 (855) o 檔案拒絕存取 (861) o SQL10012N (869) 十七劃 * 儲存程序 o 於資料倉儲中心 (1025) * 檔案拒絕存取錯誤 (860) * 環境變數 o LD_ASSUME_KERNAL (847) * 繁體中文 o 顯示在 Linux 上的限制 (682) * 聯合系統 o 外層 (729) o 限制 (731) o 暱名 (730) * 聯合系統的限制 (1019) * 鍵定義 o 描述資料匯入/匯出 (885) * 韓語 o 顯示在 Linux 上的限制 (683) 十八劃 * 擴充大小 o 建立資料庫精靈中的設定 (876) * 擷取程式和引用程式 o 於 AS/400 (830) o 從應用程式內啟動 (834) o 錯誤訊息 (833) * 簡體中文 o 顯示在 Linux 上的限制 (681) o Linux 上的語言環境設定 (675) * 雙向語言支援 o 使用 Windows NT 上的控制中心 (853) * 雙位元組字集 (DBCS) o 顯示 Linux 上的限制 (684) A * Adobe Acrobat Reader o 使用非英文語言環境來存取 (698) * ADT transforms (910) * AIX o 安裝錯誤 (720) * AIX 4.3.3 o AutoLoader hanging after a fork (817) * AS/400 o 擷取程式和引用程式 (829) * assigning strings to columns, rules for (984) * assignments o strings, basic rules for (982) * AutoLoader o hanging during fork (816) B * binding database utilities using Run-Time Client (907) * buffer pool blocking (756) o examples (763) * buffer pool IDs (762) * buffer pools o block-based (758) o contiguous pages (761) o page-based (757) C * CAPTURE(LOGRETAIN 設定) o 備份與復置行為 (809) * character conversion o rules for operations combining strings (985) o rules when comparing strings (987) * character string o assignment, overview (981) * CLI o advantages of (911) o configuration keywords + CURRENTFUNCTIONPATH (937) + SKIPTRACE (938) o stored procedures + multiple result sets (912) o writing a Unicode application (913) * CLI functions o SQLBindFileToParam (940) o SQLColAttribute (941) o SQLGetInfo (944) o SQLGetLength (946) o SQLNextResult (949) o SQLSetStmtAttr (951) * CLI stored procedures o autobinding (936) o limitations (935) * clients o three-tier environment (918) * CLOB data o MQSeries functions (978) * clone databases o creating (778) * column o string assignment, basic rules for (983) * compound SQL, using (933) * concatenation o operator (991) * connections o increasing data transfer rates (1008) * conversion rules o for operations combining strings (986) o for string comparisons (988) * copy 常駐程式 (723) * crash recovery o using db2inidb tool (776) * CREATE PROCEDURE statement o GET DIAGNOSTICS statement (997) * cursors o attributes, default (922) o concurrency (926) o keyset-driven + updating (929) o scrollable (927) + keyset-driven (917) + OS/390 (914) + server-side (915) + static (916) + troubleshooting applications (932) o sensitivity (924) o type (923) o updatable (925) o values concurrency (930) D * Data Link Manager o 備份方法 (813) * Data Links Manager o 復置檔案時的問題 (727) * Data Movement o limits of Unicode clients (818) * data transfer rates o increasing (1007) * data types o promotion in a Unicode database (980) * Database Movement Tool (814) * DataJoiner o 限制 (1020) * DATALINK o 抄寫 (824) o 復置時發生問題 (724) * DAYOFWEEK_ISO scalar function (957) * DB2 control server o minimum requirements (791) o response file installation (792) o Version 6, upgrading (802) * DB2 Enterprise Edition o setting up as satellite (783) + prerequisites (790) o Version 6, using as DB2 control server (801) * DB2 Personal Edition o setting up as satellite (782) + prerequisites (789) * DB2 Relational Connect o 在 Unix 上安裝 (733) o 在 Windows NT 上安裝 (732) * DB2 Server for VM & VSE o 從控制中心管理資料庫 (850) * db2ArchiveLog (906) * db2inidb tool (773) * db2iupdt 指令,升級 DB2 後執行 (714) * db2move (815) * db2start o on Windows 95, 98 and ME (835) * DB2_BLOCK_BASED_BP (766) * DB2_NEWLOGPATH (769) * DB2_NEWLOGPATH2 (770) o 之前為 NEWLOGPATH2 (811) * DB2_PARALLEL_IO (755) * DB2_REDUCED_OPTIMIZATION (772) * DB2_ROLLFORWARD_NORETRIEVE * deadlocks (837) * DFS 從屬站啟動程式 o 解除安裝 (1016) * dlfm client_conf o 失敗理由 (726) * DWC7906,訊息已更新 (884) E * enable_MQFunctions (843), (845) * error messages o when adding nodes to partitioned databases (765) * expression o concatenation operator (989) o string (990) F * functions o in a Unicode database (995) o scalar + MQPUBLISH (960) + MQREADCLOB (963) + MQRECEIVECLOB (966) + MQSEND (969) o table + MQREADALLCLOB (972) + MQRECEIVEALLCLOB (975) G * gateways o three-tier environment (919) * GET DIAGNOSTICS statement (998) * GET ROUTINE (806) * GET_ROUTINE_SAR (1002) * GUI 工具 o 連結錯誤 (1011) H * high availability (775) * HP-UX o no support for Query Enabler (904) * HP-UX 11 o 記憶體視窗 (1014) I * Internet Explorer o 使用控制中心的錯誤 (686) * IPX/SPX 通信協定支援,於 Windows 2000 (711) J * JDBC o scrollable cursors, accessing (921) * JDBC/ODBC/CLI static profiling, limitations (908) * JDK 1.1 o 安裝路徑 (868) L * Linux o 日文及簡體中文的語言環境設定 (673) o 在雙位元組字集上的限制 (678) o 執行 DB2 UBD 管理工具 (848) o 設定控制中心環境 (716) * lock waits (838) * locking, optimistic (931) M * Microsoft SQL Server 資料來源 o 字碼頁 (751) o 增進效能 (747) o 環境變數 (745) o 鏈結至 DB2 (746) o DSN 名稱 (749) o MERANT 外層 (748) o MERANT 檔案庫 (744) o ODBC 追蹤 (750) o ODBC 驅動程式 (743) * MQ 函數 (844), (846) * MQPUBLISH function o detailed description (961) o values and arguments (962) * MQREADALLCLOB function o detailed description (973) o values and arguments (974) * MQREADCLOB function o detailed description (964) o values and arguments (965) * MQRECEIVEALLCLOB function o detailed description (976) o values and arguments (977) * MQRECEIVECLOB function o detailed description (967) o values and arguments (968) * MQSEND function o detailed description (970) o values and arguments (971) * MQSeries functions o CLOB data support (979) * MQSeries 輔助精靈 (879) N * NetQuestion o 使用 OS/2 上的 TCP/IP (694) * Netscape o 用來存取線上資訊 (689) o 錯誤訊息 (697), (875) * NEWLOGPATH2 o 現在稱為 DB2_NEWLOGPATH2 (810) * next key locking (839) * NLV 支援 o Unicode (1004) * NUMA-Q o no support for Query Enabler or Tracker (905) O * ODBC o fetch orientations (928) o scrollable cursors, accessing (920) * ODBC Unicode applications (953) * OLE DB 輔助精靈 (881) * operand o string (993) * Oracle 資料來源 o 環境變數 (736) o Linux 外層 (735) o Solaris 外層 (734) * OS/2 o 安裝控制中心 (859) o NetQuestion (695) P * partitioned databases o errors when adding nodes (764) * PDF 檔案 o 使用非英文語言環境來存取 (699) * performace o on paid (754) Q * Query Enabler o unsupported on HP-UX and NUMA-Q (903) * Query Patroller o loss of user privileges after migration (901) * Query Patroller Tracker o unsupported on NUMA-Q (902) R * raid o optimizing for (752) * registry variables o DB2_NEWLOGPATH (767) o DB2_REDUCED_OPTIMIZATION (771) o DB2_ROLLFORWARD_NORETRIEVE (768) * response file installation o DB2 control server keywords (793) o satellite-specific keywords (798) * RESULT_STATUS o GET DIAGNOSTICS statement (999) * ROW_COUNT o GET DIAGNOSTICS statement (1000) S * SAP Connector o 安裝 (894) * satellite environment o administering with Version 6 Satellite Administration Center (805) o DB2 Personal Edition satellite (786) o DB2 Workgroup Edition satellite (787) o installation considerations (794) o interactive installation of satellite (800) o prerequisites (788) o response file installation of satellite (797) * satellites o DB2 Personal Edition (784) o DB2 Workgroup Edition (785) o installation considerations (795) o interactive installation (799) o response file installation (796) * scalar functions o DAYOFWEEK_ISO (955) o WEEK_ISO (956) * scattered read (759) * Search 探索 (1012) * SNA Server o 從主電腦或 AS/400 應用程式存取 UDB。 (705) * SNA SPM o 於重新啟動之後啟動驗證 (1022) * Solaris o 不支援 UltraSparc 之前的版本 (669) o V2.6 所需的修補層次 (701) * Solaris 作業系統 o 64 位元 + 架構 (840) + 限制 (841) * Solaris 作業環境 o 搜尋線上資訊於 (692) * split mirror o as a backup image (780) o as a standby database (779) o as the primary database (781) * split mirror handling o online (777) * SQL procedure o GET DIAGNOSTICS statement (1001) * SQL, compound (934) * SQL2554N (959) * SQLBindFileToParam CLI function, correction (939) * SQLColAttribute function o SQL_DESC_AUTO_UNIQUE_VALUE (942) o SQL_DESC_UPDATABLE (943) * SQLGetInfo function (945) * SQLGetLength function o DBCLOB (947) * SQLNextResult function (948) * SQLSetEnvAttr function o SQL_ATTR_KEEPCTX attribute (950) * SQLSetStmtAttr function o SQL_ATTR_QUERY_TIMEOUT attribute (952) * starting DB2 o using db2start on Windows 95, 98 and ME (836) * static profiling, in JDBC/ODBC/CLI applications (909) * string o expression (992) o operand (994) * suspended I/O function o supporting continuous availability (774) * Sybase o 在 Windows 上與 ICM 不相容 (898) * Sybase Open Client (738) * Sybase 資料來源 (737) o 字碼頁 (742) o 增進效能 (741) o 環境變數 (739) o 鏈結至 DB2 (740) T * table space o on raid (753) * TCP/IP o NetQuestion (696) * transfer rates o increasing (1006) U * Unicode o 文件更新 (1005) o 資料庫及應用程式 (1003) o functions in (996) o in ODBC applications (954) * Unicode clients o data movement limitations (819) V * vectored I/O (760) W * Web 瀏覽器 o 建議 - Windows 2000 (688) * WEEK_ISO scalar function (958) * Windows o Sybase 及 ICM 間的不相容 (899) * Windows 2000 o 建議的 Web 瀏覽器 (690) o 移轉於 (703) o IPXX/SPX 通信協定支援 (710) X * XML extender o release notes (842) 1 A Service Policy defines a set of quality of service options that should be applied to this messaging operation. These options include message priority and message persistence. See the MQSeries Application Messaging Interface manual for further details.