某PDB数据库重要性越来越高,在CDB容器中运行,从维护以及资源方面来评估,不再满足当前业务需求。该数据库PDB整体容量低于100G。当前采用数据泵的方式导入到处。
源环境:
目标环境:
create directory rpsdmp as /archlog;
grant read,write on directory rpsdmp to sys;
alter system check point;
alter tablespace users read only;
alter tablespace perfstat read only;
alter tablespace SCRPSDB_INDEX read only;
alter tablespace SCRPSDB_DATA read only;
expdp sys/xxxx@orcldb1 as sysdba directory=rpsdmp dumpfile=orcldb1_20181127_%U.dmp parallel=4 cluster=n full=y logfile=exp_orcldb20181127.log
scp /archlog/orcldb1_20181127_*.dmp oracle@192.168.1.2:/archlog
6. 新主机上创建数据库导入目录rpsdmp
sqlplus / as sysdba
create directory rpsdmp as /archlog;
set lines 1000
set pages 100
set timing on
select sysdate,a.tablespace_name,
round(nvl(a.Free_Space,0)) free_space,
round(nvl(b.TOTAL_SPACE - a.Free_Space,0)) used_space,
round(nvl(b.TOTAL_SPACE,0)) total_space,
trunc(nvl(b.TOTAL_SPACE - a.Free_Space,0)/b.TOTAL_SPACE*100,2) used_percent
from
(select tablespace_name,sum(bytes/1024/1024) Free_Space
from dba_free_space
group by tablespace_name
) a,
(select tablespace_name,sum(bytes/1024/1024) TOTAL_SPACE
from dba_data_files
group by tablespace_name
) b
where a.tablespace_name=b.tablespace_name
order by a.Free_Space;
8. 检查两边字符集是否一致:
9. 开始导入
impdp sys/xxxx@orcldbn1 as sysdba directory=rpsdmp dumpfile=orcldb1_20181127_%U.dmp parallel=4 full=y logfile=exp_orcldb20181127.log
10. 数据验证:
目标环境:orcldbn1
select count(1) from dba_objects;
11. 将源库orcldb 关闭,并修改PDB状态为不随CDB启动而OPEN。
alter pluggable database orcldb close;
alter pluggable database orcldb save state;
由于此前新环境做过一次预演,随后重建了新环境,但该新环境实例为手工创建,但由于手工创建的DB缺少很多非必要组件。在导入过程中导入失败。
实例创建避免使用手工建库的方式。
更多精彩干货分享
点击下方名片关注
IT那活儿
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/129841.html
阅读 1346·2023-01-11 13:20
阅读 1684·2023-01-11 13:20
阅读 1132·2023-01-11 13:20
阅读 1858·2023-01-11 13:20
阅读 4100·2023-01-11 13:20
阅读 2704·2023-01-11 13:20
阅读 1385·2023-01-11 13:20
阅读 3597·2023-01-11 13:20