Гость
Целевая тема:
Создать новую тему:
Автор:
Форумы / Oracle [игнор отключен] [закрыт для гостей] / причины ORA-02064: distributed operation not supported / 5 сообщений из 5, страница 1 из 1
04.09.2017, 09:33
    #39514860
saxarock
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
причины ORA-02064: distributed operation not supported
есть такая штука
Код: plsql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
procedure ....
 begin

      user_sqlrowcount := rep_R@uo;
    
    LogAction(p_ActionName, p_Ac, 'END', user_sqlrowcount);
      commit;
    

    exception when OTHERS then
      LogAction(p_ActionName, p_ActionBrick, 'END', pErrMessage => SQLERRM);
      rollback;
 end;



в rep_R@uo следующее:

Код: plsql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
function rep_R return number
is
  v_sync date;
  sql_rows          pls_integer := 0;
  sql_rows_curr     pls_integer := 0;
  n                 number      := 0;
  n_commitrows      number      := 3000;
begin
for rec in (SELECT DISTINCT qw FROM Clients  
           ) loop
           -- возьмем max дату синхронизации
                   select trunc (max(t.tax), 'MM')
                     into v_sync
                     from n t
                    where rec.qw = t.qw;
                 --затянем данные
              MERGE INTO .......;

  sql_rows_curr := sql%rowcount;
  sql_rows      := sql_rows + sql_rows_curr;
  n             := n + sql_rows_curr;
  
 
  if n > n_commitrows then
       commit;
       n := 0;
     end if;
  
    end loop;
  --dbms_output.put_line('sql%rowcount : ' || n);
 return (sql_rows);
end;



Валится на commit; ORA-02064: distributed operation not supported.
нужно ли оно там, данных в мердж попадает многа, сегмент отката увеличивать не вариант. ХЗ, причина ли в этом?

Удаленная БД
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production.
...
Рейтинг: 0 / 0
04.09.2017, 09:53
    #39514873
Viewer
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
причины ORA-02064: distributed operation not supported
http://www.cyberforum.ru/oracle/thread703518.html Попробуйте перенести commit из 2 в 1 процедуру.
?
...
Рейтинг: 0 / 0
04.09.2017, 10:06
    #39514879
Viewer
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
причины ORA-02064: distributed operation not supported
saxarockпричины ORA-02064...
https://asktom.oracle.com/pls/apex/f?p=100:11:::NO:RP:P11_QUESTION_ID:9534655900346492970 and we said...
In a distributed transaction -- one in which "DATABASE A" calls "DATABASE B", only "DATABASE A" may commit. The reason is "database B" has no mechanism for co-ordinating with "database a" on the commit. We need to do a 2 phase commit to ensure that when the transaction commits any work performed on DATABASE A is committed *as well as* any work on database b.

Because the problem is more complex in general when database A calls both database B and database C. Here, if database B (which has NO IDEA that database C is even involved) attempted to commit -- it would not be able to coordinate with database A and having no knowledge of the existence of database C in the transaction -- could not coordinate it either.

A common workaround is an optional parameter to the existing routine -- a commit flag (make it be something like:

p_do_not_commit boolean in default FALSE );

You will then seek out all commit and rollback statements in the affected routine and rewrite them as:

if ( NOT p_do_not_commit ) then
commit;
end if;

so the routine can be called locally or remotely, and the parameter set accordingly.
...
Рейтинг: 0 / 0
04.09.2017, 11:42
    #39514941
saxarock
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
причины ORA-02064: distributed operation not supported
Viewer,

Код: plsql
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
procedure ....
 begin

      user_sqlrowcount := rep_R@uo;
    
    LogAction(p_ActionName, p_Ac, 'END', user_sqlrowcount);
      commit;--лишний коммит?
    

    exception when OTHERS then
      LogAction(p_ActionName, p_ActionBrick, 'END', pErrMessage => SQLERRM);
      rollback;
 end;
...
Рейтинг: 0 / 0
04.09.2017, 12:23
    #39514986
Viewer
Участник
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
причины ORA-02064: distributed operation not supported
2 saxarock
Попробуйте уж сами решить, где у вас "DATABASE A" и где "DATABASE B" ;)
...
Рейтинг: 0 / 0
Форумы / Oracle [игнор отключен] [закрыт для гостей] / причины ORA-02064: distributed operation not supported / 5 сообщений из 5, страница 1 из 1
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]