Data Type Mapping from SQL server to Oracle

I am using Oracle 12c with heterogenous services connecting to SQL server DB. Some of the columns in the SQL server SB are defined as 'nvarchar(max)'. These are coming over to Oracle as 'long' type columns. I would like these to be 'varchar2' types in Oracle so I do not have any of the restrictions related to 'long' type fields when using. I can create a view in SQlServer to convert the data type ie. nvarchar(100). What is the highest value I can use to make the data show in Oracle as varchar? BTW  I tried nvarchar(4000) but that still showed as long. I tried nvarchar(1000), and that did show as varchar.

The maximum value for a nvarchar2 in Oracle is 2000. The mapping -if the remote column is mapped to an Oracle varchar/nvarchar- depends on the data type returned by the ODBC driver. When the driver returns SQL_Varchar, then the maximum precision is 4000 and when it will map it to SQL_WVarchar then it is 2000.
As your Oracle database uses AL32UTF8 as character set you will get the nvarchar(max) mapped to Oracle longs as the content of your SQL Server nvarchar is stored using UCS2 character set which is covered by the Oracle database charset UTF8. So it shouldn't really matter if the returned string is mapped to an Oracle varchar or nvarchar.

Similar Messages

  • Mapping between oracle data types and ms sql server data types

    hello
    i need mapping between oracle data types and ms sql server data types
    where can i find them ?

    read this
    http://download.oracle.com/docs/cd/E10405_01/doc/appdev.120/e10379/ss_oracle_compared.htm

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

  • How to import data from SQL server to Oracle?

    Dear Sir/Madam,
    I want to move database data from SQL Server to Oracle, but don't how to do it, will you please help me do it?

    Oracle Migration Workbench is your best bet:
    http://www.oracle.com/technology/tech/migration/workbench/index.html
    Cheers, OTN

  • Faster way to migrate data from SQL Server to Oracle 10g

    We have to migrate data from SQL Server to Oracle 10 g.
    One particular table on SQL Server has records around 1.25 millions.
    We tried moving data using DTS package, but looks it will take hours with current speed of 300 records/minute.
    This table has TEXT column, which has XML strings stored. I am not sure, if this is the reason for slow migration.
    Would you please suggest better options to migrate it faster?
    Thanks in advance !!!

    Have you tried Migration work bench?

  • Show data from sql server to oracle db

    Hi,
    I am using oracle 10g R1 on windows 2003 platform. On one machine database 10gR1 is running and on other machine sql server is running. I want to retrieve some data from sql server to oracle database. Please tell me how I can show data from sql server to oracle db.
    Thanks

    To make heterogeneous connection with oracle:
    1.First make an ODBC connection, make entry in System DSN(to create a data source)
    2.Make an entry in tnsnames.ora
    3.Make an entry in listener.ora under SID_LIST_LISTENER
    4.Make an entry in file named init<HS>.ora file located "oracle_base\oracle_home\db\hs\admin"
    5.Restart the listener
    e.g:
    1. create a odbc system dsn named like 'sqlserver'
    2. sqlserver= (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp) (HOST=xx.xx.xx.xx) (PORT=1521))
    (CONNECT_DATA = (SERVICE_NAME=sqlserver))
    (HS = OK)
    3. (SID_DESC = (SID_NAME = sqlserver) (ORACLE_HOME = oracle_base\oracle_home\db) (PROGRAM = hsodbc) )
    4.Create a file named initsqlserver.ora and make the following entry:
    HS_FDS_CONNECT_INFO = sqlserver
    Alternatively, you can copy the file named inithsodbc.ora and rename it to initsqlserver.ora
    and edit as HS_FDS_CONNECT_INFO = sqlserver
    5. lsnrctl reload listener_name
    regards
    adnan kaysar

  • Transfering Data from SQL Server 2 Oracle

    Hellow All,
    Even the subject is not here, but i'm trying to transfere data from SQL Server to Oracle 8 (8.0.6) .. using the Wizard that ships with MS SQL Server. All Connections (ODBC or OLE DB) are alright, but still have problems in moving Data .. and Failure.
    Failure in Data Movement and not in Table structures.
    I have tried using most of the Valid and consistent ODBC and OLE Providers from Microsoft & From Oracle... but still have problems.
    Even The Oracle Migration Assitiant from Access 97 dose not work properly.
    Any commenets please ???
    Regards
    Tariq
    null

    Anil,
    OMWB has an inbuilt collision manager, that will check for conflicting words and aptly replaces them with an alternative word.
    OMWB also allows users to change these words once you finish performing capture. In this particular case, when you capture the view with the name 'rule', you can go to the oracle model in omwb and change the name to "rule1" or anything that is desirable, preferably those words that do not conflict with the oracle d/b's reserved words.
    Regards,
    Srinivas

  • Replicating data from SQL Server to Oracle

    I like to know whether it is possible to Replicate data from SQL Server to Oracle and vice-versa.
    My present application is using SQL server and very recently we migrated to Oracle. As the usage of SQL Server is more, I like to replicate the data being entered into SQL Server into Oracle also.

    You can also use SQL Server replication right out of the box to replicate data to Oracle. In Enterprise Manager, configure an OLE-DB or ODBC subscriber with the Oracle credentials, and then just create a standard push subscription to the newly configured Oracle subscriber. Note that you need to click the advanced checkbox on the subscription wizard to see the heterogeneous datasource as a subscriber.
    Good luck,
    Matt Hollingsworth
    Microsoft

  • Loading data from SQL server to Oracle database

    i want to create one table in oracle db from table in sql server. Table is huge it got 97,456,789 records.
    I created db link (HS) in oracle database which is pointing to sql server. i can select that table from oracle thru db link.
    select * from "dbo"."t1@dblink;
    i fired below create table.
    create table t2 nologging parallel (degree=3) as select * from "dbo"."t1@dblink;
    and its taking long time.... but its running...
    is there any alternate method to do this and and populate table in oracle db faster.
    Please advise. thanks.

    vhiware wrote:
    create table t2 nologging parallel (degree=3) as select * from "dbo"."t1@dblink;
    and its taking long time.... but its running...I doubt that parallel processing will be used as this is unique to Oracle (using rowid ranges typically) and not SQL-Server.
    is there any alternate method to do this and and populate table in oracle db faster.Part of the performance overhead is pulling that data from SQL-Server to Oracle across the network link between them. This can be sped up by compressing the data first - and then transferring that across the network.
    For example: using +bcp+ to export the data on the SQL-Server box to a CSV file, compress/zip the file, scp/sftp the file to Oracle, and then unzipping it there. Parallel and direct load processing can now be done using SQL*Loader to load the CSV into Oracle.
    If this is a Linux/Unix base system, then the unzip/decompress process can be run in parallel with the SQL*Loader process by creating a pipe between the two - where the unzip process writes uncompressed data into the pipe and SQL*Loader reads and loads data as it becomes available via the pipe.
    Alternatively, you can do you own PQ processing. Let's say the data is date ranged. You can create a procedure on Oracle that looks something like this:
    {code}
    create or replace procedure CopyDay( day date ) is
    begin
    insert /*+ append */ into local_tab select * from remote_tab@remotedb where col_day = day;
    -- add logging info, commit, etc.
    end;
    {code}
    You can now start 10 or more of these for different days and run it in the background using DBMS_JOB.

  • How to merge data from SQL server to Oracle Database

    Dear Expert,
    I am having problem with SQL server with Oracle.
    Problem: I want to merge table records from SQL server to Oracle Table. Which License free tool I can use to achive the goals.
    If I able to make a free DB link from Oracle to SQL server , then we can select table and will be able to update.
    Right now I have made a DB link from SQL server to Oracle, Using that I can see the records from oracle database but I can't update them.
    Thanks,
    Sher

    Hi,
    What about using Oracle SQL Developer for migration
    http://www.oracle.com/technetwork/database/migration/sqlserver-095136.html
    HTH

  • 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

  • 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

  • Reading milliseconds from Sql server into oracle 10g

    Hi,
    We have a very time sensitive pressing requirements to be addressed immediately.
    We need to read the date time column from sql server 2008 into oracle 10g.
    We have a dblink established between the two servers and have tried to use sql server and sql native client 10 driver to read the dates from sql into oracle.This we are able to do very successfully.
    The issue is in reading milliseconds stored in sql server.The millisecond part comes in as 00000 from sqlserver to oracle.These milliseconds are needed to identlfy the unique records.
    For instance
    SQL SERVER Oracle
    source_id source id
    01/01/2012 6:30:35:456 01/01/2012 6:30:35:000000.
    Im issuing my query through Toad via Oracle to remote sql server using a dblink which connects using HS ODBC connection to sql server 2008(remote).
    We have no control over sql server Db as this is remote third party DB.We just have select access to their tables to bring into our own oracle DB.
    Any insight or help will be much appreciated.

    Hi,
    Could you please send the following information -
    - what version of HSODBC are you using ? Is it a 10.2 version ?
    - what is the SQL*Server datatype of the column you are reading ?
    - from Oracle could you issue -
    describe sql_server_table@hsodbc
    - what is the Oracle datatype shown for the column ?
    Could you also run your tests using SQLPLUS instead of TOAD ? We don't support TOAD and need to know if the problem also happens when using SQLPLUS, to avoid it being a TOAD problem.
    Also, 10.2 HSODBC is now desupported and you should be using the 11g Database Gateway for ODBC (DG4ODBC) which is a direct replacement for HSODBC. To use DG4ODBC your RDBMS needs to be at 10.2.0.4 or higher and DG4ODBC should be installed in a completely separate ORACLE_HOME from the existing 10.2 install.
    Regards,
    Mike

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

  • Insert and update tables from SQL server to oracle database tables

    Hi,
    I am having problem while update data from sql server to oracle database tables.
    I am doing one way insert +updates that is from SQL Server tables ==> Oracle database tables
    I am using tools Sql server Integration service. I can insert data from sql server to oracle but update can't. Please help me how can I update + insert from sql server to oracle database tables easily.
    Thanks in advance.

    Hi,
    What about using Oracle SQL Developer for migration
    http://www.oracle.com/technetwork/database/migration/sqlserver-095136.html
    HTH

