问题
I've been trying to solve this problem for days and I always get the same error over and over. I am user Oracle SQL Developer Version 3.2.20.09 and I want to send files through FTP with this code
CREATE OR REPLACE
PROCEDURE subirFTP(dirServer VARCHAR2, port VARCHAR2, usr VARCHAR2, pass VARCHAR2, dirRemitente VARCHAR2, dirDestinatario VARCHAR2, nombreArchivo VARCHAR2)
IS
l_conn UTL_TCP.connection;
BEGIN
l_conn := ftp.login(dirServer,port,usr,pass);
ftp.binary(p_conn => l_conn);
ftp.put(p_conn => l_conn,
p_from_dir => dirRemitente,
p_from_file => nombreArchivo,
p_to_file => dirDestinatario);
ftp.logout(l_conn);
END subirFTP;
Informe de error:
ORA-24247: acceso de red denegado por la lista de control de acceso (ACL)
ORA-06512: en "SYS.UTL_TCP", línea 17
ORA-06512: en "SYS.UTL_TCP", línea 267
ORA-06512: en "WORKFLOW.FTP", línea 76
ORA-06512: en "WORKFLOW.SUBIRFTP", línea 5
ORA-06512: en línea 2
回答1:
this error would be thown on 11g due to the ACL (access control list) restictions. you need to grant the privs to your "WORKFLOW" user to communicate with the FTP server.
you can see the existing grants in
select * from dba_network_acls
your dba can grant access with something like:
begin
dbms_network_acl_admin.create_acl(acl => 'ftp.xml',
description => 'Enables FTP',
principal => 'WORKFLOW',
is_grant => true,
privilege => 'connect');
end;
/
begin
dbms_network_acl_admin.assign_acl(acl => 'ftp.xml',
host => 'yourhost.com',
lower_port => ftp port);
end;
/
commit;
see the docs for more info.
来源:https://stackoverflow.com/questions/15816179/ora-24247-when-sending-through-ftp