Ordered Sequences in RAC

We are currently in the process of migrating a single database to a RAC database under an aggressive time line. One of the issues we're currently facing is the use of sequences by our application. Various components of our app require ORDERED sequences (...terrible dependency, actually), and since these components can now connect to multiple instances with separate SGA's (with separately cached sequences), they produce bad results... fail!... "break"... Nothing new...
Because of the aggressive time line, modifying each component in the application is not feasible.
We've come up with a "temporary" solution:
*1. Create a service called SEQSRV that is defined as having a preferred instance: INSTA and and available instance: INSTB with a TAF policy of BASIC.
2. Create the necessary TNS entries for the service.
3. Create a database link (SEQ).
4. Create (recreate) the sequence(s) with appropriately tuned CACHE value NOORDERED (because they will be ORDERED by virtue of accessing only one instance).
5. Create a synonym from the sequence(s) incorporating the database link
sql> create synonym <synonym_name> for <sequence>@SEQ
* - in case we have an issue with INSTA, requests will fail over to INSTB.
I've tested this with a few options:
a. CACHE=20, 5000, 1000000
b. ORDERED, NORDERED
c. from multiple concurrent clients.
d. 'select sequence_synonym.nextval from dual' in a loop for iterations: 50, 5000, 2000000
The test results showed solid performance for all runs, and the trace indicated a DSF locks were proportional to (CACHE/number of iterations). On higher iterations, there was a bit of recursive sql along with the usual TNS-related wait information, but nothing indicating poor performance.
Can anyone comment on this? Is our logic flawed? Any suggestions? Anything?
Jeffrey Frey
Sr. Oracle DBA
BondDesk Group Llc
Edited by: jjfrey on Feb 11, 2009 12:17 PM

Absolutely, the requirement "just" ordered... gaps are permitted between (for whatever reason), as long as the application's threads see chronologically incremented values.
I'll be sure to test the TAF policies before implementing, when I test failover scenarios... thanks! great suggestion.
So far, my most extreme test has been two simultaneous connections running 2,000,000 iterations of nextval ... results were comparable to a single without database links (with a few minor tweaks on CACHE value). Nothing in our application comes close to this kind of abuse; however, there are components that run 4 and 5 threads deep, but their requests for nextvals are typically more "serialized" and throttled by other factors (batch processing, AQ etc).
As for busy database links, I have no issues increasing the number of sockets (distinct links) and grouping accordingly to avoid contention... will require some effort, but... effort is in the job description, right?
Still think its feasible?
Jeffrey

