-
Notifications
You must be signed in to change notification settings - Fork 368
Updating public docs with Reverse-ETL DB2 source setup guide #7664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gilsegment
wants to merge
25
commits into
develop
Choose a base branch
from
db2SourceSetup
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
ded4a49
add db2 to supported retl sources
gilsegment 53a2fc0
add db2 setup guide
gilsegment 0fb8cb6
[netlify-build]
gilsegment efae4b2
[netlify-build] add DB2 source to dropdown menu
gilsegment cd96a3a
[netlify-build] small fixes
gilsegment 9f68558
[netlify-build] more fixes
gilsegment 11ab780
Update src/_data/sidenav/main.yml
gilsegment 1dcbf58
Update src/connections/reverse-etl/reverse-etl-source-setup-guides/db…
gilsegment 73240ca
Update src/connections/reverse-etl/reverse-etl-source-setup-guides/db…
gilsegment 3c5c38c
Update src/connections/reverse-etl/reverse-etl-source-setup-guides/db…
gilsegment 7086a9f
Update src/connections/reverse-etl/reverse-etl-source-setup-guides/db…
gilsegment fab1552
Update src/connections/reverse-etl/reverse-etl-source-setup-guides/db…
gilsegment b98e62f
Update src/connections/reverse-etl/reverse-etl-source-setup-guides/db…
gilsegment 395ae0f
Update src/connections/reverse-etl/reverse-etl-source-setup-guides/db…
gilsegment 41f68c7
Update src/connections/reverse-etl/reverse-etl-source-setup-guides/db…
gilsegment 6703997
Update src/connections/reverse-etl/reverse-etl-source-setup-guides/db…
gilsegment 7eeb28c
Update src/connections/reverse-etl/reverse-etl-source-setup-guides/db…
gilsegment 81e188c
Update src/connections/reverse-etl/reverse-etl-source-setup-guides/db…
gilsegment d8a752c
Update src/connections/reverse-etl/reverse-etl-source-setup-guides/db…
gilsegment b7b8003
Update src/connections/reverse-etl/reverse-etl-source-setup-guides/db…
gilsegment f1cb559
Update src/connections/reverse-etl/reverse-etl-source-setup-guides/db…
gilsegment c036ce8
Update src/connections/reverse-etl/reverse-etl-source-setup-guides/db…
gilsegment 66ee83d
Update src/connections/reverse-etl/reverse-etl-source-setup-guides/db…
gilsegment d118797
Update src/connections/reverse-etl/reverse-etl-source-setup-guides/db…
gilsegment f1a05db
Update src/connections/reverse-etl/setup.md
gilsegment File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
src/connections/reverse-etl/reverse-etl-source-setup-guides/db2-setup.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
title: Db2 Reverse ETL Setup | ||
--- | ||
|
||
Set up Db2 as your Reverse ETL source. | ||
|
||
At a high level, when you set up Db2 for Reverse ETL, the configured database user must have read permissions on any tables involved in the query and write permissions on a managed schema (`SEGMENT_REVERSE_ETL`) that Segment uses to track sync progress. Segment authenticates with your Db2 instance through a username and password. | ||
|
||
|
||
|
||
## Required permissions | ||
|
||
In order to run a Reverse ETL sync in your Db2 warehouse, you'll create a user with the following permissions: | ||
|
||
* **Permission to read from all tables used in the model**: The user must be able to access all tables included in your SELECT query. | ||
* **Permission to create and manage a schema**: Segment creates and manages a schema in your warehouse to track sync metadata. | ||
* **Permission to create tables in the database**: Segment creates metadata tables in your warehouse. | ||
|
||
|
||
> info "Create a dedicated user for Segment's Reverse ETL connection" | ||
> Segment recommends that you create a dedicated Db2 user for when setting up Reverse ETL. This user should only have access to the relevant schemas and tables you'll need to access during syncs between Segment and your warehouse. | ||
|
||
1. In IBM Cloud, go to your Db2 instance and navigate to **Administration > User management**. | ||
2. Click **Add**. | ||
3. Create a new user with *user* privileges. Note the username and password of the user you created, as you'll need this information to set up the Segment source connection in a later step. | ||
|
||
|
||
> info "" | ||
> Segment creates and manages the `SEGMENT_REVERSE_ETL` schema to track the status of each sync. | ||
> You can also choose to create this schema yourself by running: | ||
> `CREATE SCHEMA SEGMENT_REVERSE_ETL` | ||
> After you've created the schema, grant Segment the appropriate privileges. | ||
|
||
|
||
|
||
Run the following SQL commands to grant Segment the required permissions: | ||
|
||
```sql | ||
-- Grant permissions to create and manage objects within the SEGMENT_REVERSE_ETL schema | ||
GRANT CREATEIN, DROPIN ON SCHEMA SEGMENT_REVERSE_ETL TO USER <username>; | ||
|
||
-- Grant permission to create tables in the database | ||
GRANT CREATETAB ON DATABASE TO USER <username>; | ||
|
||
-- Grant read access on each table used in the model | ||
GRANT SELECT ON TABLE <schema_name>.<table_name> TO USER <username>; | ||
-- Repeat the above command for all tables involved in your model | ||
``` | ||
|
||
|
||
## Set up guide | ||
|
||
To set up Db2 as your Reverse ETL source: | ||
|
||
1. Confirm that your Db2 database is network-accessible from the [IP address that Segment uses to connect to your warehouse](/docs/connections/storage/warehouses/faq/#which-ips-should-i-allowlist). | ||
2. Open [your Segment workspace](https://app.segment.com/workspaces){:target="_blank"}. | ||
3. Navigate to **Connections > Sources** then select the **Reverse ETL** tab. | ||
4. Click **+ Add Reverse ETL source**. | ||
5. Select **Db2** and click **Add Source**. | ||
6. Fill in the following Db2 connection settings: | ||
* Hostname: `<hostname>` | ||
* Port: `<port>` | ||
* Database: `<db_name>` | ||
* Username: `<segment_db2_user>` | ||
* Password: `<password>` | ||
7. Click **Test Connection** to validate the setup. | ||
8. If the connection is successful, click **Add source**. | ||
|
||
After successfully adding your Db2 source, [add a model](/docs/connections/reverse-etl/setup/#step-2-add-a-model) and follow the rest of the steps in the Reverse ETL setup guide. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where would someone run these commands? Is it in a workbook/workspace/warehouse/etc.? just looking for more context on this step.