FTP using UTL_FTP package fails for large files - oracle

I am trying to FTP a file from one Unix box to another with UTL_FTP packages using Tim Hall's FTP packages.
BEGIN
--pl_release_id := 'IT3';
pl_release_id := release_id;
l_conn:= ftp.login(SOURCESERVER,'21',SOURCEUSER,SOURCEPASSWORD);
ftp.binary(p_conn => l_conn);
ftp.get
(
p_conn => l_conn,
p_from_file => SOURCEPATH,
p_to_dir => INTERMEDIATEPATH,
p_to_file => FILE
);
-- ftp.logout(l_conn);
utl_tcp.close_connection(c => l_conn);
EXCEPTION
WHEN OTHERS THEN
utl_tcp.close_connection(c => l_conn);
raise;
END;
This is successful for files less than 50 Mb in size, but for large files, I get the following error:
Error at line 1
ORA-29260: network error: not connected
ORA-06512: at "SYS.UTL_TCP", line 231
ORA-06512: at "SYS.UTL_TCP", line 460
ORA-06512: at "SYS.FTP", line 301
ORA-20000: 550 sendfile: Broken pipe.
ORA-06512: at "SYS.FTP_FILES", line 32
ORA-06512: at line 20
I am able to FTP the same files between the database server and the source server using oprating system ftp command.
There is ample space in the partitions. Tried to FTP to different partitions.
Server OS: AIX unix, Oracle version: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production

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.

ORA-29024: Certificate validation failure When Using UTL_HTTP.REQUEST in Autonomous Database

When I execute the following statement that involves a UTL_HTTP.REQUEST call, I get ORA-29024: Certificate validation failure:
SELECT UTL_HTTP.REQUEST('https://www.google.com') from DUAL;
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1620
ORA-29024: Certificate validation failure
ORA-06512: at "SYS.UTL_HTTP", line 380
ORA-06512: at "SYS.UTL_HTTP", line 1560
ORA-06512: at line 1
According to the Autonomous Database doc, UTL_HTTP is among the supported PL/SQL packages. Why is this query not working?
This error is a result of not completing the prerequisite steps for UTL_HTTP in Autonomous Database. As mentioned in the example from the doc, before calling the UTL_HTTP.REQUEST() procedure, we need to first create an Access Control List (ACL) for the host via the DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE() and set the wallet location via UTL_HTTP.SET_WALLET():
-- Create an Access Control List for the host
BEGIN
DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
host => 'www.google.com',
ace => xs$ace_type(privilege_list => xs$name_list('http'),
principal_name => 'ADMIN',
principal_type => xs_acl.ptype_db));
END;
/
PL/SQL procedure successfully completed.
-- Set Oracle Wallet location (no arguments needed)
BEGIN
UTL_HTTP.SET_WALLET('');
END;
/
PL/SQL procedure successfully completed.
SELECT UTL_HTTP.REQUEST('https://www.google.com') from DUAL;
utl_http.request('https://www.google.com')
-------------------------------------------------------------------------------------
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en"> ...
Disclaimer: I’m a Product Manager at Oracle.

AWS RDS Oracle Datapump error ORA-39001: invalid argument value

I want to import my dump file from my local to AWS. I've uploaded my pdv.dpdm file into my S3 bucket
expdp sys/pass schemas=PDV dumpfile=pdv.dpdm NOLOGFILE=YES directory=TEST_DIR
I was success downloading that file into oracle DATA_PUMP_DIR with rdsadmin.rdsadmin_s3_tasks.download_from_s3 command, When I list the files inside that directory, I got this. So I think the problem is not the failure when moving the data.
select * from table
(rdsadmin.rds_file_util.listdir(p_directory => 'DATA_PUMP_DIR'));
datapump/ directory 4096 2020-03-04 06:49:40
pdv2.log file 28411 2020-03-04 06:49:40
29012020.DMP file 825552896 2020-03-03 09:36:59
pdv2.dpdm file 685617152 2020-03-04 06:49:40
pdv.dpdm file 685613056 2020-03-04 06:49:27
When I starting to import that file with DBMS_DATAPUMP.ADD_FILE I got an error on that line.
DECLARE
hdnl NUMBER;
BEGIN
hdnl := DBMS_DATAPUMP.OPEN( operation => 'IMPORT', job_mode => 'SCHEMA', job_name=> NULL, version => 12);
DBMS_DATAPUMP.ADD_FILE(
handle => hdnl,
filename => 'pdv.dpdm',
directory => 'DATA_PUMP_DIR',
filetype => DBMS_DATAPUMP.KU$_FILE_TYPE_DUMP_FILE
);
DBMS_DATAPUMP.START_JOB(hdnl);
END;
Error :
SQL Error [39001] [99999]: ORA-39001: invalid argument value
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
ORA-06512: at "SYS.DBMS_DATAPUMP", line 4087
ORA-06512: at "SYS.DBMS_DATAPUMP", line 4338
ORA-06512: at line 6
It seems I'm missing something, maybe configure in AWS or what. I've done searching for a couple of answers but it doesn't fix my problem. Could you help me with this? I don't know anymore what should I do. Thanks
You are mistaken with the import version.
hdnl := DBMS_DATAPUMP.OPEN( operation => 'IMPORT', job_mode => 'SCHEMA', job_name=> NULL, version => 12);
version=>'12.0.0'
Oracle Documentation
COMPATIBLE - (default) the version of the metadata corresponds to the
database compatibility level and the compatibility release level for
feature (as given in the V$COMPATIBILITY view). Database compatibility
must be set to 9.2 or higher.
LATEST - the version of the metadata corresponds to the database
version.
A specific database version, for example, '11.0.0'.
Specify a value of 12 to allow all existing database features,
components, and options to be exported from Oracle Database 11g
release 2 (11.2.0.3) or later into an Oracle Database 12 c Release 1
(12.1) (either a multitenant container database (CDB) or a non-CDB).
You must export as a non-SYS user!
grant read, write on directory TEST_DIR to PDV;
expdp PDV/password schemas=PDV dumpfile=pdv.dpdm NOLOGFILE=YES directory=TEST_DIR
Oracle Documentation
Note:Do not start Export as SYSDBA, except at the request of Oracle
technical support. SYSDBA is used internally and has specialized
functions; its behavior is not the same as for general users.

How to change oracle 10g port 8080 to other port

I am trying this method to change my ORACLE XE 10g port 8080 to other port but it shows me this error mentioned below.
As Oracle is using this port due to which I am not able to start my Tomcat on port number 8080.
SQL> Exec DBMS_XDB.SETHTTPPORT(8181); BEGIN DBMS_XDB.SETHTTPPORT(8181); END;
ERROR at line 1: ORA-31050: Access denied ORA-06512: at "XDB.DBMS_XDB", line 382 ORA-06512: at "XDB.DBMS_XDB", line 521 ORA-06512: at line 1
I'm not sure why you exec plus have a PLSQL block - usually what you need to do is this:
SQL> begin
2 dbms_xdb.sethttpport('8181');
3 end;
4 /
And you have to connect as SYSTEM - maybe that's why it's denied for you.

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