Similar Messages

  • Sequences under RAC

    Does anyone have any general/specific recommendations for the 9300 sequences in EBS under RAC?
    Jeff

    In RAC environments, it is always suggested to cache the sequence number to avoid the concurrent updates on the data dictionary because of sequence generator. If cluster databse is processing heavy workload then database sessions may have to wait on SQ enqueues if sequences are not cached. If you want ordered sequence number then you can use 'CACHE ORDER' of sequence. If there is no such requirement of ordered sequence number then 'CACHE NORDER' is the best trade.
    Thanks & Regards
    -Harish Kumar Kalra

  • Error during scheduling while running Run order sequencing in PPR

    Hello Experts,
    An error saying 'Error during scheduling' is logged while running Run order sequencing in Production Planning Run and the job is failed.
    Checked the capacity of the resource but seems ok.
    The below long text is displayed next to the error message.
    Error during scheduling
    Message no. /SAPAPO/OM043
    Diagnosis
    The system could not schedule an order, operation or activity.
    This could have the following causes:
    The resource does not have any free working time or capacity.
    If you have set planning direction backwards in the strategy profile:
    There is not enough working time or capacity available for scheduling between now and the scheduling date.
    If you have set planning direction forwards in the strategy profile:
    There is not enough working time or capacity available for scheduling between the scheduling date and the end of the planning area.
    If you plan characteristics-dependently:
    You have assigned characteristics to operations of the order that do not agree with characteristics of the resources on which the operations are to be processed.
    The system cannot find any suitable characteristics on the resources and so it cannot schedule.
    Procedure
    Depending on which of the above reasons is the cause, change the following settings:
    Change the working times and capacities of the resources.
    Set the planning mode "infinite planning" in the strategy profile.
    Activate the planning direction forwards or backwards and reverse in the strategy profile.
    Change the characteristics that you have assigned to the resource.
    Can anyone let me know what else need to check to avoid the error.

    Dear Maddy,
    The function "Reschedule" follows an all-or-nothing logic, which means that either all selected activities on a resource can be re-scheduled or the function (better the liveCache) cancels and no activities will be re-scheduled.
    One reason might be that you have a pegging relation to a fixed activity (this might be a sales order, forecast, an activity outside the propagation range...) which cannot be considered during the
    scheduling. The liveCache cannot break the pegging, therefore it cancels the scheduling.
    Please have a look at the note 510669 which offers a heuristic on the basis of the algorithm /SAPAPO/HEUR_PLAN_SEQ_PACKAGES. This heuristic should solve your problem. It will re-schedule as many activities as possible and will not cancel if one fails.
    Depending on your current release there could be also some correction notes like
    1272960
    1027194
    I hope I could help you further.
    Regards,
    Tibor

  • Order Sequence at Confirmation

    Dear All,
    I want that if i confirm a production order then it should give error if order sequence is not adhered to. i have already done setting in OPK4 but system is allowing me to confirm the 2nd operation directly. Please guide me

    check the control key for 1 st operation, I feel the maintained control key have setting- confirmation not mandatory
    change the control key which have confirmation mandatory
    and then try to confirm 20 th operation, system won't allow

  • Sequences in order - 10g r2 RAC

    Hello, we have a j2ee application against Oracle 10g r.2, which uses sequences (over ten approximately). These sequences are used to assign automatically value to the primary key of registers of several tables.
    In production environment, we have RAC with 4 instances. We would be interesting in maintaining the order of the values in this fields. We've defined these sequences as ORDER and CACHE=20, but after reading in forums and Oracle documentation, we've seen that the best practice is to define them (in RAC) as NO ORDER.
    My question is, could we have problems derived from this type of definition (ORDER - CACHE) ? Our main thought is that is very important that the primary key are not repeated, and also maintaining the order. On the other hand, could we have performance problems with this mechanism ?
    Thanks in advance.

    with the ORDER parameter, what I'm trying to obtain is that the number given by the sequence will be 1,2,3,4,5, ....49,50,51,52,... regardless of the instance that provides it.Why? The only requirement for a surrogate key is to be unique! Where in relational design is it recommended/suggested that surrogate keys be numbers in a gap free ascending sequence?
    This so-called "+requirement+" from developers for gap free surrogate key sequences are based on ignorance of relational design fundamentals.
    Also, you are not even considering the impact on the RDBMS for wanting it's sequences to behave this way.
    Think of a 100+ users, using a a 4 node RAC. All of them running typical OLTP apps that are inserted rows. All of which requires a sequence. For this to be ascending and gap free there can only be a single sequence generator on all 4 RAC nodes. As only a single generator can ensure gap free ascending numbers. This means that all 100+ users have to queue for access to this single generator to get a surrogate key value.
    What does this introduce? Serialisation. What not only kills performance, but utterly destroys it on a server platform? Serialisation.
    It is even worse on a RAC as instead of introducing serialisation on a single database instance, it will introduce serialisation on all cluster instances. Effectively rendering the whole RAC concept of scalability and performance totally useless.

  • Sequence in RAC

    Hi
    I am new for RAC environment
    My new database will create in RAC environment
    In my database table,we are using sequence in many place
    so what are the step i want to take when i create sequence
    Please any one help me
    Regards
    Makesh

    Hi,
    Check this sample questions explanation on oracle site.
    Sequences and Oracle RAC
    The use of sequences in Oracle Real Application Clusters (Oracle RAC) is much the same as it is for single-instance Oracle databases, but there are certain Oracle RAC-specific issues. With two or more database instances, sequences may require coordination to guarantee that the sequence numbers are allocated in the correct order.
    Which of the following are always true regarding the use of sequences in an Oracle 10g RAC database? (Pick two.)
    A. It is not possible to use the CACHE option, because each database has a row cache.
    B. Sequence numbers may be out of order if multiple instances run the application program that uses the sequence.
    C. Sequences add no extra overhead to traffic over the interconnect.
    D. Using the CACHE and NOORDER options together results in the best performance for a sequence.
    The correct answers are B and D.
    Answer B is correct because if the CACHE option is used without the ORDER option, each instance caches a separate range of numbers and sequence numbers may be assigned out of order by the different instances. Answer D is correct because the CACHE option causes each instance to cache its own range of numbers, thus reducing I/O to the Oracle Data Dictionary, and the NOORDER option eliminates message traffic over the interconnect to coordinate the sequential allocation of numbers across all instances of the database.
    Answer A is incorrect because even though each instance has a row cache, it is still possible to use the CACHE option with sequences. In such a case, each instance may cache numbers for that sequence in its row cache. Answer C is incorrect because if the CACHE and ORDER options are used together, all instances must allocate numbers in order by coordinating the assignment of the next value, using messages over the interconnect, thereby increasing interconnect traffic in proportion to the frequency of new-number assignment.
    Hope it explains

  • Log sequence in RAC database

    10.2 Doc. says: http://download.oracle.com/docs/cd/B19306_01/backup.102/b14194/rcmsynta008.htm#RCMRF106
    >
    Although the SEQUENCE parameter does not require that THREAD be specified, a given log sequence always implies a thread
    >
    Does this mean that the log sequence is unique for all threads ? If not what does this sentence mean ?
    Note that in my 10.2.0.1 RAC database log sequence is unique only for a given thread:
      1  select thread#, sequence#, name, status
      2  from v$archived_log
      3  where sequence# between 34 and 35
      4* order by sequence#
    SQL> /
       THREAD#  SEQUENCE# NAME                                                         S
             1         34                                                              D
             2         34 /u02/fra/RAC/archivelog/2010_08_20/o1_mf_2_34_66xb2ttb_.arc  A
             1         34 /u02/fra/RAC/archivelog/2010_08_20/o1_mf_1_34_66xcgmbn_.arc  A
             2         35 /u02/fra/RAC/archivelog/2010_08_20/o1_mf_2_35_66xb48b8_.arc  A
             1         35 /u02/fra/RAC/archivelog/2010_08_20/o1_mf_1_35_66xcgkk0_.arc  A
             1         35                                                              D
    6 rows selected.

    I sent mail to the writer and got this in reply:
    The sentence will be rewritten to state that: "When you do not explicitly specify a thread number with the sequence number in the command, thread number 1 is used."
    -----------------

  • Regarding xml file sequence and sales order sequence not equal

    Hi frnds,
                                     The XML File generates after sorting the line items, the sorting is done alphabetically on material master codes but the when the program converts the XML to Sales orders, the line item numbers does not matches with the line item of the XML File, like to understand how the XML conversion happens and is it possible to keep the same sequence of the XML file?
    Regards,
    Jaya.

    And This is a xml details to read
    <ENV:Envelope TransactionID="234567" xmlns:ENV="schemas-hiwg-org-au:EnvelopeV1.0">
         <ENV:SenderID>ABC</ENV:SenderID>
           <ENV:RecipientID>XYZ</ENV:RecipientID>
           <ENV:DocumentCount>1</ENV:DocumentCount>
         <Documents>
              <PurchaseOrder RecordType="10" xmlns="schemas-hiwg-org-au:PurchaseOrderV2.0">
                     <TradingPartnerID>C42000</TradingPartnerID>
                     <MessageType>ORDERS</MessageType>
                     <VersionControlNo>2.0</VersionControlNo>
                     <DocumentType>220</DocumentType>
                </PurchaseOrder>
           </Documents>     
           <Document_Lines>
              <row>
                   <ItemCode>Nylon Black</ItemCode>
                   <Quantity>2</Quantity>
              </row>
              <row>
                   <ItemCode>Nylon White</ItemCode>
                   <Quantity>3</Quantity>
              </row>
         </Document_Lines>
      </ENV:Envelope>
    But this event is fileted with this result message
    "Mapping from LocalObjectType Envelope to object Type failed."
    I've tried to use ENV:Envelope logical objecttype instead of Envelope. But result is same.
    I hope someone can help me
    Thanks

  • Changing the order sequence

    Hello,
    i have a table test contains these data.
    group sequence value
    1 1 100
    1 2 200
    1 3 300
    1 4 400
    1 5 500
    1 6 600
    Now i want to change the sequence. ie, eg change the sequence of 2nd record to 5th.
    ie moving the 2nd record to 5th and re arrange the sequence. so the records get rearranged
    with new sequence.
    3 becomes ==> 2
    4 becomes ==> 3
    5 becomes ==> 4
    so the records should looks like
    1 1 100
    1 2 300
    1 3 400
    1 4 500
    1 5 200 --> 2nd record moved to 5th
    1 6 600
    how can i achieve this?

    create table TestTable AS
    SELECT 1 group_id, 1 seq, 100 val FROM DUAL UNION
    SELECT 1 group_id, 2 seq, 200 val FROM DUAL UNION
    SELECT 1 group_id, 3 seq, 300 val FROM DUAL UNION
    SELECT 1 group_id, 4 seq, 400 val FROM DUAL UNION
    SELECT 1 group_id, 5 seq, 500 val FROM DUAL UNION
    SELECT 1 group_id, 6 seq, 600 val FROM DUAL;"excahnge 2 and 5" is easy.
    select group_id,seq,
    case when seq = 2 then max(decode(seq,5,val)) over()
         when seq = 5 then max(decode(seq,2,val)) over()
         else val end as seq
    from TestTable;"excahnge 2 to 5" is this solution.
    This solution is used for ReverseSort.
    select group_id,seq,val as OldVal,RevSeq - seq as a,abs(RevSeq - seq) as b,
    case when seq between 2 and 5
          and RevSeq - seq  > 0 then Lead(val,abs(RevSeq - seq)) over(order by seq)
         when seq between 2 and 5
          and RevSeq - seq <= 0 then Lag (val,abs(RevSeq - seq)) over(order by seq)
    else val end as newVal
    from (select group_id,seq,val,
          Row_Number() over(order by seq desc) RevSeq
          from TestTable)
    order by seq;update is complex.
    update TestTable a set
    val = (select newVal
             from (select Row_ID,
                    case when seq between 2 and 5
                          and RevSeq - seq  > 0 then Lead(val,abs(RevSeq - seq)) over(order by seq)
                         when seq between 2 and 5
                          and RevSeq - seq <= 0 then Lag (val,abs(RevSeq - seq)) over(order by seq)
                         else val end as newVal
                     from (select seq,val,
                           RowID as Row_ID,
                           Row_Number() over(order by seq desc) as RevSeq
                           from TestTable)) b
            where b.Row_ID = a.RowID)
    where seq between 2 and 5;

  • Startup and shutdown sequence in RAC on Linux

    I am trying to understand the start-up and shutdown sequence in 11g R2 RAC on Linux(OEL5.8).
    can you please share me docs or sequence.

    Hi Friend,
    Example : Two node RAC. RAC1 and RAC2 instances.
    Stopping RAC2 Instance :
    =========================
    1. Shutdown the Instance running on RAC2
    2. ./srvctl stop asm -n csbppmaadbs02
    3. ./srvctl stop nodeapps -n csbppmaadbs02
    4. ./srvctl stop listener -n csbppmaadbs02
    5. Check "./crs_stat -t"
    Note 1 : Check the following also for healthy status & If any service of RAC that also we have to check.
    6./crsctl check crs
    CSS appears healthy
    CRS appears healthy
    EVM appears healthy
    Starting RAC2 Instance
    =========================
    1 ./srvctl start nodeapps -n csbppmaadbs02
    2 ./crs_stat -t
    3 ./srvctl start listener -n csbppmaadbs02
    4 ./srvctl start asm -n csbppmaadbs02
    5. Start the Instance of RAC2
    6. ./crs_stat -t
    Hope it helps...
    Thanks
    LaserSoft

  • ABAP Update to Production Order Sequence

    Good afternoon PP Gurus,
    We are creating an inquiry that shows all production orders for a given work center.  What we want the inquiry to do is then allow the user to change the sequence AFKO-CY_SEQNR and then save the new value back to the order header AFKO.
    Example Inquiry.
    Work Center: 123
    OrderNumber  Part   Description  Sequence
    100001           123   Part123             _
    100002           456   Part456             _
    100003           789   Part789             _
    100004           000   Part000             _
    So we need an ABAP object that would take production order as the key and allow a change to sequence number CY_SEQNR.
    We're running an older R/3 version 4.7.
    Thanks in advance for any information that you might share.
    Chad

    Don't sweat this one gang.
    Our current version of R/3 does not contain any native ABAP that allows for us to update the production order.  We came up with our own FM created off a recording of CO02.
    Thanks,
    Chad

  • Multiple output records for delivery type access order sequence

    Hello,
    This is a question about output delivery type for outbound deliveries.
    I have created one delivery type YF and two output condition types YDL1  and assigned access sequence (by sales org/customer) and YDL2 (by  shipping point) in NACE V2 shipping. I have also created their corresponding condition records: salesorg/cust and shipping point in VV21.
    When I created my outbound delivery YF from sales order and saved it. System finds both output condition types. First YDL1 and then YDL2 as expected because condition records have been maintained. However, I need to change this order so that YDL2 is the default one and YDL1 is found next.
    Could somebody help me how do I change this order?
    Thank you in advanced.

    Hello,
    what do you mean with
    I need to change this order so that YDL2 is the default one
    When two or more output types are determined, they have the same "rank".
    If you mean that you want to sort the output types to have one printed before the other one, please refer to point 3. of OSS Note 960611
    https://websmp130.sap-ag.de/sap(bD1pdCZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361…
    Best regards,
    Andrea

  • What is the order / sequence of the Report

    Hi,
    I have created all my dimensions and application, when I am trying to take Report (Account Trend)
    the format of the report is totally different from my Account dimension.  It is showing 1st
    Income then expenditure and Gross profit, net profit accounts etc.... So can anybody help how actually
    report will form.  It is based on our code wise or Description?   If at all we wanted our own format
    then how to do?
    Thanks in advance.
    Raghu B.S.

    Hi Raghu -
    If I understand correctly, you want your report to show accounts in a particular order.  If that is the case you have two options:
    Option 1: create a hierarchy of the accounts in the order you wish to present them.  Select the top node of the new hierarchy and allow the EVDRE function to expand to all members.
    Option 2: disable the expansion function of the EVDRE report and manually position each account in the order desired.  Make sure your row settings include all manually positioned accounts members.
    Hope this helps!
    Regards,
    Sheldon

  • Unrelease Purchase order Sequence

    Dear all,
           Whenever releasing the PO then first release should be done by higher level(Purchase Head) to lower(Purchase Officer), same we have requirement like when user unrelease the PO, first Purchase Head should be unrelease the PO then it allow to Purchase Officer to unlelease, & if Purchase Officer is doing same without unreleased by Purchase Head then it shows error message .
    I searched but i think it is not possible in customization.so if any possibility by EXIT or BADI then pls help..........
    Thanks & regards
    Atul
    Moderator Message: Read my comment here: Re: Unreleased Sequence.
    Edited by: kishan P on Nov 24, 2010 6:26 PM

    Hi Parag ,
    Check ur Release Pre-requisites against ur Release Strategy.
    At first check whether 2nd level can release a PO without 1st Level -  I think this is possible in ur system , therefore the error.
    Set ur release pre-requisites in such a way that unless 1st level release , 2nd level can't release. If this is set , the reverse will also work .
    Regards
    Ramesh Ch

  • How to order sequences by modification date

    Hi!
    Hopefully this is a really basic question:
    I have a large project which has many sequences. I would like to sort those sequences from newest to oldest to be able to find where I was up to. Is that possible? I can't find an option under the various "metadata display" items that shows that info and allows sorting.
    thanks
    tom

    in Project section, right upper corner you have the menu. In menu the option metadata display, in basic section you have creation and modification date, select them and it will be added to project list.

Maybe you are looking for

  • 2006 white macbook hdd

    i have a 2006 white macbook and was wonting to upgread my HDD do i need to buy a (ATA) or a (SATA)

  • How do i publish comments in a shared review?

    It used to automatically give me the option with a publish button, but now I don't see it anywhere.

  • Is it possible to activate CS (original)?

    I can install using the original discs and serial number however, there is no way to activate the product (online and phone number don't work anymore). Is it possible to activate the CS, the original?

  • Tooltip problem

    HI all I am facing a problem using a tool tip on tile list image.I am using flex 3. i need to display some data in custom tooltip.as i used itemrenderer to display the image in tile list it is possible by using simple tooltip.but unable to use custom

  • Advanced Dialog in Elements 9 Organizer

    I just downloaded Photoshop Elements 9 and am trying to import photos into the Organizer.  In the Photo Downloader window, the Advanced Dialog button is missing.  This is an option that I desperately need, as I upload photos from many dates and event