众所周知,数据库升级、转换、迁移是数据库运维必备的日常技能,本文详细介绍一则将DB2数据库转换成Oracle数据库的案例,希望对大家有帮助。
记录一则使用sql developer工具,将DB2数据库迁移到ORACLE数据库的案例。
#! /bin/bash
source /home/db2/.bash_profile
TODAY=`date +%Y%m%d%H%M%S`
db2 backup db db2 online to /home/db2 compress include logs
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 Applications
db2stop force
db2start
db2 connect to db2 user db2 using db2
db2 "grant dbadm on database to user db2"
db2 "grant dbadm on database to user db2"
db2look -d db2 -l -e -x -o db2.sql
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;
...
✨ 接下来内容请访问原文(https://www.modb.pro/db/28448?YYF)进行查看~
更多数据库相关内容,可访问墨天轮(https://www.modb.pro/?YYF)进行浏览。