How to solve : ORA-02019: connection description for remote database not found? - oracle

It's my first time with stored procedures in Oracle.
I have the following .Net class :
Public Class Class1
Public Shared Function StoredProcedure1() As String
Return "coucou"
End Function
End Class
I want to use this class from Oracle. I followed the steps to deploy the class on Visual Studio. The deployment was successful.
Now when I go on Oracle and I query :
select STOREDPROCEDURE1 from dual
I'm getting the error :
ORA-02019: connection description for remote database not found
ORA-06512: at "SYS.DBMS_CLR", line 243
ORA-06512: at "SYS.DBMS_CLR", line 42
ORA-06512: at "SYS.DBMS_CLR", line 236
ORA-06512: at "SCHEMA.STOREDPROCEDURE1", line 6
02019. 00000 - "connection description for remote database not found"
I don't understand where this error is coming from. I'm not using any database link in this function or whatever.
Can anyone help please ?
Thanks

Related

Resolving ORA-02019 error during DBMS_FILE_TRANSFER.PUT_FILE()

I am using DBMS_FILE_TRANSFER.PUT_FILE() on a local Oracle Express instance to transfer a local file to a remote AWS RDS Oracle instance, but I am receiving the following error:
ERROR at line 1:
ORA-02019: connection description for remote database not found
ORA-06512: at "SYS.DBMS_FILE_TRANSFER", line 60
ORA-06512: at "SYS.DBMS_FILE_TRANSFER", line 168
ORA-06512: at line 2
I receive this error while executing the following SQL script:
BEGIN
DBMS_FILE_TRANSFER.PUT_FILE(
'DATA_PUMP_DIR',
'some_file.txt',
'DATA_PUMP_DIR',
'some_file.txt',
'MY_DATABASE_LINK'
);
END;
/
MY_DATABASE_LINK is a public database link located in my local Oracle Express instance:
CREATE PUBLIC DATABASE LINK MY_DATABASE_LINK CONNECT TO example_schema IDENTIFIED BY "example_user" USING '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=example_host_info)(PORT=1521))(CONNECT_DATA=(SID=example_sid)))';
I'm fairly confident that the connection string behind the database link is correct, but I'm not sure how to be 100% sure.
The ORA-02019: connection description for remote database not found error does not make sense because the connection description is defined by the database link. It is not present in tnsnames.ora, and I am confident that it doesn't have to be for DBMS_FILE_TRANSFER.PUT_FILE() to work.

Oracle Database Job run issue-ora01031, insufficient privileges ora06512

I am very new to oracle and dont have much of an idea of how to resolve this problem.
I have two schema ERM22_TEST and ERM22_TEST_CUSTOM
One package exists in RM22_TEST.ASYNC_JOB_QUEUE_COMMAND_BAS
and another package in ERM22_TEST_CUSTOM.C_PSP_INTERFACE
I have a job scheduler in ERM22_TEST_CUSTOM schema, which exports the data from a view in to CSV file, but when I click on run job it gives me the error:
ORA-01031: insufficient privileges
ORA-06512: at "ERM22_TEST.ASYNC_JOB_QUEUE_COMMAND_BAS", line 101
ORA-06512: at "ERM22_TEST.ASYNC_JOB_QUEUE_COMMAND_BAS", line 106
ORA-06512: at "ERM22_TEST_CUSTOM.C_PSP_INTERFACE", line 39
ORA-06512: at "ERM22_TEST_CUSTOM.C_PSP_INTERFACE", line 95
But it same export I do form my application than it export the data in csv file. Both user name are not same which run the database job and run the job from application client.
I just know it has some issue of granting the access but I have no idea how to grant access to ERM22_TEST_CUSTOM schema which run a package in another schema ERM22_TEST.
ORA-01031: insufficient privileges
ORA-06512: at "ERM22_TEST.ASYNC_JOB_QUEUE_COMMAND_BAS", line 101
ORA-06512: at "ERM22_TEST.ASYNC_JOB_QUEUE_COMMAND_BAS", line 106
ORA-06512: at "ERM22_TEST_CUSTOM.C_PSP_INTERFACE", line 39
ORA-06512: at "ERM22_TEST_CUSTOM.C_PSP_INTERFACE", line 95

Non useful ORA error when working with KafkaConnect JdbcDriver with Oracle 11g (Strimzi Operator)

