Create Table Trigger to replicate data from MSSQL2K5 to Oracle 11G on Linux

I am trying to create a trigger on my MSSQL 2k5 server so that when a record is inserted, a replicated record is created in a table on an Oracle 11g database on a Linux server (Oracle Linux 6).
Creating the trigger is easy, but when I test it I am getting an error stating the following:
.NetSqlClient Data Provider The operation could not be performed because OLE DB Provider 'OraOLEDB.Oracle' for linked server "<myserver>" was unable to begin the distributed transaction.
OLEDB Provider "OraOLEDB.Oracle" for linked server "<myserver>" returned: "New transaction cannot enlist in the specified transaction coordinator"
Here is the trigger (MSSQL):
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE insert_aban8_state
    @an8 int,
    @st nvarchar(3)
AS
BEGIN
    SET NOCOUNT ON;
    declare @c numeric
    select @c = count(*) from [e9db]..[CRPDTA].[ABAN8_STATE$] where alan8=@an8 and aladds=@st
    if(@c =0)
     begin
        insert into [e9db]..[CRPDTA].[ABAN8_STATE$]
        values(@an8, @st)
     end
    END
GO
After reviewing the MS Transaction Coordinator, I am now totally confused. I checked the services and have the MS DTC enabled and running, but am not sure what to do on the Linux side.
Does the Oracle Services for Microsoft Transaction Server (OraMTS) work on Linux? I could only find references for this for Oracle 11g on Windows.
What do I need to do to enable this replication via mssql table trigger to Oracle11g on Linux?

nsidev wrote:
While I would agree in part, it appears from the message that the trigger is requiring the Transaction Service to be enabled on both the host and target. The point of this post is to determine what, if anything, I need to do on my Oracle DB to allow the trigger to complete successfully.
There are many posts found with Google concerning the OraMTS service on the Oracle system, but they all appear to be for Windows based systems. My question is, is this service part of the Linux based Oracle DB and if so, how do I initialize it?
If I am mistaken and this is truly an issue with the MSSQL server, I will replicate the post in those forums. I am just looking for direction and help.
1) I have NEVER heard that Oracle has, knows about, or supports any "Transaction Service".
2) Consider what I previously posted regarding the flavor of client source.
If your assertion about this mythical service were correct, then the Oracle DB would have to be able to "know" that this client connection was originated by SQL Server.
I don't understand how or why Oracle should behave differently depending upon whether INSERT is done inside or outside a MS SQL Server trigger.
Please explain & elaborate why Oracle should behave different depending upon the source of any INSERT statement.
3) From Oracle DB standpoint an INSERT is an INSERT; regardless of the client.

