共计 3051 个字符,预计需要花费 8 分钟才能阅读完成。
迁徙降级背景介绍
测试环境: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 表空间下创立了测试用户和测试数据
测验自蕴含
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
SYS@orclrac1> alter database enable block change tracking using file ‘+DATA/bct/bct2’;
配置 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