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 are 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.
Dig Deeper on IBM DB2 management
Related Q&A from Craig S. Mullins
Our expert suggests that the best way to pass the SAP BW exam is to have hands-on job experience. But that's not all he has to say about ... Continue Reading
To export data from a DB2 table to a flat file, you need to run an export specifying the proper file format. The export utility exports data from a ... Continue Reading
Craig Mullins recommends two specific resources for learning how to create and support Binary Large Objects (BLOB) in DB2. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.