DB2 Federated Systems Guide Step 6: Create the Nicknames for Tables Chapter 11
Total Page:16
File Type:pdf, Size:1020Kb
® ™ IBM DB2 Universal Database Federated Systems Guide Ve r s i o n 8 GC27-1224-00 ® ™ IBM DB2 Universal Database Federated Systems Guide Ve r s i o n 8 GC27-1224-00 Before using this information and the product it supports, be sure to read the general information under Notices. This document contains proprietary information of IBM. It is provided under a license agreement and is protected by copyright law. The information contained in this publication does not include any product warranties, and any statements provided in this manual should not be interpreted as such. You can order IBM publications online or through your local IBM representative. v To order publications online, go to the IBM Publications Center at www.ibm.com/shop/publications/order v To find your local IBM representative, go to the IBM Directory of Worldwide Contacts at www.ibm.com/planetwide To order DB2 publications from DB2 Marketing and Sales in the United States or Canada, call 1-800-IBM-4YOU (426-4968). When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © Copyright International Business Machines Corporation 1998 - 2002. All rights reserved. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Figures .............ix Application programs ........30 Tables ..............xi Chapter 2. Business Solutions with federated systems .........31 About this book ..........xiii Leverage the federated functionality to solve Who should read this book.......xiv your business needs .........31 Conventions and terminology used in this Replication with a federated system ....31 book ..............xiv Spatial analysis with a federated system . 32 Prerequisite and related information ....xv Retail site selection.........33 How to send your comments ......xv Insurance risk assessment ......33 What’s new about federated systems in DB2 Targeted marketing campaigns .....33 Version 8?.............xv Using DB2 Spatial Extender with a federated system .........34 Part 1. Introduction to federated Data warehousing with a federated system . 34 systems and concepts ......1 Part 2. Planning, setting up, and Chapter 1. Overviewof a federated system 3 configuring a federated system . 37 Federated systems ..........3 Data sources ............5 Chapter 3. Setting up the federated server The federated database.........7 and database ...........39 The SQL Compiler and the query optimizer . 8 Fast track to setting up your server and Compensation............9 database .............39 Pass-through sessions .........11 Setting up the server to access DB2 family Wrappers and wrapper modules .....12 data sources ............44 Server definitions and server options....14 Setting up the server to access Informix data User mappings and user options .....15 sources..............47 Nicknames and data source objects ....16 Setting up the server to access Oracle data Column options...........17 sources..............50 Data type mappings .........18 Setting up the server to access Sybase data Function mappings and function templates . 20 sources..............54 Function mappings options .......22 Setting up the server to access Microsoft SQL Index specifications .........22 Server data sources .........57 DB2 Relational Connect ........23 Setting up the server to access ODBC data About the other IBM Connect products . 24 sources..............62 DB2 Relational Connect and the other Setting up the server to access OLE DB data Connect products .........24 sources..............65 Using Life Sciences Data Connect with Checking the federated server setup ....67 DB2 Relational Connect .......26 Checking the federated server setup—details 68 Overview of the tasks to set up a federated Checking the data source environment system ..............26 variables ............68 How you interact with a federated system . 29 Confirming the link between DB2 and the DB2 command line processor (CLP) . 29 data source client libraries (UNIX) . 75 DB2 Command Center .......29 Checking the wrapper library file DB2 Control Center ........30 permissions (UNIX) ........80 © Copyright IBM Corp. 1998 - 2002 iii Checking the FEDERATED parameter . 81 Adding Informix data sources to a federated Creating the federated database .....82 server ..............117 Obtaining updates for DB2 and Relational Step 1: Set up and test the client Connect .............83 configuration file .........118 Step 2: Create the wrapper ......119 Chapter 4. Overviewof configuring access Step 3: Create the server definition . 120 to data sources ..........85 Step 4: Create the user mappings . 122 Fast track to configuring your data sources . 85 Step 5: Test the connection to the Informix Prepare the federated database......86 server.............123 Create the wrapper .........88 Step 6: Create the nicknames for tables, Supply the server definition.......91 views, and synonyms .......123 Additional server options ......93 Tuning and troubleshooting the Create the user mappings and test the configuration to Informix .......125 connection to the data source ......94 Improving performance by setting the Create nicknames for each data source object 96 FOLD_ID and FOLD_PW server options . 125 Including column options when you create Improving performance by setting the a nickname ...........97 DB2_DJ_COMM environment variable Creating a nickname on a nickname . 98 (UNIX)............126 Optional configuration steps ......98 About optional configuration steps ....99 Chapter 7. Configuring access to Oracle Specify data source object indexes....99 data sources ...........127 Define alternative data type mappings to Adding Oracle data sources to a federated the federated database .......101 server..............127 Define alternative function mappings to Step 1: Set up and test a client the federated database .......103 configuration file .........128 Troubleshoot the data source configuration 105 Step 2: Create the wrapper......129 Step 3: Create the server definition . 130 Chapter 5. Configuring access to DB2 Step 4: Create the user mappings . 132 family data sources ........107 Step 5: Test the connection to the Oracle Adding DB2 family data sources to a server.............133 federated server ..........107 Step 6: Create the nicknames for tables Step 1: Catalog a node entry in the and views ...........133 federated node directory ......108 Tuning and troubleshooting the Step 2: Catalog the remote database in the configuration to Oracle data sources . 135 federated system database directory . 109 Improving performance by setting the Step 3: Create the wrapper......109 DB2_DJ_COMM environment variable Step 4: Create the server definition . 110 (UNIX)............135 Step 5: Create the user mappings . 112 Connectivity problems .......135 Step 6: Test the connection to the data source server ..........112 Chapter 8. Configuring access to Sybase Step 7: Create the nicknames for the data sources ...........137 tables and views .........113 Adding Sybase data sources to a federated Tuning and troubleshooting the server..............137 configuration to DB2 family data sources . 115 Step 1: Set up and test the client Improving performance by setting the configuration file .........138 DB2_DJ_COMM environment variable Step 2: Create the wrapper......139 (UNIX)............115 Step 3: Create the server definition . 140 Step 4: Create the user mappings . 142 Chapter 6. Configuring access to Informix Step 5: Test the connection to the Sybase data sources ...........117 server.............143 iv DB2 Federated Systems Guide Step 6: Create the nicknames for tables Chapter 11. Configuring access to OLE and views ...........143 DB data sources .........167 Tuning and troubleshooting the Adding OLE DB data sources to a federated configuration to Sybase data sources . 145 server..............167 Improving performance by setting the Step 1: Create the wrapper......168 DB2_DJ_COMM environment variable Step 2: Create the server definition . 168 (UNIX)............145 Step 3: Create the user mappings . 169 Using CTLIB instead of DBLIB ....146 Registering a user-defined OLE DB external Resolving the sp_helpindex error . 146 table function ...........170 Chapter 9. Configuring access to Part 3. Using, administering, and Microsoft SQL Server data sources . 147 programming the federated Adding Microsoft SQL Server data sources to a federated server .........147 system ............173 Step 1: Prepare the federated server and database ............148 Chapter 12. Working with the federated Step 2: Create the wrapper......149 system .............175 Step 3: Create the server definition . 150 Working with nicknames .......175 Step 4: Create the user mappings . 152 Working with nicknames—details ....176 Step 5: Test the connection to the The SQL statements you can use with Microsoft SQL Server remote server. 153 nicknames ...........176 Step 6: Create the nicknames for tables Accessing new data source objects . 180 and views ...........153 Accessing data sources using PASSTHRU 181 Tuning and troubleshooting the Accessing heterogeneous data through configuration to Microsoft SQL Server data federated views .........182 sources .............155 Transaction support in a federated system 183 Improving performance by setting the Selecting data in a federated system . 188 DB2_DJ_COMM environment variable Modifying data in a federated system . 191 (UNIX)............155 Inserting data into