Migrating MS SQL 2005 to Oracle 9i  (sqlserver_utilities can't compile)

The package sqlserver_utilities can’t compile. (SQLSERVER_UTILITIES Body Compiled (with errors) )
I am migrating a MS SQL 2005 database to an Oracle 9i database. I have the following installed:
•     Oracle 9i Enterprise Edition Release 9.2.0.1.0 –Production with the partitioning, Spatial, Olap, and Oracle data mining options.
•     Internal to Oracle SQL Developer (client-only) 1.5.0.53.04
•     JTDS JDBC Driver 11.4.4.53.01 oracle.sqldeveloper.thirdparty.drivers.sqlserver
•     Java(TM) Platform 1.5.0_06
The MS SQL 2005 Database consists out of multiple tables, views, stored procedures, functions and triggers. I tried quick migrate only to find that the migration failed.
For a simple migration test I created a test database in MSQL 2005. This database has a simple table with an identity field and a store procedure that does an insert into the table. I followed all the steps to migrate a sql database and everything seemed to work. In Oracle I can now find the migrated table and stored procedure. I also see that the migration tool has created a sequence to deal with the identity field (in combination with a trigger) . when I try to execute the insert stored procedure in Oracle it fails. When I started looking at the log messages I see:
INSERT INTO "DBO_STOREDPROCEDURETEST"."SOMEOTHERTABEL" (SOMEOTHERTABELTEXT, SOMEOTHERTABELCODE, VERYBASICTABLEID) VALUES ('sdfgsdfg', 'sdgfsdfg', '1')
One error saving changes to table "DBO_STOREDPROCEDURETEST"."SOMEOTHERTABEL":
Row 3: ORA-04068: existing state of packages has been discarded
ORA-04063: has errors
ORA-04063: package body "DBO_STOREDPROCEDURETEST.SQLSERVER_UTILITIES" has errors
ORA-06508: PL/SQL: could not find program unit being called
ORA-06512: at "DBO_STOREDPROCEDURETEST.SOMEOTHERTABEL_SOMEOTHERTABE_1", line 19
ORA-04088: error during execution of trigger 'DBO_STOREDPROCEDURETEST.SOMEOTHERTABEL_SOMEOTHERTABE_1'
ORA-06512: at line 1
INSERT INTO "DBO_STOREDPROCEDURETEST"."SOMEOTHERTABEL" (SOMEOTHERTABELTEXT, SOMEOTHERTABELCODE, VERYBASICTABLEID) VALUES ('sadf', 'asfd', '1')
One error saving changes to table "DBO_STOREDPROCEDURETEST"."SOMEOTHERTABEL":
Row 3: ORA-04068: existing state of packages has been discarded
ORA-04063: has errors
ORA-04063: package body "DBO_STOREDPROCEDURETEST.SQLSERVER_UTILITIES" has errors
ORA-06508: PL/SQL: could not find program unit being called
ORA-06512: at "DBO_STOREDPROCEDURETEST.SOMEOTHERTABEL_SOMEOTHERTABE_1", line 19
ORA-04088: error during execution of trigger 'DBO_STOREDPROCEDURETEST.SOMEOTHERTABEL_SOMEOTHERTABE_1'
ORA-06512: at line 1
I then noticed the sqlserver_utilities package compiled with errors. It seems that DBMS_DB_VERSION.VER_LE_9_2 and REGEXP_INSTR doesn’t exists. (see code beneath)
-- only for 10g
IF NOT DBMS_DB_VERSION.VER_LE_9_2 THEN
IF REGEXP_INSTR(temp_exp,
'^\{d[[:space:]]*''([[:digit:]]{4})-([[:digit:]]{2})-([[:digit:]]{2})''\}$') = 1 THEN -- ISO861 format
-- e.g. {d '2004-05-23' }
temp_exp := REGEXP_REPLACE(temp_exp,
'^\{d[[:space:]]*''([[:digit:]]{4})-([[:digit:]]{2})-([[:digit:]]{2})''\}$',
'\1-\2-\3');
format_str := 'YYYY-MM-DD';
Question 1: How do I solve this problem? (the oracle database must be Oracle 9i)
Question 2: How can I migrate an MS SQL 2005 DB to oracle 9i ? (with views, triggers, stored procedures )
Message was edited by:
user640306

Hi user640306,
FUNCTION str_to_date(p_date_expr IN VARCHAR2)
RETURN DATE
has the 10g regexp code
IF format_str IS NOT NULL THEN
RETURN TO_DATE(temp_exp, format_str);
ELSE
RETURN TO_DATE(temp_exp, 'DD-MON-YYYY HH24:MI:SS');
END IF;
It defaults to 'DD-MON-YYY HH24:MI:SS' I suggest altering the code to suite how you want string to date to work in your locale.
FUNCTION str_to_date(p_date_expr IN VARCHAR2)
RETURN DATE
IS
temp_val NUMBER;
temp_exp VARCHAR2(50);
format_str VARCHAR2(50) := NULL;
BEGIN
IF p_date_expr IS NULL THEN
RETURN NULL;
END IF;
temp_exp := TRIM(p_date_expr);
-- only for 10g code removed this was trying
-- to work out the date mask using regular expressions.
IF format_str IS NOT NULL THEN
RETURN TO_DATE(temp_exp, format_str);
ELSE
--If you use this code insert an appropriate data mask,
--default is  'DD-MON-YYYY HH24:MI:SS'
RETURN TO_DATE(temp_exp, 'DD-MON-YYYY HH24:MI:SS');
END IF;
EXCEPTION
WHEN OTHERS THEN
RETURN NULL;
END str_to_date;
-Turloch

Similar Messages

  • SQL 2005 to Oracle 10g migration

    We are migrating from SQL 2005 on Windows to Oracle 10g on Linux. If any one has experience with this kind of migration please share the steps involved.
    Also is it possible to migrate subset of data from SQL to Oracle or is migrating entire data/schema the only option?
    Any help or direction in this is much appreciated.Thanks in advance

    Hi spulyala,
    There is no clear and simple way of doing this.
    -The online data move migrates from one java connection/table to another java connection/table so you would need to have the source table already filtered.
    -The offline data move dumps the information out of SQL Server one table at a time, a where clause may be able to be applied manually at this stage, and loads the data in using Oracle sqlldr.
    Of course you can filter and manipulate the tables within SQLServer before migration, within Oracle after migration, and delete table representations from with the tool.
    -Turloch

  • Migrating from SQL Server to Oracle 8i

    Hi all :),
    I am trying to migrate from SQL Server to Oracle 9i.
    I am using the Migration Workbench.
    Everything goes fine during Capturing phase, but while
    creating Oracle model the Workbench just hangs at
    "Mapping Tablespaces" for over three hours.
    (not exactly hangs in the sense that it responds to mouse
    events and I can abort the ongoing activity ...)
    What should I do ? Should I let it go on and see what
    happens.
    I follow each and every step as mentioned in the
    documentation ... but obviously I am doing something
    wrong. Any pointers ???
    However ... if I try to migrate to Personal Oracle 8 ...
    the migration goes fine from start to end ... just that
    the SQL Server triggers aren't successfully migrated.

    You may want to start by downloading the Oracle Migration Workbench. That generally does a reasonable job in moving the tables, stored procedures, etc. from SQL Server to Oracle. If your VB code is database agnostic, it should continue to work without any more intervention. Realistically, however, you'll rpobably have to at least tweak a few things that don't work the same way in the old ODBC/ OLE DB provider and the new one.
    The hard part of migrations like this is that you may need to revisit some of your architectural decisions if you want Oracle to perform well. There are plenty of things that one does in SQL Server (i.e. frequent commits) to improve performance that have the opposite affect in Oracle. Identifying and fixing these sorts of things tends to be the largest part of a migration like this. Unfortunately, I don't know of a resource that talks addresses all the possible gotchas here.
    Justin
    Distributed Database Consulting, Inc.
    www.ddbcinc.com

  • How to migrate from sql server to oracle

    Hi ,
    My requirement is we are planning to migrate the sql server data to oracle.
    what is the way to do migration from sql server to oracle. Please let me know if any tools are there for migration.Previous we used sql developer( which is provided by oracle i.e. freeware )
    tool but it was created only table structures not ported any data.

    Hi,
    Oracle sql developer is a great tool for migration from sql server to oracle..
    Refer the link,
    http://www.oracle.com/technetwork/database/migration/sqlserver-095136.html

  • Migrate from sql server to oracle

    can anyone help me how to migrate from sqlserver to oracle

    Hi;
    i have been searching in google if anybody having live experience in migration pl help meOk than i am helping you,checked google search and found below links from search. They should help you friend. Please see:
    http://st-curriculum.oracle.com/obe/db/hol08/sqldev_migration/mssqlserver/migrate_microsoft_sqlserver_otn.htm
    http://www.oracle.com/technetwork/database/migration/sqlserver-095136.html
    Also see:
    SQL Server to Oracle migration queries
    SQL Server to Oracle migration queries
    If have still question than update thread.
    Regard
    Helios

  • Migration from Sqlserver 2005 to Oracle 10g

    Hi all,
    does anyone know a tool good to migrate a sqlserver 2005 database to oracle 10g ?
    I tried Sqldeveloper and the migration of tables and datas are ok, but when I try to migrate views, functions and procedures the sqldeveloper hangs.
    regards,.
    Wander (Brazil)

    Quite frankly forget using tools for all but the simplest migration: The best you will get from a tool, provided it works, is mediocrity.
    Moving tables and data with tools works if you are using basic data types. Once you get past this, in all seriousness, it is time to roll up your sleeves and start writing code.
    The differences between the two products is profound. What constitutes a transaction different, locking different, logging different, security models different, etc.
    No tool can turn Transact SQL into nested BULK COLLECT and FORALL statements. And for many years into the future ... none will.

  • Migrate Data action hanging migrating from sql server to Oracle 10g

    Hi,
    I am currently migrating a SQL Server 2005 db to Oracle 10g using SQL Developer 1.2.1. I have created the migration repository, captured the SQL Server db objects, and created the target schema. There are about 109 tables captured. During Data migration, however, the data move hangs. I have run the data move a couple of times now and it does not hang while migrating any particular table, but seems to be more to do with the length of time it is taking to migrate. Could this be an issue with SQL Server connections being lost? The SQL Server db is quite large. Row counts of 100k plus.
    Message was edited by:
    user596259

    Probably. There is an offline option for migrating data under the migration menu. Generate Scripts for the data move using the appropriate converted model and u can export the data to bcp export files and load it with teh generated SQL Loader scripts.

  • Connecting to SQL 2005 from Oracle error

    I have an Oracle Database and SQL Database on the same server and wants to use odbc to connect to the SQL 2005 database and query tables of my choice.
    I did configured the ODBC correctly and called the DSN TSH_ARCHIVE. I have tested it and it works great. But each time I run the following query I get error:
    SQL> select count(*) from BALANCES_HS@tse_archive;
    select count(*) from BALANCES_HS@tse_archive
    ERROR at line 1:
    ORA-12154: TNS:could not resolve the connect identifier specified
    Any suggestion and help will be greatly appreciated.
    Edited by: azaza on Jan 28, 2010 6:32 AM

    Hi,
    Thanks for the files.
    There are some problems with the configuration.
    listener.ora -
    LISTENERTSE_ARCHIVE =
    (ADDRESS_LIST=
    (ADDRESS=(PROTOCOL=tcp)(HOST = xxxxx.ita.doc.gov)(PORT=1521))
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    SID_LIST_LISTENER=
    (SID_LIST=
    (SID_DESC=
    (SID_NAME=TSE_ARCHIVE)
    (ORACLE_HOME=J:\app\product\11.1.0\db_2)
    (PROGRAM=hsodbc)
    (SID_DESC=
    (SID_NAME=tpisdb06)
    (ORACLE_HOME=J:\app\product\11.1.0\db_2)
    This should be -
    LISTENERTSE_ARCHIVE =
    (ADDRESS_LIST=
    (ADDRESS=(PROTOCOL=tcp)(HOST = xxxxx.ita.doc.gov)(PORT=1521))
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    SID_LIST_LISTENERTSE_ARCHIVE =
    (SID_LIST=
    (SID_DESC=
    (SID_NAME=TSE_ARCHIVE)
    (ORACLE_HOME=J:\app\product\11.1.0\db_2)
    (PROGRAM=dg4odbc)
    (SID_DESC=
    (SID_NAME=tpisdb06)
    (ORACLE_HOME=J:\app\product\11.1.0\db_2)
    The SID_LIST_LISTENER needs to match the actual listener name and the program for 11g DG4ODBC is called dg4odbc and not hsodbc.
    tnsnames.ora -
    TSE_ARCHIVE =
    (DESCRIPTION=
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = TSE_ARCHIVE)(PORT=1521))
    (CONNECT_DATA =
    (SERVICE_NAME = TSE_ARCHIVE)
    (HS=OK)
    The HOST name - TSE_ARCHIVE does not match the HOST in the listener, so it should be -
    TSE_ARCHIVE =
    (DESCRIPTION=
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = xxxxx.ita.doc.gov)(PORT=1521))
    (CONNECT_DATA =
    (SERVICE_NAME = TSE_ARCHIVE)
    (HS=OK)
    I've changed the actual name to xxxxx so replace that with the name in the original file.
    Change the files, stop and start the listener then try again.
    If you still have an ora-12154 error then send the output from the following SQL -
    select db_link, host from user_db_links; <=== as the user getting the error
    and
    select db_link, host from dba_db_links; <===== as a DBA user
    Regards,
    Mike

  • 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

  • Migration from SQL Server to Oracle issue

    Hi,
    While trying to migrate SQL Server to Oracle via Standard Migration method, I got stuck at the point where it says.....
    To perform online capture, right-click the connection name in the Connections navigator and select Capture database-type (for example, Capture MySQL, Capture Microsoft Access, Capture Microsoft SQL Server, or Capture Sybase Adaptive Server).
    The problem is that, I do not see this menu Capture Microsoft SQL Server. Looks like this is a bug SQL Developer 3, which does not shows option for Capture on right clicking the non-oracle database connection. In earlier release of SQL Developer 2.1.1, I can see the option of Catture...
    Thanks,
    Gyan

    Gyan,
    You are correct. The online help screen says -
    <<<
    Online Capture
    To perform an online capture of the source database, you can have the capture performed automatically as part of the Quick Migrate option, or you can have it performed as a separate operation by right-clicking the connection name in the Connections navigator and selecting Capture product-name (for example, Capture MySQL, Capture Microsoft Access, Capture Microsoft SQL Server, or Capture Sybase Adaptive Server).
    >>>
    but this option does not show up.
    I did some testing and was able to make the capture by following these steps -
    - right click on the SQL*Server database in the Connections panel
    - choose 'Migrate to Oracle'
    - follow the menus until you get to 'Capture' screen where you should have the SQL*Server database to be migrated in the 'Selected Databases' panel
    - then choose 'Finish' from the options at bottom of the screen.
    - you should then have the capture scripts in the directory chosen earlier in the process.
    Regards,
    Mike

  • Migration from SQL 2000 to Oracle 10g

    Hi every one,
    This is the first i am posting to this forum.
    I have a problem in migration of Sql Server database to Oracle 10g.
    We use Microsoft Navision Axapta 3.0 SP4 as front end.
    and Sql Server 2000.
    All table and indexes are created in sql server by Navison only.
    My Database size is 300 GB and now we face thousands of Problem with SQL server so we decided to make a intelligent move to oracle 10g.
    As we have 1200+ users.
    The problem i am facing when i tranfer all the table to my Oracle Database it gives a error out of buffer.
    some time it gives me error about the index as few of our developer have create two indexex on one field.
    So oracle identifies that there are two indexes on one field.
    So pls help how can i solve this problem.
    I have 1234 tables.
    from
    Mohd Sufian

    Can you post the exact Oracle error you are getting? The ORA-xxxxx part is the most important for us to identify what particular problem(s) you're having.
    Is your front-end certified to use an Oracle database? Particularly if the front end is creating database objects, it needs to know how to work with whatever database it is connecting to.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • SQL 2005 x64 poor performance after migration from SQL 2005 x86

    Recently We've migrated SQL 2005 x86 SP1 Enterprise running on Windows 2003 Enterprise to new hardware where is running Windows 2008 SP2 and SQL 2005 x64 SP4 with CU3.
    In the work day, there are sometime SQL excpetions like this below. On other hand i can also tell that we already found some queries which has some inner joins and where clauses on nvarchar fileds, because of the nature of application. Such a query
    is running for about 11 seconds on old SQL server, and about 6 minutes on new SQL server. My main question if is this possible just with a change to new architecture of SQL and more last patches and updates for SQL 2005. Is there any way how to get
    this queries running faster, without rewritng them with new ones? Is this also possible this could be also cause for SQL exceptions, which we are facing on SQL server?
    About new hardware, for now we can't find it something wrong. There is basic configuration:
    Cisco UCS  C220 M3S (1U server)
    32GB RAM
    Intel(R)Xeon® CPU [email protected], 6 core
    Disk system: 4xSAS 300GB in RAID5 (OS and DATA) and 2xSATA 1TB in RAID1 (SQL backup)
    RAID controller: LSI MegaRAID SAS 9271-8i (with latest driver and firmware)
    Part of log of dump file:
    2014-05-09 08:30:07.08 spid86      Error: 17311, Severity: 16, State: 1.
    2014-05-09 08:30:07.08 spid86      SQL Server is terminating because of fatal exception c0000264. This error may be caused by an unhandled Win32 or C++ exception, or by an access violation encountered during exception handling.
    Check the SQL error log for any related stack dumps or messages. This exception forces SQL Server to shutdown. To recover from this error, restart the server (unless SQLAgent is configured to auto restart).
    2014-05-09 08:30:07.08 spid86      Using 'dbghelp.dll' version '4.0.5'
    2014-05-09 08:30:07.08 spid86      **Dump thread - spid = 86, PSS = 0x0000000132A67ED0, EC = 0x0000000132A67EE0
    2014-05-09 08:30:07.08 spid86      ***Stack Dump being sent to D:\MSSQL.1\MSSQL\LOG\SQLDump0087.txt
    2014-05-09 08:30:07.08 spid86      * *******************************************************************************
    2014-05-09 08:30:07.08 spid86      *
    Thanks for any help,
    Matjaž

    >Is there any way how to get this queries running faster, without rewriting them with new ones?
    You need to perform basic performance tuning steps in the new environment.
    Software optimization:
    http://www.sqlusa.com/articles/query-optimization/
    Disk optimization:
    http://www.sqlusa.com/bestpractices/configureharddisk/
    Memory optimization:
    http://www.sqlusa.com/bestpractices/memory-configuration/
    REBUILD INDEXES, eliminate missing indexes & UPDATE STATISTICS.
    If there is still a problem, look in Activity Monitor for expensive queries. Optimize them. As a general rule, you don't want to have expensive queries in RDBMS.
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Migration from SQL Reports to Oracle Reports

    Hello everybody,
    We have a requirement where we need to convert various SQL
    reports in .SQL format to Oracle reports ie rdf format. Is there
    a quick solution for this? Is there a tool available? Or is the
    straight forward approach of starting an entirely new report the
    only option available.
    Awaiting your replies,
    regs,
    pramodh

    [Oracle Migration Workbench|http://www.oracle.com/technology/tech/migration/workbench/index.html]
    You can post your questions Database and Application Migrations
    Edited by: Anantha R on Sep 10, 2009 2:56 PM
    Edited by: Anantha R on Sep 10, 2009 2:57 PM

Maybe you are looking for