MS SQL Server to Oracle

I am going to write all of the steps here that I have used trying to connect Oracle to MS SQL Server, so that others may benefit. I spent a few days using the following document, but in the end it turned out to be fairly incomplete, and I was frustrated by the amount of time that I had wasted.
"Using Heterogeneous Services"
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96544/admin.htm#169356
This document could be substantially improved with just three additions:
1. A clear distinction between tasks which are to be performed on the MS SQL Server hardware vs. the Oracle server,
2. More meaningful naming conventions in the examples instead of "Sybase_sales" and "SalesDB", that give you an idea of whether they refer to an Oracle Instance, a SQL Server Database, or something else,
3. Some mention of Oracle Transparent Gateway, and the fact that it needs to be installed for any of this to work.
I fully recognize the fact that I am still somewhat in the dark because I havn't gotten it to work yet; however, I wanted to mention that I began working for Oracle Consulting in 1990, and have been an independent Oracle Consultant since 1995. Therefore; the documentation for Heterogeneous Connectivity has not been adequate for a somewhat experienced Oracle developer.
Below are the steps that I have performed:

How to use TG4MSQL with MS SQL Server Instances
Microsoft introduced with MS SQL Server 2000 the concept of "instances".
All older releases (6.5 or 7.0) running on the same machine as a
SQL Server 2k act as a DEFAULT instance. The same is true for the first
installation of a MS SQL SERVER 2k on a PC.
All further installations of MS SQL Server 2k on the same machine are
named instances; this means a name must be provided during the
MS installation routine for this instance.
How to configure TG4MSQL in detail is described in
Note 231458.1 named HOW TO SETUP TG4MSQL
If there is only a default instance of MS SQL Server running, the parameter
HS_FDS_CONNECT_INFO is configured as:
HS_FDS_CONNECT_INFO = <server name>.<database name>
Method I:
This method is the fastest, but might cause problems if the MS SQL Server
is not listening on the default port. Give it a try, but if this method
causes troubles, please proceed to method 2.
The simplest way to work with instances is to specify the connect details in
the init.ora of the TG4MSQL.
The connect info contains the server name of the MS SQL Server, the instance
name and the database of the instance:
HS_FDS_CONNECT_INFO="<SERVER NAME>\\<INSTANCE NAME>.<DATABASE>"
If the server name is SQLSERVER and the instance name is instance2, the connect
string to the Northwind database looks like:
HS_FDS_CONNECT_INFO="SQLSERVER\\instance2.Northwind"
Similar to the description above is the connect information:
HS_FDS_CONNECT_INFO="SERVER=<SERVER NAME>\\<INSTANCE NAME>;DATABASE=<DATABASE>"
(HS_FDS_CONNECT_INFO="SERVER=SQLSERVER\\instance2; DATABASE=Northwind" )
Method II:
This method can be used also to connect to a MS SQL Server not listening
on the default port 1433.
It is based on using ALIASes:
If the MS SQL Server port or an alias is used instead of the servername,
the following registry key will be checked:
HKEY_LOCAL_MACHINE\
SOFTWARE\
Microsoft\
MSSQLServer\
ConnectTo
Microsoft provides a Client Configuration Tool to pass all parameters into the
registy (for example run PROFILER, click on options and execute the
Client Config Tool).
If there is no SQL Server client installed on the gateway machine, an idea
could be to configure it on the MS SQL Server, export the registry key and
import it again on the TG4MSQL machine. Please contact Microsoft about details.
This registry key is responsible for the connection details to the MS SQL Server.
While dealing with INSTANCEs or changing the MS SQL Server to listen on a
networking port other then 1433 (MS default port for SQL Server) the SUBKEY
ConnectTo is used to verify the connect details.
The Micrososft Client Configuration Utility configures ALIASes.
To work with a second instance of the MS SQL Server, an ALIAS for this
instance must be added.
This tool asks to choose a Serveralias (a name you can define on your own)
and to specify the Server name.
Normally the server name is equal to the IP address or to the hostname of
the MSQ SQL Server machine. But while working with instances the instance name
must be specified as well. The instance name is separated by TWO back slashes
from the server name.
For a better explanation the value for for the Server alias is "instance2alias" and
for the server name it is MSSQLSERVER. The sample name of the second instance is
INSTANCE2.
In the config tool type instance2alias into the entry filed of the server alias
and type MSSQLSERVER\\INSTANCE2 as server name.
Furthermore the default option is to figure out the MS SQL Server Ports dynamically.
If you do not want to detect them automatically, add the port of your SQL
Server is listening on; default is 1433. For this example port 1868 is used.
After applying this the ALIAS is saved into the registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo]
and it contains the following connect information:
"instance2alias"="DBMSSOCN,MSSQLSERVER\\INSTANCE2,1868"
The first parameter is the SQL Server alias, the second is a MS key word and
the next value is the hostname delimited by two back slashes from the instance
name.
Comment: Default instances do not have an entry here.
The last parameter is the port if it is not detected automatically.
If you have any questions about creating SQL Server aliases or what to
fill into the according columns, please contact Microsoft Support!
There is also a good note in the MS knowledge base:
Microsoft Knowledge Base Article - 265808
INF: How to Connect to an SQL Server 2000 Named Instance
with the Previous Version's Client Tools
Back to the Gateway configuration:
Oracle Transparent Gateway is able to work with MS SQL Server instances;
instead of specifying the <servername> at HS_FDS_CONNECT_INFO, the
<alias> must be specified.
For this example the parameter looks like:
HS_FDS_CONNECT_INFO = instance2alias.master

