Skip to content
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

FIX: [DataHub]: Updated SQL for permissions and query logging #144

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 18
author: Paul Ibberson
email: [email protected]
page_last_update: Deccember 19th, 2023
page_last_update: October 3rd 2024
description: Configure a Teradata Vantage connection in DataHub.
keywords: [data warehouses, compute storage separation, teradata, vantage, cloud data platform, object storage, business intelligence, enterprise analytics, datahub, data catalog, data lineage]
---
Expand Down Expand Up @@ -34,25 +34,31 @@ pip install 'acryl-datahub[teradata]'
``` sql
CREATE USER datahub FROM <database> AS PASSWORD = <password> PERM = 20000000;

GRANT SELECT ON dbc.columns TO datahub;
GRANT SELECT ON dbc.databases TO datahub;
GRANT SELECT ON dbc.tables TO datahub;
GRANT SELECT ON DBC.All_RI_ChildrenV TO datahub;
GRANT SELECT ON DBC.DatabasesV TO datahub;
GRANT SELECT ON DBC.TablesV TO datahub;
GRANT SELECT ON DBC.ColumnsV TO datahub;
GRANT SELECT ON DBC.IndicesV TO datahub;
GRANT SELECT ON dbc.TableTextV TO datahub;
GRANT SELECT ON dbc.TablesV TO datahub;
GRANT SELECT ON dbc.dbqlogtbl TO datahub; -- if lineage or usage extraction is enabled
GRANT SELECT ON DBC.All_RI_ChildrenV TO datahub;

-- if lineage or usage extraction is enabled
GRANT SELECT ON dbc.dbqlogtbl TO datahub;
GRANT SELECT ON dbc.QryLogV TO datahub;
GRANT SELECT ON dbc.QryLogSqlV TO datahub;
```

* If you want to run profiling, you need to grant select permission on all the tables you want to profile.

* If you want to extract lineage or usage metadata, query logging must be enabled and it is set to size which will fit for your queries (the default query text size Teradata captures is max 200 chars) An example how you can set it for all users:

``` sql
-- set up query logging on all

REPLACE QUERY LOGGING LIMIT SQLTEXT=2000 ON ALL;
REPLACE QUERY LOGGING WITH SQL LIMIT SQLTEXT=2000 ON ALL;
```
Learn more about query logging in this document:
[https://docs.teradata.com/r/Teradata-VantageCloud-Lake/Database-Reference/Database-Administration/Tracking-Query-Behavior-with-Database-Query-Logging-Operational-DBAs](https://docs.teradata.com/r/Teradata-VantageCloud-Lake/Database-Reference/Database-Administration/Tracking-Query-Behavior-with-Database-Query-Logging-Operational-DBAs)



## Add a Teradata connection to DataHub
With DataHub running, open the DataHub GUI and login. In this example this is running at localhost:9002
Expand Down Expand Up @@ -110,7 +116,7 @@ Clicking on "Succeeded" after a sucessful execution will bring up a dialogue sim
* Schema of an entity showing column/field names, data types and usage if it has been captured
![Schema display](../other-integrations/images/configure-a-teradata-connection-in-datahub/schema.png)
* Lineage providing a visual representation of how data is linked between tables and views
![Lineage picture](../other-integrations/images/configure-a-teradata-connection-in-datahub/lineage-weather.png)
![Lineage picture](../other-integrations/images/configure-a-teradata-connection-in-datahub/lineage-example.png)

## Summary

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading