Oracle到MySQL遷移小記 資料部分

2021-06-09 14:45:38 字數 846 閱讀 5140

1.ora2mysqcn

使用ora2mysqcn工具,完成表結構、表資料從oracle匯入到mysql中,部分中文資料因編碼問題,導致資料無法匯出。

對無法匯出的庫表資料,需要採用其他途徑進行處理。

工具匯出資料有誤時,提示資訊

create table mytab...done

insert table mytab 100 rows 

incorrect string value: '\xd7\xee\xbd\xfc\xc5\xbc...' for column 'xx_text' at row 1...done

2.sqluldr

使用sqluldr 完成上1中的資料匯出,其中mytab有兩個資料id和xx_text

使用下面命令,匯出到d盤的mytab.txt檔案中。

sqluldr2 scss/scss@a203 query=mytab text=mysql  file=d:\mytab.txt

因sqluldr2匯出的資料檔案格式為ascii,需要用ue或editplus把檔案格式轉成utf-8格式

3.load

使用load匯入txt檔案

load data local infile 'd:/mytab.txt' into table mytab fields terminated by ',' lines terminated by '\n' (id,xx_text);

其中表字段可通過pl/sql 拷貝到ue,用^r^n替換為, 編輯一下就可拷貝過去。

至此資料庫庫表部分由oracle遷移到mysql搞一段落。

專案遷移oracle到mysql 持續更新

專案從oracle遷移到mysql,很有很多問題。總結一下目前遇到的問題。1 配置mysql資料來源,引用mysql驅動,這個是必須的。2 生成表,一些資料型別的變化,比如在oracle的日期型別是datetime,在mysql用date。3 oracle樹結構查詢 select start wit...

專案oracle遷移到mysql的小總結

1 更新表的不同 oracle update ip gn baxx gbxx ls sjxt id provincesystemid jlid broadcastipid czjg operatingresult jgms resultinfo where rbsj select max rbsj ...

資料庫遷移,從oracle到mysql的sql修改

1.函式修改 字串轉時間的函式 to date yyyy mm dd str to date y m d 時間轉字串的函式 to char operate time,yyyy mm dd hh24 mi ss date format operate time,y m d h i s 字串連線函式 c...