Добро пожаловать в форум, Guest  >>   Войти | Регистрация | Поиск | Правила | В избранное | Подписаться
Все форумы / Oracle Новый топик    Ответить
 ORA-03113  [new]
Sherst
Member

Откуда:
Сообщений: 222
Привет всем.
При работе с LDAP получаю такую ошибку

ORA-03113: end-of-file on communication channel


Фильтр поиска в LDAP такой:

search_filter := '(&(objectclass=person)(uid=*)(mail=*))';



Самое смешное что раньше все работало и хорошо все считывалось. Есть подозрение что у некоторых людей отсутсвует мыло. Хотя эта ошибка может означать все что угодно.

Привожу код процедуры:

PROCEDURE testing_ldap(pm_val IN INTEGER) IS
  
    ldap_host   VARCHAR2(512); -- The LDAP Directory Host
    ldap_port   VARCHAR2(512); -- The LDAP Directory Port
    ldap_user   VARCHAR2(512); -- The LDAP Directory User
    ldap_passwd VARCHAR2(512); -- The LDAP Directory Password
    ldap_basedn VARCHAR2(512); -- The starting (base) DN
    retval      PLS_INTEGER; -- Used for all API return values.
    my_session  dbms_ldap.session; -- Used to store our LDAP Session
    res_attrs   dbms_ldap.string_collection; -- A String Collection used
    --   to specify which
    --   attributes to return
    --   from the search.
    search_filter VARCHAR2(512); -- A simple character string used to
    --   store the filter (criteria) for
    --   the search.
    res_message dbms_ldap.message; -- Used to store the message
    --   (results) of the search.
    temp_entry dbms_ldap.message; -- Used to store entries retrieved
    --   from the LDAP search to print
    --   out at a later time.
    entry_index PLS_INTEGER; -- Used as a counter while looping
    --   through each entry. As we
    --   retrieve an entry from the LDAP
    --   directory, we increase the
    --   counter by one.
    temp_dn VARCHAR2(512); -- After each entry is retrieved
    --   from the LDAP directory (from
    --   the search), we want to use
    --   this variable to extract, store
    --   and print out the DN for each
    --   entry.
    temp_attr_name VARCHAR2(512); -- After retrieving an entry from
    --   LDAP directory, we will want to
    --   walk through all of the
    --   returned attributes. This
    --   variable will be used to store
    --   each attribute name as we loop
    --   through them.
    temp_ber_elmt dbms_ldap.ber_element;
    attr_index    PLS_INTEGER; -- Used as a counter variable for
    --   each entry returned for each
    --   entry.
    temp_vals dbms_ldap.string_collection; -- Used to extract, store,
    --   and print each of the
    --   values from each
    --   attribute.
    temp_var  VARCHAR2(10);
    count_val NUMBER;
  
    p_uid        VARCHAR2(50);
    p_mail       VARCHAR2(50);
    p_all_symbol VARCHAR2(28);
  
  BEGIN
  
    dbms_output.enable(1000000);
  
    retval := -1;
    DELETE FROM test_ldaps@csd_meeting;
    COMMIT;
    -- p_all_symbol := 'abcdefghijklmnopqrstuvwxyz';
    --p_all_symbol := 'abcdefghijklmnopqrstuvwxy';
    -- -------------------------------------------------------------------------
    -- Customize the following variables as needed.
    -- -------------------------------------------------------------------------
    ldap_host   := 'ldap-ro.kv.aval';
    ldap_port   := '389';
    ldap_user   := '';
    ldap_passwd := '';
    ldap_basedn := 'ou=people,o=avalbank.com';
  
    -- -------------------------------------------------------------------------
    -- Print out variables.
    -- -------------------------------------------------------------------------
    dbms_output.put_line('DBMS_LDAP Search Example');
    dbms_output.put_line('---------------------------------------------------');
    dbms_output.put_line(rpad('LDAP Host ', 25, ' ') || ': ' || ldap_host);
    dbms_output.put_line(rpad('LDAP Port ', 25, ' ') || ': ' || ldap_port);
    dbms_output.put_line(rpad('LDAP User ', 25, ' ') || ': ' || ldap_user);
    dbms_output.put_line(rpad('LDAP Base ', 25, ' ') || ': ' ||
                         ldap_basedn);
  
    -- -------------------------------------------------------------------------
    -- We want all exceptions from DBMS_LDAP to be raised.
    -- -------------------------------------------------------------------------
    dbms_ldap.use_exception := TRUE;
  
    -- -------------------------------------------------------------------------
    -- Obtain an LDAP session. The init() function initializes a session with an 
    -- LDAP server. This actually establishes a connection with the LDAP server
    -- and returns a handle to the session which can be used for further
    -- calls into the API.
    -- -------------------------------------------------------------------------
    my_session := dbms_ldap.init(ldap_host, ldap_port);
  
    dbms_output.put_line(rpad('LDAP Session ', 25, ' ') || ': ' ||
                         rawtohex(substr(my_session, 1, 16)) ||
                         ' - (returned from init)');
  
    -- -------------------------------------------------------------------------
    -- Bind to the directory. The function simple_bind_s can be used to perform
    -- simple username/password based authentication to the directory server.
    -- The username is a directory distinguished name. This function can be 
    -- called only after a valid LDAP session handle is obtained from a call to 
    -- DBMS_LDAP.init(). If the connection was successful, it will return: 
    -- DBMS_LDAP.SUCCESS. This function can raise the following exceptions:
    --      invalid_session : Raised if the session handle ld is invalid.
    --      general_error   : For all other errors. The error string associated 
    --                        with this exception will explain the error in 
    --                        detail.
    -- -------------------------------------------------------------------------
    retval := dbms_ldap.simple_bind_s(my_session, ldap_user, ldap_passwd);
  
    --DBMS_OUTPUT.PUT_LINE(RPAD('simple_bind_s Returned ', 25, ' ') || ': ' ||
    --                     TO_CHAR(retval));
  
    -- -------------------------------------------------------------------------
    -- Before actually performing the sort, I want to setup the attributes I
    -- would like returned. To do this, I declared a "String Collection" that
    -- will be used to store all of the attributes I would like returned.
    --
    --      If I wanted to return all attributes, I would specify:
    --          res_attrs(1) := '*';
    -- 
    --      If I wanted multiple (specified) attributes, I would specify:
    --          res_attrs(1) := 'cn';
    --          res_attrs(2) := 'telephoneNumber';
    -- -------------------------------------------------------------------------    
    res_attrs(1) := 'uid';
    res_attrs(2) := 'mail';
  
    -- -------------------------------------------------------------------------
    -- Finally, before performing the actual search, I want to specify the 
    -- criteria I want to search on. This will be passed as the "filter"
    -- parameter to the actual search.
    --
    --      If you wanted all of the entries in the directory to be returned,
    --      you could simply specify:
    --          search_filter   := 'objectclass=*';
    --
    --      You could also refine your search my specify a criteria like the
    --      following:
    --          search_filter   := 'cn=Jeff*';
    -- -------------------------------------------------------------------------
      search_filter := '(&(objectclass=person)(uid=*)(mail=*))';
    
  

    retval := dbms_ldap.search_s(ld       => my_session,
                                 base     => ldap_basedn,
                                 scope    => dbms_ldap.scope_subtree,
                                 filter   => search_filter,
                                 attrs    => res_attrs,
                                 attronly => 0,
                                 res      => res_message);
  
    -- -------------------------------------------------------------------------
    -- After the search is performed, the API stores the count of the number of
    -- entries returned.
    -- -------------------------------------------------------------------------
    retval := dbms_ldap.count_entries(my_session, res_message);
    dbms_output.put_line(rpad('Number of Entries ', 25, ' ') || ': ' ||
                         to_char(retval));
    dbms_output.put_line('---------------------------------------------------');
  
    -- -------------------------------------------------------------------------
    -- Retrieve the first entry.
    -- -------------------------------------------------------------------------
    temp_entry  := dbms_ldap.first_entry(my_session, res_message);
    entry_index := 1;
  
    -- -------------------------------------------------------------------------
    -- Loop through each of the entries one by one.
    -- -------------------------------------------------------------------------
    count_val := 0;
    WHILE temp_entry IS NOT NULL LOOP
      -- ---------------------------------------------------------------------
      -- Print out the current entry.
      -- ---------------------------------------------------------------------
      temp_dn := dbms_ldap.get_dn(my_session, temp_entry);
    
      temp_attr_name := dbms_ldap.first_attribute(my_session,
                                                  temp_entry,
                                                  temp_ber_elmt);
      attr_index     := 1;
      WHILE temp_attr_name IS NOT NULL LOOP
      
        temp_vals := dbms_ldap.get_values(my_session,
                                          temp_entry,
                                          temp_attr_name);
      
        -- 
        IF temp_vals.COUNT > 0 AND temp_attr_name = 'mail' THEN
          p_mail := substr(temp_vals(0), 1, 50);
        END IF;
      
        -- 
        IF temp_vals.COUNT > 0 AND temp_attr_name = 'uid' THEN
          p_uid := substr(temp_vals(0), 1, 50);
        END IF;
      
        temp_attr_name := dbms_ldap.next_attribute(my_session,
                                                   temp_entry,
                                                   temp_ber_elmt);
        attr_index     := attr_index + 1;
      END LOOP;
    
      INSERT INTO test_ldaps@csd_meeting (id, mail) VALUES (p_uid, p_mail);
    
      IF (count_val = 50) THEN
        COMMIT;
        count_val := 0;
      END IF;
    
      temp_entry  := dbms_ldap.next_entry(my_session, temp_entry);
      entry_index := entry_index + 1;
      count_val   := count_val + 1;
    END LOOP;
    COMMIT;
  
    -- -------------------------------------------------------------------------
    -- Unbind from the directory
    -- -------------------------------------------------------------------------
    retval := dbms_ldap.unbind_s(my_session);
    dbms_output.put_line(rpad('unbind_res Returned ', 25, ' ') || ': ' ||
                         to_char(retval));
  
    -- -------------------------------------------------------------------------
    -- Handle Exceptions
    -- -------------------------------------------------------------------------
  EXCEPTION
    WHEN OTHERS THEN
      dbms_output.put_line(' Error code : ' || to_char(SQLCODE));
      dbms_output.put_line(' Error Message : ' || SQLERRM);
      dbms_output.put_line(' Exception encountered .. exiting');
    
  END;
19 июл 07, 14:03    [4409750]     Ответить | Цитировать Сообщить модератору
 Re: ORA-03113  [new]
SQL*Plus
Member

Откуда: Россия, Москва
Сообщений: 8129
ORA-03113: end-of-file on communication channel

Cause: The connection between Client and Server process was broken.

Action: There was a communication error that requires further investigation.
First, check for network problems and review the SQL*Net setup. Also, look in the
alert.log file for any errors. Finally, test to see whether the server process is dead
and whether a trace file was generated at failure time.
19 июл 07, 19:05    [4412371]     Ответить | Цитировать Сообщить модератору
Все форумы / Oracle Ответить