AUTONOMOUS TRANSACTION(8I NEW FEATURE)에 대한 소개

제품 : ORACLE SERVER
작성날짜 : 2003-10-14
AUTONOMOUS TRANSACTION(8I NEW FEATURE)에 대한 소개
==================================================
autonomous transaction은 child transaction이라고도 불리우며 Oracle
8i부터 제공되는 새로운 기능이며 현재까지는 pl/sql을 통해서만 구현이
가능하지만 앞으로는 OCI까지 확장될 예정이다.
pl/sql routine의 declare section 중 어떠한 곳에서라도 아래의 progma
(compiler directive)를 지시함으로써 autonomous로 구분이 가능하다.
pragma AUTONOMOUS_TRANSACTION;
'pragma'는
1) top-level anonymous blocks
2) local, standalone or packaged functions and procedures
3) methods of object types
4) database triggers의 declare section 어디에서나 나타낼 수 있슴.
아래의 경우에는 사용이 불가능.
1) outside of a declase section
2) nested block의 declare section
3) package specification
4) package body 중 procedure나 function definition 외부
5) type body중 method definition의 외부
autonomous transaction(tx) 내에서 명시적으로 rollback이나 commit을
하여야 한다. 만일 이를 위반하였을 경우 main transcation 및 child
transaction 모두 error 발생과 함께 rollback이 되게 된다.
main transaction이 수행 중이고 child transaction이 아래의 상태의 경우 :
1) autonomous transcation으로 선언된 code unit의 declare section에서
기술된 statement가 수행 중인 동안 parent tx는 active로 남아있게 된다.
2) "begin" 이후의 첫 executable step을 만나게 되면 parent transaction은
유보되고 새로운 tx(child tx)가 시작된다.
3) 이 code unit은 normal하게 수행이 되나 tx context는 새로운 transaction로
설정된다.
4) autonomous code unit에서 commit 이나 rollback 이 수행되면 이
autonomous tx은 종료된다. 이 때까지 parent(main) tx는 계속 유보상태로
남아 있으며 autonomous unit에서 계속되는 operation이 있다면 새로운 tx이
시작된다.
5) autonomous code unit에서 exit를 하게 되면 transaction context는
parent로 전환이 된다.
transaction context의 변경은 session parameter에 영향을 주지 않는다.
따라서 parent transaction 에서 적용된 session parameter는 그대로 child
tx에서도 영향을 미치게 된다.
parent tx와 child tx는 서로 독립적이므로 lock 역시 공유하지 못한다.
만일 parent tx에서 점유된 lock을 child에서 소유하고자 한다면 dead lock
현상이 발생할 것이다. 이런 경우 ORA-60 이 발생되고 child tx는 자동적으로
rollback 된다.
<주의>
ORACLE 8.1.6 README에서는 분산 transaction에서 autonomous tx 사용 시
dead lock 발생 시 distributed lock timeout을 정상적으로 하지 못한다는
주의사항이 소개되고 있슴.
[예제]
create table test_lobs (c1 number,c2 clob);
create table msg (msg varchar2(120));
create or replace function getlen (p1 in clob,
p2 in number) return number as
pragma AUTONOMOUS_TRANSACTION;
len number;
buf varchar2(120);
tlen number;
begin
len := dbms_lob.getlength(p1);
if len != 0 then
dbms_lob.read(p1,len,1,buf);
dbms_output.put_line('Value: '||buf);
insert into msg values (buf);
commit;
end if;
select dbms_lob.getlength(c2) into tlen
from test_lobs where c1=p2;
dbms_output.put_line('Length selected from table is '||tlen);
return len;
end;
insert into test_lobs values (1,'Hello');
insert into test_lobs values (2,'The quick brown fox');
commit;
declare
cl1 clob;
cl2 clob;
ret number;
begin
select c2 into cl1 from test_lobs where c1 = 1 for update;
select c2 into cl2 from test_lobs where c1 = 2;
ret := getlen(cl1,1);
dbms_output.put_line('Length of first row is '||ret);
ret := getlen(cl2,2);
dbms_output.put_line('Length of second row is '||ret);
dbms_lob.writeappend(cl1,6,' there');
ret := getlen(cl1,1);
dbms_output.put_line('Length of first row is now '||ret);
end;
gives:
Value: Hello
Length selected from table is 5
Length of first row is 5
Value: The quick brown fox
Length selected from table is 19
Length of second row is 19
Value: Hello there
Length selected from table is 5
Length of first row is now 11
Selecting from the msg table gives 3 rows as follows:
Hello
The quick brown fox
Hello there

