Pular para o conteúdo
Visualizando 14 posts - 1 até 14 (de 14 do total)
  • Autor
    Posts
  • #89187
    ramasine
    Participante

      galera,

      tem um job demorando pra burro….sempre o evento associado a ele é o library cache pin…alguem pode dar mais informações sobre esse cara e se tem alguma investigação mais profunda?

      16:34:07 sql’@’btosing > @sess

      Last Cal LAST_CALL_ET Idle OSUSER SIDSER USERNAME MODULE EVENT
      ——– ———— ——— ———- ———– ——————— ————— —————–
      09.08.21 352 0:5:52 job ‘142,45539’ OPS$JOB enqueue
      09.08.21 207 0:3:27 job ‘81,11321’ OPS$JOB library cache pin

      #89189
      ramasine
      Participante

        Mais uma informação!

        16:58:36 sql’@’bposing > select * from V$session_event
        16:58:51 2 where sid = 204;

        SID EVENT TOTAL_WAITS TOTAL_TIMEOUTS TIME_WAITED AVERAGE_WAIT MAX_WAIT TIME_WAITED_MICRO


        204 latch free 67 9 14 0 3 144360
        204 db file sequential read 4080 0 2666 1 20 26660908
        204 db file scattered read 17 0 13 1 2 125422
        204 single-task message 3 0 14 5 5 144987
        204 SQLNet message to client 4 0 0 0 0 2
        204 SQL
        Net message to dblink 16835 0 1 0 0 12498
        204 SQLNet message from client 4 0 0 0 0 1064
        204 SQL
        Net message from dblink 16835 0 11761 1 116 117608196
        204 SQL*Net more data from dblink 151 0 0 0 0 2798

        #89190
        vieri
        Participante

          Não é melhor vc analizar a procedure que o job dispara,
          ela deve usar db_link.

          Prrvavelmente deve fazer alguma carga (linha á linha) em outro server.

          #89191
          ramasine
          Participante

            Exato Vieri, usa mesmo dblink..!
            Tem alguma maneira de ir mais a fundo nessa analise?

            #89192
            ramasine
            Participante

              Esse é o código da Package que anda na execução!
              Realmente faz uso do dblink! O gargalo deve estar por ai, junto com o evento LATCH FREE (Library Cache)

              procedure principal (i_ano in varchar2,
              i_dat_emi in varchar2,
              i_fic_nin in varchar2,
              o_erro out number,
              o_mensagem out varchar2)

              is
              begin

              g_campanha := i_ano;
              g_dat_emi  := to_date(i_dat_emi, env.formato);
              

              — avalia quais os dblinks activos —

              horpr203('SINGA', 'ISIP', v_link_isip, g_erro, g_mensagem);
              if g_erro  0 then
                 raise v_fim;
              end if;
              
              horpr203('SINGA', 'SNIRB', v_link_snirb, g_erro, g_mensagem);
              if g_erro  0 then
                 raise v_fim;
              end if;
              

              — carrega a informacao das culturas —

              carrega_culturas ();
              if g_erro != 0 then raise v_fim; end if;
              

              — carrega os tipos de pomares —

              carrega_pomares ();
              if g_erro != 0 then raise v_fim; end if;
              

              — carrega os controlos e os locais —

              carrega_controlos_locais ();
              if g_erro != 0 then raise v_fim; end if;
              

              — carrega Especies Classe Etária —

              carrega_esp_cla_eta ();
              if g_erro != 0 then raise v_fim; end if;
              

              — carrega Racas —

              carrega_racas ();
              if g_erro != 0 then raise v_fim; end if;
              

              — carrega Racas Agro-Ambientais —

              carrega_racas_agr ();
              if g_erro != 0 then raise v_fim; end if;
              

              — carrega culturas para o cálculo das bca’s —

              carrega_bca ();
              if g_erro != 0 then raise v_fim; end if;
              

              — carrega a hor_freguesia

              carrega_hor_freguesia ();
              if g_erro != 0 then raise v_fim; end if;
              

              — cria tranche de emissao —

              ccipk001_09.criar_tra_emi (g_campanha, g_dat_emi, 'CCI', g_tra_emi ,g_erro, g_mensagem);
              if g_erro  0 then
                 raise v_fim;
              end if;
              

              — universo de selecção —
              — —
              — se nao for indicado nenhum ficheiro de leitura de ningas é feito —
              — que estejam nas condicoes de ser emitidos —

              — —

              if i_fic_nin is not null  then
              
                 --abre o ficheiro para leitura
                 abre_ficheiros(i_fic_nin,g_erro, g_mensagem);
                 if g_erro  0 then
                    raise v_fim;
                 end if;
              
                 loop
              
                    begin
              
                      utl_file.get_line (v_ficheiro, v_string);
                      g_nifap := to_number(rtrim (substr (v_string,  1)));
                      open c_req_emi_fic(g_nifap);
                      fetch c_req_emi_fic into v_req_emi;
                      if c_req_emi_fic%found then
              
                        ccipk510_09.emite_requerente(g_nifap,g_erro, g_mensagem);
                        if g_erro  0 then
                           raise v_fim;
                        end if;
              
                      else
                        g_erro     := 110;
                        g_mensagem := ' Este nifap não está conforme para emissão na cci_sel_07 - '||g_nifap;
                        raise v_fim;
                      end if;
                      close c_req_emi_fic;
                    exception
                      when no_data_found then
                           exit;
                    end;
                 end loop;
              else
                 open c_req_emi;
                 fetch c_req_emi into v_req_emi;
                 while c_req_emi%found loop
              
                   g_nifap := v_req_emi.ter_ninga;
              
                   ccipk510_09.emite_requerente(g_nifap,g_erro, g_mensagem);
                   if g_erro  0 then
                       raise v_fim;
                   end if;
              
                   fetch c_req_emi into v_req_emi;
                 end loop;
                 close c_req_emi;
              end if;
              utl_file.fclose_all;
              
              o_mensagem := 'O procedimento acabou com Sucesso';
              
              begin
               dbms_session.close_database_link(substr(v_link_snirb,2));
               dbms_session.close_database_link(substr(v_link_isip,2));
              exception
                when others then
                  null;
              end;
              

              exception
              when v_fim then
              o_erro := g_erro;
              o_mensagem := ‘Principal: (1) Ninga’ || g_nifap||’ – ‘||substr(g_mensagem, 1, 200);
              begin
              dbms_session.close_database_link(substr(v_link_snirb,2));
              dbms_session.close_database_link(substr(v_link_isip,2));
              exception
              when others then
              null;
              end;
              when others then
              o_erro := sqlcode;
              o_mensagem := ‘Principal: (2) Ninga’ || g_nifap||’ – ‘||substr(sqlerrm, 1, 200);
              begin
              dbms_session.close_database_link(substr(v_link_snirb,2));
              dbms_session.close_database_link(substr(v_link_isip,2));
              exception
              when others then
              null;
              end;
              end;

              /*
              declare

              o_erro NUMBER:= 0;
              o_mensagem VARCHAR2(255);

              begin
              ccipk510_09.Principal (‘2009′,’03-03-2009′ ,null, o_erro , o_mensagem );
              if o_erro 0 then
              dbms_output.put_line(o_erro||’ – ‘||o_mensagem);
              else
              dbms_output.put_line(‘acabou bem’);
              end if;

              end;
              */
              end ccipk510_09;

              #89195
              vieri
              Participante

                Verifique na V$dblink no momento da execução se ela está conseguindo fechar a conexão com database link.

                O problema pode estár por ai…

                verifique também seu paramêtro open_links.

                E verifique o tamanho da shared_pool.

                acho que por ai é um bom inicio de investigação.

                #89197
                vieri
                Participante

                  Mais uma idéia.

                  204 db file scattered read 17 0 13 1 2 125422

                  Passe um trace na execução dela porque ela deve está com algum full
                  table scan.

                  #89202
                  ramasine
                  Participante

                    Vieri,

                    Na v$dblink não tem nada!
                    A shared_pool não está sobrecarregada!
                    Vou ver q questão do full scan..já não sei mais por onde ir..

                    Relançamos o processo e nada…

                    21:52:38 sql’@’bposing > @shared

                    TAMANHO_SHARED_POOL USADO_SHARED_POOL LIVRE_SHARED_POOL PERCENTAGEM_USADO_SHARED_POOL


                               2576        622,124001          1953,876                    24,1507764
                    

                    1 row selected.

                    Elapsed: 00:00:00.00
                    21:55:21 sql’@’bposing > @sess

                    Last Cal LAST_CALL_ET Idle OSUSER SIDSER USERNAME MODULE EVENT STATE


                    09.08.21 10664 2:57:44 job ‘291,23231’ OPS$JOB latch free WAITED KNOWN TIME

                    Um dos traces que tiramos..

                    TKPROF: Release 9.2.0.8.0 – Production on Fri Aug 21 17:10:48 2009

                    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

                    Trace file: bposing_ora_717002.trc
                    Sort options: fchcpu


                    count = number of times OCI procedure was executed
                    cpu = cpu time in seconds executing
                    elapsed = elapsed time in seconds executing
                    disk = number of physical reads of buffers from disk
                    query = number of buffers gotten for consistent read
                    current = number of buffers gotten in current mode (usually for update)
                    rows = number of rows processed by the fetch or execute call


                    SELECT IMA_VAL,IMA_POC
                    FROM
                    CCI_IMA_MAR_EXP_09 WHERE CAM_ANO_INI_CAM = :B4 AND TEM_NUM_SEQ = :B3 AND
                    TER_NINGA = :B2 AND IMA_MAR_EXP = :B1

                    call count cpu elapsed disk query current rows


                    Parse 0 0.00 0.00 0 0 0 0
                    Execute 3727198 51.08 63.09 0 0 0 0
                    Fetch 3727197 30.43 34.59 0 7454394 0 0


                    total 7454395 81.51 97.68 0 7454394 0 0

                    Misses in library cache during parse: 0
                    Optimizer goal: CHOOSE
                    Parsing user id: 91 (CCI) (recursive depth: 1)

                    Rows Execution Plan


                      0  SELECT STATEMENT   GOAL: CHOOSE
                      0   TABLE ACCESS   GOAL: ANALYZED (BY INDEX ROWID) OF
                              'CCI_IMA_MAR_EXP_09'
                      0    INDEX   GOAL: ANALYZED (UNIQUE SCAN) OF 'IME_09_PK' (UNIQUE)
                    

                    SELECT IAF_SEQ_PU
                    FROM
                    CCI_IMA_ANI_CFI_09 WHERE TER_NINGA = :B5 AND CAM_ANO_INI_CAM = :B4 AND
                    TEM_NUM_SEQ = :B3 AND IAF_SIA = :B2 AND IAF_ESP_DEC = ‘B’ AND IME_MAR_EXP =
                    :B1

                    call count cpu elapsed disk query current rows


                    Parse 0 0.00 0.00 0 0 0 0
                    Execute 3727197 51.53 65.02 0 0 0 0
                    Fetch 3727198 26.78 30.85 0 11181594 0 0


                    total 7454395 78.31 95.87 0 11181594 0 0

                    Misses in library cache during parse: 0
                    Optimizer goal: CHOOSE
                    Parsing user id: 91 (CCI) (recursive depth: 1)

                    Rows Execution Plan


                      0  SELECT STATEMENT   GOAL: CHOOSE
                      0   TABLE ACCESS   GOAL: ANALYZED (BY INDEX ROWID) OF
                              'CCI_IMA_ANI_CFI_09'
                      0    INDEX   GOAL: ANALYZED (UNIQUE SCAN) OF 'IAF_09_PK' (UNIQUE)
                    

                    OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS

                    call count cpu elapsed disk query current rows


                    Parse 0 0.00 0.00 0 0 0 0
                    Execute 0 0.00 0.00 0 0 0 0
                    Fetch 0 0.00 0.00 0 0 0 0


                    total 0 0.00 0.00 0 0 0 0

                    Misses in library cache during parse: 0

                    OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS

                    call count cpu elapsed disk query current rows


                    Parse 0 0.00 0.00 0 0 0 0
                    Execute 7454395 102.61 128.12 0 0 0 0
                    Fetch 7454395 57.21 65.44 0 18635988 0 0


                    total 14908790 159.82 193.56 0 18635988 0 0

                    Misses in library cache during parse: 0

                    2  user  SQL statements in session.
                    0  internal SQL statements in session.
                    2  SQL statements in session.
                    2  statements EXPLAINed in this session.
                    

                    Trace file: bposing_ora_717002.trc
                    Trace file compatibility: 9.02.00
                    Sort options: fchcpu
                    1 session in tracefile.
                    2 user SQL statements in trace file.
                    0 internal SQL statements in trace file.
                    2 SQL statements in trace file.
                    2 unique SQL statements in trace file.
                    2 SQL statements EXPLAINed using schema:
                    imtare.plan_table
                    Schema was specified.
                    Existing table was used.
                    14908816 lines in trace file.

                    #89203
                    ramasine
                    Participante

                      E o parâmetro OPEN_LINKS

                      22:01:28 sql’@’bposing > show parameter open%

                      NAME_COL_PLUS_SHOW_PARAM TYPE VALUE_COL_PLUS_SHOW_PARAM


                      open_links integer 4
                      open_links_per_instance integer 4

                      #89204
                      ramasine
                      Participante

                        E no final, depois de um tempão, o processo aborta com um ORA-0600..
                        Uiiii

                        ~*** SESSION ID:(291.23231) 2009-08-22 06:13:50.514
                        *** 2009-08-22 06:13:50.514
                        ksedmp: internal or fatal error
                        ORA-00600: internal error code, arguments: [4454], [], [], [], [], [], [], []

                        #89210
                        ramasine
                        Participante

                          E tb com esse erro:

                          ORA-02055:
                          distributed update operation failed; rollback required

                          Cause: a failure during distributed update operation may not have rolled back all effects of the operation. Since some sites may be inconsistent, the transaction must roll back to a savepoint or entirely

                          Action: rollback to a savepoint or rollback transaction and resubmit

                          Alguem pode ajudar com alguma sugestão?

                          #89215
                          Ricardo Portilho Proni
                          Participante

                            Minha aposta seria aqui, no loop que lê este arquivo:

                            utl_file.get_line (v_ficheiro, v_string);

                            Qual o tamanho deste arquivo?
                            Ele pode ser previamente carregado em uma tabela?

                            #89234
                            ramasine
                            Participante

                              Ricardo, vou verificar isso!!

                              Obrigado!!

                              #89264
                              ramasine
                              Participante

                                Galera,

                                Depois de muito suor e sangue, fazendo o meu trabalho e o do desenvolvedor, achei dentro de um cursor, um loop interminável, que gerava o double transaction na base de dados, fazia o open, o fetch e não o close..!!!

                                Valeu pela ajuda!!

                              Visualizando 14 posts - 1 até 14 (de 14 do total)
                              • Você deve fazer login para responder a este tópico.