I'm going to talk to you today. How is DB2 cross-database access table implemented? Because it took me a long time to test success, so decided to share with you!
All right, no more nonsense! Let's get to the point, first you install the DB2 database, and then, in the Start menu, find the following location:
After opening, enter
Db2
Enter DB2 edit mode as follows:
The following sequence of commands executes:
// Open Database Federated query
Db2stop Force;
// Restart the database before you can take effect
Next, you need to connect to a specific database, for example, if you have a library and B library, now you want to access the B library in a library table, then the connection is a library
Connect to [database name] User [user name] using [password]
At this point the [database name] is a library.
Sequentially execute the following command:
// Create Drda Wrapper (WRAPPER)
// creating Servers (server)
Here, we name the database server alias: B, which will be used behind.
for // Create user Mappings
Here, the database server alias should be: B, corresponding to the above.
for //
Here the database server alias corresponds to: B.
At this point, you can access the Student table in the B library in a library like this: SELECT * from Nk_student.
This article is reproduced from
Needy's Blog
Thank you so much!
One copy of the attached website:
http://blog.sina.com.cn/s/blog_45fd882f0100u6p2.html
Interested students, you can go to visit!
DB2 Accessing tables across libraries