Similar Messages

  • BLOCK CORRUPTION (ORA-1578) 처리 (ORACLE 8I NEW FEATURE)

    제품 : ORACLE SERVER
    작성날짜 : 2002-05-31
    BLOCK CORRUPTION (ORA-1578) 처리 (ORACLE 8I NEW FEATURE)
    ========================================================
    PURPOSE
    Block Corruption의 처리 방안에 대해 알아본다.
    Problem Description
    block corruption 시 10210, 10211,10231 의 event 를 사용해서
    해당 block 을 skip 할 수도 있지만 V8.1 이상에서는
    dbms_repair.fix_corrupt_blocks ,
    dbms_repair.skip_corrupt_block 를 이용하여
    corrupt가 발생한 block을 detect하고 skip, 또는 repair해주는 방안이
    제시되고 있다.
    Workaround
    Solution Description
    - 먼저 detecting 을 위해 db_block_checking =true 를 init.ora 에 set
    - dbms_repair 의 package 를 사용하는데 이 package 는 dbmsrpr.sql,
    prvtrpr.plb를 수행한다 .
    - sys 로 접속하여 package 를 실행한다.
    다음의 예제를 살펴보자
    T1 테이블에 corrupt 된 block 이 있다고 가정한다.
    SQL> desc t1
    Name Null? Type
    COL1 NOT NULL NUMBER(38)
    COL2 CHAR(512)
    SQL> analyze table t1 validate structure;
    analyze table t1 validate structure
    ERROR at line 1:
    ORA-01498: block check failure - see trace file
    이때 ANALYZE로 부터 발생된 trace file 에 corrupt 된 block 에 3 row 의
    (nrows = 3) data 가 있음을 알수 있다고 가정하자.
    DBMS_REPAIR.ADMIN_TABLES (repair and orphan key)
    ================================================
    ADMIN_TABLES 은 table 을 위한 repair table과,인덱스를 위한 orphan key
    tables을 제공한다.
    SQL> @adminCreate
    SQL> connect sys/change_on_install
    Connected.
    SQL>
    SQL> -- Repair Table
    SQL>
    SQL> declare
    2 begin
    3 -- Create repair table
    4 dbms_repair.admin_tables (
    5 -- table_name => 'REPAIR_TABLE',
    6 table_type => dbms_repair.repair_table,
    7 action => dbms_repair.create_action,
    8 tablespace => 'USERS'); -- default TS of SYS if not specified
    9 end;
    10 /
    PL/SQL procedure successfully completed.
    SQL> select owner, object_name, object_type
    2 from dba_objects
    3 where object_name like '%REPAIR_TABLE';
    OWNER OBJECT_NAME OBJECT_TYPE
    SYS DBA_REPAIR_TABLE VIEW
    SYS REPAIR_TABLE TABLE
    SQL>
    SQL> -- Orphan Key Table
    SQL>
    SQL> declare
    2 begin
    3 -- Create orphan key table
    4 dbms_repair.admin_tables (
    5 table_type => dbms_repair.orphan_table,
    6 action => dbms_repair.create_action,
    7 tablespace => 'USERS'); -- default TS of SYS if not specified
    8 end;
    9 /
    PL/SQL procedure successfully completed.
    SQL> select owner, object_name, object_type
    2 from dba_objects
    3 where object_name like '%ORPHAN_KEY_TABLE';
    OWNER OBJECT_NAME OBJECT_TYPE
    SYS DBA_ORPHAN_KEY_TABLE VIEW
    SYS ORPHAN_KEY_TABLE TABLE
    DBMS_REPAIR.CHECK_OBJECT
    =========================
    CHECK_OBJECT procedure 는 기술된 object를 check 하고, repair 를 위한 정보를 수집하기 위함이다.
    SQL> @checkObject
    SQL> set serveroutput on
    SQL>
    SQL> declare
    2 rpr_count int;
    3 begin
    4 rpr_count := 0;
    5 dbms_repair.check_object (
    6 schema_name => 'SYSTEM',
    7 object_name => 'T1',
    8 repair_table_name => 'REPAIR_TABLE',
    9 corrupt_count => rpr_count);
    10 dbms_output.put_line('repair count: ' || to_char(rpr_count));
    11 end;
    12 /
    repair count: 1
    PL/SQL procedure successfully completed.
    SQL> desc repair_table
    Name Null? Type
    OBJECT_ID NOT NULL NUMBER
    TABLESPACE_ID NOT NULL NUMBER
    RELATIVE_FILE_ID NOT NULL NUMBER
    BLOCK_ID NOT NULL NUMBER
    CORRUPT_TYPE NOT NULL NUMBER
    SCHEMA_NAME NOT NULL VARCHAR2(30)
    OBJECT_NAME NOT NULL VARCHAR2(30)
    BASEOBJECT_NAME VARCHAR2(30)
    PARTITION_NAME VARCHAR2(30)
    CORRUPT_DESCRIPTION VARCHAR2(2000)
    REPAIR_DESCRIPTION VARCHAR2(200)
    MARKED_CORRUPT NOT NULL VARCHAR2(10)
    CHECK_TIMESTAMP NOT NULL DATE
    FIX_TIMESTAMP DATE
    REFORMAT_TIMESTAMP DATE
    SQL> select object_name, block_id, corrupt_type, marked_corrupt,
    2 corrupt_description, repair_description
    3 from repair_table;
    OBJECT_NAME BLOCK_ID CORRUPT_TYPE MARKED_COR
    CORRUPT_DESCRIPTION
    REPAIR_DESCRIPTION
    T1 3 1 FALSE
    kdbchk: row locked by non-existent transaction
    table=0 slot=0
    lockid=32 ktbbhitc=1
    mark block software corrupt
    Data Extraction
    ===============
    repair table에 의하면 file 6 ,block 3 에 corrupt 이 났음을 알수 있다
    그러나 아직 이 block 은 corrupt 로 mark 되어 있지 않으므로 필요 data 를
    추출하여야 한다.
    1. ALTER SYSTEM DUMP (nrows = 3) 에 의해 block안에 있는 row수를 결정한다.
    2. corrupt object를 select 하여 가능한 정보를 추출한다.
    SQL> -- The following query can be used to salvage data from a corrupt block.
    SQL> -- Creating a temporary table facilitates data insertion.
    SQL> create table temp_t1 as
    2 select * from system.t1
    3 where dbms_rowid.rowid_block_number(rowid) = 3
    4 and dbms_rowid.rowid_to_absolute_fno (rowid, 'SYSTEM','T1') = 6;
    Table created.
    SQL> select col1 from temp_t1;
    COL1
    2
    3
    DBMS_REPAIR.FIX_CORRUPT_BLOCKS (ORA-1578)
    ============================================
    FIX_CORRUPT_BLOCKS procedure는 repair table 의 정보를 이용하여 corrupt
    blocks 을 fix 한다
    그러나 아직 full table scan 시 여전히 error 가 발생한다
    SQL> declare
    2 fix_count int;
    3 begin
    4 fix_count := 0;
    5 dbms_repair.fix_corrupt_blocks (
    6 schema_name => 'SYSTEM',
    7 object_name => 'T1',
    8 object_type => dbms_repair.table_object,
    9 repair_table_name => 'REPAIR_TABLE',
    10 fix_count => fix_count);
    11 dbms_output.put_line('fix count: ' || to_char(fix_count));
    12 end;
    13 /
    fix count: 1
    PL/SQL procedure successfully completed.
    SQL> select object_name, block_id, marked_corrupt
    2 from repair_table;
    OBJECT_NAME BLOCK_ID MARKED_COR
    T1 3 TRUE
    SQL> select * from system.t1;
    select * from system.t1
    ERROR at line 1:
    ORA-01578: ORACLE data block corrupted (file # 6, block # 3)
    ORA-01110: data file 6: '/tmp/ts_corrupt.dbf'
    DBMS_REPAIR.DUMP_ORPHAN_KEYS
    ==============================
    DUMP_ORPHAN_KEYS는 corrupt data 에 해당하는 index 를 나타내 준다
    SQL> select index_name from dba_indexes
    2 where table_name in (select distinct object_name from repair_table);
    INDEX_NAME
    T1_PK
    SQL> @dumpOrphanKeys
    SQL> set serveroutput on
    SQL>
    SQL> declare
    2 key_count int;
    3 begin
    4 key_count := 0;
    5 dbms_repair.dump_orphan_keys (
    6 schema_name => 'SYSTEM',
    7 object_name => 'T1_PK',
    8 object_type => dbms_repair.index_object,
    9 repair_table_name => 'REPAIR_TABLE',
    10 orphan_table_name => 'ORPHAN_KEY_TABLE',
    11 key_count => key_count);
    12 dbms_output.put_line('orphan key count: ' || to_char(key_count));
    13 end;
    14 /
    orphan key count: 3
    PL/SQL procedure successfully completed.
    SQL> desc orphan_key_table
    Name Null? Type
    SCHEMA_NAME NOT NULL VARCHAR2(30)
    INDEX_NAME NOT NULL VARCHAR2(30)
    IPART_NAME VARCHAR2(30)
    INDEX_ID NOT NULL NUMBER
    TABLE_NAME NOT NULL VARCHAR2(30)
    PART_NAME VARCHAR2(30)
    TABLE_ID NOT NULL NUMBER
    KEYROWID NOT NULL ROWID
    KEY NOT NULL ROWID
    DUMP_TIMESTAMP NOT NULL DATE
    SQL> select index_name, count(*) from orphan_key_table
    2 group by index_name;
    INDEX_NAME COUNT(*)
    T1_PK 3
    Note: orphan key table의 index 는 다시 rebuild 되어야 한다.
    DBMS_REPAIR.SKIP_CORRUPT_BLOCKS
    ===============================
    SKIP_CORRUPT_BLOCKS 은 table 과 index 의 corrupt block 을 skip 하는 것을 enable/disable 을 실시한다.
    Suggestion: SKIP_CORRUPT_BLOCKS 가 enabled되면 orphan key table의 모든
    index 는 모두 rebuild 되어야 한다. ( all index associated with object
    if DUMP_ORPHAN_KEYS was omitted).
    SQL> @skipCorruptBlocks
    SQL> declare
    2 begin
    3 dbms_repair.skip_corrupt_blocks (
    4 schema_name => 'SYSTEM',
    5 object_name => 'T1',
    6 object_type => dbms_repair.table_object,
    7 flags => dbms_repair.skip_flag);
    8 end;
    9 /
    PL/SQL procedure successfully completed.
    SQL> select table_name, skip_corrupt from dba_tables
    2 where table_name = 'T1';
    TABLE_NAME SKIP_COR
    T1 ENABLED
    SQL> -- rows in corrupt block skipped, no errors on full table scan
    SQL> select * from system.t1;
    COL1 COL2
    4 dddd
    5 eeee
    --> Notice the pk index has not yet been corrected.
    SQL> insert into system.t1 values (1,'aaaa');
    insert into system.t1 values (1,'aaaa')
    SQL> select * from system.t1 where col1 = 1;
    no rows selected
    DBMS_REPAIR.REBUILD_FREELISTS
    ===============================
    REBUILD_FREELISTS rebuilds freelists for the specified object.
    SQL> declare
    2 begin
    3 dbms_repair.rebuild_freelists (
    4 schema_name => 'SYSTEM',
    5 object_name => 'T1',
    6 object_type => dbms_repair.table_object);
    7 end;
    8 /
    PL/SQL procedure successfully completed.
    Rebuild Index
    =============
    Note: Every index identified in the orphan key table should be rebuilt to
    ensure consistent results.
    SQL> alter index system.t1_pk rebuild online;
    Index altered.
    SQL> insert into system.t1 values (1, 'aaaa');
    1 row created.
    SQL> select * from system.t1;
    COL1 COL2
    4 dddd
    5 eeee
    1 aaaa
    Reference Document
    ------------------

    Try look to alert<SID>.log file for full error report (you could paste it here).
    Also from alert log you could get real values for db_block_buffers and shared_pool_size parameters that used during instance startup.

  • (V9I) ORACLE 9I NEW FEATURE : RESUMABLE SPACE ALLOCATION

    제품 : ORACLE SERVER
    작성날짜 : 2002-11-01
    (V9I) ORACLE 9I New Feature : Resumable Space Allocation
    =====================================================
    PURPOSE
    Oracle9i New Feature 인 Resumable Space Allocation 에 대해
    알아보도록 한다.
    Explanation
    Resumable Space Allocation 은 다음과 같은 새로운 Space allocation
    이 발생되어야 할 시점에 에러를 바로 발생하지 않고 어느정도의 Time 을 준뒤
    Admin에게 이를 알림으로써 수행중인 Transaction rollback 되지 않고 계속적으로
    진행할 수 있도록 하는 기능이다.
    Query 수행시 다음과 같은 원인으로 에러가 발생하면서 query 수행이 중지된다.
    1) Out of space condition
    2) Maximum number of extents reached condision
    3) Space quota exceeded condition
    그러나 9I 에서 Resumable Space Allocation Operations을 설정하게 되면
    alertSID.ora file에 suspend 되는 메세지와 함께 설정한 timeout 까지 hang 상태가
    발생된다. 만약 timeout 초과시엔 에러가 발생하면서 transaction은 rollback 된다.
    alertSID.ora 메세지예)
    Wed Mar 14 11:14:17 2001
    statement in resumable session 'User SCOTT(54), Session 9, Instance 1' was
    suspended due to
    ORA-01631: max # extents (5) reached in table SCOTT.TEST_RESUMABLE
    Example
    다음은 Resumable Space Allocation Operations 을 설정하기 위해서는 RESUMABLE 을
    ENABLE 시키고 또는 DBMS_RESUMABLE package를 이용한다.
    1) RESUMABLE system privilege 부여
    SQL> connect system/manager
    Connected.
    SQL> grant resumable to scott;
    Grant succeeded.
    2) session level에서 RESUMABLE enable 시키기
    SQL> alter session enable resumable;
    Session altered.
    This can be set automatically through an AFTER LOGON trigger.
    SQL> create or replace trigger logon_set_resumable
    2 after logon
    3 on scott.schema
    4 begin
    5 execute immediate 'alter session enable resumable timeout 1200';
    6 end;
    7 /
    Trigger created.
    3) 생성한 TEST_RESUMABLE table 에 insert 작업
    -> insert 시에 hang 현상 발생(transaction rollback은 이루어지지 않는다.)
    -> alert.log에 suspend message 확인
    -> 만약 설정한 timeout 초과시 에러 발생되면서 transaction rollback
    a. Displaying the DBA_RESUMABLE view(DBA_RESUMABLE view에서 suspend 확인)
    SQL> select user_id,SESSION_ID, STATUS, START_TIME, SUSPEND_TIME,
    2 SQL_TEXT, ERROR_NUMBER, ERROR_MSG
    3 from dba_resumable;
    USER_ID SESSION_ID STATUS START_TIME SUSPEND_TIME
    SQL_TEXT
    ERROR_NUMBER
    ERROR_MSG
    54 9 SUSPENDED 03/14/01 10:49:25 03/14/01 11:14:17
    insert into test_resumable select * from test_resumable
    1631
    ORA-01631: max # extents (5) reached in table SCOTT.TEST_RESUMABLE
    b. In alert.log file(alert.log에서 message 확인)
    Wed Mar 14 11:14:17 2001
    statement in resumable session 'User SCOTT(54), Session 9, Instance 1' was
    suspended due to
    ORA-01631: max # extents (5) reached in table SCOTT.TEST_RESUMABLE
    c. The statement may issue the following error when the timeout set for the
    session has expired(timeout 초과시 transaction rollback 되면서 에러 발생)
    SQL> insert into test_resumable values (1);
    insert into test_resumable values (1)
    ERROR at line 1:
    ORA-30032: the suspended (resumable) statement has timed out
    ORA-01536: space quota exceeded for tablespace 'EXAMPLE'
    4) The DBA now knows why the session hangs, and needs to find which action to
    take to alleviate the ora-1631 error(DBA는 timeout 이 발생하기 전에 에러 발생)
    SQL> connect system/manager
    Connected.
    SQL> alter table scott.test_resumable storage (maxextents 8);
    Table altered.
    SQL> select user_id,SESSION_ID, STATUS, START_TIME, RESUME_TIME,
    2 SQL_TEXT, ERROR_NUMBER, ERROR_MSG
    3 from dba_resumable;
    USER_ID SESSION_ID STATUS START_TIME RESUME_TIME
    SQL_TEXT
    ERROR_NUMBER
    ERROR_MSG
    54 9 NORMAL 03/14/01 10:49:25 03/14/01 11:24:02
    insert into test_resumable select * from test_resumable
    0
    5) If the session does not need to be in resumable state, the session can
    disable the resumable state(더이상 resumable 기능 사용하지 않을 경우 disable 시키기)
    SQL> alter session disable resumable;
    Session altered.
    SQL> select user_id,SESSION_ID, STATUS, START_TIME, RESUME_TIME,
    2 SQL_TEXT, ERROR_NUMBER, ERROR_MSG
    3 from dba_resumable;
    no rows selected
    Reference Document
    Note. 136941.1 Using RESUMABLE Session to Avoid Transaction Abort Due to Space Errors

    제품 : ORACLE SERVER
    작성날짜 : 2002-11-01
    (V9I) ORACLE 9I New Feature : Resumable Space Allocation
    =====================================================
    PURPOSE
    Oracle9i New Feature 인 Resumable Space Allocation 에 대해
    알아보도록 한다.
    Explanation
    Resumable Space Allocation 은 다음과 같은 새로운 Space allocation
    이 발생되어야 할 시점에 에러를 바로 발생하지 않고 어느정도의 Time 을 준뒤
    Admin에게 이를 알림으로써 수행중인 Transaction rollback 되지 않고 계속적으로
    진행할 수 있도록 하는 기능이다.
    Query 수행시 다음과 같은 원인으로 에러가 발생하면서 query 수행이 중지된다.
    1) Out of space condition
    2) Maximum number of extents reached condision
    3) Space quota exceeded condition
    그러나 9I 에서 Resumable Space Allocation Operations을 설정하게 되면
    alertSID.ora file에 suspend 되는 메세지와 함께 설정한 timeout 까지 hang 상태가
    발생된다. 만약 timeout 초과시엔 에러가 발생하면서 transaction은 rollback 된다.
    alertSID.ora 메세지예)
    Wed Mar 14 11:14:17 2001
    statement in resumable session 'User SCOTT(54), Session 9, Instance 1' was
    suspended due to
    ORA-01631: max # extents (5) reached in table SCOTT.TEST_RESUMABLE
    Example
    다음은 Resumable Space Allocation Operations 을 설정하기 위해서는 RESUMABLE 을
    ENABLE 시키고 또는 DBMS_RESUMABLE package를 이용한다.
    1) RESUMABLE system privilege 부여
    SQL> connect system/manager
    Connected.
    SQL> grant resumable to scott;
    Grant succeeded.
    2) session level에서 RESUMABLE enable 시키기
    SQL> alter session enable resumable;
    Session altered.
    This can be set automatically through an AFTER LOGON trigger.
    SQL> create or replace trigger logon_set_resumable
    2 after logon
    3 on scott.schema
    4 begin
    5 execute immediate 'alter session enable resumable timeout 1200';
    6 end;
    7 /
    Trigger created.
    3) 생성한 TEST_RESUMABLE table 에 insert 작업
    -> insert 시에 hang 현상 발생(transaction rollback은 이루어지지 않는다.)
    -> alert.log에 suspend message 확인
    -> 만약 설정한 timeout 초과시 에러 발생되면서 transaction rollback
    a. Displaying the DBA_RESUMABLE view(DBA_RESUMABLE view에서 suspend 확인)
    SQL> select user_id,SESSION_ID, STATUS, START_TIME, SUSPEND_TIME,
    2 SQL_TEXT, ERROR_NUMBER, ERROR_MSG
    3 from dba_resumable;
    USER_ID SESSION_ID STATUS START_TIME SUSPEND_TIME
    SQL_TEXT
    ERROR_NUMBER
    ERROR_MSG
    54 9 SUSPENDED 03/14/01 10:49:25 03/14/01 11:14:17
    insert into test_resumable select * from test_resumable
    1631
    ORA-01631: max # extents (5) reached in table SCOTT.TEST_RESUMABLE
    b. In alert.log file(alert.log에서 message 확인)
    Wed Mar 14 11:14:17 2001
    statement in resumable session 'User SCOTT(54), Session 9, Instance 1' was
    suspended due to
    ORA-01631: max # extents (5) reached in table SCOTT.TEST_RESUMABLE
    c. The statement may issue the following error when the timeout set for the
    session has expired(timeout 초과시 transaction rollback 되면서 에러 발생)
    SQL> insert into test_resumable values (1);
    insert into test_resumable values (1)
    ERROR at line 1:
    ORA-30032: the suspended (resumable) statement has timed out
    ORA-01536: space quota exceeded for tablespace 'EXAMPLE'
    4) The DBA now knows why the session hangs, and needs to find which action to
    take to alleviate the ora-1631 error(DBA는 timeout 이 발생하기 전에 에러 발생)
    SQL> connect system/manager
    Connected.
    SQL> alter table scott.test_resumable storage (maxextents 8);
    Table altered.
    SQL> select user_id,SESSION_ID, STATUS, START_TIME, RESUME_TIME,
    2 SQL_TEXT, ERROR_NUMBER, ERROR_MSG
    3 from dba_resumable;
    USER_ID SESSION_ID STATUS START_TIME RESUME_TIME
    SQL_TEXT
    ERROR_NUMBER
    ERROR_MSG
    54 9 NORMAL 03/14/01 10:49:25 03/14/01 11:24:02
    insert into test_resumable select * from test_resumable
    0
    5) If the session does not need to be in resumable state, the session can
    disable the resumable state(더이상 resumable 기능 사용하지 않을 경우 disable 시키기)
    SQL> alter session disable resumable;
    Session altered.
    SQL> select user_id,SESSION_ID, STATUS, START_TIME, RESUME_TIME,
    2 SQL_TEXT, ERROR_NUMBER, ERROR_MSG
    3 from dba_resumable;
    no rows selected
    Reference Document
    Note. 136941.1 Using RESUMABLE Session to Avoid Transaction Abort Due to Space Errors

  • (V9I) ORACLE 9I NEW FEATURE : ORACLE FLASHBACK

    제품 : ORACLE SERVER
    작성날짜 : 2002-11-01
    (V9I) ORACLE 9I New Feature : ORACLE FLASHBACK
    ==============================================
    PURPOSE
    Oracle9i 새로운 기능인 Flashback 의 등장으로 Commit 된 Transaction 에 대해
    특정 시점의 과거 DATA를 Query가 가능함으로써 Self-service repair 기능이 향상되었다.
    다음 Flashback query 기능과 Setup 방법 및 실제 Data Recovery 에 관한 내용에 대해 알아보도록 한다.
    Explanation
    Flashback : 새로운 기능인 Flahback 은 과거 시점의 consistent view 를 볼 수있는
    기능으로 system time or systme change number(SCN) 기반 read-only view이다.
    다음은 Flashback 기능을 사용하기 위해 미리 설정해야할 부분에 대해 알아보도록 한다.
    1) 반드시 Automatic Undo Management 에서만 가능
    (initSID.ora file이나 spfile에 다음 파라미터가 auto로 설정)
    UNDO_MANAGEMENT = AUTO
    2) Rentention interval 을 두어 해당 time 동안은 inactive rollback 이라 하더라도
    overwrite 되지 않도록 유지(초단위)
    SQL> ALTER SYSTEM SET undo_retention = 1200;
    UNDO_RETENTION 을 지정한 다음 실제 적용을 위해 5분정도 기다려야 한다.
    3) DBMS_FLASHBACK package를 이용하여 Flashback 기능을 enable 시킨다.
    SQL> call dbms_flashback.enable_at_time('9-NOV-01:11:00:00');
    Example1. Flashback setup 과 date/time 설정
    1) Undo tablespace 생성
    SQL> create undo tablespace UNDOTBS datafile
    '/database/901/V901/undotbs01.dbf' size 100M;
    2) intiSID or spfile 에 다음 파라미터 적용
    undo_management=auto
    undo_retention=1200
    undo_tablespace=UNDOTBS
    3) dbms_flashback exeucte 권한 grant
    SQL> connect / as sysdba
    Connected.
    SQL> grant execute on dbms_flashback to testuser;
    Grant succeeded.
    4) test table 생성
    SQL> connect testuser/testuser;
    Connected.
    SQL> create table emp_flash as select * from scott.emp;
    Table created.
    SQL> select count(*) from emp_flash;
    COUNT(*)
    15
    5) table 생성후 5분 정도 waiting -> table delete
    SQL> delete from emp_flash;
    15 rows deleted.
    SQL> commit;
    Commit complete.
    SQL> select count(*) from emp_flash;
    COUNT(*)
    0
    6) flashback 활성화
    SQL> execute DBMS_FLASHBACK.ENABLE_AT_TIME(sysdate - 5/1440);
    PL/SQL procedure successfully completed.
    SQL> select count(*) from emp_flash;
    COUNT(*)
    15
    SQL> execute DBMS_FLASHBACK.DISABLE;
    PL/SQL procedure successfully completed.
    SQL> select count(*) from emp_flash;
    COUNT(*)
    0
    Example2. Flashback 으로 잃어버린 data recovery
    1) test user 생성
    SQL> connect testuser/testuser;
    Connected.
    SQL> create table emp_recover as select * from scott.emp;
    Table created.
    SQL> select count(*) from emp_recover;
    COUNT(*)
    15
    2) delete table
    SQL> VARIABLE SCN_SAVE NUMBER;
    SQL> EXECUTE :SCN_SAVE := DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER;
    PL/SQL procedure successfully completed.
    SQL> PRINT SCN_SAVE
    SCN_SAVE
    6.4455E+12
    SQL> select count(*) from emp_recover;
    COUNT(*)
    15
    SQL> delete from emp_recover;
    15 rows deleted.
    SQL> commit;
    Commit complete.
    SQL> select count(*) from emp_recover;
    COUNT(*)
    0
    3) flashback 이용한 data recover
    SQL> DECLARE
    2 CURSOR FLASH_RECOVER IS
    3 select * from emp_recover;
    4 emp_recover_rec emp_recover%ROWTYPE;
    5 begin
    6 DBMS_FLASHBACK.ENABLE_AT_SYSTEM_CHANGE_NUMBER(:SCN_SAVE);
    7 open FLASH_RECOVER;
    8 DBMS_FLASHBACK.DISABLE;
    9 loop
    10 FETCH FLASH_RECOVER INTO emp_recover_rec;
    11 EXIT WHEN FLASH_RECOVER%NOTFOUND;
    12 insert into emp_recover
    13 values
    14 (emp_recover_rec.empno,
    15 emp_recover_rec.ename,
    16 emp_recover_rec.job,
    17 emp_recover_rec.mgr,
    18 emp_recover_rec.hiredate,
    19 emp_recover_rec.sal,
    20 emp_recover_rec.comm,
    21 emp_recover_rec.deptno);
    22 end loop;
    23 CLOSE FLASH_RECOVER;
    24 commit;
    25 end;
    26 /
    PL/SQL procedure successfully completed.
    SQL> select count(*) from emp_recover;
    COUNT(*)
    15
    Reference Document
    Note. 174425.1
    Note. 143217.1
    Note. 179851.1

    I 'm sorry I can not offer the correct figure since I'm an easy-to-forget guy.
    Below is extracted from other's post. wish it helps.
    Oracle Security Server ---> 2 questions
    High Availability Technology ---> 4 questions
    LogMiner Enhancements -> 1 question
    Backup & Recovery Enhancements ---> 3 questions
    Data Guard ---> 3 questions
    Resource Manager Enhancements ---> 2 questions
    Online Operations Enhancements ---> 3 questions
    Segment Management (Part I) ---> 4 questions
    Segment Management (Part II) ---> 3 questions
    Performance Improvements ---> 4 questions
    Scalable Session Management ---> 2 questions
    Real Application Clusters ---> 2 questions
    File Management ---> 4 questions
    Tablespace Management ---> 4 questions
    Memory Management ---> 3 questions
    Enterprise Manager Enhancements ---> 2 questions
    by the way, I just found an enthusiast (roxylo
    ) posted a book about the 9i new features. It surely will help

  • Autonomous transactions not seeing posted data

    I want to add a button to a form to call a report. The users want to update data in the form, run the report then decide if the data is to be committed. I can post the changed data but the report doesn't see the posted data as Oracle starts a new session.
    The report performs various calculations and before it is run, the calculations are performed and data extracted to separate tables, the report then runs on the extracted data then the temporary table data is deleted.
    I thought autonomous transactions would be my solution. The data is posted within forms, the form then calls a database procedure which has the autonomous procedure declared, data extracted and committed to the temporary tables within the autonomous transaction (form data stays uncommitted), report runs using the extracted data. User could then decide if the amended data could then be committed to the database.
    The autonomous transaction does not seem to see the posted data. The procedure picks up the data 'pre post'. Any ideas on what I can do to get round this?
    Thanks in advance
    Karen Stalker

    Thanks for all the replies.
    My form that will call the report can call up to 12 other forms with data always posted and never committed until the user is prompted to on leaving the main form, or the user presses the commit key. I liked the idea of writing to a temporary table but the way this application is designed, this would mean a big rewrite of a lot of complicated forms. I would rather leave them alone as they work!!
    I could pass the record groups into the report - this would mean about 15 groups but that shouldn't be a problem except that there are a few child queries which I read can't be done that way. This may be a daft question but can I pass the record groups into the report and the record groups be then used in the after parameter trigger. There I could do all the necessary complications, write to my extract tables and then carry on as normal - i.e. the report gets the data from these extract tables.
    My best solution would be to get the reports and forms to run in the same session but how can I do this? As far as I'm aware, RUN_REPORT_OBJECT starts a new session. Hopefully someone knows how to get them in the same session.
    Thanks again
    Karen

  • 10 new features to the oracle dataabse 10g

    Hi all.
    Recently, I have been interivewed and I have been asked to list 10 new features of Oracle 10g.
    I told him about:
    1) Here, stats have been collected automatically, in oracle 9i it was manual
    2) AWR
    3) RULE based optimizer is not there only in oracle 9i
    4) ASM
    Anything else which you want to mentioned:

    The Automatic Database Diagnostic Monitor (ADDM) analyzes data in the Automatic Workload Repository (AWR) to identify potential performance bottlenecks. For each of the identified issues it locates the root cause and provides recommendations for correcting the problem. An ADDM analysis task is performed and its findings and recommendations stored in the database every time an AWR snapshot is taken provided the STATISTICS_LEVEL parameter is set to TYPICAL or ALL. The ADDM analysis includes:
    •     CPU load
    •     Memory usage
    •     I/O usage
    •     Resource intensive SQL
    •     Resource intensive PL/SQL and Java
    •     RAC issues
    •     Application issues
    •     Database configuration issues
    •     Concurrency issues
    •     Object contention
    ASM
    Automatic Storage Management (ASM) simplifies administration of Oracle related files by allowing the administrator to reference disk groups rather than individual disks and files, which are managed by ASM
    DBMS_FILE_TRANSFER Package in Oracle Database 10g•     Common Usage Notes
    •     COPY_FILE
    •     GET_FILE
    •     PUT_FILE
    Flashback New Features and Enhancements in Oracle Database 10g•     Flashback Query
    •     Flashback Version Query
    •     Flashback Transaction Query
    •     Flashback Table
    •     Flashback Drop (Recycle Bin)
    •     Flashback Database
    •     Flashback Query Functions
    Oracle Data Pump
    STARTUP UPGRADE
    The is a new startup mode associated with the upgrade procedure in Oracle 10g.
    SQL> STARTUP UPGRADE
    Automatic Shared Memory ManagementAutomatic Shared Memory Management puts Oracle in control of allocating memory within the SGA. The SGA_TARGET parameter sets the amount of memory available to the SGA. This parameter can be altered dynamically up to a maximum of the SGA_MAX_SIZE parameter value. Provided the STATISTICS_LEVEL is set to TYPICAL or ALL and the SGA_TARGET is set to a value other than "0" Oracle will control the memory pools which would otherwise be controlled by the following parameters:
    •     DB_CACHE_SIZE (default block size)
    •     SHARED_POOL_SIZE
    •     LARGE_POOL_SIZE
    •     JAVA_POOL_SIZE
    If these parameters are set to a non-zero value they represent the minimum size for the pool. These minimum values may be necessary if you experience application errors when certain pool sizes drop below a specific threshold.
    The following parameters must be set manually and take memory from the quota allocated by the SGA_TARGET parameter:
    •     DB_KEEP_CACHE_SIZE
    •     DB_RECYCLE_CACHE_SIZE
    •     DB_nK_CACHE_SIZE (non-default block size)
    •     STREAMS_POOL_SIZE
    •     LOG_BUFFER

  • ORA-00164: autonomous transaction disallowed within distributed transaction

    I have been trying to solve this problem for weeks now, I have posted this question everywhere I can think of, but I havent really received and answer that has helped, so now I am going to post it here hoping for an answer.
    We are running 9iAS on Solaris and when the following stuff is run we are getting ORA-00164 errors. If you refresh the page a bunch of time the problem goes away. But it comes back the next time you try to execute the procedure again. Here are the cases when the problem shows up.
    Editing the style:
    PROCEDURE : PORTAL30.wwpob_app_style.edit_style
    Saving changes to the banner for a page
    PROCEDURE : PORTAL30.wwptl_banner.savecustom
    Logging out
    PROCEDURE : PORTAL30.wwsec_app_priv.logout
    After setting the default user group and applying the changes:
    PROCEDURE : PORTAL30.wwsec_app_user_mgr.edit_user
    Creating a new group:
    PROCEDURE : PORTAL30.wwsec_app_group_mgr.create_group
    Opening the add portlet screen:
    PROCEDURE : PORTAL30.wwv_main.main
    There are a few other places but I don't have them documented. In ALL cases the problem goes away once we start and stop the Apache using the following comands:
    /app/oracle/n_portal/Apache/Apache/bin/apachectl stop
    ps -ef | grep httpd | grep n_portal
    /app/oracle/n_portal/Apache/Apache/bin/apachectl start
    After starting and stopping Apache the problem is gone for a little while (20-30 mins) then it starts coming back slowly (sometimes the problem is there then it is not). Once the problem is back if you continually press refresh on the browser (5-10 times) the page might appear, if the page does not appear you will see the
    ORA-00164: autonomous transaction disallowed within distributed transaction
    The following error appears in apache log (50% of the time) when Autonomous Transaction error shows up on the screen:-
    DSHttpSessionBindingListenerImpl.valueUnbound : closing DS session : DSSession id = 5225534324468880950975536484
    215 PortalSession id = 521335001720MERAJ
    DSHttpSessionBindingListenerImpl.valueUnbound : closing DS session : DSSession id = -638034231325135430097553725
    8001 PortalSession id = 992335001711JDALGLIESH
    These errors might be related to dynamic services but we were had the problem long before Dynamic services was installed.
    We want to start pre-production user testing as we have just had 11 developers building portlets for the company, but we cant do much with this error popping up every time a user wants to test it. We have one of the Oracle consultants here and he has asked the oracle developer group what the problem could be, and they seem to think it might be related to our use of DB links however, we never get the problem when we try to run a portlet that uses a database link.
    Please help.
    Jeff Dalgliesh
    null

    Jay,
    My name is Craig McCauley. I'm an Oracle Technical Manager working onsite at Unocal Indonesia. I'm with the Portal group in ATS.
    When I got here the first thing we did was bump up init.ora parameters and apache confif parameters as suggested by the iPlatform group. We have thes sessions parameter (in init.ora) bumped up from 100 to 700. I'm watching v$session and the get these AT messages with as few as 70 total db sessions. Any help your group can give will be greatly appreciated.
    Unocal is planning on implementing Oracle Portal globally - as a common interface. They have similar installs in Thailand and Houston and thus far have not seen the AT messages (although there has not been much development going on at those sites).
    Thanks,
    Craig

  • (V9I) ORACLE9I NEW FEATURE : LOGMINER 의 기능과 사용방법

    제품 : ORACLE SERVER
    작성날짜 : 2002-11-13
    (V9I) ORACLE9I NEW FEATURE : LOGMINER 의 기능과 사용방법
    ==========================================
    Purpose
    Oracle 9i LogMiner 의 새로운 기능과 사용방법에 대해 알아보도록 한다.
    (8I LogMiner의 일반적인 개념과 기능은 BUL. 12033 참조)
    Explanation
    LogMiner 는 8I 에서부터 새롭게 제공하는 기능으로 Oracle 8 이상의 Redo
    log file 또는 Archive log file 분석을 위해 이용된다.
    9I 에서는 기존 8I 에서 제공하던 기능을 모두 포함하고 그 외 새로운 점은
    LogMiner 분석을 위해 dictionary 정보를 Flat file(output)로 생성이 가능하
    였으나 9I 에서부터는 Flat file 과 함께 On line redo log 를 이용하여
    dictionary 정보를 저장할 수 있게 되었고, Block corruption이 발생하였을
    경우 해당 부분만 skip할 수 있는 기능이 추가되었다.
    9I 에서의 New feature 를 정리하면 다음과 같다.
    1. 9I New feature
    1) DDL 지원 단, 9I 이상의 Redo/Archive log file만 분석 가능
         : V$LOGMNR_CONTENTS 의 OPERATION column에서 DDL 확인
    2) LogMiner 분석을 위해 생성한 dictioanry 정보를 online redo 에 저장 가능
         : 반드시 Archive log mode 로 운영 중이어야 한다.
         : DBMS_LOGMNR_D.BUILD를 사용하여 dictionary file 생성
         : 기존 Flat file 또는 Redo log 에 생성 가능
         : 예) Flat file
              - SQL> EXECUTE dbms_logmnr_d.build
                   (DICTIONARY_FILENAME => 'dictionary.ora'
                   ,DICTIONARY_LOCATION => '/oracle/database'
                   ,OPTIONS => DBMS_LOGMNR_D.STORE_IN_FLAT_FILE);
         예) Redo log
              - SQL> EXECUTE dbms_logmnr_d.build
                   (OPTIONS => DBMS_LOGMNR_D.STORE_IN_REDO_LOGS);
    3) Redo log block corruption 이 발생하였을 경우 corruption 된 부분을 skip하고 분석
         : 8I 에서 log corruption 발생 시 LogMiner 가 종료되고 분석 위해 다시 시도
         : 9I 에서는 DBMS_LOGMNR.START_LOGMNR 의 SKIP_CORRUPTION option 으로 skip 가능
    4) Commit 된 transaction 에 대해서만 display
         : DBMS_LOGMNR.START_LOGMNR 의 COMMITTED_DATA_ONLY option
    5) Index clustered 와 연관된 DML 지원 (8I 제공 안 됨)
    6) Chained and Migrated rows 분석
    2. 제약 사항(9I LogMiner 에서 지원하지 않는 사항)
    1) LONG and LOB data type
    2) Object types
    3) Nested tables
    4) Object Refs
    5) IOT(Index-Organized Table)
    3. LogMiner Views
    1) V$LOGMNR_CONTENTS - 현재 분석되고 있는 redo log file의 내용
    2) V$LOGMNR_DICTIONARY - 사용 중인 dictionary file
    3) V$LOGMNR_LOGS - 분석되고 있는 redo log file
    4) V$LOGMNR_PARAMETERS - LogMiner에 Setting된 현재의 parameter의 값
    4. LogMiner 를 이용하기 위한 Setup
    1) LogMiner 를 위한 dictionary 생성(flatfile or on line redo log)
    2) Archive log file or Redo log file 등록
    3) Redo log 분석 시작
    4) Redo log 내용 조회
    5) LogMiner 종료
    5. LogMiner Example
    1) flatfile이 생성될 location을 확인
    SQL> show parameter utl
    NAME TYPE VALUE
    utl_file_dir string /home/ora920/product/9.2.0/smlee
    2) dictionary 정보를 저장할 flatfile 정의 -> dictionary.ora 로 지정
    SQL> execute dbms_logmnr_d.build -
    (dictionary_filename => 'dictionary.ora', -
    dictionary_location => '/home/ora920/product/9.2.0/smlee', -
    options => dbms_logmnr_d.store_in_flat_file);PL/SQL procedure successfully completed.
    3) logfile을 switch 하고 current logfile name과 current time을 기억한다.
    SQL> alter system switch logfile;
    System altered.
    SQL> select member from v$logfile, v$log
    2 where v$logfile.group# = v$log.group#
    3 and v$log.status='CURRENT';
    MEMBER
    /home/ora920/oradata/ORA920/redo02.log
    SQL> select current_timestamp from dual;
    CURRENT_TIMESTAMP
    13-NOV-02 10.37.14.887671 AM +09:00
    4) test를 위해 table emp30 을 생성하고 update -> drop 수행
    SQL> create table emp30 as
    2 select employee_id, last_name, salary from hr.employees
    3 where department_id=30;
    Table created.
    SQL> alter table emp30 add (new_salary number(8,2));
    Table altered.
    SQL> update emp30 set new_salary = salary * 1.5;
    6 rows updated.
    SQL> rollback;
    Rollback complete.
    SQL> update emp30 set new_salary = salary * 1.2;
    6 rows updated.
    SQL> commit;
    Commit complete.
    SQL> drop table emp30;
    select
    Table dropped.
    SQL> select current_timestamp from dual;
    CURRENT_TIMESTAMP
    13-NOV-02 10.39.20.390685 AM +09:00
    5) logminer start (다른 session을 열어 작업)
    SQL> connect /as sysdba
    Connected.
    SQL> execute dbms_logmnr.add_logfile ( -
    logfilename => -
    '/home/ora920/oradata/ORA920/redo02.log', -
    options => dbms_logmnr.new)PL/SQL procedure successfully completed.
    SQL> execute dbms_logmnr.start_logmnr( -
    dictfilename => '/home/ora920/product/9.2.0/smlee/dictionary.ora', -
    starttime => to_date('13-NOV-02 10:37:44','DD_MON_RR HH24:MI:SS'), -
    endtime => to_date('13-NOV-02 10:39:20','DD_MON_RR HH24:MI:SS'), -
    options => dbms_logmnr.ddl_dict_tracking + dbms_logmnr.committed_data_only)PL/SQL procedure successfully completed.
    6) v$logmnr_contents view를 조회
    SQL> select timestamp, username, operation, sql_redo
    2 from v$logmnr_contents
    3 where username='HR'
    4 and (seg_name = 'EMP30' or seg_name is null);
    TIMESTAMP                USERNAME           OPERATION           SQL_REDO           
    13-NOV-02 10:38:20          HR               START               set transaction read write;
    13-NOV-02 10:38:20          HR               DDL               CREATE TABLE emp30 AS
                                                      SELECT EMPLOYEE_ID, LAST_NAME,
                                                      SALARY FROM HR.EMPLOYEES
                                                      WHERE DEPARTMENT_ID=30;
    13-NOV-02 10:38:20          HR                COMMIT
    commit;
    13-NOV-02 10:38:50          HR               DDL               ALTER TABLE emp30 ADD
                                                      (new_salary NUMBER(8,2));
    13-NOV-02 10:39:02          HR               UPDATE          UPDATE "HR"."EMP30" set
                                                      "NEW_SALARY" = '16500' WHERE
                                                      "NEW_SALARY" IS NULL AND ROWID
                                                      ='AAABnFAAEAALkUAAA';
    13-NOV-02 10:39:02-10     HR               DDL               DROP TABLE emp30;
    7) logminer 를 종료한다.
    SQL> execute dbms_logmnr.end_logmnr
    PL/SQL procedure successfully completed.
    Reference Documents
    Note. 148616.1

  • Maxdb new features - Page Clustering and Prefetch

    Hi to all,
    2 new features of maxdb are available with new patches: Page Clustering and Prefetch in OLTP-Systems.
    Are there any experiences to this features?
    READAHEAD_TABLE_THRESHOLD
    "This parameter is used to specify, if read operations of tables
    should be optimized, i.e. if during a table access more than the
    specified value in pages is affected, servertasks will be used to
    read ahead pages of this table."
    I activated this parameter in November. The system now starts more quickly and some expensive sql-statements may be faster. But the average db-time didn't change.
    Page Clustering can be activated with parameter: DATA_IO_BLOCK_COUNT
    Then tables can be migrated with SQL-Statement: ALTER TABLE <table name> CLUSTER
    I activated this only for one table. This table now is read much faster.
    My questions.
    Is there a documentation available for this features?
    How can I "uncluster" clustered tables?
    When this features are activated, expensive sql-statements are processed much faster. Because of the high workload on storagesystem, all other transaction may get slower?
    regards
    Franz

    > 2 new features of maxdb are available with new patches: Page Clustering and Prefetch in OLTP-Systems.
    First of all: both features, although technically available, are not yet generally released for OLTP usage.
    The current implementation of page prefetching is explicitely a proof-of-concept implementation which should be used by recommendation from MaxDB support only.
    There are several limitations to the functionality at the moment, e.g. it does only work for table scans.
    It does not work for joins, for index builds neither does it work on clustered tables.
    Prefetching is available to 7.6 release only at the moment, so after an upgrade to 7.7 this feature would be gone...
    > I activated this parameter in November. The system now starts more quickly and some expensive sql-statements may be faster. But the average db-time didn't change.
    Well, nothing surprising here.
    On SAP start there happen a lot of tablescans, mostly attributable to the fully buffered tables for the ABAP internals (security, ddic, etc.)
    These statements will of course benefit if the pages are now read into the buffer in parallel.
    For the avg. db-time: be happy!
    This basically means, that most of the statements running in your system aren't processed by table scans, which is for MaxDB nearly always a very good thing.
    > Page Clustering can be activated with parameter: DATA_IO_BLOCK_COUNT
    > Then tables can be migrated with SQL-Statement: ALTER TABLE <table name> CLUSTER
    Ok, page clustering is not documented yet (just as prefetching is not officially documented) and not released for OLTP.
    > I activated this only for one table. This table now is read much faster.
    >
    > My questions.
    > Is there a documentation available for this features?
    Hmm.. you're using undocumented features - what do you expect?`
    No, currently there is no official documentation.
    There is work going on to provide official documentation but none of it is released yet (and it will take some more time!)
    > How can I "uncluster" clustered tables?
    ALTER TABLE <tablename> NOT CLUSTER
    > When this features are activated, expensive sql-statements are processed much faster. Because of the high workload on storagesystem, all other transaction may get slower?
    It's not that simple.
    Both features address specific issues and are used only in very specific circumstances.
    The clustering feature will not improve performance if the table is not accessed via the cluster key.
    In fact, it may even decrease performance if this is done.
    Also, at the moment clustered tables don't stay clustered on updates/inserts/deletes.
    Therefore it is not necessarily a good idea to cluster tables like REPOLOAD pr REPOSRC on a development system.
    regards,
    Lars

  • Autonomous transaction - user updating information through form

    Good afternoon,
    I have a form that has a database datablock that is populated using a cursor that does a select on 4 tables, being one the most important (table A). When the user is done he commits the changes and the information is saved in table B, the "source" of the datablock.
    This generates a concurrency problem: if two users give the same parameters the cursor populates the same information in their respective sessions and the information is saved twice. I want to prevent this, only one person should be allowed to use the information.
    I know about autonomous transactions and perhaps this is the best idea: update the status of the row in table A in order to prevent any further uses but i want to check any other solution. Perhaps i could write the user and the time and the second person would get a message: "being used by"
    Thanks,

    Yes i too have read about autonomous transaction and its very rare usability.
    Ok here's the situation:
    Table B
    code_B (number) PK
    code_B1 (number PK
    description
    selected (Y/N), default N
    more fields...
    Table A
    code_A PK
    description
    code_B NOT part of PK_A
    code_B1 NOT part of PK_A
    more fields
    step 1: user opens form X and marks some records from table B, setting selected to Y
    step 2: User open forms Y and populates block Z (table A) based on a cursor (PL/sql run through a push button) that looks for all the records from B that have selected = Y
    step 3: user commits and the form updates table A with new records
    this is the normal procedure but sometimes two users open form Y at almost the same time and the both populate the datablock Z with the same info.
    I have thought about creating a new hidden datablock in form Y that uses table B, in order to block other users.
    and these forms have been like this for years now, i did not create them and the tables have millions of records now...
    This was a design flaw, not taking concurrency into account i guess
    Many thanks
    Edited by: user474437 on Apr 17, 2010 10:38 AM

  • Enhancement and new features available in AFS 6.0 in reference to AFS 5.0?

    Hi Experts,
    Please can you explain what are the Enhancement and new features available in AFS 6.0 in reference to AFS 5.0

    Hi Mithun,
    Following are the details you needed.
    Enhancement and new features available in AFS 6.0 wrt AFS 5.0
    AFS Interface
    AFS GTS Master Data Integration - IS-AFS-INT-GTS (New)
    As of SAP AFS 6.0, you can integrate the SAP Global Trade Services 7.1 (SAP GTS 7.1) master data to the AFS data.
    AFS Retail Integration (Change)
    As of SAP AFS 6.0, the integration of Apparel and Footwear Solution (AFS) with Retail has been
    Enhanced by the following functions:
    u2022     One SAP Retail Logical system is mapped to multiple Customers in SAP AFS system, which ensures that each Customer can be mapped to a different purchase organization.
    u2022     You can maintain the retail merchandise category in the AFS material master for each retail logical system.
    u2022     The variant numbers created in the retail for the article (material in AFS) have the number with the category and grid combination. A new BADI method is used to allow the user to change the variant numbering as required.
    u2022     The material type of the generic article created is the same as the AFS material. A new BADI method is used to set the material type of the article as required.
    Quality Management (IS-AFS-QM)
    Enabling QM for Goods Receipt (GR) Process for AFS (New)
    As of SAP AFS 6.0, you can activate the inspection type at material level and control the inspection lot creation at stock keeping unit (SKU) level during the goods receipt process.
    Additionally, during posting of quality inspection stocks, you can directly post stock of one SKU to unrestricted stock of another SKU.
    Basic Data (IS-AFS-BD)
    Commodity Codes at the SKU Level (New)
    As of SAP AFS 6.0, you can maintain commodity codes at the SKU level in the material master. A new relevancy Global Trade Services (GTS) is allotted to the characteristics attached to the grid and categories. If this new relevancy is set then the commodity codes can be assigned at the SKU level. You can also assign commodity codes of different countries other than the country in which the plant is located.
    The AFS material master IDoc and BAPI have been enhanced to handle commodity codes at the SKU level.
    Material Master Enhancements (New)
    As of SAP AFS 6.0, the following enhancements have been made in the material master:
    u2022     You can maintain commodity codes at the stock keeping unit (SKU) level.
    u2022     You can maintain the retail data merchandise category and characteristic profile at the material master level. This is used to create article in retail.
    u2022     You can maintain quality management (QM) inspection type at SKU level.
    u2022     You can enable Seasons for inventory management (IM).
    Materials Management (IS-AFS-MM)
    Seasonality Roundoff - Inventory Management-(New)
    As of SAP AFS 6.0, season functionality is extended to Inventory Management (IM). This enables you to gain an overview of material movements during each season. You can maintain stocks for different seasons separately. To enable this functionality, you have to activate the Season Active in IM indicator for a material in the material master. This indicator can be set only for materials created in AFS 6.0. If the season is maintained for an SKU in the material master, you can obtain season information for the SKUs in batches, in material movement documents and in stock tables.
    Also, as of AFS 6.0, you cannot set the Season Fixed indicator for new materials. However, for old materials (materials created in AFS 5.0 with Season Fixed indicator) the behavior remains the same.
    Stock Selection Available in Transaction MIGO (New)
    As of SAP AFS 6.0, the goods movement transaction MIGO has been enhanced with Stock Selection for AFS materials. Goods movement here implies only goods issued/transfer postings without document reference.
    Consumption of PIRs by TPO, MTO and PTO (New)
    As of SAP AFS 6.0, the Consume PIR Customizing indicator at sales and distribution (SD) item category level enables special orders like TPO (third-party order), MTO (make-to order) and PTO (purchase-to order) to consume normal planned independent requirements (PIRs).
    IS-AFS-MM-PUR Purchasing
    Purchasing BAPIs (Change)
    The interface of the purchase order (PO) BAPIs mentioned below have been enhanced with optional parameters to handle the AFS data.
    Purchase order BAPIs
    u2022      AFSPurchaseOrder.GetDetail1 (BAPI_PO_GETDETAIL1)
    u2022     AFSPurchaseOrder.Change (BAPI_PO_CHANGE)
    u2022     AFSPurchaseOrder.CreateFromData1 (BAPI_PO_CREATE1)
    Purchase Requisition BAPIs
    u2022     PurchaseRequisition.CreateFromData (BAPI_REQUISITION_CREATE)
    u2022     PurchaseRequisition.Change (BAPI_REQUISITION_CHANGE)
    u2022     PurchaseRequisition.Delete (BAPI_REQUISITION_DELETE)
    Contract BAPIs
    u2022     PurchasingContract.Change (BAPI_CONTRACT_CHANGE)
    u2022     PurchasingContract.Create (BAPI_CONTRACT_CREATE)
    u2022     PurchasingContract.GetDetail (BAPI_CONTRACT_GETDETAIL)
    Production planning and control IS-AFS- PP
      Manufacturing (IS-AFS-PP-MAN)
    BAPI for Bill of Material (BOM) Maintenance (New)
    As of SAP AFS 6.0, you use this BAPI (AFSMaterialBOM.AFSMatBomMaintain) to maintain a material BOM. You can also use this BAPI for the following functionalities:
    u2022     Creating a standard or AFS BOM
    u2022     Changing a standard or AFS BOM
    u2022     Updating a quantity distribution profile for AFS BOM components
    u2022     Maintaining SKU deviation quantities or zero quantities (if relevant) for AFS BOM components
    u2022     Maintaining categories (if relevant) for AFS BOM components
    Transaction for Grouping PO using Combined Order Number (New)
    BAPIs for AFS Planned Orders - Create, Change and Get Details (Change)
    BAPI for Production Orders - Create, Change and Get Details (Change)
    Production Planning (IS-AFS-PP-PPL)
    Consumption of PIRs by TPO, MTO and PTO (New)
    As of SAP AFS 6.0, the Consume PIR Customizing indicator at sales and distribution (SD) item category level enables special orders like TPO (third-party order), MTO (make-to order) and PTO (purchase-to order) to consume normal planned independent requirements (PIRs).
    Sales and Distribution (IS-AFS-SD)
    BADI for Contract Selection (New)
    As of SAP AFS 6.0, you can use this BADI to filter contracts for display when a sales order is created without giving reference to the contract, and when there are open contracts for the material. This functionality is also available for the sales order created by IDocs.
    BAPI for AFS Material Availability (New)
    you can use this BAPI method MaterialAFS.AFSAvailabilityCheck (/AFS/BAPI_MAT_AVAILABILITY) to determine the available quantity for an AFS material in a certain plant according to ATP (available-to-promise) logic.
    Consumption of PIRs by TPO, MTO and PTO (New)
    As of SAP AFS 6.0, the Consume PIR Customizing indicator at sales and distribution (SD) item category level enables special orders like TPO (third-party order), MTO (make-to order) and PTO(purchase-to order) to consume normal planned independent requirements (PIRs).
    Display of Allocated Quantities (New)
    As of SAP AFS 6.0, you can find the allocated quantity information of the contract in the Contract Reference Overview screen.
    BAdIs in Mass Document Change MDC (New)
    The following NEW Business Add-Ins (BAdIs) are provided:
    u2022     BAdI for adding custom selection fields in MDC (/AFS/MDC_SELECT_CUSTOM_FIELDS) -You use this BAdI to implement your business process-specific logic in selecting data in mass Document Change transaction (/AFS/MDC).
    u2022     BAdI for adding custom change fields in MDC (/AFS/MDC_CHANGE_CUSTOM_FIELDS) -You use this BAdI for implementing your business process-specific logic in changing custom fields data in transaction /AFS/MDC.
    u2022     BAdI for adding custom fields to the Adjust Update tab in MDC (/AFS/MDC_ADJ_UPD_CUSTOM_FIELDS) you use this BAdI to implement custom processes that are specific to your business scenario.
    Condition Table Display (Change)
    As of SAP AFS 6.0, in transaction J3A9 it is possible to display condition tables for value-added service(VAS) and multi-store order (MSO) condition types beyond the existing limit of 19 condition tables. The Conditions Info display in transactions J3A4 and J3AN can be viewed in an ALV list.
    AFS Sales and Distribution (SD) IDOCS
    As of SAP AFS 6.0, the function modules J_4A_IDOC_INPUT_ORDERS and J_4A_IDOC_INPUT_ORDCHG are not supported. The standard function module IDOC_INPUT_ORDERS are used instead J_4A_IDOC_INPUT_ORDERS and standard function module IDOC_INPUT_ORDCHG are used instead of J_4A_IDOC_INPUT_ORDCHG. There is no change in the IDOC type /AFS/ORDERS05 which is presently used to create/change sales orders. Accordingly, you must use inbound process code ORDE for message type ORDERS and inbound process code ORDC for message type ORDCHG.
    Supporting the Change of Single Characteristic (New)
    As of SAP AFS 6.0, you can use transaction /AFS/MDC, to select sales documents by specifying a single characteristic name and value range in the same ways as you select sales documents by specifying grid value.
    Partial Quantity Reductions in Sales Order (New)
    As of SAP AFS 6.0, you can find the quantity changes done for a schedule line from the sales order screen itself without navigating to the change logs. This is possible only when you reduce the quantity of a schedule line.
    Allocation Run (IS-AFS-ARUN)
    Seasonality Roundoff - Allocation Run (New)
    As of SAP AFS 6.0, season functionality is available in the allocation run (ARun) to ensure the season information is considered while creating assignments, and to cause deallocation as per the settings in the deallocation rule on change in season information in the future receipts, sales order or while performing goods receipt (GR). This functionality is available only with online ARun.
    BAPI for Individual Allocation and/or Deallocation
    As of SAP AFS 6.0, you can use the BAPI /AFS/BAPI_INDIVIDUAL_ARUN to handle allocation/deallocation of specified sales order quantities for single or multiple orders. This enables you to make:
    u2022     New allocations
    u2022     Allocations from a particular storage location/batch number
    u2022     Allocations for a quantity less than equal to the requirement quantity
    u2022     Deallocations for a quantity less than equal to the requirement quantity
    u2022     A total deallocation
    Hope it helps.
    Regards,
    Anirban Roy

  • "An autonomous transaction does not see any changes made by main transact"

    Hi,
    I'm trying to reproduce the "An autonomous transaction does not see any changes made by main transaction" reffered on :
    Oracle® Database Application Developer's Guide - Fundamentals
    10g Release 2 (10.2)
    Part Number B14251-01
    chapter 2 SQL Processing for Application Developers
    Paragraph : Autonomous TransactionsI set up a simple case...
    create table emp_ as select * from emp
    begin
      update emp_ set hiredate=hiredate+100 where empno=7934;
    end;
    create or replace trigger trg_emp_
    after insert or update on emp_
    for each row
    declare
        pragma autonomous_transaction;
        emp_var emp.hiredate%type;
      begin
        select hiredate
          into emp_var
          from emp_
        where empno=:new.empno;
        dbms_output.put_line('empno: '||:new.empno);
        dbms_output.put_line('old hiredate: '||:old.hiredate);
        dbms_output.put_line('new hiredate: '||:new.hiredate);
      end;Prior to any change...
    SQL> select empno,hiredate from emp_;
    EMPNO HIREDATE
    5498 21/4/1982
    5499 11/10/1981
    5411 10/10/1981
    5410 10/10/1982
    7369 17/12/1980
    7499 20/2/1981
    7521 22/2/1981
    7566 2/4/1981
    7654 28/9/1981
    7698 1/5/1981
    7782 9/6/1981
    7788 19/4/1987
    7839 17/11/1981
    7844 8/9/1981
    7876 23/5/1987
    7900 3/12/1981
    7902 3/12/1981
    7934 23/1/1982After the change...
    SQL> begin
      2    update emp_ set hiredate=hiredate+100 where empno=7934;
      3  end;
      4  /
    empno: 7934
    old hiredate: 23/01/82
    new hiredate: 03/05/82
    PL/SQL procedure successfully completedAccording to the Oracle doc the select of the autonomous transaction should not see the change made to the hiredate column of the table in the main transaction(in the anonymous block)....
    What may i do wrong..????
    Thank you,
    Sim

    Simon:
    As Tubby pointed out, your dbms_output commands do not display the value you selected in the trigger. Your trigger based demonstration needs to be more like:
    SQL> SELECT * FROM t;
            ID DT
             1 05-SEP-2009
             2 17-JUL-2009
    SQL> CREATE TRIGGER t_ai
      2     AFTER INSERT OR UPDATE ON t
      3     FOR EACH ROW
      4  DECLARE
      5     PRAGMA AUTONOMOUS_TRANSACTION;
      6     l_dt t.dt%TYPE;
      7  BEGIN
      8     SELECT dt INTO l_dt
      9     FROM t
    10     WHERE id = :new.id;
    11     DBMS_OUTPUT.Put_Line ('ID: '||:new.id);
    12     DBMS_OUTPUT.Put_Line ('Old dt: '||:old.dt);
    13     DBMS_OUTPUT.Put_Line ('New dt: '||:new.dt);
    14     DBMS_OUTPUT.Put_Line ('Aut dt: '||l_dt);
    15  END;
    16  /
    Trigger created.
    SQL> UPDATE t SET dt = sysdate WHERE id = 2;
    ID: 2
    Old dt: 17-JUL-2009
    New dt: 25-OCT-2009
    Aut dt: 17-JUL-2009
    1 row updated.So, the automomous transaction select did not see the changed value of dt.
    I know you are just trying to understand automomous transactions here and would never do sometihg like this in production right? :-)
    Your trigger, as written, has some interesting side effects because of the automomous transaction. For example:
    SQL> INSERT INTO t VALUES(3, sysdate - 25);
    INSERT INTO t VALUES(3, sysdate - 25)
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at "OPS$ORACLE.T_AI", line 5
    ORA-04088: error during execution of trigger 'OPS$ORACLE.T_AI'
    SQL> UPDATE t SET id = 3 where trunc(dt) = TO_DATE('05-Sep-2009', 'dd-mon-yyyy');
    UPDATE t SET id = 3 where trunc(dt) = TO_DATE('05-Sep-2009', 'dd-mon-yyyy')
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at "OPS$ORACLE.T_AI", line 5
    ORA-04088: error during execution of trigger 'OPS$ORACLE.T_AI'John

  • Performing DDLs in themiddle of a transaction: use Autonomous Transactions?

    We want to use Oracle Spatial to store some of our data, for example SDO_PC, a Spatial type for arbitrarily large point clouds. The problem is that the standard way to populate a SDO_PC instance (in a row) is via SDO_PC_PKG.CREATE_PC, which turns out to be a DDL operation, and furthermore operates on an input table containing just the points to inserts for that SDO_PC instance, thus one needs to create a temp table as well per point cloud (or reuse the same, serializing access to it), another DDL.
    But when the user hit save in our application, she may have 10 or 20 or 100 point clouds to save, and I'd want the entire save to be in a single large transaction (I asked about it in this forum a while back, and was answered to make my transactions as large as they should "logically" be, which is a "save" operation in this case).
    How does one resolve doing the save in a single transaction, when the save itself requires calling SDO_PC_PKG.CREATE_PC (which is a DDL) multiple times?
    Are "Autonomous Transactions" the solution? (I've read in Ask Tom that Autonomous Transactions are miss-used most of the time; would it be true here as well?)
    Must the application open a separate Connection to the same server, and perform the DDLs in this other connection? If so, will the first "transactional save" connection be able to access the side effects (tables, etc...) of the DDLs of the "DDL" connection?
    What other solution to this issue could be implemented?
    In a related issue, in this Spatial thread Performance of insert with spatial index someone proposed dropping a Spatial Index before an insert to recreate it afterward, to overcome a large overhead on the insert, but this also implies DDLs in the middle of a large multi-table transaction, so would a solution to the SDO_PC_PKG.CREATE_PC issue above apply equally well in this case as well?
    As everyone can tell, I'm fairly new to databases and Oracle, so I'd appreciate the help of more experienced DBAs / Application Database Architects on this. Thanks, --DD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Thanks Justin. I didn't think of this, even though I've looked at Workspace Manager a bit, and it's something we are considering using in the future.
    But I'm worried about 1) the complexity that Workspace Manager adds, where every table is renamed and replaced by a view, and 2) the performance implications of all the instead of triggers to write to the underlying data tables.
    Furthermore, I wonder how Workspace Manager would scale with hundreds of users, since having the save done in a separate branch kinda implies having a branch per user, and thus hundred of branches. Plus Workspace Manager uses VPD I think, yet another complication (again, we'll probably have to bite the bullet eventually, but I'd rather that be later than sooner).
    Thus I'm reluctant to go the Workspace Manager route at this point, because we already have so much going on with Oracle that I'd rather leave this layer out, at least for now.
    What about the parallel connection or autonomous transaction options? Thanks, --DD                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Captivate 7 new features

    Adobe recently announced new features added to Captivate 7. There are several videos discribing these features here:
    http://www.linkedin.com/news?viewArticle=&articleID=8940148143744880004&gid=2009048&type=m ember&item=5814636812890558467&articleURL=http%3A%2F%2Fblogs%2Eadobe%2Ecom%2Fcaptivate%2F2 013%2F12%2Fthe-most-awaited-enhancements-in-advanced-actions-and-variables-are-here%2Ehtml &urlhash=QS9H&goback=%2Egde_2009048_member_5814636812890558467!
    The descriptions in the videos don't help much because I learn best by doing things myself. Does anyone know where to find hands-on exercises using these new features?

    Lieve, there are all kinds of learners and you can cater to both types of users. So, please publish your ebook. You can combine multiple methods for this. Here are my two cents (not sure if this makes business sense though).
    1. You can have step-by-step procedures in an ebook (which can be printed of course) and direct the users to your blog/ website/ youtube channel for practical demonstration. You can include the cost of videos in the book price or you can charge separately.
    2. You can provide overview of steps in an ebook (just like you do on these forums) and charge for more detailed steps and video demonstrations. As a bonus, you can provide source files to the users who want to customize your solution. Here again, you can decide whether you want to charge separately for source files or not.
    Irrespective of your approach, if possible, please make sure that:
    1. Users can pay in all popular currencies -- USD, AUD, Euro, GPB, and my INR. Atleast in my case, as much as I want to buy few ebooks, the seller's inability to accept payment in my currency has put me on hold several times. My bank charges a huge money for foreign currency transactions, sometimes the charges are more than the book cost itself.
    2. Keep the multi-user license cost low. Users working in a company buy one copy and share it among their team. Having hefty multi-user cost will be a hindrance in such cases. Being the Queen of Advanced Actions, users will be ready to pay a premium upfront for your advanced actions book.
    Overall, it is indeed a huge task to have the setup in place. But that is a one time task.
    Sreekanth

  • Help on autonomous transaction

    Hi All.
    I've been testing the use of AT and have come to the following doubt:
    The example below is based on the Summit Schema:
    1) Log table to insert audit info:
    create table traza_error
    (co_error integer not null
    ,tx_error varchar2(4000) not null
    ,fe_error date not null
    ,usuario_error varchar2(30)
    ,equipo_error varchar2(200))
    2) Procedure to insert info on log table:
    create or replace procedure registra_log_error is
    pragma autonomous_transaction;
    r_traza traza_error % rowtype;
    begin
    r_traza.co_error := sqlcode;
    r_traza.tx_error := substr(sqlerrm,1,4000);
    r_traza.fe_error := sysdate;
    r_traza.usuario_error := user;
    r_traza.equipo_error := sys_context('userenv','terminal');
    insert
    into traza_error
    values r_traza;
    commit;
    end;
    3) Procedure to insert rows on S_EMP table:
    create or replace procedure registra_empleado (r_emp in s_emp % rowtype) is
    begin
    insert
    into s_emp
    values r_emp;
    end registra_empleado;
    4) Anonymous block to insert rows on S_EMP table and raise error:
    declare
    r_emp s_emp % rowtype;
    begin
    r_emp.id := 98;
    r_emp.last_name := 'Perez';
    r_emp.first_name := 'Pedro';
    r_emp.dept_id := 34;
    registra_empleado (r_emp);
    r_emp.id := 99;
    r_emp.last_name := 'Perez';
    r_emp.first_name := 'Pablo';
    r_emp.dept_id := 111;
    registra_empleado (r_emp);
    commit;
    dbms_output.put_line('Registrado el empleado: '||r_emp.first_name||','||r_emp.last_name);
    exception
    when others then
    dbms_output.put_line('Ocurrió el error '||sqlcode||' se registrará en la auditoria de Log');
    registra_log_error;
    end;
    5) Comments:
    Anonymous block must inserts two records, the first one succeeds, second must fail as dept_id 111 is not a valid id (fk with s_dept).
    My point is that, as i understand, the main block (anonymous) must fail an insert no records. However when autonomous transaction is called(registra_log_error) the commit in it , commit boths, the log error record and also the first insert on the S_EMP table.
    From my understanding of AT, the pragma starts a new transaction. For me, that implies another logical unit of work, and as though it should only commit the log record, not boths.
    The whole idea of the log error routine is to be independent of the main transaction, as would happen on a real world situation.
    Please, anyone, clarify on this one ....
    Help will be greatly appreciated ....!

    Your understanding of how autonomous transactions should work is correct - the work of the autonomous transaction is committed independently of the main transaction.
    From a quick look at your example, this has nothing to do with the autonomous transaction nor its commit boundaries but everything to do with having an exception handler that does not raise or rollback and the difference in this regard between handled and unhandled exceptions.
    See the difference between this:
    SQL> create table t1
      2  (col1 number primary key);
    Table created.
    SQL> begin
      2   insert into t1 values (1);
      3   insert into t1 values (1);
      4  exception when dup_val_on_index then null;
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL> select * from t1;
          COL1
             1
    SQL> rollback;
    Rollback complete.
    SQL> select * from t1;
    no rows selectedand this:
    SQL>  begin
      2    insert into t1 values (1);
      3    insert into t1 values (1);
      4   end;
      5  /
    begin
    ERROR at line 1:
    ORA-00001: unique constraint (RIMS.SYS_C00167927) violated
    ORA-06512: at line 3
    SQL> select * from t1;
    no rows selected
    SQL> or this:
    SQL> begin
      2   insert into t1 values (1);
      3   insert into t1 values (1);
      4  exception when dup_val_on_index then
      5   -- do some stuff then
      6   raise;
      7  end;
      8  /
    begin
    ERROR at line 1:
    ORA-00001: unique constraint (RIMS.SYS_C00167927) violated
    ORA-06512: at line 6
    SQL>  select * from t1;
    no rows selected
    SQL>

