众所周知,数据库升级、转换、迁移是数据库运维必备的日常技能,本文详细介绍一则将DB2数据库转换成Oracle数据库的案例,希望对大家有帮助。
1.前言记录一则使用sql developer工具,将DB2数据库迁移到ORACLE数据库的案例。
2.环境准备安装ORACLE数据库并创建实例安装DB2软件安装SQL DEVELOPER 软件3.备份生产环境DB2数据库#! /bin/bashsource /home/db2/.bash_profileTODAY=`date +%Y%m%d%H%M%S`db2 backup db db2 online to /home/db2 compress include logs4.将备份传到新的DB2环境(在新环境进行数据转换最大可能地保护生产数据)5.在新环境恢复DB2数据库db2 'RESTORE DB db2 FROM "/home/db2/" TAKEN AT 20200729053002 LOGTARGET /home/db2arclog' db2 'ROLLFORWARD DB db2 to end of backup and stop OVERFLOW LOG PATH (/home/db2/arclog)'db2 update dbm cfg using SYSMAINT_GROUP db2 db2 list applicationsdb2stop forcedb2startdb2 connect to db2 user db2 using db2db2 "grant dbadm on database to user db2"db2 "grant dbadm on database to user db2"db2look -d db2 -l -e -x -o db2.sql6.ORACLE环境创建用户create user mig identified by "mig" default tablespace DATA temporary tablespace temp quota unlimited on DATA;GRANT RESOURCE TO MIG WITH ADMIN OPTION; GRANT CONNECT, RESOURCE, CREATE VIEW, CREATE MATERIALIZED VIEW, CREATE PUBLIC SYNONYM TO MIG WITH ADMIN OPTION;7.使用SQL developer进行数据转换7.1创建一个连接到目标ORACLE数据库
✨ 接下来内容请访问原文()进行查看~
更多数据库相关内容,可访问墨天轮()进行浏览。