SQL Server Performance

  • Home
  • Articles
  • Forums
  • Tips
  • Training
  • FAQ's
  • Blogs
  • Software
  • Books
  • About Us
RSS Feeds
Sign in | Join


Article Topics

All Articles
Performance Tuning
Audit
Business Intelligence
Clustering
Reporting Services
SQL Azure
Developer
General DBA
ASP.NET / ADO.NET
SQL Azure

USEFUL SITES :

ASP.NET Tutorials
Windows and SQL Azure Tutorials
Cloud Hosting Magazine
SharePoint Tutorials
Windows Server Help

Write for Us

Share your SQL Server knowledge with others and raise your profile in the community More...
Latest Articles

A High Level Comparison Between Oracle and SQL Server - Part ...
A High Level Comparison Between Oracle and SQL Server - Part ...
A High Level Comparison Between Oracle and SQL Server - Part ...
A High Level Comparison Between Oracle and SQL Server

More     
 
Latest FAQ's

Add Node to A SQL Server failover Cluster failed with invalid ...
SQL Server Destination remote server error
Setting Up Data And Log Files For SQL Server
Will Check Constraints Improve Database Performance?

More     
   
Latest Software Reviews

dbForge Review
Spotlight on ApexSQL Diff - Server-based database comparison tool ...
Spotlight on ApexSQL Data Diff - Server-based database comparison tool ...
Spotlight on ApexSQL Doc 2008

More     

articles >> general dba >> Migrating from Oracle to SQL Server ...

Migrating from Oracle to SQL Server

By : Nagabhushanam Ponnapalli
Nov 22, 2003

I was involved in a recent project to migrate an Oracle database to Microsoft SQL Server 2000, and successfully migrated all Oracle objects to SQL Server. This experience has encouraged me to write an article on Oracle to SQL Server 2000 migration.

In this article, I will explain how to transfer Oracle Objects, including constraints and data, to SQL Server 2000.

 

Step I: Create the Linked Server

Linked servers provide connectivity to external data sources, allowing you to access data and run procedures on SQL Servers other than the one you are currently running on. Moreover, linked servers provide connectivity to just about any data source you can get an ODBC driver for, providing you with a DML interface to Oracle databases, Excel spreadsheets, flat files and many others. In many cases, this makes linked servers a viable alternative to using DTS or BCP to get data from external sources.

I have used link server to migrate Oracle database to SQL Server 2000.

To create a linked server to access an Oracle database instance:

  1. Ensure the Oracle client software on the server running SQL Server is at the level required by the provider.

     
  2. Create an NET8 alias name on the server running SQL Server that points to an Oracle database instance.

     
  3. Execute sp_addlinkedserver to create the linked server, specifying MSDAORA as provider_name, and the Net8 alias name for the Oracle database instance as data_ source.

    Assume that NET8 alias name as OracleDB.

    sp_addlinkedserver 'OraLinkServer', 'Oracle', 'MSDAORA', 'OracleDB'

     
  4. Use sp_addlinkedsrvlogin to create login mappings from SQL Server logins to Oracle logins.

This example maps the SQL Server login ‘Bush’ to the linked server defined in Step 3 using the Oracle login and password OrclUsr and OrclPwd:

sp_addlinkedsrvlogin 'OraLinkServer', false, 'Bush', 'OracleUserID', 'OrclePassword'

In order to test the whether the linked server is properly created or not, execute the following sql statement from query analyzer

SELECT * FROM OPEQUERY(OraLinkServer, ‘Select * From <any known table in Oracle> ‘)

 

Step II: Creating Tables

Converting Oracle SQL tables, indexes, and view definitions to SQL Server tables, indexes, and view definitions require relatively simple syntax changes. This table shows some differences in database objects between Oracle and SQL Server. The row size in Oracle is unlimited, where it is 8060 bytes in SQL Server. SQL Server allows you to create tables with more the 8064 bytes in row size with a warning message, however it will raise an error message when transfer the data from Oracle to SQL Server if the row size is more than 8060 bytes.

I have not considered the table and index storage parameters in this article. You can modify the scripts for as per your requirement to include them.

Some of the data type conversions from Oracle to SQL Server are straightforward, while other data type conversions will require evaluating a few options. I have assumed the data type conversions in the following manner. You can change as per your convenience by changing in the script.

'CHAR' --> 'CHAR

'VARCHAR2' --> 'VARCHAR

'LONG RAW' --> 'IMAGE'

'LONG' --> 'TEXT'

'DATE' --> 'DATETIME'

'BLOB' --> 'IMAGE'

'CLOB' --> 'TEXT'

'NUMBER': Without precision --> 'INT', With Precision and Scale --> ‘FLOAT’

 

Step III Creating the Table Defaults

Microsoft treats a default as a constraint, where as Oracle treats a default as a column property.

Is easy easily migrate the Oracle DEFAULT column property. You should define DEFAULT constraints at the column level in SQL Server without applying constraint names.


    Next Page>>    








C# Help and Tutorials | PHP MySQL Tutorial | Sharepoint Tutorial | Azure Tutorial | Cloud Hosting Magazine | ASP.NET Tutorials | Windows Server Help | Windows Phone Pro | Silverlight Ace | Visual Studio Tutorials | Home | Peformance Articles | Audit Articles | Business Intelligence Articles | Clustering Articles | Developer Articles | Reporting Services Articles | DBA Articles | ASP.NET / ADO.NET Articles | SQL Server Training Videos | DBA FAQ's | Developer Peformance FAQ's | DBA Peformance FAQ's | Developer FAQ's | Clustering FAQ's | Error Messages | Audit Tool Reviews | Backup Tool Reviews | Coding Tool Reviews | Compare Tool Reviews | Documentation Tool Reviews | Design Tool Reviews | Monitoring Tool Reviews | Log Tool Reviews | Reporting Tool Reviews | Clustering Tool Reviews | Security Tool Reviews | Change Management Tool Reviews | Remote Access Tool Reviews | Book Reviews | Security Tool Reviews | ADO.NET / ASP.NET | Administration | Analysis/OLAP Services | Application Development | Configuration | Components | ETL | Hardware | High Availability | Hints | Index | Misc | Operating Systems | Performance Tuning | Replication | T-SQL | Views


              © 2010 Jude O'Kelly. All rights reserved