1
0
mirror of synced 2025-12-30 03:02:21 -05:00
Files
airbyte/docs/integrations/sources/db2.md
Liren Tu 888347a0d0 🎉 JDBC sources: store cursor record count in db state (#15535)
* Add cursor_record_count to db stream state

* Add cursor record count to cursor info

* Emit max cursor record count

* Add original cursor record count

* Unify logging format

* Add backward compatible methods

* Update unit tests for state decorating iterator

* Update test (not done yet)

* Fix one more unit test

* Change where clause operator according to record count

* Add branch for null cursor

* Skip saving record count when it is 0

* Fix log wording

* Set mock record count in test

* Check cursor value instead of cursor info

* Fix source jdbc test

* Read record count from state

* Fix tests

* Add an acceptance test case

* Fix npe

* Change record count from int to long to avoid type conversion

* Fix references

* Fix oracle container

* Use uppercase for snowflake

* Use uppercase for db2

* Fix and use uppercase

* Update test case to include the edge case

* Format code

* Remove extra assertion in clickhouse

* Merge ms sql incremental query method

* Log query for debugging

* Clean up name_and_timestamp table

* Fix db2 tests

* Fix mssql tests

* Fix oracle tests

* Fix oracle tests

* Fix cockroachdb tests

* Fix snowflake tests

* Add changelog

* Fix mssql tests

* Fix db2-strict-encrypt tests

* Fix oracle-strict-encrypt tests

* Bump postgres version

* Fix oracle-strict-encrypt tests

* auto-bump connector version [ci skip]

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
2022-10-14 01:09:12 -07:00

5.0 KiB

Db2

Overview

The IBM Db2 source allows you to sync data from Db2. It supports both Full Refresh and Incremental syncs. You can choose if this connector will copy only the new or updated data, or all rows in the tables and columns you set up for replication, every time a sync is run.

This IBM Db2 source connector is built on top of the IBM Data Server Driver for JDBC and SQLJ. It is a pure-Java driver (Type 4) that supports the JDBC 4 specification as described in IBM Db2 documentation.

Resulting schema

The IBM Db2 source does not alter the schema present in your warehouse. Depending on the destination connected to this source, however, the result schema may be altered. See the destination's documentation for more details.

Features

Feature Supported?(Yes/No) Notes
Full Refresh Sync Yes
Incremental - Append Sync Yes
Namespaces Yes

Getting started

Requirements

  1. You'll need the following information to configure the IBM Db2 source:
  2. Host
  3. Port
  4. Database
  5. Username
  6. Password
  7. Create a dedicated read-only Airbyte user and role with access to all schemas needed for replication.

Setup guide

1. Specify port, host and name of the database.

This step is optional but highly recommended allowing for better permission control and auditing. Alternatively, you can use Airbyte with an existing user in your database.

Please create a dedicated database user and run the following commands against your database:

-- create Airbyte role
CREATE ROLE 'AIRBYTE_ROLE';

-- grant Airbyte database access
GRANT CONNECT ON 'DATABASE' TO ROLE 'AIRBYTE_ROLE'
GRANT ROLE 'AIRBYTE_ROLE' TO USER 'AIRBYTE_USER'

Your database user should now be ready for use with Airbyte.

3. Create SSL connection.

To set up an SSL connection, you need to use a client certificate. Add it to the "SSL PEM file" field and the connector will automatically add it to the secret keystore. You can also enter your own password for the keystore, but if you don't, the password will be generated automatically.

Changelog

Version Date Pull Request Subject
2022-10-13 15535 Update incremental query to avoid data missing when new data is inserted at the same time as a sync starts under non-CDC incremental mode
0.1.16 2022-09-06 16354 Add custom JDBC params
0.1.15 2022-09-01 16238 Emit state messages more frequently
0.1.14 2022-08-18 14356 DB Sources: only show a table can sync incrementally if at least one column can be used as a cursor field
0.1.13 2022-07-22 14714 Clarified error message when invalid cursor column selected
0.1.12 2022-07-14 14574 Removed additionalProperties:false from JDBC source connectors
0.1.11 2022-06-17 13864 Updated stacktrace format for any trace message errors
0.1.10 2022-04-29 12480 Query tables with adaptive fetch size to optimize JDBC memory consumption
0.1.9 2022-02-21 10242 Fixed cursor for old connectors that use non-microsecond format. Now connectors work with both formats
0.1.8 2022-02-18 10242 Updated timestamp transformation with microseconds
0.1.7 2022-02-14 10256 Add -XX:+ExitOnOutOfMemoryError JVM option
0.1.6 2022-02-08 10173 Improved discovering tables in case if user does not have permissions to any table
0.1.5 2022-02-01 9875 Discover only permitted for user tables
0.1.4 2021-12-30 9187 8749 Add support of JdbcType.ARRAY to JdbcSourceOperations.
0.1.3 2021-11-05 7670 Updated unique DB2 types transformation
0.1.2 2021-10-25 7355 Added ssl support
0.1.1 2021-08-13 4699 Added json config validator
0.1.0 2021-06-22 4197 New Source: IBM DB2