Maybe you are looking for

  • Clone computers. Any reason why not?

    Hi I have an Intel Mini and I am going to buy a MacBook for travelling. Is there any reason why I could not just copy my Mini onto the MacBooks drive? Would it still be possible to use them together on a local network, given that their names etc woul

  • IPhoto versions and compatibility

    I have iPhoto 9.5.1 on my iMac 10.9.1.  I have iPhoto 9.2.3 on a Macbook 10.6.8.  I have the iPhoto library from iMac on an EHD.  The iPhoto on the Macbook will not open iPhoto with that library.  I can open it in IPLM on the MB, but I cannot seem to

  • List of Export Excise Invoice Created.

    Hi Gurus, I wanted to know any transaction code or report(standard) avaialble to differenctiate between an local excise invoice and export excise invoice generated. I have tried using T. Code : J1I7

  • Temporary objects are deleted incorrectly

    The temporary objects are deleted (their destructors called) when they are leaving the scope of the expression due to wich they were created. But the Standard says that a temporary object should be deleted when the full expression due to wich it was

  • Photoshop Elements 12 Crashes Computer While in Photo Editor

    How can I get Photoshop Elements 12 to stop crashing when I am editing photos?  This has become a huge problem.  I even installed a new copy of the program and it still happens.  I also have had to make multiple catalogs and still have many problems