mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-18 12:18:35 +00:00
Check Test Connection Oracle DBA Access (#15764)
This commit is contained in:
parent
2e640f6ef2
commit
7c7a7c35a9
@ -38,6 +38,7 @@ from metadata.ingestion.connections.builders import (
|
||||
)
|
||||
from metadata.ingestion.connections.test_connections import test_connection_db_common
|
||||
from metadata.ingestion.ometa.ometa_api import OpenMetadata
|
||||
from metadata.ingestion.source.database.oracle.queries import CHECK_ACCESS_TO_DBA
|
||||
from metadata.utils.logger import ingestion_logger
|
||||
|
||||
CX_ORACLE_LIB_VERSION = "8.3.0"
|
||||
@ -136,9 +137,13 @@ def test_connection(
|
||||
Test connection. This can be executed either as part
|
||||
of a metadata workflow or during an Automation Workflow
|
||||
"""
|
||||
|
||||
test_conn_queries = {"CheckAccess": CHECK_ACCESS_TO_DBA}
|
||||
|
||||
test_connection_db_common(
|
||||
metadata=metadata,
|
||||
engine=engine,
|
||||
service_connection=service_connection,
|
||||
automation_workflow=automation_workflow,
|
||||
queries=test_conn_queries,
|
||||
)
|
||||
|
@ -88,7 +88,7 @@ WHERE
|
||||
type = 'PROCEDURE' and owner = '{schema}'
|
||||
"""
|
||||
)
|
||||
|
||||
CHECK_ACCESS_TO_DBA = "SELECT table_name FROM DBA_TABLES where ROWNUM < 2"
|
||||
ORACLE_GET_STORED_PROCEDURE_QUERIES = textwrap.dedent(
|
||||
"""
|
||||
WITH SP_HISTORY AS (SELECT
|
||||
|
@ -57,6 +57,9 @@ GRANT new_role TO user_name;
|
||||
|
||||
-- GRANT CREATE SESSION PRIVILEGE TO USER
|
||||
GRANT CREATE SESSION TO new_role;
|
||||
|
||||
-- GRANT SELECT CATALOG ROLE PRIVILEGE TO FETCH METADATA TO ROLE / USER
|
||||
GRANT SELECT_CATALOG_ROLE TO new_role;
|
||||
```
|
||||
|
||||
With just these permissions, your user should be able to ingest the schemas, but not the tables inside them. To get
|
||||
|
@ -61,8 +61,11 @@ CREATE ROLE new_role;
|
||||
-- GRANT ROLE TO USER
|
||||
GRANT new_role TO user_name;
|
||||
|
||||
-- GRANT CREATE SESSION PRIVILEGE TO USER
|
||||
-- GRANT CREATE SESSION PRIVILEGE TO ROLE / USER
|
||||
GRANT CREATE SESSION TO new_role;
|
||||
|
||||
-- GRANT SELECT CATALOG ROLE PRIVILEGE TO FETCH METADATA TO ROLE / USER
|
||||
GRANT SELECT_CATALOG_ROLE TO new_role;
|
||||
```
|
||||
|
||||
With just these permissions, your user should be able to ingest the schemas, but not the tables inside them. To get
|
||||
|
@ -59,6 +59,9 @@ GRANT new_role TO user_name;
|
||||
|
||||
-- GRANT CREATE SESSION PRIVILEGE TO USER
|
||||
GRANT CREATE SESSION TO new_role;
|
||||
|
||||
-- GRANT SELECT CATALOG ROLE PRIVILEGE TO FETCH METADATA TO ROLE / USER
|
||||
GRANT SELECT_CATALOG_ROLE TO new_role;
|
||||
```
|
||||
|
||||
With just these permissions, your user should be able to ingest the schemas, but not the tables inside them. To get
|
||||
|
@ -65,6 +65,9 @@ GRANT new_role TO user_name;
|
||||
|
||||
-- GRANT CREATE SESSION PRIVILEGE TO USER
|
||||
GRANT CREATE SESSION TO new_role;
|
||||
|
||||
-- GRANT SELECT CATALOG ROLE PRIVILEGE TO FETCH METADATA TO ROLE / USER
|
||||
GRANT SELECT_CATALOG_ROLE TO new_role;
|
||||
```
|
||||
|
||||
With just these permissions, your user should be able to ingest the schemas, but not the tables inside them. To get
|
||||
|
@ -42,6 +42,9 @@ GRANT new_role TO user_name;
|
||||
|
||||
-- GRANT CREATE SESSION PRIVILEGE TO USER
|
||||
GRANT CREATE SESSION TO new_role;
|
||||
|
||||
-- GRANT SELECT CATALOG ROLE PRIVILEGE TO FETCH METADATA TO ROLE / USER
|
||||
GRANT SELECT_CATALOG_ROLE TO new_role;
|
||||
```
|
||||
|
||||
With just these permissions, your user should be able to ingest the schemas, but not the tables inside them. To get
|
||||
|
@ -42,6 +42,9 @@ GRANT new_role TO user_name;
|
||||
|
||||
-- GRANT CREATE SESSION PRIVILEGE TO USER
|
||||
GRANT CREATE SESSION TO new_role;
|
||||
|
||||
-- GRANT SELECT CATALOG ROLE PRIVILEGE TO FETCH METADATA TO ROLE / USER
|
||||
GRANT SELECT_CATALOG_ROLE TO new_role;
|
||||
```
|
||||
|
||||
With just these permissions, your user should be able to ingest the schemas, but not the tables inside them. To get
|
||||
|
@ -42,6 +42,9 @@ GRANT new_role TO user_name;
|
||||
|
||||
-- GRANT CREATE SESSION PRIVILEGE TO USER
|
||||
GRANT CREATE SESSION TO new_role;
|
||||
|
||||
-- GRANT SELECT CATALOG ROLE PRIVILEGE TO FETCH METADATA TO ROLE / USER
|
||||
GRANT SELECT_CATALOG_ROLE TO new_role;
|
||||
```
|
||||
|
||||
With just these permissions, your user should be able to ingest the schemas, but not the tables inside them. To get
|
||||
|
@ -42,6 +42,9 @@ GRANT new_role TO user_name;
|
||||
|
||||
-- GRANT CREATE SESSION PRIVILEGE TO USER
|
||||
GRANT CREATE SESSION TO new_role;
|
||||
|
||||
-- GRANT SELECT CATALOG ROLE PRIVILEGE TO FETCH METADATA TO ROLE / USER
|
||||
GRANT SELECT_CATALOG_ROLE TO new_role;
|
||||
```
|
||||
|
||||
With just these permissions, your user should be able to ingest the schemas, but not the tables inside them. To get
|
||||
|
@ -23,6 +23,9 @@ GRANT new_role TO user_name;
|
||||
|
||||
-- GRANT CREATE SESSION PRIVILEGE TO USER
|
||||
GRANT CREATE SESSION TO new_role;
|
||||
|
||||
-- GRANT SELECT CATALOG ROLE PRIVILEGE TO FETCH METADATA TO ROLE / USER
|
||||
GRANT SELECT_CATALOG_ROLE TO new_role;
|
||||
```
|
||||
|
||||
- `GRANT SELECT` on the relevant tables which are to be ingested into OpenMetadata to the user
|
||||
|
@ -17,6 +17,9 @@ GRANT new_role TO user_name;
|
||||
|
||||
-- GRANT CREATE SESSION PRIVILEGE TO USER
|
||||
GRANT CREATE SESSION TO new_role;
|
||||
|
||||
-- GRANT SELECT CATALOG ROLE PRIVILEGE TO FETCH METADATA TO ROLE / USER
|
||||
GRANT SELECT_CATALOG_ROLE TO new_role;
|
||||
```
|
||||
|
||||
**Important:** OpenMetadata utilise `python-oracledb` qui supoorte seulement les version 12c, 18c, 19c, et 21c d'Oracle.
|
||||
|
Loading…
x
Reference in New Issue
Block a user