Problem solve Get help with specific problems with your technologies, process and projects.

Accessing tables from another DB2 subsystem

Learn how using distributed access and DB2 data sharing can help you access tables from another DB2 subsystem.

I need to access tables (only SELECT) in my Production DB2, but I don't want to run long queries in it. Can I access tablespaces from another DB2 in the same CPU (in read-only mode)?

The short answer to your question, is "no you cannot, not without some additional configuration and/or programming." The long answer to you question is that there are two ways to access tables from another DB2 subsystem. One method is to use distributed access. With distributed access you will need to code your programs to connect to the other subsystem and then access the data. Before attempting to do this, make sure you talk to your systems programmer or DBA to verify that your shop is set up to enable distributed data.

The second approach is to use DB2 data sharing. This requires a parallel sysplex and a significant amount of configuration of your system as well. So, please talk to your systems programmer or DBA to see if data sharing is a possibility. With data sharing, you will not need to code extra logic to access data across the DB2 subsystems participating in the data sharing group.

If neither of these approaches is viable at your shop, consider setting up duplicate tables on the DB2 subsystem you do have access to, and then use an extract and load process to synchronize data between the source tables and your target tables. To elegantly accomplish this, though, you might need to purchase ETL (Extract Transform Load) software - although you can set up a rudimentary version using the DB2 UNLOAD and LOAD utilities.

Good luck.

Dig Deeper on IBM DB2 management

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.