1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

ORA-24247: network access denied by access control list (ACL)

Discussion in 'Oracle Webcenter Suite (formerly Oracle ECM)' started by jesthr@gmail.com, May 25, 2012.

  1. jesthr@gmail.com

    jesthr@gmail.com Active Member

    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    80
    ------- ACL
    DECLARE
    l_acl_name VARCHAR2(30) := 'ftp_conn_test.xml';
    l_ftp_server_ip VARCHAR2(20) := '134.239.239.3';
    l_ftp_server_name VARCHAR2(20) := 'bsnet-test';
    l_username VARCHAR2(30) := 'TEST';
    BEGIN
    begin
    dbms_network_acl_admin.drop_acl( 'ftp_conn_test.xml' );
    end;
    DBMS_NETWORK_ACL_ADMIN.create_acl (
    acl => l_acl_name,
    description => 'Allow connections using UTL_TCP',
    principal => l_username,
    is_grant => TRUE,
    privilege => 'connect',
    start_date => null,
    end_date => NULL);
    COMMIT;
    DBMS_NETWORK_ACL_ADMIN.add_privilege (
    acl => l_acl_name,
    principal => l_username,
    is_grant => FALSE,
    privilege => 'connect',
    position => NULL,
    start_date => NULL,
    end_date => NULL);
    COMMIT;
    DBMS_NETWORK_ACL_ADMIN.assign_acl (
    acl => l_acl_name,
    host => l_ftp_server_ip,
    lower_port => NULL,
    upper_port => NULL);

    DBMS_NETWORK_ACL_ADMIN.assign_acl (
    acl => l_acl_name,
    host => l_ftp_server_name,
    lower_port => NULL,
    upper_port => NULL);
    COMMIT;
    END;
    /
    ---------------------------------------------------------------------
    set serveroutput on
    DECLARE
    l_conn UTL_TCP.connection;
    l_list bs_ftp.t_string_table;
    v_xfile varchar2(200);
    v_xpot varchar2(200);
    v_num number;
    v_id number;
    v_dat date := trunc(sysdate);
    BEGIN
    l_conn := bs_ftp.login('bsnet-test', '21', 'test', '4Test');
    v_xpot := '/tmp/output/accepted/';
    bs_ftp.nLST (p_conn => l_conn,
    p_dir => v_xpot,
    p_list => l_list);
    bs_ftp.LOGOUT (l_conn);
    DBMS_OUTPUT.put_line('Na '||v_xpot||' files: '||l_list.COUNT);
    IF l_list.COUNT > 0 THEN
    FOR i IN l_list.FIRST .. l_list.LAST LOOP
    DBMS_OUTPUT.put_line (i || ': ' || l_list (i));
    v_id := null;
    v_xfile := upper(substr(l_list(i), 1+length(v_xpot)));
    DBMS_OUTPUT.put_line (i || ': ' || v_xfile);
    END LOOP;
    END IF;
    DBMS_OUTPUT.put_line('close FTPDIR_NA_TEST');
    exception
    when others then
    DBMS_OUTPUT.put_line('Error (ftpdir_na_test)='||sqlerrm);
    end;
    ----------------------------------------------------------------------
    Error (ftpdir_na_test)=ORA-24247: network access denied by access control list (ACL)
    ----------------------------------------------------------------------