DB2 database is one of the key projects supported by IBM and is widely used. The following describes how to use DB2 joint database for your reference.
You can use an SQL statement to query data from multiple data sources using the DB2 federated database. What's amazing is that these data sources can be varied: Multiple relational database systems, non-relational database systems, such as Microsoft Excel and xml. This article will first discuss the joint access between multiple relational databases.
We recommend that you first configure a simple apsaradb instance to cultivate your sense of accomplishment. This will increase your confidence in the concepts and a wide range of Parameter options designed for apsaradb. I have always liked this article style, and I believe many people will also like it.
To perform the following experiment, you must first install DB2 v8.2 ESE (Enterprise Server Edition) for Windows. DB2 installation is not covered in this article.
If your DB2 has been installed, start.
1) users who use windows Administrator permissions log on to windows. The author uses Administrator.
2) in order to complete the following demonstration, you also need another windows user, which is automatically created by the author when installing DB2. You can also use other windows users.
3) Make sure that you have created at least one available instance. The author uses the default DB2 instance. You can start this instance by running the DB2START command in the Command window.
4) Run DB2 get dbm cfg in the DB2 command window to view the configuration parameters of the current instance and ensure that the FEDERATED parameter is set to YES, you can set this parameter by running DB2 update dbm cfg using federated yes. After this parameter is modified, you must restart the instance to make the DB2STOP/DB2START take effect)
5) You have created the DB2 SAMPLE Database SAMPLE. If you have not created the SAMPLE database, you can create it by running the db2sampl command in the DB2 command line window. This sample database contains some sample tables and data. Using this database for demonstration can save us some time.
6) create another database. The author uses the name TESTDB:
DB2 CREATE DB TESTDB