Similar Messages

  • SQL Server to Oracle migration with SQL Server DTS

    I migrate database from SQL Server to Oracle with SQL Server DTS. the process is success. I can select table_name from user_tables or user_objects. I also can see the table from DBA Studio. But When I use desc to list the structure of table in SQLPLUS. it tell me object don't exist.
    What is wrong?
    Thanks

    use sp_help <tablename>

  • Migrating a table with BLOB field from SQL-Server to Oracle.

    Hi All,
    I'm trying to create a Class to migrate data from SQL-Server to Oracle, this table has a BLOB field.
    The Code:
    package br.com.infox;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.Statement;
    public class Migrador {
         public static void main(String[] args){
              try {
                   // Conex�o com o SQL Server
                   Class.forName("net.sourceforge.jtds.jdbc.Driver");
                   Connection conSQL = DriverManager.getConnection ("jdbc:jtds:sqlserver://10.10.2.9/protocolo","prot","suinf2002");
                   // Conex�o com o Oracle
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                   Connection conORA = DriverManager.getConnection ("jdbc:oracle:thin:@10.10.2.2:1521:des","protocolo","protocolo");
                   Statement stSQL = conSQL.createStatement();
                   String querySQL = "SELECT * FROM DOC_INCORPORADO";
                   ResultSet rsSQL = stSQL.executeQuery(querySQL);
                   String queryORA = "INSERT INTO PROT_VITALICIAMENTO (NU_PROCESSO, ANO_PROCESSO, CD_USUARIO, DT_ENVIO," +
                             "DE_COMPLEMENTO, NM_ARQUIVO, ARQUIVO, NU_SEQ, CD_TIPO_ARQUIVO, MES, ANO) VALUES (?,?,?,?,?,?,?,?,?,?,?)";
                   PreparedStatement psORA = conORA.prepareStatement(queryORA);
                   while (rsSQL.next()){
                        System.out.println("Linha: " + rsSQL.getRow());
                        psORA.setInt(1, rsSQL.getInt("nu_processo"));
                        psORA.setInt(2, rsSQL.getInt("ano_processo"));
                        psORA.setInt(3, rsSQL.getInt("cd_usuario"));
                        psORA.setDate(4, rsSQL.getDate("dt_incorporacao"));
                        psORA.setString(5, rsSQL.getString("complemento"));
                        psORA.setString(6, rsSQL.getString("nm_arquivo"));
                        psORA.setBinaryStream(7, rsSQL.getBinaryStream("arquivo"), (int)rsSQL.getBlob("arquivo").length());
                        psORA.setInt(8, rsSQL.getInt("num_seq"));
                        psORA.setInt(9, rsSQL.getInt("cd_tipo_arquivo"));
                        psORA.setInt(10, rsSQL.getInt("mes"));
                        psORA.setInt(11, rsSQL.getInt("ano"));
                        psORA.executeUpdate();
                   stSQL.close();
                   psORA.close();
                   conORA.close();
                   conSQL.close();
              } catch (Exception e){
                   e.printStackTrace();
    The ERROR:
    java.sql.SQLException: Exce��o de E/S: Connection reset
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
         at oracle.jdbc.ttc7.TTC7Protocol.handleIOException(TTC7Protocol.java:3668)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1986)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1119)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2191)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2064)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2989)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:658)
         at br.com.infox.Migrador.main(Migrador.java:41)
    What's the problem of these Class?
    Thank's.

    Depending on the version of the database you have, you could use transportable tablespaces.
    http://download-east.oracle.com/docs/cd/B10501_01/server.920/a96524/c04space.htm#9370

  • Entity Framework - Code First - Migration - How to access SQL Server and Oracle using the same context?

    Hello,
    I use Entity Framework code first approach.
    My project is working fine with SQL Server. But, I want to access Oracle too. I want to switch SQL Server and Oracle in run time.
    I am able to access Oracle using "Oracle.ManagedDataAccess.EntityFramework.dl" in a new project.
    But, Is this possible to access SQL Server and Oracle in the same project.
    Thanks,
    Murugan

    This should be possible with a Code-First workflow.  In Code-First the database mapping layer is generated at runtime.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • How to connect to a Sql server from Oracle using db link

    Hi All,
    Does anybody have any idea about how to connect to a sql server from oracle database using db link to syncronize the data? I need to pull the data from Sql server table to Oracle tables and relay messages back to the sql server.
    Thank you,
    Praveen.

    we have 2 products - DG4MSQL and DG4ODBC.
    DG4ODBC is for free and requires a 3rd party ODBC driver and it can connect to any 3rd party database as long as you use a suitable ODBC driver
    DG4MSQL is more powerfull as it is designed for MS SQL Server databases and it supports many functions it can directly map to SQL Server equivalents - it can also call remote procedures or participtae in distributed transactions. Please be aware DG4MSQL requires a license - it is not for free.
    Check out Metalink and you'll find notes how to configure both products.
    For a generic overview:
    Note.233876.1 Options for Connecting to Foreign Data Stores and Non-Oracle Databases
    And the setup notes:
    DG4ODBC
    Note.561033.1 How to Setup DG4ODBC on 64bit Unix OS (Linux, Solaris, AIX, HP-UX) :
    Note.466225.1 How to Setup DG4ODBC (Oracle Database Gateway for ODBC) on Windows 32bit RDBMS.HS-3-2 :
    Note.109730.1 How to setup generic connectivity (HSODBC) for 32 bit Windows (Windows NT, Windows 2000, Windows XP, Windows 2003) V817:
    Note.466228.1 How to Setup DG4ODBC on Linux x86 32bit
    DG4MSQL
    Note.466267.1 How to Setup DG4MSQL (Database Gateway for MS SQL Server) on Windows 32bit
    Note.562509.1 How to Setup DG4MSQL (Oracle Database Gateway for MS SQL Server) 64bit Unix OS (Linux, Solaris, AIX,HP-UX)
    Note.437374.1 How to Setup DG4MSQL (Oracle Database Gateway for MS SQL Server) Release 11 on Linux

  • Related to migration of db from sql server to oracle 11 g

    We're trying to migrate a Sql server managment studio database to Oracle 11g using SQL Developer 4.0. We can successfully connect to both Sql server managment studion 8.0 and Oracle 11g using the tool, as well as click through the Migration Wizard and start the migration.
    This opens the Database Migration dialog box, which indicates the capture process starts normally. we get the following error:
    ora :01440 : can not insert null into migrlog (id column) ,
    \and then after some time , i get an error that migration failed
    i am not getting the reason,I thing it may be due to reason that , I have table's column in my source db with more than 30 character.
    If i am migrating one by one table . then it is not giving any error, and identifier name is getting shrink in 30 character. but i am not getting the view , stored procedure , indexes , and others
    then what is the solution  for that, somebody pls suggest any help?????????????               

    Pl do not post duplicates - related to migration of db from sql server to oracle 11 g
    Continue the discussion in your original thread
    The error message is explicitly clear
    ora :01440 : can not insert null into migrlog (id column)
    Your process is trying to insert a NULL value into the ID column, which presumably cannot be NULL

  • Different output of same query in SQL Server and Oracle

    I have two tables table1 and table2
    --table1 has two columns c1 int and c2 varchar. there are not constraints added in it. it has data as given below
    c1     c2
    6     d
    5     j
    102     g
    4     g
    103     f
    3     h
    501     j
    1     g
    601     n
    2     m
    --table2 has only one column c1 int. there are not constraints added in it. it has data as given below
    c1
    6
    1
    4
    3
    2
    now when i run below given query in sql server and oracle it gives me different result
    select *
    from table1
         inner join (SELECT ROW_NUMBER() OVER (order by c1 ASC) AS c1 from table2) table2 on table2.c1=table1.c1
    sql server output
    c1     c2     c1
    1     g     1
    2     m     2
    3     h     3
    4     g     4
    5     j     5
    oracle output
    C1 C2 C1
    5 j 5
    4 g 4
    3 h 3
    1 g 1
    2 m 2
    If you notice the first column in both output. It is sorted in sql server and not in oracle.
    Why it is behaving differently in oracle? Is there any way I can solve this in oracle?
    Thanks,
    Jigs

    It is NOT behaving "differently" in Oracle; you just haven't specified an order that you expect your results to be in, so you're going to get output in whatever order the database fancies displaying it (ie. no guarenteed order). This is an artifact of how the database chooses to put together the data, and different databases (or even datasets within the same database) can and most likely will behave differently.
    Even SQL Server won't guarentee to always get your data in an ordered fashion if you exclude the order by clause, even if you think it has always output the data in an ordered fashion.
    Your solution is to add an order by clause, in BOTH databases, to force the order of the output data.

  • CONVERT function in SQL Server to oracle

    All,
    How to convert CONVERT function in SQL Server to oracle, below mentioned format is in SQL Server:
    variable1 = convert(numeric(20), SUBSTRING( parameter1,parameter2,parameter3)
    parameter1 datatype nvarchar2(100)
    parameter2 datatype bigint
    parameter3 datatype bigint
    I did bit R&D, but was not successful..but still getting on..
    If any help that would be great...
    Regards,
    ~ORA

    You cannot specify the precision/scale or length of input paramters to a stored procedure in Oracle, or at least the pl/sql engine does not respect the sizing. Assuming that you want to do something with variable1 in the procedure, and not just return it, the Oracle equivalent would be something along the lines of:
    SQL> CREATE FUNCTION f (p_param1 IN VARCHAR2,
      2                     p_param2 IN NUMBER,
      3                     p_param3 IN NUMBER) RETURN NUMBER IS
      4     l_var1 NUMBER(20) := SUBSTR(p_param1, p_param2, p_param3);
      5  BEGIN
      6     RETURN l_var1 * 10;
      7  END;
      8  /
    Function created.
    SQL> SELECT f('ABC10DEF', 4, 2) FROM dual;
    F('ABC10DEF',4,2)
                  100You may need to adjust the return type to match what you are actually returning.
    You can also use this iin a direct assignment in pl/sql without doig a select, something like:
    SQL> DECLARE
      2     l_num NUMBER(20);
      3  BEGIN
      4     l_num := f('ABC10DEF', 4, 2);
      5     DBMS_OUTPUT.Put_Line('The number is: '||l_num);
      6  END;
      7  /
    The number is: 100John

  • 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 !

  • Access Oracle from SQL Server using Oracle Provider for OLE DB

    Using
    - SQL Server 2000 SP4
    - Oracle 10g
    - Oracle10g Provider for OLE DB Version 10.1.0.4.0
    - Oracle 10g client
    Able to create linked server in SQL server to Oracle 10g and display list of tables in Oracle. However, when execute query, it gives
    Server: Msg 7320, Level 16, State 2, Line 1
    Could not execute query against OLE DB provider 'OraOLEDB.Oracle'.
    OLE DB error trace [OLE/DB Provider 'OraOLEDB.Oracle' ICommandText::Execute returned 0x80040155].
    Any idea what is the problem ?

    I'm having the same error message...But I'm connecting to a Oracle 8i DB......
    I think this has to do with SP4 for SQL....I will test this tonight....

  • Regarding the tns-12541 error in connecting to sql server from oracle

    i need to create a database link from oracle on windows box to sql server.I configured everything but when i am trying to tnsping the sqlserver
    it throws me an TNS12541 no listener error.
    The listner status is up and the listener works

    little confusion here, are you trying to tnsping sql server? tnsping is an Oracle utulity.
    To acces sql server from Oracle you may use Transparent Gateway for Microsoft SQL - http://download.oracle.com/docs/cd/B19306_01/gateways.102/b14270/ch3.htm#sthref66 and Heterogeneous Connectivity - http://download.oracle.com/docs/cd/B19306_01/server.102/b14232/intro.htm#sthref33
    Best regards.

  • Migration from SQL server to Oracle

    Hi,
    Has anybody done migration from the SQL server to Oracle? If so, what manual method do you recommend? I'm a new college grad and I would like to get your expertise, if you have done this in the past.
    Thanks in advance!
    Sho

    It is some time back, so I do not remember the specifics. Oracle gives Oracle Migration Workbench for free. You can use it to convert all SQL tables and procedures etc to oracle. It is not that difficult. If there are no stored procedures etc, you can just extract the DDL and create the tables with minor changes to the script. You might need bcp-sqlloader/trasparent gateway etc copy the data.
    Giby

  • Migration from SQL server to Oracle 10g

    Hi, I am new here,
    I would like to ask how to use SQL developer MWB to migration SQL Server to Oracle?
    I have go through the doc(s) like: getting start, user's guild, etc. and have following problems
    (1), where should the SQL developer installed? in SQL Server side? Oracle side? or any PC with connection to the databases?
    (2), do I need to get some plug-in(s) for MWB to work? If yes, which plug-in do I need and where are they?
    Thank you very much.

    Hi Chocobo,
    I put together a Quick Guide myself
    http://dermotoneill.blogspot.com/2008/06/sql-developer-migration-workbench-151_11.html
    I updated it to answer your questions.
    Hope that helps
    Dermot.

  • Migration from SQL Server to Oracle 8i

    Hi,
    what are the general issues to be considered when migrating a database from SQL server to Oracle 8i.
    Is it documented on the web/ or any publication
    Samit

    What we did was to create the schema using migration work bench and then transfer the data using data junction
    The main issues that you have to handle are
    1) Data type issue, here problem comes converting chars to varchars as chars are padded and may not work in indexes, so you have to trim the afterwards, and if you have any image type data types in Sqlserver, you can use either lobs or long raw, it again depends upon your application, if you uses lobs you may have to recode your application
    2) Sql statements, Oracle cannot understand Sqlserver sql statements, so you have to convert them all. Sqlserver allows two outerjoins to a table, Oracle does not, so you have to modify your functionality
    3) Connections to the database. if you are using ODBC then use Oracle ODBC drivers and the latest ones, otherwise you may encounter memory leaks.
    These are from the top of my head, if you have any specific problem I may be able to help.
    Good luck

  • How to extract incremental data from SQL server to oracle tables in ODI

    HI All,
    In my ODI sql server is install.My Source is in SQL server and my target is in Oracle.
    I need to create a interface mapping where i need to extract incremental data from sql server to oracle.
    There is a datetime(with Timestamp) field in sql server .I need to pull incremental data based on dateime.
    Example = tablename.DateTime > (select '1-jan-11' from dual) .....i am using this query but its not woking.the error is Invalid object name"dual".
    We are not going to use Incremental in IKM and LKM.
    Request you to please provide any suggestion ASAP.
    Thanks,
    Lony

    You can do that via Variable.
    In the interface mapping create a filter on Tablename.DateTime
    and put the condition like this
    Tablename.DateTime BETWEEN #VAR and in the variable use this query in refreshing tab with oracle schema
    SELECT max(start_time)||' AND '||max(END_TIME)+1 from audit_table where ETL_JOB_CODE = '20'In the package call the above variable in refresh mode and then interface.
    This way you will pass from the query between and condition date and pass to interface so that SQL Server fetches the data between those too range.
    Note:- You might need to tweak the date format so that SQL Server can understand.
    Hope this helps.

  • Planning db from SQL server to Oracle

    Hi Friends
    We are planning to upgrade our Hyperion Environment from 9.3.3 to 11.1.2.2. and we are going from SQL server to Oracle as our RDBMS.
    If we are changing DBMS, do we have to rebuild total application or is there any easy method to migrate from sql server to Oracle
    Please suggest
    Thanks

    871250 wrote:
    Thank you so much John
    Just to make sure i got it correct
    1. Export from 9.3.3 to 11.1.2.2 using LCM
    2. Delete the planning application
    3. Update oracle data source on 11 point to Oracle
    4.Again use LCM to export planning app from 9.3.3 to 11.1.2.2
    Please suggest if i am wrong
    Thanks
    No you would upgrade the planning application using the upgrade wizard in 11.1.2.2, once the application has been upgrade you can use LCM to export the full application, then delete, re-point data source, import using LCM.
    Cheers
    John
    http://john-goodwin.blogspot.com/

Maybe you are looking for

  • Regarding  normal  ALVs

    Hi friends, I have developed a report in alv .it's working . 1) when I tried to add some additional flds it's not working properly here iam giving my codig.I addeded matkl,arktx. it's giving wrong data of these 2flds. can any body help me to get this

  • Ignore Open orders in Credit Check

    Dear All, As you are aware of that in the Static Credit Limit Check The credit exposure is the total combined value of the following documents: - Open orders - Open deliveries - Open billing documents - Receivables The requirement is  to exclude Open

  • How to use Script in ADF model?

    Hi! I don't know how to use Script in ADF model. Help me, please! Detail: javaScript. Thanks so much!

  • Delete response doesn't work in my automation

    Hello all, Has anybody else come across problems with the 'delete' response, or have any suggestions for me? I've setup a watcher automation that's very simple. 1. Copy and move the file to the library (no transcode), and 2. Delete. When I drag a fil

  • Change colours of BSP standalone application

    Hi all, I want to run e-recruiting (bsp or webdynpro) as standalone application and need to change the colours of the GUI elements. The header picture should also be changed. Where can I do the changes? Do I do it in the portal theme editor even if I