oracle sql and dba tutorial logo

 

Oracle DBA

Learn Oracle 11g / 12c Database Admin step by step



Oracle SQL

Tutorial for Oracle SQL


Oracle DBA Interview Questions

Most asked Oracle DBA Interview Questions.

60 Technical Questions
42 Backup & Recovery Questions

Unix For Oracle DBA 20 Questions



Download Oracle 11g / 12 c Software

Links to Download Oracle 12c / 11g for Linux, Windows etc.


MySQL Tutorial

Learn MySQL step by step


 

 

 

 

 

 

 

 

 

Migrating MS SQL Server table to Oracle Using SQL Loader - Step 3: Create table structure in Oracle

 

Step 3

Now go to Linux Server running Oracle database and login to the Oracle database from user account where you want to transfer the table. Let's say suppose we want to transfer the table to Scott account,

Start SQL * Plus and login as scott user

sqlplus-win

We need to create a table structure in scott account to hold the rows, you can create the table with same name or different but the column structure should be same as MS SQL Server table. You should also substitute MS SQL Server datatypes with similar datatypes available in Oracle. For Example INTEGER can be mapped to NUMBER datatype in Oracle, VARCHAR to VARCHAR2 in Oracle etc. The column widths should be same or more but not less than original table length.

The MS SQL Server Table structure

CREATE TABLE [dbo].[customers](
[CustomerID] [varchar](5) NOT NULL,
[CompanyName] [varchar](40) NOT NULL,
[ContactName] [varchar](30) NULL,
[ContactTitle] [varchar](30) NULL,
[Address] [varchar](60) NULL,
[City] [varchar](15) NULL,
[Region] [varchar](15) NULL,
[PostalCode] [varchar](10) NULL,
[Country] [varchar](15) NULL,
[Phone] [varchar](24) NULL,
[Fax] [varchar](24) NULL,
)

We have to convert the above table structure to match Oracle database. To do this remove the Square braces and replace varchar with varchar2.

Here is the matching Oracle structure

CREATE TABLE customers(
CustomerID varchar2(5) NOT NULL,
CompanyName varchar2(40) NOT NULL,
ContactName varchar2(30) NULL,
ContactTitle varchar2(30) NULL,
Address varchar2(60) NULL,
City varchar2(15) NULL,
Region varchar2(15) NULL,
PostalCode varchar2(10) NULL,
Country varchar2(15) NULL,
Phone varchar2(24) NULL,
Fax varchar2(24) NULL)

Now issue the above command at SQL Plus prompt

sqlplus-create-table

 

Next, we need to write a sqlloader control file

 

 


HomeContact Us

Data Loader

Data Loader is a simple yet powerful tool to
export and import Data between many common database formats


Forms Data Loader

Tool to load data into Oracle E-Business Suite R12 / Oracle Apps using Macros and Forms Record and Playback

Interface Computers Academy © 2007-2017 All Rights Reserved