Multi-Database Scanning with JSON Credentials
The Data Discovery rbdms-scanner can scan multiple databases using a JSON credential format for the following data sources:
-
Snowflake (JSON coming soon)
JSON Connection Properties
-
When using a multi-database connection,
database_listis required, as each will replace the{db}placeholder in the URL string when establishing a connection. -
The
base_databaseproperty is also required as it is used for the initial connection and retrieving data source-level metadata.
|
Property |
Description |
Required |
Example Value |
|---|---|---|---|
|
|
Complete connection URL string used to establish the connection. |
Yes |
|
|
|
Name of the driver used to connect. |
Yes |
|
|
|
CSV list of databases to scan. The same credentials must be configured for all databases in the list. |
Yes |
|
|
|
The database used for the initial connection. |
Yes |
|
|
|
Username used for authentication. |
Yes |
username@postgreserver |
|
|
Password used for authentication. |
Yes |
*********** |
|
|
Set to true for Schema-Table structures. |
No |
|
|
|
Set to true for Database-Schema-Table structures. |
No |
|
|
|
The maximum time a query can run before the driver cancels it. |
No |
Format: PT(XX)(increment)
|
|
|
The quantity in bytes of data that will be fetched in one attempt. |
No |
|
|
|
Controls whether each SQL statement is committed immediately. |
No |
|
Generic JDBC
Example for connecting to PostgreSQL using Generic JDBC:
{
"connectionUrl": "jdbc:postgresql://<host>:<port>/{db}",
"driver_class_name": "org.postgresql.Driver",
"database_list": "database1,database_demo,db_2",
"base_database": "database1",
"user": "username@host",
"password": "*****",
"is_multi_connection_supported": "true",
"jdbc_query_timeout": "PT10M",
"fetch_size": "1024",
"auto_commit": "false"
}
Amazon Athena
When scanning multiple databases using other connectors, the format of the connectionURL changes in some cases, but the other parameters remain the same, except for Amazon Athena.
Amazon Athena does not require base_database or database_list , as the connection is established for the Amazon account.
{
"S3OutputLocation": "s3://dd-athena-storage/Unsaved",
"connectionUrl": "jdbc:awsathena://AwsRegion=<region>;UID=<username>;PWD=<password>;WorkGroup=primary;S3OutputLocation=s3://dd-athena-storage/Unsaved",
"password": "<password>",
"username": "<username>"
}
IBM DB2
{
"base_database": "<DB-Name>",
"connectionUrl": "jdbc:db2://<Host>:<Port>/{db}",
"database_list": "<DB1>,<DB2>",
"password": "<Password>",
"user": "<User>"
}
MicrosoftSQL
{
"connectionUrl": "jdbc:sqlserver://<host>;database={db}",
"user": "<user>",
"password": "<password>",
"base_database": "<db-name>",
"database_list": "<db1>,<db2>"
}
Oracle
{
"database_list": "XE,OTHERDB",
"base_database": "XE",
"password": "password",
"user": "username",
"connectionU
rl": "jdbc:oracle:thin:system/oracle@localhost:55182:{db}"
}
Troubleshooting
1. Database Missing Errors
Message:[SQLException: No specific database specified for parameterized url for dialect postgresql.] Arguments:[[Dialect: postgresql]] Date:[2024-05-30T19:11:38]
java.util.concurrent.CompletionException: com.onetrust.discovery.scanner.common.exceptions.DataDiscoveryException: SQLException: No specific database specified for parameterized url for dialect postgresql.
Indicates there is no database to connect to in the URL. Check if the base_database property is missing from the credential JSON.
Message:[PSQLException: FATAL: database "username" does not exist] Arguments:[[Dialect: postgresql]] Date:[2024-05-30T19:16:34]
java.util.concurrent.CompletionException: com.onetrust.discovery.scanner.common.exceptions.DataDiscoveryException: PSQLException: FATAL: database "intg1user@intpostgre" does not exist
Indicates the base_database specified does not exist when the "username" appears in the error, as the database it may indicate the value for is an empty string.
2. Connection Errors
Message:[PSQLException: FATAL: password authentication failed for user "username"] Arguments:[[Dialect: postgresql]] Date:[2024-05-30T19:26:09]
java.util.concurrent.CompletionException: com.onetrust.discovery.scanner.common.exceptions.DataDiscoveryException: PSQLException: FATAL: password authentication failed for user "username"
Username or password is incorrect.
3. Incorrect Formats
Message:[PSQLException: FATAL: Invalid Username specified. Please check the Username and retry connection. The Username should be in <username@hostname> format.] Arguments:[[Dialect: postgresql]] Date:[2024-05-30T19:27:30]
java.util.concurrent.CompletionException: com.onetrust.discovery.scanner.common.exceptions.DataDiscoveryException: PSQLException: FATAL: Invalid Username specified. Please check the Username and retry connection. The Username should be in <username@hostname> format.
The specified username should include the server where the connection will be attempted (e.g., user@server)