I'm using strimzi Kafka operator to work with a Confluent Cluster to achieve an Oracle2Kafka type KafkaConnector with JdbcSourceConnector from confluent.
The KafkaConnector spec
# connector
connection.url: jdbc:oracle:thin:#HOST:PORT/SERVICE
connection.user: USER
connection.password: PASS
dialect.name: OracleDatabaseDialect
topic.prefix: test-topic-
mode: bulk
db.timezone: Europe/Madrid
table.whitelist: TEST_TABLE
But I get the following error in the strimzi-cluster-operator logs.
io.strimzi.operator.cluster.operator.assembly.ConnectRestException: PUT /connectors/confluent-cluster-int-20200706-02/config returned 400 (Bad Request): Connector configuration is invalid and contains the following 2 error(s):
Invalid value java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 43
for configuration Couldn't open connection to jdbc:oracle:thin:#***:1534/***
Invalid value java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 43
for configuration Couldn't open connection to jdbc:oracle:thin:#***:1534/***
You can also find the above list of errors at the endpoint `/connector-plugins/{connectorType}/config/validate`
at io.strimzi.operator.cluster.operator.assembly.KafkaConnectApiImpl.lambda$null$2(KafkaConnectApi.java:208) ~[io.strimzi.cluster-operator-0.18.0.jar:0.18.0]
If I modify the source I get a much specific stacktrace
2020-07-14 09:33:46,636 ERROR SQLException (io.confluent.connect.jdbc.source.JdbcSourceConnectorConfig) [qtp742672280-21]
java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 43
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:509)
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:456)
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:451)
at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:1123)
at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:552)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:553)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:269)
at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:501)
at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:1292)
at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:1025)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:747)
at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:793)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:57)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:747)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:562)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at io.confluent.connect.jdbc.dialect.GenericDatabaseDialect.getConnection(GenericDatabaseDialect.java:223)
at io.confluent.connect.jdbc.source.JdbcSourceConnectorConfig$TableRecommender.validValues(JdbcSourceConnectorConfig.java:606)
at io.confluent.connect.jdbc.source.JdbcSourceConnectorConfig$CachingRecommender.validValues(JdbcSourceConnectorConfig.java:653)
at org.apache.kafka.common.config.ConfigDef.validate(ConfigDef.java:607)
at org.apache.kafka.common.config.ConfigDef.validate(ConfigDef.java:622)
at org.apache.kafka.common.config.ConfigDef.validate(ConfigDef.java:530)
at org.apache.kafka.common.config.ConfigDef.validateAll(ConfigDef.java:513)
at org.apache.kafka.common.config.ConfigDef.validate(ConfigDef.java:495)
at org.apache.kafka.connect.connector.Connector.validate(Connector.java:135)
Some things I already checked
KafkaConnect image is a self-made one with the required addons for the JdbcSourceConnector with an OracleDriver
Dockerfile
FROM strimzi/kafka:0.18.0-kafka-2.5.0
USER root:root
COPY ./kafka-connect-jdbc-5.4.0.jar /opt/kafka/plugins/
COPY ./ojdbc6.jar /opt/kafka/libs/
USER 1001
KafkaConnect resource is deployed successfully, as KafkaConnect topics are being populated on confluent cluster (connect-cluster-configs, connect-cluster-configs, ...)
Oracle driver seems to be successfully loaded. If I add a typo in the credentials or connection chain the error is self-explanatory and makes sense. I also tried other versions of oracle drivers.
Back in time (4 months ago), this same config was working (both on a local strimzi-deployed-cluster and confluent). Now the local cluster works fine, but confluent one fails with the described error.
Tried several upgraded latest versions of strimzi operator and kafka-jdbc-connector
(edit) As suggested in strimzi slack, tried the PUT /connector-plugins/JdbcSourceConnector/config/validate rest endpoint of KafkaConnect and got same 2 errors, in the whitelist and blacklist fields
result
"value": {
"name": "table.blacklist",
"value": "",
"recommended_values": [],
"errors": ["Invalid value java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1\nORA-06502: PL/SQL: numeric or value error: character string buffer too small\nORA-06512: at line 43\n for configuration Couldn't open connection to jdbc:oracle:thin:#***:1534/***"],
"visible": true
}
(edit) I've tried to leave whitelist field empty and error is the same. The database seems not have been changed and the connection chain works fine from source code spring-data access.
I'm out of ideas, any hint is welcome x)
I don't know tools you use, but - the error you got means this:
SQL> declare
2 l_var varchar2(1); -- note length, only 1 character
3 begin
4 l_var := 'Littlefoot'; -- I'm little, but can't fit
5 end;
6 /
declare
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 4
SQL>
What to do?
SQL> declare
2 l_var varchar2(20); -- is that enough?
3 begin
4 l_var := 'Littlefoot';
5 end;
6 /
PL/SQL procedure successfully completed. --> Yes, it is!
SQL>
Therefore, check the sizes in your code.

Oracle 12c impdp fails when executed fromt the command line

Trying to use impdp to do a data refresh on an Oracle 12c database:
Receive the following error after invoking the impdp from the command line:
ORA-39006: internal error
ORA-39065: unexpected master process exception in DISPATCH
ORA-00942: table or view does exist
ORA-06512: at "SYS.KUPU$UTILITIES_INT", line 1579
ORA-06512: at "SYS.KUPM$MCP", line 2710
ORA-39097: Data Pump encountered unexpected error -942
I found a post that made reference to GSM objects not being available, but there was no confirmation or response to this.
All the GSM schemas have been removed from the database I am working in.

How can a add acl rules for Oracle 11g to allow pl/sql upload file

In Oracle 11g ,the database has an Fine-Grained network access control list, so when i use pl/sql to upload a file to the ftp_server,it gives me a network access error.
The error information like this:
error at 1 line:
ORA-29260: network error:not connected
ORA-06512: at "SYS.UTL_TCP", line 212
ORA-06512: at "SYS.UTL_TCP", line 432
ORA-06512: at "SCOTT.FTP", line 413
ORA-24247: Network access rejected by acl
ORA-06512: at "SCOTT.FTP", line 491
ORA-06512: at line 6
I want to know how can i do about creating acl rules so that i can get the privilege.
Thanks
Here's a tutorial about ACL in Oracle.

Resources