2012-03-26 10 views
2

Ich habe ein Problem mit meiner Datenbank (Version ist Oracle 11g).Oracle 11g Prozedurfehler mit FTP-Paketen

Was wollte ich tun?

  • Ich möchte Prozeduren verwenden, um eine Datei auf den FTP-Server hochzuladen.

Wie habe ich getan?

  • erste, habe ich laden Sie die ftp.pks und ftp.pkb Dateien und ich verwende @ **. Pks diese Pakete zu importieren.

  • und dann Code, den ich die Verfahren wie folgt aus:

    DECLARE 
        l_conn UTL_TCP.connection; 
    BEGIN 
        l_conn := ftp.login('192.168.1.102', '21', 'tony', 'tony'); 
        ftp.ascii(p_conn => l_conn); 
        ftp.put(p_conn  => l_conn, 
          p_from_dir => 'MY_DOCS', 
          p_from_file => 'aaa.txt', 
          p_to_file => 'test_put.txt'); 
        ftp.logout(l_conn); 
    END; 
    
  • , wenn ich es laufen, die Konsole geben Sie mir diese Fehlerinformationen

ORA-24247: network access rejected by ACL 
    ORA-06512: at "SYS.UTL_TCP", line 17 
    ORA-06512: at "SYS.UTL_TCP", line 246 
    ORA-06512: at "SCOTT.FTP", line 76 
    ORA-06512: at line 4 
  • und für diese reas auf, habe ich die ACL Regeln mit dem folgenden Code:

    begin 
    
        DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(
        acl   => 'ftp_conn.xml', 
        description => 'ftp connection', 
        principal => 'SCOTT', 
        is_grant  => TRUE, 
        privilege => 'connect'); 
    
        DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(
         acl   => 'ftp_conn.xml', 
         host  => '192.168.1.102', 
         lower_port => 21, 
         upper_port => 21); 
    
    end; 
    

Aber, wenn ich den FTP-Code erneut ausführen, es zeigt auch, dass Fehler, so möchte ich wissen, wie diese zu beheben.

ACL können TCP-Verbindung erlauben, aber wenn ich ftp-Paket verwenden, und rufen ‚ftp.put‘, Die Konsolenausgabe ist

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 
+0

Haben Sie nach der ACL-Anmeldung zugesagt? –

+0

@ A.B.Cade ja, ich habe die Änderungen übernommen. – Tony

+0

kann das helfen? stackoverflow.com/questions/9827038/oracle-11g-migrated-users-have-acl-set-but-cant-hit-utl-http-ora-24247-29273/9858759 –

Antwort

0

Versuchen Sie, die Entschlossenheit Privileg hinzuzufügen (auch wenn es seltsam klingt ...):

begin 
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(
acl   => 'ftp_conn.xml', 
description => 'ftp connection', 
principal => 'SCOTT', 
is_grant  => TRUE, 
privilege => 'connect'); 

DBMS_NETWORK_ACL_ADMIN.add_privilege ( 
acl   => 'ftp_conn.xml', 
principal => 'SCOTT', 
is_grant => FALSE, 
privilege => 'resolve', 
position => NULL, 
start_date => NULL, 
end_date => NULL); 

DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(
    acl   => 'ftp_conn.xml', 
    host  => '192.168.1.102', 
    lower_port => 21, 
    upper_port => 21); 

end; 
/
COMMIT; 
+1

Es tut mir leid, das Format der Fehlerinformationen ist nicht schön
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 Tony