Resolving ORA-02019 error during DBMS_FILE_TRANSFER.PUT_FILE() - oracle

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.

Related

Oracle Cloud, access Flask Server on Compute Instance from Autonomous Database

I build a Flask Python REST app on a Oracle Cloud compute instance. The REST Call works from my client just fine. (I added Ingress Rule for 0.0.0.0/0).
My plan is to have the Comupute Instance only accesible from my ATP Database and call the REST Service from PL/SQL. When I try to call the Webservice, I get the following error:
DECLARE
l_clob CLOB;
BEGIN
l_clob := apex_web_service.make_rest_request(
p_url => 'https://130.zz.yy.xx:5000/test',
--p_url=> 'https://httpbin.org/get',
p_http_method => 'GET'
);
END;
Error report -
ORA-29273: HTTP request failed
ORA-06512: at "APEX_220100.WWV_FLOW_WEB_SERVICES", line 1182
ORA-06512: at "APEX_220100.WWV_FLOW_WEB_SERVICES", line 782
ORA-01031: insufficient privileges
ORA-06512: at "SYS.UTL_HTTP", line 380
ORA-06512: at "SYS.UTL_HTTP", line 1209
ORA-06512: at "APEX_220100.WWV_FLOW_WEB_SERVICES", line 756
ORA-06512: at "APEX_220100.WWV_FLOW_WEB_SERVICES", line 1023
ORA-06512: at "APEX_220100.WWV_FLOW_WEB_SERVICES", line 1371
ORA-06512: at "APEX_220100.WWV_FLOW_WEBSERVICES_API", line 568
ORA-06512: at line 5
29273. 00000 - "HTTP request failed"
*Cause: The UTL_HTTP package failed to execute the HTTP request.
*Action: Use get_detailed_sqlerrm to check the detailed error message.
Fix the error and retry the HTTP request.
Normal REST Calls work just fine. What could be the problem?
The ATP can not access the compute instance because of some network settings?
ATP is not happy with the SSL settings or some other nasty HTTPS stuff?
The restrictions of calling REST APIs from APEX on autonomous database are outlined here:
https://docs.oracle.com/en/cloud/paas/atp-cloud/atpgs/autonomous-apex-web-services.html
So ...
must be a public endpoint, and the SSL certificate must be provided by a public CA.
For HTTPS, only the default port (443) is allowed; other ports raise the error message you're seeing.
configuring a proxy server in APEX is not supported on ADB; you then also
get the "Insufficient Privileges" error.

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

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

Datapump Import Fails With ORA-39006, ORA-39213: “Metadata processing is not available”

I am trying to import multiple dmp files using impdp command i got this error DataPump import (impdp) reports the errors:
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
ORA-39006: internal error
ORA-39213: Metadata processing is not available
Attempting to correct the error ORA-39213 via
dbms_metadata_util.load_stylesheets also reports errors similar to:
SQL> exec dbms_metadata_util.load_stylesheets;
BEGIN dbms_metadata_util.load_stylesheets; END;
* ERROR at line 1: ORA-22288: file or LOB operation FILEEXISTs failed
Permission denied
ORA-06512: at "SYS.DBMS_METADATA_UTIL", line 1807
ORA-06512: at line 1
login from sys and run below query worked for me oracle 11.2
exec dbms_metadata_util.load_stylesheets;

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.

SMTP error while I am trying to run the sending email program in oracle pl/sql

When I am running this, i am getting error:
begin
UTL_MAIL.SEND(SENDER =>'admin#dbaclass.com',
RECIPIENTS=> 'support#dbaclass.com',
SUBJECT=> 'MAIL FROM dbaclasss SENDER',
MESSAGE => 'Welcome to dbaclass'
);
end;
Error:
Error report -
ORA-29278: SMTP transient error: 421 Service not available
ORA-06512: at "SYS.UTL_MAIL", line 654
ORA-06512: at "SYS.UTL_MAIL", line 671
ORA-06512: at line 2
29278. 00000 - "SMTP transient error: %s"
I checked the telnet command to check the stmp.gmail.com its working fine.
but when i tried this from oracle it is giving the above error.
Can someone please help me.
That will not work out of the box.
If your server is not ssl/tls you need at least set (maybe create local smtp first for test) and set acl:
ALTER SYSTEM SET smtp_out_server = 'mailserver.domain.com'
If server is secure (and gmail is) and you have no local smtp server to work with. You need to do more to set secure connection.
Look at this to get idea for start(you need walled or own secure ssl/tls implementation):
Give credentials to UTL_MAIL.SEND to bypass ORA-29278
Probably at this too:
http://oracle.ninja/sending-secure-e-mails-out-of-the-database-ssltls-utl_smtp-openssl-acl-wallet/

Resources