Background Image
기타
2015.06.19 01:40

콘솔에서 마이그레이션 하기.

조회 수 13428 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부


마이그레이션 마법사 5단계에서 저장한 마이그레이션 스크립트를 클릭하고 툴바에서 마이그레이션 스크립트 > 내보내기를 클릭하면 해당 스크립트를 XML 파일로 출력할 수 있으며 SSH를 이용해 원격 서버로 내보낼 수도 있다.

img_001.jpg

 

마이그레이션 스크립트 내보내기 대화 상자에서는 내 PC에 저장하거나 SSH 를 경유해 원격 서버에 저장 할 수 있다.

img_002.jpg

 

 

큐브리드 FTP 웹사이트의 CUBRID_Tools/CUBRID_Migration_Toolkit 디렉터리(http://ftp.cubrid.org/CUBRID_Tools/CUBRID_Migration_Toolkit)에서 다음과 같은 마이그레이션 툴킷 콘솔 버전을 다운로드 할 수 있다.

 

CUBRID-Migration-Toolkit-console-2014-build-4597-linux.tar.gz

CUBRID-Migration-Toolkit-console-2014-build-4597-windows.gz

 

압축을 푼 후 migration.sh를 실행한다.

 

$ sh ./migration.sh

Thank you for using CUBRID Migration Toolkit(CMT) Console.

 

Usage in windows: migration.bat <utility-name> [options]

Usage in linux: migration.sh <utility-name> [options]

 

Available <utility-name> (Default is “start”):

    Start: Start a migration task.

    Log: Review a migration work’s log.

    Report: Review amigration work’s result.

    Script: Build a migration script with online source and default options.

 

Please visit http://www.cubrid.org  for more information.

 

마이그레이션 명령(start) 외에 마이그레이션이 끝난 후 생성되는 로그(log)나 보고서(report)를 보는 명령도 제공한다.  Script 명령을 이용하면 원본 데이터베이스에 연결해 스키마 정보를 마이그레이션 스크립트에 포함한 후 원본 데이터베이스를 연결할 수 없는 곳에 있는 마이그레이션 툴킷  GUI에서 이 마이그레이션 스크립트를 열어 매핑 작업을 할 수 있다물론, 작업 후에 다시 큐브리드 마이그레이션 툴킷 콘솔로 업로드해서 서버에서 마이그레이션을 시작할 수 있다.

리눅스 터미널에서 마이그레이션 하기 위해 여기서는 start 명령을 이용한다.  sh ./migration.sh start를 실행해보자.

 

$ sh ./migration.sh start

Thank you for using CUBRID Migration Toolkit(CMT) Console.

Please specify the migration script file:

 

마이그레이션 스크립트 내보내기로 출력한 스크립트 파일 경로를 입력하면 다음과 같이 원본 데이터베이스에 연결해서 마이그레이션을 시작한다.

Please specify the migration script file: migration-demodb.xml

Reading <migration-demodb.xml>

Reading source database schema …

Migration started at 2014-07-20 18:02:28

100%

Migration is finished.

Migration Report summary:

Time used: 00 00:00:07.516

     table: Exported[11];  Imported[11]

     view: Exported[0];  Imported[0]

     primary key: Exported[10];  Imported[10]

     foreign key: Exported[4];  Imported[4]

     index:  Exported[0];  Imported[0]

     sequence: Exported[2];  Imported[2]

     trigger: Exported[0];  Imported[0]

     function: Exported[0];  Imported[0]

     procedure: Exported[0];  Imported[0]

     record: Exported[19202];  Imported[19202]

 

진행률이 100%가 되고 간략한 마이그레이션 종료 보고서가 출력된다물론 자동화를 위해 다음의 파라미터를 지정하면 사용자의 입력을 기다리지 않고 바로 마이그레이션이 시작되게 할 수 있다.

Usage in Windows: migration.bat start [options] [migration script file]

Usage in Linux: migration.sh start [options] [migration script file]

 

Available options:

-s,      Configuration Name of source in db.conf.

     -t,      Configuration Name of target in db.conf.

     -sd,     Full name of source database's JDBC driver file.

     -td,     Full name of target database's JDBC driver file.

     -tp,     Path to save exported files if the configuration is setting to export source DB to files.

     -xml,    MySQL XML dump file.

     -mm,     Monitor mode.  The value should be one of [error, info, debug]

     -rm,     Report mode.  The value should be one of [error, info, debug]

     -do,     CMT only migrates data.  The value should be one of [yes, no]

 

, 다음과 같이 실행하도록 옵션을 추가하면 별도 입력 없이 마이그레이션을 시작할 수 있기 때문에 crontab  등에 지정하고 주기적으로 마이그레이션 해야 하는 경우에 유용하다.

sh ./migration.sh start migration-demodb.xml

 

그런데 마이그레이션 툴킷 GUI에서 마이그레이션 스크립트를 작성하면  JDBC 드라이버의 경로가 실제 마이그레이션 콘솔이 동작하는 서버와 다를 수 있다이런 경우에는 –sd, -td 옵션을 이용해 JDBC 드라이버를 직접 지정할 수 있다.

sh ./migration.sh start migration-demodb.xml  -sd  jdbc/ojdbc6.jar  -td  jdbc/JDBC-9.3.0.026-cubrid.jar

 

마이그레이션 완료 후 보고서를 보려면 {큐브리드 마이그레이션 툴킷 콘솔 설치 경로} /workspace//report에 있는 .mh 파일을 큐브리드 마이그레이션 툴킷 GUI에서 열어 볼 수 있다터미널에서 바로 보고 싶다면 다음과 같이 report 명령을 이용하면 된다.

 

sh ./migration.sh report

Thank you for using CUBRID Migration Toolkit(CMT) Console.

 

Usage in Windows: migration.bat report [options] [migration history file(*.mh)]

Usage in Linux: migration.sh report [options] [migration history file(*.mh)]

 

Available [options]:

    -l,    To show the latest migration report automatically.

 

Please visit http://www.cubrid.org for more information.

Available migration history file(s):

    1405846948752.mh

    1405847351180.mh

 

 

Available migration history file(s) 항목에서 마이그레이션이 2회 실행됐고 그 보고서가 저장 돼 있음을 알 수 있다다음과 같이 보고서 파일(*.mh)을 옵션으로 추가하면 결과 보고서를 볼 수 있다.

sh ./migration.sh report  1405846948752.mh

Thank you for using CUBRID Migration Toolkit(CMT) Console.

 

Reading migration history file: <1405846948752.mh>

 

[Overview]

    [table]

           Total:[11]

       Exported:[11]

       Imported:[11]

 

보고서 파일(*.mh) GUI 화면에서 보려면 툴바에서 마이그레이션 이력을 클릭한다. 마이그레이션 이력탭이 열리면 열기를 클릭하고 해당 .mh 파일을 더블클릭한다마이그레이션 이력 목록에 해당 보고서가 추가되면 이를 더블 클릭해 상세한 보고서를 확인 할 수 있다.

img_003.jpg

큐브리드 마이그레이션 툴킷이 없으면 데이터베이스를 마이그레이션 할 때 스키마 이전을 위해 DDL 구문을 일일이 작성하고 별도의 스크립트를 작성해 실행해야 한다물론, 데이터의 양이 많은 경우 JDBC를 경유해서 데이터를 추출하는 과정에서 많은 시간이 소요될 수 있으나, 큐브리드 마이그레이션 툴킷은 번거로운 작업을 하나의 도구에서 표준화하고 자동화 할 수 있다는 것에 의의가 있겠다.

  1. 멀티미디어 데이터 관리를 위한 CUBRID GLO Method 활용

    Date2009.12.11 Category기타 Byjanus Views16191
    Read More
  2. QTADO를 이용하여 CUBRID접속하기

    Date2009.12.10 CategoryODBC/OLEDB Bycubebridge Views21489
    Read More
  3. CUBRID 개발 가이드

    Date2009.12.09 Category기타 Byjanus Views18368
    Read More
  4. 서비스 오픈을 위한 CUBRID 구성 가이드

    Date2009.11.28 Category기타 By손승일 Views23204
    Read More
  5. CUBRID R2.0 ISV(Independent Software Vendor)설치방법

    Date2009.11.20 CategoryInstall Bycubebridge Views27920
    Read More
  6. CUBRID 2008 R2.0의 CM변경사항

    Date2009.11.20 Category기타 Byjanus Views17045
    Read More
  7. CUBRID Java Stored Procedure와 DB Server Memory 관계

    Date2009.10.31 CategoryJava By손승일 Views40190
    Read More
  8. QuantumDB Eclipse Plugin을 사용하여 CUBRID연동하기

    Date2009.10.06 CategoryJava Bycubebridge Views28920
    Read More
  9. windows 환경에서 여러버젼의 CUBRID 설치하여 사용하기

    Date2009.09.16 CategoryWindows By남재우 Views26187
    Read More
  10. CUBRID HA introduction

    Date2009.08.28 Category기타 Byjanus Views20862
    Read More
  11. CUBRID2008 R2.0 실행계획 분석하기

    Date2009.08.27 Category기타 Bycubebridge Views21917
    Read More
  12. CUBRID 2008 + XE 설치 가이드 [R2.0]

    Date2009.08.27 Category기타 ByPrototype Views16573
    Read More
  13. CUBRID 설치 및 매니저 구동하기(CUBRID 2008 R2.0)

    Date2009.08.18 CategoryInstall ByCUBRID_DEV Views30039
    Read More
  14. DB의 스키마와 데이터를 파일로 내려받기

    Date2009.08.17 Category기타 Byseongjoon Views20008
    Read More
  15. CUBRID 주요 명령 요약 정리

    Date2009.08.17 Category기타 By정만영 Views17187
    Read More
  16. CUBRID Manager login 안내

    Date2009.08.17 Category기타 Byseongjoon Views16200
    Read More
  17. CUBRID2008_보안설정[R2.0]

    Date2009.08.17 Category기타 Byseongjoon Views16272
    Read More
  18. CUBRID2008R1.x to 2.0 마이그레이션 가이드 (32bit 기준)

    Date2009.08.17 CategoryLinux By정만영 Views27200
    Read More
  19. CUBRID Tutorial (Unix/Linux)

    Date2009.08.17 CategoryLinux By정만영 Views27884
    Read More
  20. CUBRID2008R2.0 Windows BACKUP 자동화 설정하기

    Date2009.08.17 CategoryWindows By정만영 Views27942
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 Next
/ 9

Contact Cubrid

대표전화 070-4077-2110 / 기술문의 070-4077-2113 / 영업문의 070-4077-2112 / Email. contact_at_cubrid.com
Contact Sales