Enqueue and dequeue between two databases

Please help me to solve i was able to eneque and dequeue in the same database but i just want to enqueue in one database and dequeue in another database can some one let me know the process and it may require any listener configuration?

DECLARE
dequeue_options dbms_aq.dequeue_options_t;
message_properties dbms_aq.message_properties_t;
message_handle RAW(16);
message aqt_order;
BEGIN
dequeue_options.DEQUEUE_MODE := DBMS_AQ.BROWSE;
DBMS_AQ.DEQUEUE ('aqt_queue', dequeue_options, message_properties, message, message_handle);
Dbms_output.put_line(message.ord_name);
END;
i want to dequeue the above code in my database 'b'. i am able to enqueue and dequeue in my database 'a'.Whenever i am dequeueing this it keep on executing.please suggest

Similar Messages

  • Enqueue and Dequeue before updating Database table

    Hi all,
    We are updating database tables using INSERT, MODIFY and UPDATE statements. Since many people will be running the application at the same time we need to lock the table before updating database table. So we need to use ENQUEUE and DEQUEUE functionality for this purpose.
    Can any plz explain what are the steps we should follow now?
    Thanks in advance.

    Hi,
    Any Database access should carefully handled as multiple applications may be accessing the database at the same time. To read a record from the database you don't need to implement a lock, but to write you need not only locks but also ideally should use the Update Function Modules to comply SAP "All or Nothing" Principle. This will prevent data inconsistency of the database and the data will be proper state. You need to use the COMMIT WORK and ROLLBACK WORK in you code to handle the consistency part of the database.
    The best design approach would be seperate the Database Layer completely from the business layers. This will make your code robust and easy to maintain.
    As, for the Locking Concepts, you will get multiple resources from SDN as how to create Locks and implement the Locking modules in your code. But more than that what matters is why and how to implement the SAP Locking concepts to make your application run better.
    Have a look at the following link
    http://help.sap.com/saphelp_nw70/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    Hope this helps.
    Thanks,
    Samantak.

  • High REDO Generation for enqueue and dequeue

    Hi,
    We have found high redo generation while enqueue and dequeue. Which is in-turn affecting our database performance.
    Please find a sample test result below :
    Create the Type:-
    CREATE OR REPLACE
    type src_message_type_new_1 as object(
    no varchar(10),
    title varchar2(30),
    text varchar2(2000))
    Create the Queue and Queue Table:-
    CREATE OR REPLACE procedure create_src_queue
    as
    begin
    DBMS_AQADM.CREATE_QUEUE_TABLE
    (queue_table => 'src_queue_tbl_1',
    queue_payload_type => 'src_message_type_new_1',
         --multiple_consumers => TRUE,
         compatible=>10.1,
         storage_clause=>'TABLESPACE EDW_OBJ_AUTO_9',
    comment => 'General message queue table created on ' ||
    TO_CHAR(SYSDATE,'MON-DD-YYYY HH24:MI:SS'
         commit;
    DBMS_AQADM.CREATE_QUEUE
    (queue_name => 'src_queue_1',
    queue_table => 'src_queue_tbl_1',
    comment => 'Test Queue Number 1'
         commit;
    dbms_aqadm.start_queue
    ('src_queue_1');
         commit;
    end;
    Redo Log Size:-
    select
    n.name, t.value
    from
    v$mystat t join
    v$statname n
    on
    t.statistic# = n.statistic#
    where
    n.name = 'redo size'
    Output:-
    595184
    Enqueue Message into the Queue Table:-
    CREATE OR REPLACE PROCEDURE enque_msg_ab
    as
    queue_options DBMS_AQ.ENQUEUE_OPTIONS_T;
    message_properties DBMS_AQ.MESSAGE_PROPERTIES_T;
    message_id raw(16);
    my_message dev_hub.src_message_type_new_1;
    begin
    my_message:=src_message_type_new_1(
    '1',
    'This is a sample message',
    'This message has been posted on');
    DBMS_AQ.ENQUEUE(
    queue_name=>'dev_hub.src_queue_1',
    enqueue_options=>queue_options,
    message_properties=>message_properties,
    payload=>my_message,
    msgid =>message_id);
    commit;
    end;
    Redo Log Size:-
    select
    n.name, t.value
    from
    v$mystat t join
    v$statname n
    on
    t.statistic# = n.statistic#
    where
    n.name = 'redo size'
    Output:-
    596740
    Can any one tell us the reason for this high redo generation and how can this can be controlled?
    Regards,
    Koushik

    Please find my answers below :
    What full version of Oracle?
    - 10.1.0.5
    How large is the average message?
    - in some byets only, at max 1-2 KB and not more than this.
    What kind of performance problem is 300G of redo causing? How? Have you ran a statspack report? What did it show?
    - Actually we are facing some performance issue as a overall prespective for our daily batch processing, which now causing a delay in the batch SLA. So we have produced an AWR report for our database and from there we have found that total redo generation is around 400 GB, amoung which 300 GB has been generated by enqueue-dequeue process.
    What other activity is taking place on this instance? That is, is all this redo really being generated as the result of the AQ activity or is some of it the result of the messages being processed? How are the messages created?
    - Normal batch process everyday. Batch process also generates REDO but the amount is low compare to enqueue-dequeue process.
    Have you looked at providing a separate physical disk stripe for the online redo logs and for the archive log location from the database data file physical disk and IO channels?
    - No, as we are not the production DBA so we don't have the direct access to production database.
    What kind of file system and disk are you using?
    - I am not sure about it. I will try to confirm it by production DBA. Is there any other way to find it out, whether it is on filesystem or raw device?
    Can you please provide any help in this topic.
    Regards,
    Koushik

  • Where to enqueue and dequeue correctly

    Dear all,
    I have an application in which I need to enqueue tables and dequeue when leavin.
    The application consists of one window. In the window I have several views. One main view with a tray to navigate and a ViewContainerUIElement.
    When choosing an entry in the tray, a view called "A" is loaded into the ViewContainerUIElement. I now need to enqueue a table A and populate a message in the loaded view if a lock already exists.
    If the user then chose another entry of the tray, the existing lock on table A needs to be dequeued before view "B" is loaded into the ViewContainerUIElement and table "B" needs to be locked.
    I wanted to implement the enqueue in method WDDOINIT of each corresponding view and the dequeue in the method WDDOEXIT. But WDDOEXIT is not called when I "leave" view A and navigate to view "B" and WDDOINIT of view "B" not called again when navigate to view "B".
    Could somebody please give me a hint how to do this? I somehow dont get it done correctly.
    Thanks in advance,
    Hendrik

    Hello Handrick ,
                              You can create the INBOUND and OUTBOUND plugs for both of view A and B .
    And fire these plugs to navigate between the views  and write the  ENQUEUE and DEQUEUE in side the Inbound plug handler of both the plugs .
    For example :
    View A  :  
       Inbound plug : A_inbound     ( Handler : A_inboundhandler )
       Outbound plug : A_outbound
    View B:
    inbound  plug : B_inbound    ( Handler : B_inboundhandler)
    outbound plug : B_outbound
    create a navigation link between A_outbound to B_inbound and  B_outbound to A_inbound.
    To switch between the view fire the outbound plugs .
    in A_inboundhandler  :  enqueue A records 
    in B_inboundhandler : enqueue B records
    you can dequeue the records while changing the  tab  or  inside the handlers .
    you have to write enqueue  in the WDDOINIT. it is required  for the first time when view is loaded .
    I hope this will help you .
    Regards
    Vivek

  • Enqueue and dequeue

    Hello everyone,
        I jusr found a  interesting question, which also confused me a lot. Hope you can help me. Look at the picture(panel and block diagram). when I press the dequeue loop stop button,the number will change to be 50. when I press the enqueue loop stop button ,then press the dequeue one, the number will never change to 50. I really cannot understand. Moreover,on the basis of the second operating sequence, what I can do to jump out the dequeue loop and change the number??
    Solved!
    Go to Solution.
    Attachments:
    新建 Microsoft Visio 绘图.png ‏166 KB

    carrot0322 wrote:
    First,I am now writting a DAQ program. In order to have the data acquisition (the enqueue loop) and the data processing(the dequeue )can be synchronous, I have the enqueue and dequeue the same rate.
    Again, that doesn't make much sense.  Your producer loop should run at whatever it needs to, based on how fast you are aquiring data from the DAQ.  The consumer loop will iterate based on when data is in the queue.  If there isn't data in the queue, then it sleeps until there is data.
    carrot0322 wrote:
    Secondly, I have to stop the enqueue loop because there may be some element wait in enqueue loop. So I wait all the elements dequeue, then stop the dequeue loop .
    That's why I said to put a command of some sort into your queue when the producer loop is done.  When the consumer sees that command, it knows to stop.  This will ensure you have processed all of your data.
    carrot0322 wrote:
    Thirdly, like the number part after the dequence loop, there are still some processing modules which need all the processing result arrays generated in the dequence loop.So here I put a number control to illustrate. You may think that I can put the rest processing modules into the dequeue loop. But these processing modules are time-consuming and memory-consuming,the buffer will overflow.If you have any advises,please contact me.
    Nothing says you can't use yet another loop to do that processing.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to ...synchronization between two databases

    Hi,
    I want to set up automatic synchronization between two databases. For example, database DB1 and DB2 have table t1 and t2 with the same columns. If someone updates a record in table t1, I want automatically update the record in t2 or vice-versa.
    How can I make an automatic system like that?

    1) What is the business goal you're trying to satisfy? Failover, reporting, replication, geographic co-location, etc. each have their own set of technologies. Explaining what you're trying to accomplish from a business perspective will help us identify which technology (or technologies) to focus on.
    2) Are you synchronizing a single table? Or multiple tables? Or all the tables in a schema? Or all the tables in a database?
    3) Is there a stable network connection between the boxes?
    4) What version of Oracle do you have (10.2, 10.1, 9.2, 9.0.1, etc)? What edition (standard, express, enterprise, etc)?
    5) How quickly after a change has been made on DB1 does the change need to reflect on DB2?
    6) Am I correct in understanding that you want to be able to change the same row of data on either DB1 or DB2? So the replication needs to go in both directions?
    Justin

  • Enqueue and Dequeue consept----Please explain urgent

    hi all,
    i want to use sap locking mechanisn (Enqueue and dequeue consept) while updating database table....please explain how to use this while updating a database table.
    Thanks in advance
    Nandha kumar

    Nandha,
    Good document on this concept..
      Activating a lock object in the ABAP Dictionary automatically creates function modules for setting (ENQUEUE_<lock object name>) and releasing (DEQUEUE_<lock object name>) locks.
    The generated function modules are automatically assigned to function groups. You should not change these function modules and their assignment to function groups since the function modules are generated again each time the lock object is activated.
    Never transport the function groups, which contain the automatically generated function modules. The generated function modules of a lock object could reside in a different function group in the target system. Always transport the lock objects. When a lock object is activated in the target system, the function modules are generated again and correctly assigned to function groups.
    Parameters of the Function Modules
    Field Names of the Lock Object
    The keys to be locked must be passed here.
    A further parameter X_<field> that defines the lock behavior when the initial value is passed exists for every lock field <field>. If the initial value is assigned to <field> and X_<field>, then a generic lock is initialized with respect to <field>. If <field> is assigned the initial value and X_<field> is defined as X, the lock is set with exactly the initial value of <field>.
    Parameters for Passing Locks to the Update Program
    A lock is generally removed at the end of the transaction or when the corresponding DEQUEUE function module is called. However, this is not the case if the transaction has called update routines. In this case a parameter must check that the lock has been removed.
    Parameter _SCOPE controls how the lock or lock release is passed to the update program (see The Owner Concept for Locks). You have the following options:
    _SCOPE = 1: Locks and lock releases are not passed to the update program. The lock is removed when the transaction is ended.
    _SCOPE = 2: The lock or lock release is passed to the update program. The update program is responsible for removing the lock. The interactive program with which the lock was requested no longer has an influence on the lock behavior. This is the standard setting for the ENQUEUE function module.
    _SCOPE = 3: The lock or lock release is also passed to the update program. The lock must be removed in both the interactive program and in the update program. This is the standard setting for the DEQUEUE function module.
    Parameters for Lock Mode
    A parameter MODE_<TAB> exists for each base table TAB of the lock object. The lock mode for this base table can be set dynamically with this parameter. Valid values for this parameter are S (shared), E (exclusive) and X (exclusive but not cumulative).
    The lock mode specified when the lock object for the table is created is the default value for this parameter. This default value can however be overridden as required when the function module is called.
    If a lock set with a lock mode is to be removed by calling the DEQUEUE function module, this call must have the same value for the parameter MODE_<TAB>.
    Controlling Lock Transmission
    Parameter _COLLECT controls whether the lock request or lock release should be performed directly or whether it should first be written to the local lock container. This parameter can have the following values:
    Initial value: The lock request or lock release is sent directly to the lock server.
    X : The lock request or lock release is placed in the local lock container. The lock requests and lock releases collected in this lock container can then be sent to the lock server at a later time as a group by calling the function module FLUSH_ENQUEUE.
    Behavior for Lock Conflicts (ENQUEUE only)
    The ENQUEUE function module also has the parameter _WAIT. This parameter determines the lock behavior when there is a lock conflict.
    You have the following options:
    Initial value: If a lock attempt fails because there is a competing lock, the exception FOREIGN_LOCK is triggered.
    X : If a lock attempt fails because there is a competing lock, the lock attempt is repeated after waiting for a certain time. The exception FOREIGN_LOCK is triggered only if a certain time limit has elapsed since the first lock attempt. The waiting time and the time limit are defined by profile parameters.
    Controlling Deletion of the Lock Entry (DEQUEUE only)
    The DEQUEUE function module also has the parameter _SYNCHRON.
    If X is passed, the DEQUEUE function waits until the entry has been removed from the lock table. Otherwise it is deleted asynchronously, that is, if the lock table of the system is read directly after the lock is removed, the entry in the lock table may still exist.
    Exceptions of the ENQUEUE Function Module
    FOREIGN_LOCK: A competing lock already exists. You can find out the name of the user holding the lock by looking at system variable SY-MSGV1.
    SYSTEM_FAILURE: This exception is triggered when the lock server reports that a problem occurred while setting the lock. In this case, the lock could not be set.
    If the exceptions are not processed by the calling program itself, appropriate messages are issued for all exceptions.
    Reference Fields for RFC-Enabled Lock Objects
    The type of an RFC-enabled function module must be completely defined. The parameters of the generated function module therefore have the following reference fields for RFC-enabled lock objects:
    Parameters
    Reference fields
    X_<field name>
    DDENQ_LIKE-XPARFLAG
    _WAIT
    DDENQ_LIKE-WAITFLAG
    _SCOPE
    DDENQ_LIKE-SCOPE
    _SYNCHRON
    DDENQ_LIKE-SYNCHRON
    Pls. reward if useful

  • Synchronisation of data between two databases

    i have two databases having tables with same fields and i would like to transfer the data from one database to the other , how do i do that? is there any link which talks about synchronisation of data between two databases?

    Make the database name same in both databases and use Veritas tools for data copy.

  • Can i share music and photos between two users on the same machine?

    How can I share my music and photos between two users on the same machine?

    Thank you Joe - I tried this but it's only showing a teensy amount of music - the stuff on the second users account as opposed to the giagntic library on the 'main' account. I actually went to a Genius Bar and they said that apple doesn't really want you to share music between accounts - parents don't want to hear their kids music etc. Which seemed strange, but it might be the case sadly   Thanks anyway!

  • HT204053 how do I share calendars and music between two ID's?

    How do I share calendars and music between two Apple ID's?  We have a Mac Pro and two Iphones.  Currently we utilize one ID between the Iphones in order to sync the calendars and music.

    You can privately share a calendar between devices using different iCloud IDs as explained here: http://help.apple.com/icloud/#mm6b1a8694.  Even if your devices use different IDs for iCloud you can continue to share the same ID for iTunes to share your music and other purchased media.  The ID you use on a device for iCloud does not need to be the same as the ID used for iCloud.

  • Lock Object: Enqueue and Dequeue

    Hi
    Im using VB.Net, SAP .Net to do data entry, updates to
    SAP R/3.
    Now, I need to lock the data during user changes on
    particular documents.
    What I done is I created a lock object in SE11. Then
    it produce 2 functions which are the ENQUEUE and
    DEQUEUE.
    Since the data reading from Non-SAP, I check for Allow
    RFC and my lock mode is Exclusive and Cumulative.
    After that, I also created a remote-enabled RFCs to be
    call from VB.Net. These RFCs is calling the ENQUEUE
    and DEQUEUE.
    When I tested in SAP itself, the locking data is
    working perfectly. I checked in SM12, it does shows
    the locking entry.
    But when I try in VB.Net and call the function
    modules, it does not shows any entry in SM12. It is
    like nothing happen at all.
    After that, I do little test. Firstly I lock the data
    from SAP then I run VB.Net, and it does shows the
    message who is currently locking the data.
    Anybody could help me on this?
    Thank you.
    Regards.

    See the following extract from documentation. Check if your lock object definition is satisfying all of them.
    <i>Reference Fields for RFC-Enabled Lock Objects
    The type of an RFC-enabled function module must be completely defined. The parameters of the generated function module therefore have the following reference fields for RFC-enabled lock objects:
    Parameters               Reference fields
    X_<field name>           DDENQ_LIKE-XPARFLAG
    _WAIT                    DDENQ_LIKE-WAITFLAG
    _SCOPE                   DDENQ_LIKE-SCOPE
    _SYNCHRON                DDENQ_LIKE-SYNCHRON
    </i>
    Here is the link to the documentation
    http://help.sap.com/saphelp_46c/helpdata/en/4f/991f82446d11d189700000e8322d00/frameset.htm
    Srinivas

  • Drag and Drop between two windows

    I would like to implement Drag and Drop between two windows for example in Windows I can take URL Address form browser and drag it and drop it in to any control that excepts String like TextField.
    I would like to have the same behavior with my Java Text Controls.
    What can I do to achieve this?

    There is no configuration for it. It should work.
    Can you try it in a different user account. If it works in a different account, then it is likely something in your current user account that is messed up. If it doesn't work in another user account, then it is likely something with Mail, itself. 
    You could try downloading and installing the 10.6.7 combo update. That may repair what is wrong.

  • Drag and Drop between two JTables

    I tried to implement drag and drop between two JTables using data transfer, but i did not get it to work, that dnd works in both directions. i have my own transferhandler, but if is use setTransferHandler(handler), i'm no longer able to start a drag from that table. i also tried to use a mouse listener to call exportAsDrag, but i only works in one direction. any ideas or examples?

    That is a rather large request, and indicates that you have likely not spent much time researching the subject before posting. Read up on Swing drag & drop here (http://java.sun.com/docs/books/tutorial/dnd/), then ask specific questions about something you don't understand, problems with your implementation, etc.
    Mike

  • Drag and drop between two different browser

    Hi All,
    Is drag and drop in flex possible behind boundaries of
    browser context?.
    Currently i have a vdividebox which contains two datagrid
    with drag and drop functionality.
    Now I want to display this datagrid in two different browsers
    and provide the drag and drop functionality between them.
    Is their any way to achieve this?
    Thanks.

    Hey
    due to Security restrictions (Sandbox) I don't believe that
    you can Drag and Drop between two Browsers with Flex, maybe this
    can be done with AIR.
    Cheers
    Dietmar

  • Drag and Drop between two list boxes

    Hi all
    I am working over Drag and Drop .. i have to implement Drag and Drop between two list boxes .. both list box exist in same page ..each list box have number of rows.. please give me some idea ... as i am new for JSP and Servlet...
    Thanks in advance
    Regards
    Vaibhav

    Hi all
    I am working over Drag and Drop .. i have to
    implement Drag and Drop between two list boxes ..
    both list box exist in same page ..each list box have
    number of rows.. please give me some idea ... as i am
    new for JSP and Servlet...
    Something close to what you are looking for is Select Mover in Coldtags suite:
    http://www.servletsuite.com/jsp.htm

Maybe you are looking for

  • Ipad and scanners

    Hello, I have a HP Officejet Pro 8500 All-in-One Printer - A909a and I am trying to connect my ipad mini to that, for scanning purpose. I downloaded the the HP e-print and HP AIO remote apps and unfortunately I was not able to scan the pictures yet.

  • MacBook Pro not outputting DVI properly?

    Hi My MBP crashed (without any special provocation) and when it rebooted, my external monitor could no longer get a signal via DVI. When I use a DVI to VGA adapter, the external display gets the image fine. But I can't get a DVI image even after mult

  • Voucher Number with Forms Personalization

    I am trying to use forms personalization to accomplish the following: We've enabled vouchering in Payables and now each invoice, when saved, is assigned a voucher number. (INV_SUM_FOLDER.VOUCHER_NUM_DISPLAY). When you click the attachments icon, we w

  • Calling ODI scenario fom java program

    Hi, i have my ODI scenario. But i need to execute that scenario from a java code n pass variables as well. can any one plz guide me how to do it

  • Unable to remove CSS 6

    I am trying to upgrade from CSS6 and RNR 3.0 to CSS 8.2.  The instructions direct me to remove CSS6 and RNR3 and then install CSS8.2 I removed RNR3 after a bit of difficulty, but cannot remove CSS6 as it does not appear in the 'Add/Remove Programs' i