Você está na página 1de 4

Data Migration

Moment Of Data From One Place To


Another Place.
1.Ora(10g)-Ora(9i)
//Not Possible Becoz High To Low
2.Non-Ora—To-Ora
//Possible Through Sql Loader
3.Ora-To-Non-Ora
//Possible Through Utility File.

2.Non-Ora-To-Ora
1.Flat File:---(Datafile)(.Txt Or
.Dat,&Sv,.Xls)
Sv:---Seperated Value
2.Control File
.Ctl File
Program Written By User To Load Data.
3.Logfile:----(Execution History)
4.Bad File:---Rejected Rows By Sql
Loader Or Oracle.

FLATFILE(NOTEPADFILE)

SQL LOADER
L OS G
t eFpI L1E: - - - COMPILED
BADFILE DB
F i r s t C r e a t e A T a b l e T e m p .F I L E
Create Table Temp As Select
Empno,Ename From Emp

Step2:---
Display The Table
Select * From Temp;
Step3:---
Copy Some Row Then Paste In Notepad
Then Save That One With C:\Data1.Dat
7369 Smith
7499 Allen
7521 Ward
7566 Jones
7654 Martin
7698 Blake
7782 Clark
7788 Scott
Step4:---
Again Take New File In Notepad Then
Type This:---
Load Data Infile 'C:\Data1.Dat’ Insert
Into Table Temp

Fields Terminated By ','


(Empno,Ename)

Step5:---
Go To Host From Sql Prompt(Type Host)
Ther Type This:---
Sqlldr Userid=Scott/Tiger
Control=’C:\Data1ctl.Ctl’
Log=’C:\Datalog.Log’
Bad=’C:\Data1bad.Bad’
Press Enter
Log File Will Be Created.
Then Goto Data1.Dat File---Open—Give
Some Invalid Data(Aaa In Place Of
Empno) ---Save.
Then Goto Data1ctl.Ctl –Open—In Place
Of Insert ---Type –Truncate
--Save
Goto Host---Press Up Arrow—Then Enter
Key
Open Data1bad.Bad---Can See The Bad
Data,And Can Be Truncated From
Data1.Data.
Now Goto Sql Prompt---Select * From
Temp.
Can See Only Good Data,Bad Data Is
Gone To Bad File.

Create table based on emp with no records---goto table---select


some records—copy to notepad file—data1.dat---then---create
data1ctl.ctl file---sqlprompt---host---create logfile,badfile---
open data1.dat file—give bad data---save—give truncate in place
of insert in data1ctl.ctl file---go to host—aagin press up arror—
run the same command---sql prompt---select * from temp.---open
badfile.bad---can see bad data.

Você também pode gostar