하나의 DEFERRED TRANSACTION 에 대한 DEFCALL을 알수있는 PROCEDURE.

제품 : ORACLE SERVER
작성날짜 : 2002-11-15
하나의 DEFERRED TRANSACTION 에 대한 DEFCALL을 알수있는 PROCEDURE.
=================================================================
PURPOSE
다음은 하나의 DEFERRED TRANSACTION 에 대한 DEFCALL을 알수 있는
PROCEDURE를 제공한다.
Explanation
각각의 DEFERRED TRANSACTION에대한 DEFCALL을 알 수 있음에 따라
DEFERRED TRANSACTION 의 ENTRY 에 대하여 다음과 같은 PROCEDURE를
이용하여 TRANSACTION을 추적할수 있다.
Example
다음의 SCRIPT는 REPADMIN으로 실행하여야 하며(sys user도 가능)
SQLPLUS에서 SET SERVEROUTPUT ON 을 실행후 사용하여야 한다.
CREATE OR REPLACE PROCEDURE show_call (t IN VARCHAR2) IS
-- Print the argument type and values of a deferred call.
-- Modified for Oracle8 and supports all replicated datatypes including
-- NCHAR, NVARCHAR and all LOBs. (BFILES are not replicated [yet])
-- NOTE: set serveroutput on before calling this procedure
-- set serveroutput on size 100000
argno number;
argtyp number;
argform number;
callno number;
tranid VARCHAR2(30);
typdsc char(15);
rowid_val rowid;
char_val varchar2(255);
nchar_val nvarchar2(255);
date_val date;
number_val number;
varchar2_val varchar2(2000);
nvarchar2_val nvarchar2(2000);
raw_val raw(255);
cursor c_defcall (t VARCHAR2) is
select callno, deferred_tran_id, schemaname, packagename, procname,
argcount
from defcall
where deferred_tran_id = t;
BEGIN
FOR c1rec in c_defcall (t) LOOP
dbms_output.put_line('Call Number: ' ||c1rec.callno);
dbms_output.put_line('Call to '
||c1rec.schemaname||'.'||c1rec.packagename||'.'||c1rec.procname);
dbms_output.put_line('# of arguments: '||c1rec.argcount);
dbms_output.put_line(' ARG ' || 'Data Type ' || 'Value');
dbms_output.put_line(' --- ' || '--------------- ' ||
argno := 1;
callno := c1rec.callno; tranid := c1rec.deferred_tran_id;
WHILE TRUE LOOP
if argno > c1rec.argcount then
exit;
end if;
argtyp := dbms_defer_query.get_arg_type(callno, argno, tranid);
argform := dbms_defer_query.get_arg_form(callno, argno, tranid);
if argtyp = 1 and argform = 1 then
typdsc := 'VARCHAR2';
varchar2_val := dbms_defer_query.get_varchar2_arg(callno, argno,
tranid);
dbms_output.put_line(to_char(argno,'09')||') '||typdsc||'
'||nvl(varchar2_val,'(NULL)'));
elsif argtyp = 1 and argform = 2 then
typdsc := 'NVARCHAR2';
nvarchar2_val := dbms_defer_query.get_nvarchar2_arg(callno, argno,
tranid);
dbms_output.put_line(to_char(argno,'09')||') '||typdsc||'
'||nvl(translate(nvarchar2_val using char_cs),'(NULL)'));
elsif argtyp = 2 then
typdsc := 'NUMBER';
number_val := dbms_defer_query.get_number_arg(callno, argno, tranid);
dbms_output.put_line(to_char(argno,'09')||') '||typdsc||'
'||nvl(to_char(number_val),'(NULL)'));
elsif argtyp = 11 then
typdsc := 'ROWID';
rowid_val := dbms_defer_query.get_rowid_arg(callno, argno, tranid);
dbms_output.put_line(to_char(argno,'09')||') '||typdsc||'
'||nvl(rowid_val,'(NULL)'));
elsif argtyp = 12 then
typdsc := 'DATE';
date_val := dbms_defer_query.get_date_arg(callno, argno, tranid);
dbms_output.put_line(to_char(argno,'09')||') '||typdsc||'
'||nvl(to_char(date_val,'YYYY-MM-DD HH24:MI:SS'),'(NULL)'));
elsif argtyp = 23 then
typdsc := 'RAW';
raw_val := dbms_defer_query.get_raw_arg(callno, argno, tranid);
dbms_output.put_line(to_char(argno,'09')||') '||typdsc||'
'||nvl(raw_val,'(NULL)'));
elsif argtyp = 96 and argform = 1 then
typdsc := 'CHAR';
char_val := dbms_defer_query.get_char_arg(callno, argno, tranid);
dbms_output.put_line(to_char(argno,'09')||') '||typdsc||'
'||nvl(char_val,'(NULL)'));
elsif argtyp = 96 and argform = 2 then
typdsc := 'NCHAR';
nchar_val := dbms_defer_query.get_nchar_arg(callno, argno, tranid);
dbms_output.put_line(to_char(argno,'09')||') '||typdsc||'
'||nvl(translate(nchar_val using char_cs),'(NULL)'));
elsif argtyp = 113 then
typdsc := 'BLOB';
varchar2_val := dbms_lob.substr(dbms_defer_query.get_blob_arg(callno,
argno, tranid));
dbms_output.put_line(to_char(argno,'09')||') '||typdsc||'
'||nvl(varchar2_val,'(NULL)'));
elsif argtyp = 112 and argform = 1 then
typdsc := 'CLOB';
varchar2_val := dbms_lob.substr(dbms_defer_query.get_clob_arg(callno,
argno, tranid));
dbms_output.put_line(to_char(argno,'09')||') '||typdsc||'
'||nvl(varchar2_val,'(NULL)'));
elsif argtyp = 112 and argform = 2 then
typdsc := 'NCLOB';
nvarchar2_val :=
dbms_lob.substr(dbms_defer_query.get_nclob_arg(callno, argno, tranid));
dbms_output.put_line(to_char(argno,'09')||') '||typdsc||'
'||nvl(translate(nvarchar2_val using char_cs),'(NULL)'));
end if;
argno := argno + 1;
end loop;
end loop;
end;
Examples
SQL> select * from deftran;
DEFERRED_TRAN_ID DELIVERY_ORDER D START_TIM
3.6.74010 4.9392E+12 R 05-SEP-98
2.8.74149 4.9392E+12 R 05-SEP-98
3.0.73506 4.9392E+12 D 02-SEP-98
SQL> set serveroutput on size 1000000
SQL> execute show_call('2.8.74149');
Call Number: 0
Call to SCOTT.DEPT$RP.REP_UPDATE
# of arguments: 11
ARG Data Type Value
01) RAW 06060707
02) NUMBER 70
03) NUMBER (NULL)
04) CHAR WGT
05) CHAR (NULL)
06) CHAR ORLANDO
07) CHAR RMSC
08) VARCHAR2 INITIAL
09) VARCHAR2 MOBAY.WORLD
10) VARCHAR2 MOBAY.WORLD
11) VARCHAR2 N
Call Number: 1
Call to SCOTT.DEPT$RP.REP_UPDATE
# of arguments: 11
ARG Data Type Value
01) RAW 06060707
02) NUMBER 75
03) NUMBER (NULL)
04) CHAR WGT
05) CHAR (NULL)
06) CHAR ORLANDO
07) CHAR RMSC
08) VARCHAR2 MOBAY.WORLD
09) VARCHAR2 MOBAY.WORLD
10) VARCHAR2 MOBAY.WORLD
11) VARCHAR2 N
PL/SQL procedure successfully completed.
Reference Documents
<Note:2103883.6>

