JIAN Rainbow
JIAN Rainbow

Reputation: 76

Debezium-oracle-connect, kafka connect ORA-01031

I followed the official documentation to create kafka connect. Kafka2.4 and Debezium 1.0 Final

{
"name": "oracle-connect",
"config": {
    "connector.class" : "io.debezium.connector.oracle.OracleConnector",
    "tasks.max" : "1",
    "database.server.name" : "orcl",
    "database.hostname" : "xx.xxx.xx.xx",
    "database.port" : "1521",
    "database.user" : "c##xstrm",
    "database.password" : "xs",
    "database.dbname" : "orcl",
    "database.pdb.name" : "pdborcl",
    "database.out.server.name" : "dbzxout",
    "database.history.kafka.bootstrap.servers" : "kafka:9092",
    "database.history.kafka.topic": "schema-changes.inventory"
}}

However, throws Exception:

ERROR Failed to initialize snapshot context. (io.debezium.relational.RelationalSnapshotChangeEventSource:107)
java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-01031: insufficient privileges
at io.debezium.connector.oacle.OracleConnection.setSessionToPdb(OracleConnection.java:51)
......
Caused by: java.sql.SQLSyntaxErrorException:ORA-01031: insufficient privileges
at oracle.jdbc.driver.T2CConnection.checkError(T2CConection.java:1002)
.....
ERROR Producer failure (io.debezium.pipeline.ErrorHandler:36)
...........ORA-01031: insufficient privileges.

At the beginning I felt that Oracle user rights problems. So windows cmd connect Oracle. btw my oracle version 12c

sqlplus / as sysdba

and

grant connect, resource, dba to c##xstrm;

But still the exception.The problem most likely occurs in Oracle, but I don't know how to do it

Upvotes: 3

Views: 2298

Answers (1)

Anupreet
Anupreet

Reputation: 71

Looks like an authorization issue. A quick look on the documentation lists the permissions needed.

GRANT CREATE SESSION TO c##xstrm CONTAINER=ALL;

GRANT SET CONTAINER TO c##xstrm CONTAINER=ALL;

GRANT SELECT ON V_$DATABASE to c##xstrm CONTAINER=ALL;

GRANT FLASHBACK ANY TABLE TO c##xstrm CONTAINER=ALL;

For detailed instructions: https://debezium.io/documentation/reference/connectors/oracle.html#_creating_an_xstream_admin_user_and_a_user_for_the_connector

Upvotes: 0

Related Questions