2017-06-20 89 views

回答

1

您必須再次運行遷移向導,但在「數據傳輸設置」步驟中選擇「創建一個shell腳本將數據從工作臺之外複製」選項。該工作臺後生成你的shell腳本,它可能類似於此:

所有你需要把你的密碼源和目標數據庫的
#!/bin/sh 
# Workbench Table Data copy script 
# Workbench Version: 6.3.10 
# 
# Execute this to copy table data from a source RDBMS to MySQL. 
# Edit the options below to customize it. You will need to provide passwords, at least. 
# 
# Source DB: [email protected]:8000 (MySQL) 
# Target DB: [email protected]:8000 


# Source and target DB passwords 
arg_source_password= 
arg_target_password= 

if [ -z "$arg_source_password" ] && [ -z "$arg_target_password" ] ; then 
    echo WARNING: Both source and target RDBMSes passwords are empty. You should edit this file to set them. 
fi 
arg_worker_count=2 
# Uncomment the following options according to your needs 

# Whether target tables should be truncated before copy 
# arg_truncate_target=--truncate-target 
# Enable debugging output 
# arg_debug_output=--log-level=debug3 

/home/milosz/Projects/Oracle/workbench/master/wb_run/usr/local/bin/wbcopytables \ 
--mysql-source="[email protected]:8000" \ 
--target="[email protected]:8000" \ 
--source-password="$arg_source_password" \ 
--target-password="$arg_target_password" \ 
--thread-count=$arg_worker_count \ 
$arg_truncate_target \ 
$arg_debug_output \ 
--table '`test`' '`t1`' '`test_target`' '`t1`' '`id`' '`id`' '`id`, `name`, `date`' 

第一。然後更改wbcopytables命令的最後一個參數,從- 表- 表 - 其中並將條件添加到行尾。 注意:您可以使用運行wbcopytables命令--help參數來查看所有選項。

畢竟你應該得到的腳本,看起來像類似於:

#<...> 
# Source and target DB passwords 
arg_source_password=your_sorce_password 
arg_target_password=your_target_password 

if [ -z "$arg_source_password" ] && [ -z "$arg_target_password" ] ; then 
    echo WARNING: Both source and target RDBMSes passwords are empty. You should edit this file to set them. 
fi 
arg_worker_count=2 
# Uncomment the following options according to your needs 

# Whether target tables should be truncated before copy 
# arg_truncate_target=--truncate-target 
# Enable debugging output 
# arg_debug_output=--log-level=debug3 

/home/milosz/Projects/Oracle/workbench/master/wb_run/usr/local/bin/wbcopytables \ 
--mysql-source="[email protected]:8000" \ 
--target="[email protected]:8000" \ 
--source-password="$arg_source_password" \ 
--target-password="$arg_target_password" \ 
--thread-count=$arg_worker_count \ 
$arg_truncate_target \ 
$arg_debug_output \ 
--table-where '`test`' '`t1`' '`test_target`' '`t1`' '`id`' '`id`' '`id`, `name`, `date`' '`date` >= "2017-01-02" and `date` <= "2017-01-03"' 

我希望對你們有用。