Similar Messages

  • HOW TO VERIFY A DEFERRED TRANSACTION HAS BEEN PUSHED IN ORACLE8(MASTER REPL

    제품 : ORACLE SERVER
    작성날짜 : 2004-08-16
    HOW TO VERIFY A DEFERRED TRANSACTION HAS BEEN PUSHED IN ORACLE8
    (MASTER REPLICATION)
    ================================================================
    본 자료에서는 어느 시점에서, Deferred transaction이 PUSH 되었는지를
    확인하는 방법을 제시한다(In symmetric replication).
    단, Advanced Replication Feature는 8~10g Standard Edition에서는
    지원하지 않는다.
    개 념
    =====
    V7.x 에서는 deferred transaction 이 PUSH 됨과 동시에 삭제 되었으나, V8.x
    부터는 일정시간(interval) 이후에 PURGE 되는 절차를 따른다.
    임의의 transaction은 아래와 같은 조건을 만족할때 PUSH 된 것으로 확인될
    수 있다.
    즉, SCN-based integer 값을 기초로 transaction ordering 을 유지한다는
    기본개념을 적용한 것이다.
    - system.DEF$_DESTINATION.last_delivered > system.DEF$_AQCALL.cscn
    * DEF$_DESTINATION.last_delivered : the last transaction applied
    at the destination
    예 제
    =====
    이 예제는 REP1.ORACLE.COM site 에서 REP2.ORACLE.COM site 로 transaction 이 PUSH 되는 결과를 보여준다.
    SQL> insert into scott.dept values (80,'MARKETING','ORLANDO');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from deftran;
    DEFERRED_TRAN_ID DELIVERY_ORDER
    4.49.495 479001
    3.0.494 478972
    OR
    SQL> select enq_tid, cscn from system.def$_aqcall;
    ENQ_TID CSCN
    4.49.495 479001
    3.0.494 478972
    DEF$_DESTINATION table을 통하여 마지막으로 propagation 된 정보를 확인할
    수 있다
    SQL> select dblink, last_delivered from system.def$_destination;
    DBLINK LAST_DELIVERED
    REP2.ORACLE.COM 478992
    REP1.ORACLE.COM 478878
    이 시점에서 DEFERRED_TRAN_ID or ENQ_TID 4.49.495 transaction 이 PUSH 되지
    않았음을 알 수 있는것이다. 이는 DELIVERY_ORDER or CSCN 479001 transaction이 REP2.ORACLE.COM 에 대해 마지막으로 전이된 478992 보다 큰 값을 가지고 있기
    때문이다.
    즉, DEF$_AQCALL.CSCN > DEF$_DESTINATION.LAST_DELIVERED 을 만족한다면 해당 transaction 은 아직 PUSH 되지 않았음을 뜻한다.
    그럼 PUSH scheduling 을 적용 함으로써, 이러한 값들이 어떻게 변하는지 알아
    보도록 하자.
    SQL> exec dbms_defer_sys.schedule_push('rep2.oracle.com',
    'sysdate+1/(60*24)', sysdate+1/(60*24));
    PL/SQL procedure successfully completed.
    SQL> select * from deftran;
    DEFERRED_TRAN_ID DELIVERY_ORDER
    4.49.495 479001
    3.0.494 478972
    SQL> select enq_tid, cscn from system.def$_aqcall;
    ENQ_TID CSCN
    4.49.495 479001
    3.0.494 478972
    위 값들은 전혀 변하지 않았으나, 이는 Deferred transaction mechanism 관점에서
    정상적인 정보를 나타내고 있다(아직 PURGE 되지 않았기 때문)
    SQL> Select dblink, last_delivered from system.def$_destination;
    DBLINK LAST_DELIVERED
    REP2.ORACLE.COM 479017
    REP1.ORACLE.COM 478878
    그러나, DEF$_DESTINATION table 의 LAST_DELIVERED column 값을 확인해 보면, REP2.ORACLE.COM site 에 대한 값이 증가했음을 볼 수 있다.
    그런 이유로 DEFTRAN 에 기록되었던 transaction 중 DEF$_AQCALL.CSCN < DEF$_DESTINATION.LAST_DELIVERED 을 만족하는 모든 transaction 은 PUSH
    되었음을 확인할 수 있는것이다.
    특정 SITE 에 대해 PUSH 된 transaction 수를 구하는 방법
    ====================================================
    SQL> connect system/manager
    Connected.
    SQL> select count(*)
    from def$_aqcall
    where cscn < (select last_delivered
    from def$_destination
    where dblink ='REP2.ORACLE.COM');
    COUNT(*)
    2
    Reference
    =========
    Multimaster replication
    How to rectify the replication environment
    Parallel propagation

    제품 : ORACLE SERVER
    작성날짜 : 2004-08-16
    HOW TO VERIFY A DEFERRED TRANSACTION HAS BEEN PUSHED IN ORACLE8
    (MASTER REPLICATION)
    ================================================================
    본 자료에서는 어느 시점에서, Deferred transaction이 PUSH 되었는지를
    확인하는 방법을 제시한다(In symmetric replication).
    단, Advanced Replication Feature는 8~10g Standard Edition에서는
    지원하지 않는다.
    개 념
    =====
    V7.x 에서는 deferred transaction 이 PUSH 됨과 동시에 삭제 되었으나, V8.x
    부터는 일정시간(interval) 이후에 PURGE 되는 절차를 따른다.
    임의의 transaction은 아래와 같은 조건을 만족할때 PUSH 된 것으로 확인될
    수 있다.
    즉, SCN-based integer 값을 기초로 transaction ordering 을 유지한다는
    기본개념을 적용한 것이다.
    - system.DEF$_DESTINATION.last_delivered > system.DEF$_AQCALL.cscn
    * DEF$_DESTINATION.last_delivered : the last transaction applied
    at the destination
    예 제
    =====
    이 예제는 REP1.ORACLE.COM site 에서 REP2.ORACLE.COM site 로 transaction 이 PUSH 되는 결과를 보여준다.
    SQL> insert into scott.dept values (80,'MARKETING','ORLANDO');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from deftran;
    DEFERRED_TRAN_ID DELIVERY_ORDER
    4.49.495 479001
    3.0.494 478972
    OR
    SQL> select enq_tid, cscn from system.def$_aqcall;
    ENQ_TID CSCN
    4.49.495 479001
    3.0.494 478972
    DEF$_DESTINATION table을 통하여 마지막으로 propagation 된 정보를 확인할
    수 있다
    SQL> select dblink, last_delivered from system.def$_destination;
    DBLINK LAST_DELIVERED
    REP2.ORACLE.COM 478992
    REP1.ORACLE.COM 478878
    이 시점에서 DEFERRED_TRAN_ID or ENQ_TID 4.49.495 transaction 이 PUSH 되지
    않았음을 알 수 있는것이다. 이는 DELIVERY_ORDER or CSCN 479001 transaction이 REP2.ORACLE.COM 에 대해 마지막으로 전이된 478992 보다 큰 값을 가지고 있기
    때문이다.
    즉, DEF$_AQCALL.CSCN > DEF$_DESTINATION.LAST_DELIVERED 을 만족한다면 해당 transaction 은 아직 PUSH 되지 않았음을 뜻한다.
    그럼 PUSH scheduling 을 적용 함으로써, 이러한 값들이 어떻게 변하는지 알아
    보도록 하자.
    SQL> exec dbms_defer_sys.schedule_push('rep2.oracle.com',
    'sysdate+1/(60*24)', sysdate+1/(60*24));
    PL/SQL procedure successfully completed.
    SQL> select * from deftran;
    DEFERRED_TRAN_ID DELIVERY_ORDER
    4.49.495 479001
    3.0.494 478972
    SQL> select enq_tid, cscn from system.def$_aqcall;
    ENQ_TID CSCN
    4.49.495 479001
    3.0.494 478972
    위 값들은 전혀 변하지 않았으나, 이는 Deferred transaction mechanism 관점에서
    정상적인 정보를 나타내고 있다(아직 PURGE 되지 않았기 때문)
    SQL> Select dblink, last_delivered from system.def$_destination;
    DBLINK LAST_DELIVERED
    REP2.ORACLE.COM 479017
    REP1.ORACLE.COM 478878
    그러나, DEF$_DESTINATION table 의 LAST_DELIVERED column 값을 확인해 보면, REP2.ORACLE.COM site 에 대한 값이 증가했음을 볼 수 있다.
    그런 이유로 DEFTRAN 에 기록되었던 transaction 중 DEF$_AQCALL.CSCN < DEF$_DESTINATION.LAST_DELIVERED 을 만족하는 모든 transaction 은 PUSH
    되었음을 확인할 수 있는것이다.
    특정 SITE 에 대해 PUSH 된 transaction 수를 구하는 방법
    ====================================================
    SQL> connect system/manager
    Connected.
    SQL> select count(*)
    from def$_aqcall
    where cscn < (select last_delivered
    from def$_destination
    where dblink ='REP2.ORACLE.COM');
    COUNT(*)
    2
    Reference
    =========
    Multimaster replication
    How to rectify the replication environment
    Parallel propagation

  • DEFERRED TRANSACTION QUEUE의 내용을 지우는 여러가지 방법 (replication)

    제품 : ORACLE SERVER
    작성날짜 : 2004-08-13
    PURPOSE
    advanced replication 환경에서, 특정 master site나 updatable snapshot
    site은 다른 remote의 master site로 데이타를 propagation시키기 위해서
    해당 local site에 deferred transaction queue를 유지한다.
    remote site로 잘 전달된 데이타는 주기적으로 dbms_defer_sys.purge job에
    의해 deferred transaction queue인 DEFCALL에서 지워지게 되는데, 경우에
    따라 문제가 발생하면서 DEFCALL의 내용이 remote site로 전달이 안되면서
    계속해서 지워지지 않고 남게 될 수 있다.
    이러한 경우 다음 트랜잭션의 진행이나 전달에도 방해가 될 수 있어
    강제로 지우고자 하는 상황이 발생하는데 그러한 경우의 조치 방법에 대해서
    자세히 설명한다.
    SCOPE
    Advanced Replication Feature는 8~10g Standard Edition에서는 지원하지
    않는다.
    Explanation
    1. 특정 deferred transaction id를 지우는 경우
    기본적으로 deferred transaction queue에 쌓인 트랜잭션을 지우는
    방법은 다음과 같다.
    dbms_defer_sys.delete_tran(deferred_tran_id, destination)
    즉 다음 예와 같다.
    SQL>exec dbms_defer_sys.delete_tran('2.7.10', 'rep2.world');
    이때, 해당 destination에 대한 모든 트랜잭션인경우는 앞의 argument를
    null로 하고, 특정 transaction id에 대한 모든 destination에 대해서인
    경우는 뒷부분의 argument를 null로 한다.
    결국 저장된 모든 deferred transaction이라면, 다음과 같다.
    SQL>exec dbms_defer_sys.delete_tran(null,null);
    2. 특정 table에 관한 내용만 지우는 경우
    예를 들어 특정 table, 여기서는 DEPT table에 관한 사항을 DEFCALL에서
    지우고자 한다면 다음과 같이 조치하면 된다.
    SQL>connect repadmin/repadmin
    SQL>set pagesize 1000
    SQL>set head off
    SQL>spool purgedefcall.sql
    SQL>select 'exec dbms_defer_sys.delete_tran('''
    || deferred_tran_id || ''', null);'
    from defcall
    where packagename like 'DEPT%';
    SQL>spool off
    spool에 의해 만들어진 purgedefcall.sql을 깨끗하게 편집한 후 다시 save한다.
    SQL>connect repadmin/repadmin
    SQL>@purgedefcall.sql
    이때 만약 특정 site로의 전달만을 막고자 한다면, null대신 MS_B.WORLD와 같이
    해당 site를 가리키는 database link이름을 직접 지정하면 된다.
    3. 전체 queue의 내용을 모두 지우는 경우
    DEFCALL의 내용을 모두 지우는 경우라면 기본적으로는 앞에서 사용한
    DBMS_DEFER_SYS.DELETE_TRAN을 이용하면 된다.
    SQL>connect repadmin/repadmin
    SQL>exec dbms_defer_sys.delete_tran(null,null);
    DEFERROR의 내용을 모두 지우는 경우에는 DBMS_DEFER_SYS.DELETE_ERROR를
    사용한다.
    SQL>exec dbms_defer_sys.delete_error(null,null);
    그런데 이 delete_tran과 delete_error의 경우는 내부적으로 delete문장을
    사용하면서 undo record를 위해 rollback을 사용하면서 지워야 하는 데이타가
    매우 많은 경우 속도도 문제가 되고 rollback space오류도 발생 가능하다.
    이러한 경우에는 다음과 같이 truncate command를 이용하여 간단하고 빠르게
    deferred transaction queue의 내용을 정리할 수 있다.
    (1) Oracle7의 경우
    DEF$_CALL, DEF$_CALLDEST, DEF$_ERROR 를 모두 truncate시킨다.
    단 이때 DEF$_CALLDEST가 DEF$_CALL을 reference하는 constraint가 있는 관계로,
    DEF$_CALLDEST를 모두 truncate하여 데이타가 전혀 없는 상태에서도,
    DEF$_CALL이 truncate가 되지 않는다.
    delete operation의 경우 child table이 비어 있다면 master table의 데이타를
    지우는데 오류가 없지만, truncate의 경우는 데이타 확인 없이 바로 지우는
    것이기 때문에 child table에 데이타가 없다하더라도 그러한 check없이,
    무조건 자신을 reference하는 child table의 constraint가 enable되어 있는한은
    master table이 truncate가 불가능하게 된다.
    SQL>connect as system/password
    SQL>alter table system.DEF$_CALLDEST disable constraint
    DEF$_CALLDEST_CALL;
    SQL>truncate table system.DEF$_CALL;
    SQL>truncate table system.DEF$_CALLDEST;
    SQL>truncate table system.DEF$_ERROR;
    SQL>alter table system.DEF$_CALLDEST enable constraint DEF$_CALLDEST_CALL;
    (2) Oracle8의 경우
    Oracle8에서는 DEF$_CALLDEST가 더이상 DEF$_CALLDEST_CALL constraint를
    가지지 않으므로 이 부분에 대한 고려는 필요없이 다음과 같이 해당 table들을
    truncate시키면 된다.
    SQL>truncate table system.DEF$_AQCALL;
    SQL>truncate table system.DEF$_CALLDEST;
    SQL>truncate table system.DEF$_ERROR;
    SQL>truncate table system.DEF$_AQERROR;
    4. deferror의 내용을 지우는 방법
    deferred transaction이 remote로 전달되어 반영되다가 오류가 발생하면
    source가 되는 데이타베이스의 queue에서는 해당 내용이 사라지고,
    반영되던 destination 데이타베이스의 deferror와 defcall/deftran에
    해당 내용이 쌓이게 된다.
    이러한 경우 error의 내용을 다시 반영을 시도하거나 아니면 내용을
    확인 후 지우게 된다.
    다음과 같이 지우면 된다.
    SQL>exec dbms_defer_sys.delete_error(null,null);
    참고로 다시 수행하는 것은
    SQL>exec dbms_defer_sys.execute_error(null,null);
    Reference Documents
    <Note:190885.1> How to Clear Down the Deferred Queue and DBMS_DEFER_SYS.
    DELETE_TRAN

  • Transaction Notofocation Procedure - How to know the SAP user?

    Hi Experts,
    In the transaction notification procedure can we know the name of the SAP user whose transaction is being processed?
    Thanks a lot.
    Regards,
    B.

    hi
    sapgenpse get_my_name -v -n validity
    http://wiki.sdn.sap.com/wiki/display/Basis/HowtorenewtheSAPRouterlicense
    http://www.saptechies.com/how-to-renew-the-sap-router-certificate-validity_1/
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCSTROUT/BCCSTROUT.pdf
    Kiran

  • I Don't know how to use SBO Transaction Notification  procedure

    Hi all
    I don't know how to use SBO Transaction Notification  procedure
    can any body give me description why we use,where we use,how we use some example
    Awaiting soon reply
    Rajkumar G.

    example is for testing, if on delivery is filled ref no of vendor or not
    if @object_type = '20'  and (@transaction_type= 'A' or @transaction_type= 'U')
    begin
         if 1 = (select count(docentry) from opdn with(nolock) where docentry =@list_of_cols_val_tab_del and (numatcard is null or len(numatcard) = 0) )
         begin
              select @error =1
              select @error_message = 'vendor ref no isnt filled'
         end
    end
    next example is for creating BP as vendor and testing, if dont begin for specific sign
    if @object_type = '2' and @transaction_type= 'A'
    begin
    if left(@list_of_cols_val_tab_del, 1) = N'x' or left(@list_of_cols_val_tab_del, 1) = N'X'
         begin
              if 1 = (select count(cardcode) from ocrd where cardcode = @list_of_cols_val_tab_del and cardtype in ('S', N'S') )
                   begin
         select @error =1
              select @error_message = 'Vendor code cannot begin to X sign.'
    end
         end
    end
    is it clear?

  • Deferred transaction fails due to a "ORA-01403: no data found" error

    I recently acticated replication between two Oracle instances.
    (one being the master definition site and the other one being
    a second master site).
    Everything was going well until two weeks ago, when i realized
    that some datas were different between the two Oracle instances.
    I tried to figure out why and found that some deferred transation
    failed to propagate due to a "ORA-01403: no data found" error.
    Not all transaction fail, only a few.
    All the errors are stored in the DEFERROR table of the second
    master site, the DEFERROR table is empty in the master definition
    site.
    For every error, the source is the master definition site and the
    destination is the second master site, which is OK because the
    second master site is supposed to be "read-only". But why are the
    errors stored in the DEFERROR table of the second master site
    (and not in the master definition site (the source)).
    Most errors occur on UPDATE statements but a few of them occur
    on DELETE statements. Given the fact that the record actually is
    in the second master site, how is it possible to get a
    "ORA-01403: no data found" error on a delete statement ???????
    I can't figure out what data cannot be found,
    Thanks for your help,
    Didier.

    What if i tell you the first transaction in error is an UPDATE
    statement on a record that actually is in the destination table
    in the second master site. So the data is there, it should be
    found ...
    I've tried an EXECUTE_ERROR on that very first transaction
    in error but it doesn't work. Here's the call (as repadmin) :
    begin
    DBMS_DEFER_SYS.EXECUTE_ERROR (
    DEFERRED_TRAN_ID => '6.42.271',
    DESTINATION => 'AMELIPI.SENAT.FR'
    end ;
    And here's the full message :
    ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_DEFER_SYS_PART1" line 430
    ORA-06512: at "SYS.DBMS_DEFER_SYS" line 1632
    ORA-06512: at "SYS.DBMS_DEFER_SYS" line 1678
    ORA-06512: at line 2
    I thought it could be because the primary key constraint on the
    destination table wasn't activated but it was. Could it
    be a problem with the corresponding index ?
    Thanks for your help,
    Didier.

  • What kind of transaction in procedure?

    Hello,
    I have a procedure to reset sequences in tables:
    CREATE OR REPLACE PROCEDURE reset_sequence AS
    BEGIN
         LOCK TABLE table_name_1, table_name_2 IN EXCLUSIVE MODE NOWAIT;
         EXECUTE IMMEDIATE 'DROP SEQUENCE SEQ_1';
         EXECUTE IMMEDIATE 'CREATE SEQUENCE SEQ_1 START WITH 1 MAXVALUE 999999999999999999999999999 MINVALUE 1 NOCYCLE NOCACHE NOORDER';
         UPDATE table_name_1 SET id = SEQ_1.NEXTVAL;
         EXECUTE IMMEDIATE 'DROP SEQUENCE SEQ_2';
         EXECUTE IMMEDIATE 'CREATE SEQUENCE SEQ_2 START WITH 1 MAXVALUE 999999999999999999999999999 MINVALUE 1 NOCYCLE NOCACHE NOORDER';
         UPDATE table_name_2 SET id = SEQ_2.NEXTVAL;
         COMMIT;
    END reset_sequence;
    My question is: how can I do this procedure in one transaction? Set to serializable for session? This procedure have high prority, but when it's executed, other process can insert to these tables and I want to prevent it.
    Thanks.

    That's easy, just fix the column:
    SQL> create table t(c number(8));
    Table created.
    SQL> desc t
    Name                                      Null?    Type
    C                                                  NUMBER(8)
    SQL> alter table t modify (c number);
    Table altered.
    SQL> desc t
    Name                                      Null?    Type
    C                                                  NUMBER

  • Transactions across procedures

    Hi all,
    I have a procedure ProcA and procedure ProcB both of which have transactions
    Case1. ProcA calls ProcB
    Case2. ProcB can also be called independently
    How do we handle commits? (something to do with transaction_ids I guess but not sure)
    For case 1, we don’t want the commit on ProcB(Only in procA)
    But in case 2 we do need a commit.
    Any help would be much appreciated

    Like John and many others, I'm opposed to having commits in stored procedures in the vast majority of cases. Regardless, there is no magical way for ProcB to know whether you want it to commit or not. You'll need to have an argument to tell it to do so. Give it a default value of true and then you only need to specify it in the call from ProcA.

  • Turn off Transaction in Procedure

    Hello,
    In SAP HANA,
    Every Procedure is working as Transaction.
    While the Procedure is Executing If I want to Check the table for updates ,
    I cannot see them.
    When The Procedure is completely Executed Then only I am able to view the results.
    Please help me.

    Hello
    Thanks for the Reply.
    Instead of writing Commits for Every Procedure
    Can i do this globally for every Procedure.
    Like in SQL Server we have a Line called SET ANSI NULLS OFF kind a statement which does this.
    If that is there so, we will put a line in every procedure.
    Please help me

  • Transaction and procedure

    Hi experts.
    I`ve created some code for transaction and it is working fine. But when i`m trying to add this code to my procedure and execute it in transaction i recive lot`s of wird exeptions f.e. document header is missing and so on. What could be the problem pls help
    regards
    Michal

    Hi David
    i dont think its parameters folt .
    TN
    exec _APL_EAN @object_type  ,@transaction_type ,@num_of_cols_in_key,
    @list_of_key_cols_tab_del ,@list_of_cols_val_tab_del
    procedure
    create procedure _APL_EAN
         @object_type nvarchar(20),                     -- SBO Object Type
         @transaction_type nchar(1),               -- [A]dd, <u>pdate, [D]elete, [C]ancel, C[L]ose
         @num_of_cols_in_key int,
         @list_of_key_cols_tab_del nvarchar(255),
         @list_of_cols_val_tab_del nvarchar(255)
    as begin
    declare @error int
    declare @error_message varchar (100)
    if(@transaction_type ='A')
         begin
         declare @isok varchar(100)
         set @isok='ok'
         declare @docentry varchar(20)
         SET @docentry = @list_of_cols_val_tab_del
         if(@object_type='13' ) -- Faktura Sprzedarzy
              begin
              declare      @czyDokPow int
              set @ISOK= isnull(( select top 1 ItemCode From inv1 where U_ean is null and DocEntry=@docentry),'null')
              if(@Isok<>'null')
                   BEGIN SET @error_message =N'Prosze wprowadzic ean '
                   set @error=1
                   end
              else begin
                   set @czyDokPow =isnull((select   top 1  DocEntry  from INV1 where DocEntry= @list_of_cols_val_tab_del and BaseEntry is null ),-1)
                   if(@czyDokPow<>-1)
                        begin
                        insert into _APL_Kody (ItemCode,Ean,Magazyn,Rozmiar,Ilosc)   select ItemCode, U_ean,WhsCode,U_rozmiar,0-Quantity
                        from INV1 where DocEntry= @list_of_cols_val_tab_del
                        end
                   end
              end

  • How can i implement a Transaction Processing procedure in my web app ?

    Im planning to enhance my web app servlet.
    the web app is about Online Banking.
    since it is Online banking, there would be time where simultaneous user accessing their account. mean several connection is made on my db.
    I read some article about Transaction processing, so i think it is wise for me to
    implement on my web app but i not sure where to start and in what way can i integrate it with my web app.
    here are several thing i have in mind..
    making the admin able to monitor , or better if can coordinate the transaction.determine the network traffic on my web app. etc.
    any advise or wise opinion please ..thank you for time reading too.

    Im planning to enhance my web app servlet.
    the web app is about Online Banking.
    since it is Online banking, there would be time where
    simultaneous user accessing their account. mean
    several connection is made on my db.
    I read some article about Transaction processing, so
    i think it is wise for me to
    implement on my web app but i not sure where to start
    and in what way can i integrate it with my web app.
    here are several thing i have in mind..
    making the admin able to monitor , or better if can
    coordinate the transaction.determine the network
    traffic on my web app. etc.
    any advise or wise opinion please ..thank you for
    time reading too.Read about ACID properties, isolation, and locking mechanisms. It's a database issue, not a network traffic problem.
    Please tell me that this is just a homework assignment. If not, please tell me the name of the bank that employs you so I can be sure to never have dealings with them.
    %

  • Problem in setting up schedule push

    Hi every body,
    I have a multimaster advance replication environment and we have less than 10 transaction per day. I am not sure what is the correct set up for my case.Could you please help me?
    My first question is:I want to propagate data as soon as possible like sync if I setup the schedule push to propagate transaction every 5 seconds as below
    BEGIN
    DBMS_DEFER_SYS.SCHEDULE_PUSH(
    destination => 'orc2',
    interval => 'SYSDATE + (5/60*60*24)',
    next_date => SYSDATE,
    parallelism => 1,
    delay_seconds => 10);
    END;
    is it correct approach?
    in other hand ,book(I mean Advance Replication) has written that for simulating continuous push we should setup it as below so it will propagate transaction every 1 minute.
    My second question is:I know interval >= 'SYSDATE + (1/144)' means every 10 minutes a job will start and delay_seconds => 1200 means each job remain aware for 20 minutes,
    but I can't understand why it can simulate 1 minute propagation? anybody knows?
    BEGIN
    DBMS_DEFER_SYS.SCHEDULE_PUSH(
    destination => 'orc2',
    interval => 'SYSDATE + (1/144)',
    next_date => SYSDATE,
    parallelism => 1,
    execution_second >= 1500,
    delay_seconds => 1200);
    END;
    My thrid question is :Which of the above setups is a better solution for my environment?I mean 5 second interval (interval => 'SYSDATE + (5/60*60*24)') + delay_second = 10 and parallel or 10 minute interval (interval => 'SYSDATE + (1/144)') + delay_second = 1200 and parallel + execution_second =>1500)
    Thank you in advance.
    Mery

    With a "delay" of 20minutes, the push job will "hang around" for 20minutes waiting for new transactions. If it receives no new transactions to push, it will go to sleep. However, with the job interval at 1minute, it will "wake up" one minute later and push
    transactions that were created in that last 1 minute. Again, it will "hang around" for the next 20minutes.
    This is what I see from the 9i documentation (for advanced replication not using streams, I find the 8i and 9i documentation better
    than the 10g documentation)
    Delay Seconds
    Though not directly a performance mechanism, properly configuring the delay_seconds parameter can give you greater control over the timing of your propagation of deferred transactions.
    When you are pushing deferred transactions, you set the delay_seconds parameter in the SCHEDULE_PUSH procedure or the PUSH function. When you are purging deferred transactions, you set the delay_seconds parameter in the SCHEDULE_PURGE procedure or the PURGE function. These procedures and functions are in the DBMS_DEFER_SYS package.
    The delay_seconds parameter controls how long a job remains aware of the deferred transaction queue. The effects of the delay_seconds parameter can best be illustrated with the following two examples:
    delay_seconds = 0 (default)
    If a scheduled job with a 60 minute interval wakes up at 2:30 pm and checks the deferred transaction queue, then any existing deferred transactions are propagated. The propagation takes 2 minutes and therefore the job is complete at 2:32 pm.
    If a deferred transaction enters the queue at 2:34 pm, then the deferred transaction is not propagated because the job is complete. In this scenario, the deferred transaction will be propagated at 3:30 pm.
    delay_seconds = 300
    If a scheduled job with a 60 minute interval wakes up at 2:30 pm and checks the deferred transaction queue, then any existing deferred transactions are propagated. The propagation takes 2 minutes and therefore the job is complete at 2:32 pm.
    If a deferred transaction enters the queue at 2:34 pm, then the deferred transaction is propagated because the job remains aware of the deferred transaction queue for 300 seconds (5 minutes) after the job has completed propagating whatever was in the queue. In this scenario, the deferred transaction is propagated at 2:34 pm.
    Why not just set the job to execute more often? Starting and stopping the job has a greater amount of overhead than starting the job and keeping it aware for a set period of time. In addition to decreasing the overhead associated with starting and stopping these jobs, using the delay_seconds parameter can reduce the amount of redo logging required to support scheduled jobs.
    As with most performance features, there is a point of diminishing returns. Keep the length of the delay_seconds parameter in check for the following reasons:
    Parallel Propagation: Each parallel process that is used when pushing the deferred transaction queue is not available for other parallel activities until the propagation job is complete. A long delay_seconds value may keep the parallel process unavailable for other operations. To use parallel propagation, you set the parallelism parameter to 1 or higher in the SCHEDULE_PUSH procedure or the PUSH function.
    Serial Propagation: If you are using serial propagation (not parallel propagation), then the delay_seconds value causes the open session to "sleep" for the entire length of the delay, providing none of the benefits earlier described. To use serial propagation, you set the parallelism parameter to 0 (zero) in the SCHEDULE_PUSH procedure or the PUSH function.
    Precise Purge: If you specify the purge_method_precise method when using the DBMS_DEFER_SYS.PURGE procedure and you have defined a large delay_seconds value, then you may experience performance degradation when performing the specified purge. Using purge_method_precise is more expensive than the alternative (purge_method_quick), but it ensures that the deferred transactions and procedure calls are purged after they have been successfully pushed.
    As a general rule of thumb, there are few viewable benefits of setting the delay_seconds parameter to a value greater than 20 minutes (which is 1200 seconds for the parameter setting).
    Additionally, if you are using serial propagation by setting the parallelism parameter to 0, then you probably do not want to set a large delay_seconds value. Unlike parallel propagation, serial propagation only checks the queue after the duration of the delay_seconds value has elapsed. If you use serial propagation and set delay_seconds to 20 minutes, then the scheduled job will sleep for the entire 20 minutes, and any deferred transactions that enter the deferred transaction queue during that time are not pushed until 20 minutes have elapsed. Therefore, if you are using serial propagation, then consider setting delay_seconds to a value of 60 seconds or lower.
    If you set a value of 20 minutes for parallel propagation, then the parallel push checks once a minute. If you can afford this resource lock, then the relatively high delay_seconds value of 20 minutes is probably most efficient in your environment. If, however, you cannot afford this resource lock, then consider setting the delay_seconds value to 10 or 20 seconds. Although you will need to execute the jobs more often than if the value was set to 1200 seconds, you still gain many of the benefits of the delay_seconds feature (versus the default value of 0 seconds).

  • Deleted transactions issue

    Hello,
    We have a master database which runs on oracle 9iR2 and a replica backup database that runs on 11g. We have a replication between those servers. There is a huge amount of data that flows from master to replica.
    Yesterday, master database stacked and i needed to reset the server. When it restarted, the database instance started to work properly. But there had been a lot of deferred transactions that are flowing from replica to master. I have unscheduled the push procedure(scheduled link) from 11g EM and recreate it. So, it worked after that. But some transactions left, before recreating last schedule. After that i couldn't find any solutions how to push those transactions from replica to master. I started to remove them from 11g EM. I have removed them all, but they stayed on 9i EM replication topology. Also, topology still shows that there are 322 deferred transactions. When i look at deftrandest view (select * from deftrandest), those transactions were all there. But, when i look at errors from deferred transactions error views, there were no errors.
    How can i remove or push those transactions and can you tell me how to check concurrency and consistensy that 2 databases are exactly the same?
    Kind Regards.
    Edited on: Oct 26, 2008 11:32 AM

    Hello
    If you find entries in DEFTRANDEST view, check the following to determine why PUSH is not touching these deferred transactions:
    1. Find out LAST_DELIVERED scn from SYSTEM.DEF$_DESTINATION for the destination dblink:
    select DBLINK,LAST_DELIVERED from SYSTEM.DEF$_DESTINATION;
    2. Find out the commit scn for the transactions from SYSTEM.DEF$_AQCALL:
    select distinct t.DEFERRED_TRAN_ID,a.CSCN
    from DEFTRANDEST t, SYSTEM.DEF$_AQCALL a
    where t.DEFERRED_TRAN_ID=a.ENQ_TID;
    3. Check if the CSCN for each of these transactions are lesser than LAST_DELIVERED scn. If LAST_DELIVERED is greater than CSCN for each of these transactions, then PUSH will never touch these transactions.
    Hope this helps.
    Thanks,
    Rijesh

  • Transaction type ZGC not possible (posting to affiliated company) in ABSO

    Hi all,
    We have depreciation areas 01, 30, 31, 32 .
    dep area 30, 31, 32  inherits the values from 01.
    We want to post credit value to dep area 01 after doing the aqusition .
    Hence we created a seperate transaction type ZGC ( in aqusitions- Tcode AO73) and limited it to dep areas 01, 30, 31, 32.
    Transaction type ZGC is having credit and " do not post to affliated company " radio button is selected.
    Now the issue is when we run ABSO to do a credit post in dep area 01 we are getting the below error .
    Transaction type ZGC not possible (posting to affiliated company)
    Message no. AA390
    Diagnosis
    For the current document, you specified either implicitly (via the customer/vendor), or explicitly (with a manual entry), that this posting is to an affiliated company. In this case, Asset Accounting requires you to use special transaction types.  This enables the system to separately identify such transactions.
    Procedure
    Check the line items that you have already entered, and the transaction type you entered.
    Not sure why it is asking for affliated company .
    It will be great if any one help on this why we are getting this issue.

    Hi Daya,
    Please try to choose Trans.Type 100 in AO73 transaction code and select the radio button  Post to affiliated company under Posting type.
    Thanks,
    Kumar

  • Posting with transaction type 160 is not possible at MR8M

    MODERATOR:  Do not post (or request) email address or links to copyrighted or confidential information on these forums.  If you do, the thread will be LOCKED and all points UNASSIGNED.  If you have some information, please consider posting it to the [Wiki|https://wiki.sdn.sap.com/wiki/display/ERPFI/Home] rather than sharing via email.  Thank you for your assistance.
    Hi All,
    We raised  a PO w.r.t CWIP asset and posted GRN (MIGO - Transaction typr:100) and Invoice (MIRO).
    Here, Invoice posted wrongly, So we are trying to reverse the invoice with MR8M (which is posted thru MIRO).
    But system populating one message as per the following:
    Posting with transaction type 160 is not possible here, see long text
    Message no. AAPO 177
    Diagnosis:
    Transaction type 160 has a depreciation limitation, although posting is not mandatory in all of the depreciation areas entered However, it is not possible to select depreciation areas in the current transactions.
    Procedure:
    Check the specification of transaction type 160 or use transaction MR8M to enter the transaction
    Please help
    Sairavi
    kumarfi9gmailcom

    Welcome to the forum.
    As a newbie you should understand the forum rules where you are not suppose to post any basic or repeated question.  To avoid this, you should make a search here
    [Forum Search|http://forums.sdn.sap.com/search!default.jspa?objID=f327]
    Type the same error text in Search Terms so that you will find the solution.
    thanks
    G. Lakshmipathi

Maybe you are looking for