Maybe you are looking for

  • Using Text string match in IF Function

    Hi All, Does anybody know how I can use the if function in numbers to achieve what I used to in excel =IF(C4="N",0.35,0) This would return the value 0.35 in my cell when the letter N was entered in cell C4 and zero if it was not populated in Cell C4.

  • 3D environment in pure java programming

    hi all, my problem is dat... import java.awt.*; import java.applet.*; import java.awt.event.*; </applet code="project1" width=1024 height=768> </applet> public class project1 extends Frame implements ActionListener , MouseListener {      deathscreen

  • How to read a Characterist declared as ASCI on A2L file using NI ECU Measurement and Calibration Toolkit?

    I have a characteristic declared as seen below in a A2L File: /begin CHARACTERISTIC Sw_Id "Identification string for software build" ASCII 0xCF45 __UBYTE_Z 0 NO_FORMULA 0 255 ECU_ADDRESS_EXTENSION 0x0 EXTENDED_LIMITS 0 255 NUMBER 32 /begin IF_DATA AS

  • How to Avoid Pop up for Expand Mode Options

    Dear Experts In our Input schedules, we have two EVDRE Sheets. 1) Master Data EVDRE Sheet 2) The actual transaction data sheet. On BEFORE_EXPAND event of the Second sheet we trigger the Expansion of First Master Data Sheet to get the exact EVDRE filt

  • Editing multiple photos at once

    Hi--I have a zillion photos of old documents that, for the most part, need identical editing for exposure, contrast, definition, and saturation. I read that "lift and stamp" is how you do it in aperture, but how do you do it in iPhoto? I did try savi