DB2 Accessing tables across libraries

Source: Internet
Author: User
Tags wrapper

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.