Is "SET TRANSACTION USE ROLLBACK SEGMENT" only a hint

I have two users, one makes some inserts in a table.
The other makes a select which visits many rows.
I have a big rollback-segment.
To ensure, both users use this rollback-segment I created a logon-trigger:
CREATE OR REPLACE TRIGGER a_logon AFTER LOGON
ON DATABASE
WHEN ( USER IN ( 'SCOTT', 'BOB' ) )
BEGIN
SET TRANSACTION USE ROLLBACK SEGMENT rbs_big;
END;
But I still get "snapshot to old" messages from the select, which contains the name off an other rollback-segment in the message.
The trigger really fires, i tested it by adding an insert-statement to a log-table.
What`s wrong ?

The set transaction use rollback segment lasts only until you commit or rollback first time and all other transactions in that session will not be forced to that rbs anymore. Other possible solution could be that other users are accessing same tables / updating them so those sessions can't keep the read consistent image available anymore for your sessions.

Similar Messages

  • Set Transaction Use Rollback segment

    Hi everybody. Does It make sense issue a "set transaction use rollback" for a single query that do not update, insert or delete. The trouble is that I get e "SnapShot too Old" for a query that just do a query.
    Thanks!

    No, If you are not making any modifications then you do not generate rollback (or even a transaction to my knowledge). The SNAPSHOT TOO OLD is because a different session has run through the rollback for the read consistent view you need (either because someone made changes to a table you are reading or from delayed block cleanout). Delayed block cleanout is a pretty complicated scenario so I'll leave it to the Oracle documentation to explain that. Just be aware that even if nobody has made changes to the table since you started your query you can still get SNAPSHOT TOO OLD. Thankfully, 9i helps elleviate this somewhat with the introduction of UNDO TABLESPACES.
    Richard

  • TRANSACTION을 ROLLBACK SEGMENT에 할당하는 방법(SET TRANSACTION USE)

    제품 : ORACLE SERVER
    작성날짜 : 2003-04-04
    TRANSACTION을 ROLLBACK SEGMENT에 할당하는 방법
    ==============================================
    (SET TRANSACTION USE ROLLBACK SEGMENT)
    Purpose
    Batch job 등을 사용할 때 특별히 크게 만든 rollback segment를 사용하도록
    할 수가 있다. transaction에 특정한 rbs를 지정하는 방법을 알아보자.
    Explanation
    Oracle은 다음과 같은 규칙에 의해 각 Transaction이 사용하는 Rollback
    segment를 결정한다.
    1. Active Transaction의 수가 가장 작은 Rollback Segment에 할당한다.
    2. 만약 1의 조건에 만족하는 Rollback segment가 하나 이상이면, 가장
    마지막에 할당된 rbs 다음의 rbs를 할당한다. 이것은 undo 기능을 더
    오래 지속시키도록 해 준다.
    그러나, Application이 큰 rollback segment가 필요하다면 위와 같이
    자동적인 rollback segment의 할당이 아닌 Manual하게 특정 rollback
    segment를 할당 가능하다.
    다음의 방법을 사용한다.
    1) 큰 rollback segment를 만든다. 큰 rollback segment 를 만들기
    위해서는 rbs tablespace에 영역이 충분히 커야 하므로 필요할 경우
    tablespace를 확장하는 작업을 한다.
    <tablespace 확장>
    $ sqlplus system/manager
    sql> alter tablespace rbs add datafile '?/rbs1SID.dbf' size 100m;
    <rollback segment 생성>
    sql> create rollback segment big_rbs storage(initial 10m next 10m)
    tablespace rbs;
    sql> alter rollback segment big_rbs online;
    2) Transaction 를 assign 한다.
    <sqlplus>
    SQL> set transaction use rollback segment big_rbs;
    <pro*c>
    exec sql commit work;
    exec sql set transaction use rollback segment big_rbs;
    <forms>
    dbms_transaction.use_rollback_segment('big_rbs');
    이와 같이 지정하면 이후에 commit 또는 rollback이 일어날 때까지
    한 transaction에만 해당된다.

  • Set transaction use roll back segmet

    Hi all:
    I have lot of packages with the statement set transaction use roll back segment RBS_BIG.I am working on upgrade project and using undo tablespaces.
    Is there a quick way to grep the this statement from all the packages and remove off.Does the presence of this statement in packages of new database cause compilation errors ?
    Thanks,
    Ganesh

    Hi,
    Set init.ora parameter as follows and restart database. All SET TRANSACTION USE ROLLBACK SEGMENT statements will have no effect and ignored.
    UNDO_SUPPRESS_ERRORS=TRUE
    You may use ALTER SYSTEM rather than restart db. If your database use spfile.ora, you have to execute:
    ALTER SYSTEM SET UNDO_SUPPRESS_ERRORS=TRUE SCOPE=BOTH;
    Best regards,
    Dima

  • Set transaction use roll back

    Hi all:
    I have lot of packages with the statement set transaction use roll back segment RBS_BIG.I am working on upgrade project and using undo tablespaces.
    Is there a quick way to grep the this statement from all the packages and remove off.Does the presence of this statement in packages of new database cause compilation errors ?
    Thanks,
    Ganesh

    The set transaction use rollback segment <rbsegment> is ignored in 10g. In 9i databases this could cause errors when using automatic undo management. For your 9i databases you can suppress the errors by setting UNDO_SUPPRESS_ERRORS=true.

  • ORA-01581: attempt to use rollback segment...

    We've started getting "ORA-01581: attempt to use rollback segment (31) new extent (3) which is being allocated" messages in our production database over the last couple of days. Of course, each time we get these the rollback segment number is different, and we are getting these randomly from different applications that connect to the same database. We are using automatic undo management, so the rollback segments are not really under our control. The action in the Oracle docs for this error message doesn't give any specific actions that we should take, but we continue to get these.
    We started to get these about the same time as we ran out of available sessions on the database (sessions = 1500 and we had 1500 open sessions). Could these be related? Could there be some open session that may be causing the rollback segment issue? Would a restart of the database fix this? Of course the max sessions issue was cleaned up two days ago but the rollback segment issue is a lingering problem.
    Any help would be appreciated. We couldn't find anything for this online and Oracle hasn't responded to our service request yet.
    Thanks,
    Bobby

    As I understand it, you can not explicitly set the size for the undo segments in automatic undo management mode. From the Concepts guide:
    "In automatic undo management mode, the system controls exclusively the assignment of transactions to undo segments, and controls space allocation for undo segments."
    It looks like we are also using the default storage options that are set when the UNDO tablespace was created. Here is the DDL used to create this tablespace:
    CREATE SMALLFILE UNDO TABLESPACE "UNDOTBS" DATAFILE '/alpha/oradata/prod01/undotbs01.dbf' SIZE 750M REUSE AUTOEXTEND ON NEXT 25600K MAXSIZE 2000M , '/alpha/oradata/prod01/undotbs03.dbf' SIZE 2000M REUSE AUTOEXTEND ON NEXT 51200K MAXSIZE 2000M , '/alpha/oradata/prod01/undotbs04.dbf' SIZE 2000M REUSE AUTOEXTEND ON NEXT 104K MAXSIZE 2000M , '/alpha/oradata/prod01/undotbs02.dbf' SIZE 2000M REUSE AUTOEXTEND ON NEXT 25600K MAXSIZE 2000M

  • Worked Example on SET TRANSACTION, SAVEPOINT, ROLLBACK, COMMIT

    Does any one know if there is any worked examples on the use of SET TRANSACTION, SAVEPOINT, ROLLBACK, COMMIT?

    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_106a.htm#2067249
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_102a.htm#2065561

  • How can I avoid using rollback segment for batch updates.

    I am currently trying to avoid associating a large amount of space for rollback segment as this gets filled up only during the nightly batch updates. All that space will never be used during the day. Hence want to know if there is any way of avoiding the use of rollback segment at the session level.
    Rajesh

    No, but what you can do is create a large rollback segment to use with your batch job, at the start of your batch job bring the segment online, then use set transaction to use that rollback segment, when the batch job is finished and committed, you can then bring the rollback segment offline.
    If you are really pressed for space, as an alternate plan, you could actually create the large segment before the batch job and drop it after.

  • ORA-01581: attempt to use rollback segment (5) new extent (67) which is being allocat

    While importing a table, I got the following errors. Basically, the server couldn't extend the rollback segment. I checked the disk space, tablespace extents (unlimited), and segment extents (unlimited), but I couldn't find a reason that the segment couldn't be extended.
    What else do I have to check?

    As I understand it, you can not explicitly set the size for the undo segments in automatic undo management mode. From the Concepts guide:
    "In automatic undo management mode, the system controls exclusively the assignment of transactions to undo segments, and controls space allocation for undo segments."
    It looks like we are also using the default storage options that are set when the UNDO tablespace was created. Here is the DDL used to create this tablespace:
    CREATE SMALLFILE UNDO TABLESPACE "UNDOTBS" DATAFILE '/alpha/oradata/prod01/undotbs01.dbf' SIZE 750M REUSE AUTOEXTEND ON NEXT 25600K MAXSIZE 2000M , '/alpha/oradata/prod01/undotbs03.dbf' SIZE 2000M REUSE AUTOEXTEND ON NEXT 51200K MAXSIZE 2000M , '/alpha/oradata/prod01/undotbs04.dbf' SIZE 2000M REUSE AUTOEXTEND ON NEXT 104K MAXSIZE 2000M , '/alpha/oradata/prod01/undotbs02.dbf' SIZE 2000M REUSE AUTOEXTEND ON NEXT 25600K MAXSIZE 2000M

  • CMSXDB sample: install.sql - error out, cannot use rollback segment

    I use the setup instruction and had errors when running install.sql at the following part:
    connect cmsadmin/cmsadmin@&tnsname
    SET serveroutput ON
    PROMPT Creating Table 'OTNCMS_PERSONALIZATION'
    CREATE TABLE OTNCMS_PERSONALIZATION (
    USERNAME VARCHAR2(20) NOT NULL,
    RESOURCELOC SYS.XDBURITYPE NOT NULL,
    VIEWTYPE VARCHAR2(40) NOT NULL,
    XSLLOC SYS.XDBURITYPE NOT NULL
    Resulted in error-
    ERROR at line 1:
    ORA-01552: cannot use system rollback segment for non-system tablespace 'USERS'
    Anyone knows why?

    Hi,
    What is the version of Database that is being used ?.
    I guess there must be some issue with the database being used, the archive mode or the UNDO segments. As a workaround, you can remove the following command from install.sql and run the sql script again.
    alter user cmsadmin default tablespace users;Regards
    Elango.

  • Can we see the old value using rollback segment no?

    hi
    querying the following
    SELECT * FROM joschedule AS OF TIMESTAMP To_Timestamp('5-jul-09 8:50:58','DD-MON-YY HH24:MI:SS') where unitid = 1 and joborderno = '91260050' but im getting the following error. How to see the using the segment no.
    ORA-01555: snapshot too old: rollback segment number 1 with name "_SYSSMU1$" too small kanish

    Well, as the error says, you do not have the rollback anymore that is required to build the old snapshot that your query specifies.
    You may want to increase the undo_retention parameter to specify how long Oracle should (try to) hold on to rollback data for this type of queries.

  • Cleanup log running transactions ..rollback segments

    Is there any metric in OEM which does the following...
    Am trying to read the document and find the metric which does the following ..not having much luck...
    #* Description : Process to monitor and notify DBA about any in-doubt
    #* transaction which is holding ROLLBACK Segment and
    #* troubling system resources for longer time.
    Thank you

    Below are more details on what it does...trying to find if any metric in OEM does this...thank you
    $sql_text  = "select c.USN  ";
       $sql_text .= ",d.name       ";
       $sql_text .= ",c.EXTENTS , ";
       $sql_text .= "a.username , a.osuser , a.sid , a.process, a.status  ";
       $sql_text .= ",b.start_time ";
       $sql_text .= ",b.status trans_stat, b.used_ublk*value as Bytes_Used ";
       $sql_text .= ",b.used_urec  as Records_used          ";
       $sql_text .= ",start_uext   as First_Extent          ";
       $sql_text .= ",a.MACHINE           ";
       $sql_text .= ",a.TERMINAL        ";
       $sql_text .= ",a.PROGRAM     ";
       $sql_text .= "from v\$session     a,                        ";
       $sql_text .= "     v\$transaction b,                        ";
       $sql_text .= "     v\$rollname    d,                        ";
       $sql_text .= "     (select value from v\$parameter          ";
       $sql_text .= "          where name = 'db_block_size' )  e , ";
       $sql_text .= "     v\$rollstat    c ,                       ";
       $sql_text .= "     dba_rollback_segs f                      ";
       $sql_text .= "where b.ses_addr = a.saddr (+)                ";
       $sql_text .= " and c.usn      = b.xidusn (+)                ";
       $sql_text .= " and d.usn      = c.usn                       ";
       $sql_text .= " and f.segment_id = c.usn                     ";
       $sql_text .= " and a.status     = 'INACTIVE'                ";
       $sql_text .= " and b.used_urec <=${rec_used}                ";
       $sql_text .= " and (round((sysdate - to_date(start_time,'mm/dd/yy HH24:mi:ss'))*1440)) >= ${time_interval} ";
       $sql_text .= " and a.username  <>  'DMIRROR'  

  • Rollback segment for set transaction

    there is way that i can setup a rollback segment for a spacific user or specific transction.
    ALTER ROLLBACK SEGMENT big_rbs ONLINE;
    SET TRANSACTION USE ROLLBACK SEGMENT big_rbs;
    sql .....
    commit;
    ALTER ROLLBACK SEGMENT big_rbs OFFLINE;
    the sql is going for about hour, i was woundering during that time can some else use this rollback segment. i just want this rbs to this user, how i can do that.
    thanks

    I guess i didn't clearify well. let say i created a rbs for specific tranction. before this transaction is start it will turn on this rbs and once this transaction is completed, it issue the command commit, and bring it back to this rbs offline. the question is durning this transaction does any other transaction can come and use this rbs instead of we have lot of other rbs.
    I hope that you get my point.

  • Forcing a specific rollback segment on a transaction does not seem to work

    Hi!
    We're using Oracle 9.2.0.5.0 on Sun Solaris and we're still configured to use Rollback Segments.
    We have an issue with Snapshot too old due to RBS too small on a long query I attach below for reference:
    set heading off
    set pagesize 0
    set feedback off
    set linesize 200
    <<<<< SET TRANSACTION USE ROLLBACK SEGMENT UMF_RBS_LARGE_TRAN; <<<<<
    SELECT ucms_cards.msisdn
    || ';;' || to_char(to_date(substr(ucms_cards.notes,14+length(ucms_cards.msisdn),19),'MM-DD-YYYY.HH24-MI-SS'),'DD/MM/YYYY HH24:MI:SS')
    || ';;' || to_char(ucms_batches.expiry_date,'dd/mm/yyyy')
    || ';;' || ucms_cards.serial_no
    || ';;' || ucms_cards.serial_no
    || ';;' || ucms_cards.batch_serial_no
    || ';;' || ' '
    || ';;' || CASE ucms_cards.card_status
    WHEN 'used' THEN '1'
    ELSE '0'
    END
    || ';;' || CASE WHEN date_booked_in is null THEN '01/01/1970 00:00:00' ELSE to_char(date_booked_in,'DD/MM/YYYY') || ' 00:00:00' END
    || ';;' || ' '
    from ucms_batches,ucms_cards, UCMS_EVENT_LOG
    WHERE ucms_cards.batch_serial_no = ucms_batches.serial_no
    AND ucms_cards.serial_no = substr(UCMS_EVENT_LOG.ENTITY_ID,11,length(UCMS_EVENT_LOG.ENTITY_ID)-9)
    AND UCMS_EVENT_LOG.PARTY_NO in (0)
    AND UCMS_EVENT_LOG.TIMESTAMP>=TO_TIMESTAMP(TO_CHAR(SYSDATE-1, 'DD-MM-YYYY') || ' 00:00:01', 'DD-MM-YYYY HH24:MI:SS')
    AND UCMS_EVENT_LOG.TIMESTAMP<=TO_TIMESTAMP(TO_CHAR(SYSDATE-1, 'DD-MM-YYYY') || ' 23:59:59', 'DD-MM-YYYY HH24:MI:SS')
    AND UCMS_EVENT_LOG.USER_ID LIKE 'SCP-AGENT1%'
    AND UCMS_EVENT_LOG.EVENT_TYPE_ID IN (1,2)
    AND UCMS_EVENT_LOG.ENTITY_TYPE_ID LIKE 'ucms_cards%'
    UNION
    SELECT ucms_imported_cards.msisdn
    || ';;' || to_char(to_date(substr(ucms_imported_cards.notes,14+length(ucms_imported_cards.msisdn),19),'MM-DD-YYYY.HH24-MI-SS'),'DD/MM/YYYY H24:MI:SS')
    || ';;' || to_char(ucms_imported_cards.expiry_date,'dd/mm/yyyy')
    || ';;' || ucms_imported_cards.serial_no
    || ';;' || ucms_imported_cards.serial_no
    || ';;' || DBMS_UTILITY.GET_HASH_VALUE(ucms_imported_cards.card_type,1,65536)
    || ';;' || ' '
    || ';;' || CASE ucms_imported_cards.card_status
    WHEN 'used' THEN '1'
    ELSE '0'
    END
    || ';;' || '01/01/1970 00:00:00'
    || ';;' || ' '
    from ucms_imported_cards, UCMS_EVENT_LOG
    where ucms_imported_cards.serial_no = substr(UCMS_EVENT_LOG.ENTITY_ID,11,length(UCMS_EVENT_LOG.ENTITY_ID)-9)
    AND UCMS_EVENT_LOG.PARTY_NO in (0)
    AND UCMS_EVENT_LOG.TIMESTAMP>=TO_TIMESTAMP(TO_CHAR(SYSDATE-1, 'DD-MM-YYYY') || ' 00:00:01', 'DD-MM-YYYY HH24:MI:SS')
    AND UCMS_EVENT_LOG.TIMESTAMP<=TO_TIMESTAMP(TO_CHAR(SYSDATE-1, 'DD-MM-YYYY') || ' 23:59:59', 'DD-MM-YYYY HH24:MI:SS')
    AND UCMS_EVENT_LOG.USER_ID LIKE 'SCP-AGENT1%'
    AND UCMS_EVENT_LOG.EVENT_TYPE_ID LIKE '2%'
    AND UCMS_EVENT_LOG.ENTITY_TYPE_ID LIKE 'ucms_imported_cards%';
    As you see we forced the session to use a huge RBS created for the purpose, but strangely after a long while the query fails with a RBS too small failure due to another RBS, not the one specified.
    Is there any chance the UNION or any other component of the query is implicitly opening a new transaction with a different RBS associated?
    Any chance to force the same RBS specified explicitly?
    Thanks!
    Mike

    albertone wrote:
    but strangely after a long while the query fails with a RBS too small failure due to another RBS, not the one specified.You misunderstand snapshot too old. It can be caused by other sessions same as by your session. Assume AFTER your session issued select some other session modified one (or more) tables ucms_batches, ucms_cards, UCMS_EVENT_LOG and committed changes. By the time your select reaches to fetch rows modified by that other session rollback extents in rollback segment used by that other session were reused. You will get snapshot too old. Bottom line - all sessions modifying table(s) used by your select must use rollback segments large enough so they are not overwritten before corresponding rows are needed by your select.
    SY.

  • Different rollback segment used. why?

    Hi. I am trying to use rollback segment RB6 in a delete process in a stored procedure using SET TRANSACTION USE ROLLBACK SEGMENT RB6;
    However, when the procedure is called and performed, an error is thrown:
    ORA-01562: failed to extend rollback segment number 2
    ORA-01650: unable to extend rollback segment RB2 by 128 in tablespace my_table_space
    If you notice, the error refers to segment RB2. I have not set RB2 as a rollback segment in this procedure. How is it possible? I am using RB6 and now it's throwing an error regarding RB2? Please help. Thanks.

    It depends on where in the code you SET TRANSACTION, when you call the procedure, where delete transaction starts and where it ends. i.e does the delete part of the code run within that same windows?
    The database can decide which rollback segment to use for different transactions.
    BTW - What is your oracle release?

Maybe you are looking for