Similar Messages

  • How to get data from PostgresSQL to Oracle 11g

    I have a general idea on the topic but need more information on the procedure to get data from Postgres (version 8.2 on Linux) database to Oracle 11g (on AIX Unix). Thanks very much in advance!

    You need to configure DG4ODBC (=Database Gateway for ODBC). When you install it on a 64bit OS (for example on the same machine as your Oracle database), then it requires a 64bit Postgres ODBC driver. If you install it on a 32bit machine (for example on a 32bit Linux), then you need a 32bit Postgres ODBC driver. Commonly on Unix you also need to install a matching ODBC Dreiver Manager (for example you can get it from www.unixodbc.org) when Postgres doesn't ship one with their driver.
    A note describing the DG4ODBC configuration can be found on My Oracle Support:
    How to Setup DG4ODBC on Linux x86 32bit          (Doc ID 466228.1)
    and
    How to Setup DG4ODBC on 64bit Unix OS (Linux, Solaris, AIX, HP-UX)          (Doc ID 561033.1)

  • Create a trigger to copy data from table A to table B

    Hi,
    I been trying with no success to create a trigger on table a , so when the user update or delete or insert data on that table, I would like to copy all data from table a to table b BEFORE, the statement execute, I am using Oracle database 10g XE. It's URGENT and I would appreciate any quick response.
    Thank you in advance.

    > All what I needed to do is to copy / beckup the tableA before any changes done to the table
    Why? You are not giving us a problem to look at, analyse, and assist with - you are giving us a solution. That solution says "backup table before changes are made".
    This solution sounds very strange in the context of a RDBMS. Even stranger when dealing with relational design as one would use date and time to keep track of how data is changing.
    This, and your implementation of the solution (using triggers and DDL inside it!), makes me question whether this solution is indeed at all a solution. I see flaws and problems all the way.
    What happens if two users inserts at the same time into table A? Two truncates will be fired on table B. Then the entire contents of A (and not the changes) inserted into table B? Ridiculous...
    Thus from my point of view, looking at what you have presented to the forum in this thread, you do not seem to have any grasp on how to correctly use a RDBMS, never mind use Oracle.
    Ignorance is not a problem. It is fairly easily curable. Which is why I referred you to the manuals.
    Alternatively, instead of asking the forum how to make a flawed solution works, how about instead telling us the actual problem you are trying to solve?

  • Find Datas from Select Satement - Oracle 11g After changing the Connection?

    Iam very very new to Oracle. Yesterday only I have Installed Oracle 11G & created DataBase - JafferDB
    And from Oracle SQL Developer, I have created a connection called - JafferCon and SID also given..and the role is - SYSDBA
    And I excute the below statement
    insert into MyTable1 Values ('AAA1', 'BBB1', 'CCC1')
    insert into MyTable1 Values ('AAA2', 'BBB2', 'CCC2')
    Then I checked by Select statement, it has shown the values....No Problem....
    But, as a test, I deleted the connection and created a new connection tio the same DataBase with different name
    and when I checked by Select Statement....., it has not shown the values....????
    Does any mistakes....?
    Thanks for the directions...

    after you insert, update or delete any data in the database you must use "commit" or "rollback" statement. Commit if you want "save" the changes or rollback if you don't.
    Other users can't see this new changes until you do the "commit".

  • AQ or Streams to replicate data from a database table and put it on a queue

    If was tasked with the above if I was using AQ I'd think about publishing to queue via insert trigger on a table that's the destination end of a replication.
    Given that there's replication involved it sounds like if you want to replicate data from A to B and also push it to a queue you should be thinking Streams with a transform and not just AQ.
    However, how do you get Streams to replicate from A to B and at the same time and in the same transaction transform a message and put it on a queue?
    Also, if you are to build the message in XML and use an XML payload what do you use to construct the message? PL/SQL by hand? Are there API's in PL/SQL to build a DOM and then stringify the DOM you've built such that everything is entity encoded correctly and the payload can be published to a queue as an XML payload?

    Oh yes sorry I lost track of which thread this was. I was thinking Streams but I forgot the original suggestion was to use triggers.
    We have many use cases today where data arrives via inserts into some table and a process polls this table and processes the data. This approach does not scale very well. Currently these polling processes are polling the same database that is constantly inserting data as it arrives via multple processes.
    I am trying to move away from this approach by introducing queuing. In addition to the above we also have an approach where as the data arrives it's placed on a queue and the process processes these messages asynchonously from the queue. Currently this queue based implementation does not use Oracle. I am trying to move to a solution where if the data must arrive via inserts into a database the processing of the data doesn't necessarily have to be by fetching those records out of the table thru polling. The general idea is that as the messages are inserted they are subsequently enqueued and processed off a queue. There is no desire to have a process which simply polls the database and enqueues what I find in the table. The goal is to remove constant polling of the database.

  • Upload data from excel to oracle table

    Hi,
    if i'm user and using an application and i want to upload data from excel to oracle table on button click . Is it possible by using sql loader.
    If yes then please clarify it .
    is it possible from client end.
    thanks
    kam

    Yes it is possible using SQL*LDR, External tables and ORCL Export Utility. Though I didn't try Export Utility to load the external files.
    SQLLdr sysntax:
    Create a control file.
    It looks like this
    Load data
    Infile 'source.dat' 
    Into Table tablename
    Fields terminated by ',' optionally enclosed by '"'
    {code}
    then use sqlldr command from your OS.
    {code}
    sqlldr userid/password@sid control = filename.ctl, data = source.dat, log = logname.log, bad = badname.log, discard = discardname.discard
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Create table bulk_load as select ename from emp where 1=2

    The Above Query will create a new table using the strucure of old but there will be no data..
    Kindly explain me what is meant by "where 1=2"?
    Is it referring the table or column or for just testing the query??

    Is not a rule that you always must use 1=2... look this example:
    sql >> create table t as
    2 select * from all_objects;
    Table created.
    sql >> select count(*) from t;
    COUNT(*)
    43975
    sql >> create table ttt as
    2 select * from t where rownum=0;
    Table created.
    sql >> create table tt as
    2 select * from t where 9=4;
    Table created.

  • How to replicate data from MS SQL Server  to Oracle

    Hi,
    Can someone please help me on how to replicate data from MS SQL Server to Oracle 8i database.

    Dear,
    I'm a student.
    I do simple replication on Oracle 8.0.5 successfully. (one master site and one snapshot site). I only use the SQL*Plus and Schema Manager to do.
    But when I do advance replication (multimaster replication) I meet many problem. So I don't get the result.
    Do you show me the technology to do that ?
    Thanks !

  • How do I go about this? Creating table while looping through dates?

    How do I do this? Creating table while looping through dates?
    I have a table with information like:
    ID---Date---Status
    1-------04/23-----Open
    1-------04/25-----Open
    2-------04/24-----Closed
    3-------04/26-----Closed
    What I want to do is create another table based on this per ID, but have all the dates/statuses on the same line as that ID number (as additional columns). The problem is that the number of columns needed is to be dynamically decided by the number of dates.
    To illustrate my example, I'm looking to achieve the following:
    ID---04/23 Status---04/24--Status---04/25--Status---04/26--Status
    1----Open--------------<null>-------------Open---------------<null>
    2----<null>------------Closed-------------<null>-------------<null>
    3----<null>------------<null>-------------<null>-------------Closed
    What would be the best way to go about this?
    Can someone please point me in the right direction?
    Would I need to do some looping?
    Thanks in advance!

    thedunnyman wrote:
    How do I do this? Creating table while looping through dates?
    I have a table with information like:
    ID---Date---Status
    1-------04/23-----Open
    1-------04/25-----Open
    2-------04/24-----Closed
    3-------04/26-----Closed
    What I want to do is create another table based on this per ID, but have all the dates/statuses on the same line as that ID number (as additional columns). The problem is that the number of columns needed is to be dynamically decided by the number of dates.
    To illustrate my example, I'm looking to achieve the following:
    ID---04/23 Status---04/24--Status---04/25--Status---04/26--Status
    1----Open--------------<null>-------------Open---------------<null>
    2----<null>------------Closed-------------<null>-------------<null>
    3----<null>------------<null>-------------<null>-------------Closed
    What would be the best way to go about this?
    Can someone please point me in the right direction?
    Would I need to do some looping?
    Thanks in advance!I hope you are asking about writing a query to DISPLAY the data that way ... not to actually create such a massively denormalized table ....

  • Data from Excel to Oracle DB

    Hi,
    I can upload data from excel to access having created stored procedure on access.
    I do the upload using my vb code.
    How can I upload data from excel to oracle db? could i use the same technique as above? only problem is im not sure if that vb code will work with oracle?
    has anyone done this before? anyone have example code?
    kindly assist me here
    thanks

    The easiest way to do this is to use a Oracle ODBC connection which can be found on OTN. You do not need a stored proc.
    After installing Oracle ODBC on the machine where Excel and Access live, do the following.
    Note, you already have steps 1, 2 and 3. I list all the steps for others.
    1. Create your MS/Excel workbook
    2. Add data to it.
    3. Save it as "book1.xls".
    4. Open MS/Access
    5. Create new blank database, call it db1.
    6. Then from the file menu, get external data, import, make sure the file type is xls, select book1.xls.
    7. The wizard will walk you through the process of importing you Excel workbook into a new table.
    8. Save
    9. From the file menu select export table.
    10. Select ODBC at the bottom of the "Save as type list".
    11. Then (depending how you set up ODBC) select Machine Data Source.
    12 . Select your Oracle ODBC connection and press OK.
    You now have taken data from Excel to Access and placed it in the Oracle schema that was named when you setup your Oracle ODBC connection.
    BG...

  • Data from BW to Oracle.

    Hi All,
    I am new into BW and i know how to get the data from my applications backend i.e ORACLE to BW system for reporting purpose. I have a scenario where user can edit this information through IP. I want this modified data to go back to ORACLE DB so that i can use this in my webdynpro application for further processing.
    So how can i achieve the transfer of data from BW to ORACLE DB in real time.
    Hope i am clear and will get some solution for this.
    thanks & regards,
    Manoj

    @Jai
    no, it's not DBCONNECT.
    Database links are an ORACLE feature that comes for free if you have Oracle on both sides.
    Main steps for the implementation part:
    BW side:
    1. you have to invite the Oracle database in the protocol.ora file of the MY_BW database.
    The host is the server where the local Oracle database instance is running.
    protocol.ora:
    TCP.INVITED_NODES= (myORACLEserver,...other hosts...)
    2. Define a database user in the BW database MY_BW_USER
    3. Grant SELECT privileges for the user MY_BW_USER that is used  in the link:
    grant select on my_bw_table to my_bw_user;
    Oracle side:
    1. database link
    CREATE DATABASE LINK "MY_BW.WORLD"  CONNECT TO "MY_BW_USER"
        IDENTIFIED BY "my_bw_user_password" 
        USING '(DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (COMMUNITY = SAP.WORLD)(PROTOCOL = TCP)(HOST = mySAPBWServer.com)(PORT = 1521))
        (CONNECT_DATA = (SID = MY_BW)(GLOBAL_NAME = MY_BW.WORLD))
    2. Create a view with the SELECT to extract from BW via the link (listed after the @):
    Create view view_extract_from_bw as
    select * from my_bw_table@MY_BW.WORLD
    You can do any transformations in the SELECT part to fit the data into the local Oracle table later in the insert.
    3. You will pull the data on the Oracle DB side from the BW database via the view that inturn uses the link
    to the BW Oracle system:
    insert into local_Oracle_table select * from view_extract_from_bw
    You see some support is needed from Basis guys to establish the link. But once implemented
    you have a interface from your local Oracle to the BW database.
    bye
    yk
    Edited by: Bernd Boecker on Jul 2, 2008 1:52 PM

  • Data From Excel to Oracle

    Hi, how can I do a Stored Procedure or free code to import data from Excel to Oracle Table? Tanks for all.

    I never use UTL_FILE. I use Delphi and I need to make a subrotine to import xls file to oracle. So, I prefer to do into DataBase, using database resource, but I do not oracle expertise, I have some difficulties. Tanks.

  • Sql loader loading data from legacy to Oracle

    Hi
    we have a requirement that we need to import data from legacy to oracle AR.We know that we need to put the data file in BIN folder,but I want to know about the data file source if we place in windows folder instead of BIN directory will SQL loader picks the file and loads the data.
    Thanks
    Y

    Yes,
    Refer this
    http://www.oracle.com/technology/products/database/utilities/htdocs/sql_loader_overview.html
    * Load data across a network. This means that a SQL*Loader client can be run on a different system from the one that is running the SQL*Loader server.
    * Load data from multiple datafiles during the same load session
    * Load data into multiple tables during the same load session
    * Specify the character set of the data
    * Selectively load data
    * Load data from disk, tape, or named pipe
    * Specify the character set of the data
    * Generate sophisticated error reports, which greatly aid troubleshooting
    * Load arbitrarily complex object-relational data
    * Use either conventional or direct path loading.
    -Arun

  • Read data from an external Oracle-DB: Codepage problems

    Hi,
    I try to get data from an external Oracle-DB which runs under NLS_CHARACTER
    WE8ISO8859P1. In this DB are russian texte stored. If I read these texts via native-SQL I obviously get wrong characters. (e.g. Èíñòðóìåíòû äëÿ óãëîâîé øëèôîâàëüíîé ìàøèíû instead of &#1048;&#1085;&#1089;&#1090;&#1088;&#1091;&#1084;&#1077;&#1085;&#1090;&#1099; &#1076;&#1083;&#1103; &#1091;&#1075;&#1083;&#1086;&#1074;&#1086;&#1081; &#1096;&#1083;&#1080;&#1092;&#1086;&#1074;&#1072;&#1083;&#1100;&#1085;&#1086;&#1081; &#1084;&#1072;&#1096;&#1080;&#1085;&#1099;). If I save the text as a html file and then open it with IE. I can change the encoding and get the right view.
    Has anybody got an idea ? (Mabye I can read the data in a different codepage or maybe there is a possibility to convert the codepage in SAP after reading it from oracle)
    Thanks a lot !!!!

    The problem is solved.
    Many thanks !

  • Transfer Of Data from Sap to Oracle with the help of Enterprise Services.

    Hello,
    We want to transfer data from Sap to Oracle using standard Enterprise Services.Some fields were not available in the existing standard Enterprise Services,so we have enhanced the existing Services by writing code inside BADI available with Enterprise Services.Rest of the fields we have mapped with the existing fields available in standard Enterprise Services.But,the Oracle people want to fetch all data from Sap without entering any input as a mandatory field in the Enterprise Services.The existing standard Enterprise Services require to enter any field as mandatory and are not accepting the range in input for multiple records.e.g.All enterprise Services related to Sales Orders are displaying only one sales Order.We have searched all Enterprise Services for Sales Order(related to reading of data),but not able to find service which would display mutiple records without entering any input.ECC_SALESORDER009QR is the only service which is displaying multiple records without entering any input,but the required fields are not available in this service.So,kindly suggest what we need to do further.
    1.Should we go for customization of services completely,so that it would fulfil our requirement.
    2.Are there  standard Enterprise Services exists which would we give us data in range(all records).
    If they exists,please specify the names of Services for reading Purchase Order,Production Order,BOM etc.
    Thanks & Regards,
    Divya.

    Hi Vaibhav,
    Let me tell you the objective in detail.
    Objective.
    To develop a package solution which will work as a bridge between Oracle APS and SAP system so that customers using SAP will be able to use advantages of Oracle APS for their planning needs.
    This will consist of following major components:
    OA Templates is an Oracle utility to load data from any legacy system to Oracle APS using standard flat files.
    Oracle has developed an Application Integration Architecture which is a standard architecture used for integration of Oracle products with other systems.
    Enterprise services is an SAP utility to communicate with SAP.
    AIA canonicals are standard canonicals developed by Oracle where we have to map data fields from destination system (Oracle APS) and source system (SAP)
    Fusion middleware is being used to develop application interfaces following AIA standards.
    Tasks at stake:
    Mapping of Oracle APS fields and SAP Enterprise Service fields to AIA canonicals
    Technical work of developing middleware using Oracle Fusion
    From Sap side,we have to map fields which we have received from Oracle with the help of Enterprise Services,rest  consumption of these services is done by Oracle guys.So,suggest is there enterprise services available which would give us multiple records .
    Thanks & Regards,
    Divya.

Maybe you are looking for