Reputation: 421
I have a table in SQL Server 2008 R2. It contains 1M or more records. Now I want to create a table in oracle with the same content that is in SQL Server 2008 R2.
Upvotes: 5
Views: 2520
Reputation: 1371
There are several ways of doing that. You can first look on the following tutorial: Migrating a Microsoft SQL Server Database to Oracle Database 11g
I have done this task in the past using the following steps:
The Oracle SQL*Loader utility is a command line tool that allows you to load data from files to Oracle. It uses control file that specifies the source file, its structure and the loading strategy.
The advantage of using the tool vs. loading using INSERT statements is the speed of loading. Since this tool bypass the log files it is extreamly fase.
Here is the link to the SQL Loader tutorial: SQL*Loader FAQ
From this tutorial:
Usage:
sqlldr username/password@server control=loader.ctl
Control file sample:
(1) load data
(2) infile 'c:\data\mydata.csv'
(3) into table emp
(4) fields terminated by "," optionally enclosed by '"'
(5) ( empno, empname, sal, deptno )
Line 1: Speciefies that you want to load data into the table
Line 2: Specifies the source file that contains the data
Line 3: Specifies the destination table
Line 4: Specifies the columns delimiter (Comma in the example) and that string values might be enclosed by " char.
Line 5: Specifies the order of columns in the file
Data files sample (Corresponds to the control file above):
10001,"Scott Tiger", 1000, 40
10002,"Frank Naude", 500, 20
Hope it helped.
Koby
Upvotes: 6