Oracle 数据迁移升级(XTTS + DBUA)

迁移升级背景介绍 【Oracle 数据迁移升级(XTTS + DBUA)】测试环境:VMware? Workstation 15 Pro 虚拟机
操作系统:CentOS Linux release 7.6.1810 (Core)
系统内核:3.10.0-957.el7.x86_64
硬件架构:x86_64
软件版本:Oracle 11.2.0.4,Oracle 19.3.0.0

节点名称 处理器 内存 硬盘 IP地址(公网) IP地址(私网)
orclrac1 2C 2core 3GB 30GB 192.168.32.139 192.168.49.192
orclrac2 2C 2core 3GB 30GB 192.168.32.140 192.168.49.193
orcl19c 1C 1core 2GB 30GB 192.168.32.143
源端:orclrac1,orclrac2
目标端:orcl19c
迁移阶段准备 在USERS表空间下创建了测试用户和测试数据
Oracle 数据迁移升级(XTTS + DBUA)
文章图片

检验自包含
Oracle 数据迁移升级(XTTS + DBUA)
文章图片

select distinct tablespace_name from dba_segments where owner='EODA' order by 1;
execute dbms_tts.transport_set_check('USERS');
select * from TRANSPORT_SET_VIOLATIONS;
-- 上述查询若没有结果行返回,说明自包含校验通过
创建XTTS工作目录
-- 源端创建相关目录
mkdir -p /home/oracle/exp/newxx
mkdir -p /home/oracle/exp/newxx/src_backup
mkdir -p /home/oracle/exp/newxx/tmp
mkdir -p /home/oracle/exp/newxx/dump
mkdir -p /home/oracle/exp/newxx/backup_incre
chown -R oracle:dba /home/oracle/exp/newxx
解压 unzip rman_xttconvert_v3.zip
[oracle@orclrac1 ~]$ tree exp/newxx/
exp/newxx/
|-- backup_incre
|-- dump
|-- src_backup
|-- tmp
|-- xttcnvrtbkupdest.sql
|-- xttdbopen.sql
|-- xttdriver.pl
|-- xttprep.tmpl
|-- xtt.properties
`-- xttstartupnomount.sql
-- 目标端创建相关目录
mkdir -p /home/oracle/exp/newxx
mkdir -p /home/oracle/exp/newxx/src_backup
mkdir -p /home/oracle/exp/newxx/tmp
mkdir -p /home/oracle/exp/newxx/dump
mkdir -p /home/oracle/exp/newxx/backup_incre
chown -R oracle:dba /home/oracle/exp/newxx
上传解压 unzip rman_xttconvert_v3.zip
[oracle@orcl19c ~]$ tree exp/
exp/
`-- newxx
|-- backup_incre |-- dump |-- rman_xttconvert_v3.zip |-- src_backup |-- tmp |-- xttcnvrtbkupdest.sql |-- xttdbopen.sql |-- xttdriver.pl |-- xttprep.tmpl |-- xtt.properties `-- xttstartupnomount.sql

源端开启bct
Oracle 数据迁移升级(XTTS + DBUA)
文章图片

SYS@orclrac1> alter database enable block change tracking using file '+DATA/bct/bct2';
Oracle 数据迁移升级(XTTS + DBUA)
文章图片

配置 xtt.properties
-- 源端配置
[oracle@orclrac1 ~]$ cd exp/newxx/
[oracle@orclrac1 newxx]$ vim xtt.properties
-- 增加如下配置信息:
tablespaces=USERS
platformid=13
dfcopydir=/exp/newxx/src_backup
backupformat=/exp/newxx/backup_incre
backupondest=/exp/newxx/backup_incre
stageondest=/exp/newxx/src_backup
storageondest=+DATA/orclrac
parallel=16
rollparallel=16
getfileparallel=6
-- platformid参数取自,select platform_id from v$database查询的结果
-- 目标端配置
[oracle@orcl19c ~]$ cd exp/newxx/
[oracle@orcl19c newxx]$ vim xtt.properties
-- 增加如下配置信息:
tablespaces=USERS
platformid=13
dfcopydir=/exp/newxx/src_backup
backupformat=/exp/newxx/backup_incre
backupondest=/exp/newxx/backup_incre
stageondest=/exp/newxx/backup_incre
storageondest=/u01/app/oracle/oradata/ORCL/datafile
parallel=16
rollparallel=16
getfileparallel=6
-- asm_home=/opt/app/11.2.0/grid
-- asm_sid=+ASM1
-- 目标端是单实例,没有启用ASM管理
目标端提前建立用户角色
-- 目标端创建EODA用户,完成元数据导入后才可修改默认表空间。
以下是在源端执行获取创建用户和对应角色、权限的语句后,在目标端对应创建(如果你很清楚要迁移业务用户的用户密码和权限等信息,也可以选择直接创建):
-- 源端执行
[oracle@orclrac1 newxx]$ mkdir scripts
-- create user
[oracle@orclrac1 ~]$ sqlplus -S / as sysdba
set pages 0
set feedback off
spool /home/oracle/exp/newxx/scripts/create_user.sql
select 'create user '||name||' identified by values '''||password||'''; ' from user$ where name = 'EODA' and type#=1;
create user EODA identified by values 'D289D40C00A789DC';
spool off
exit
-- create role
[oracle@orclrac1 ~]$ sqlplus -S / as sysdba
set pages 0
set feedback off
spool /home/oracle/exp/newxx/scripts/create_role.sql
select 'grant '||GRANTED_ROLE||' to '||grantee||'; ' from dba_role_privs where grantee = 'EODA';
grant DBA to EODA;
spool off
exit

    推荐阅读