某PDB數(shù)據(jù)庫重要性越來越高,在CDB容器中運行,從維護以及資源方面來評估,不再滿足當前業(yè)務(wù)需求。該數(shù)據(jù)庫PDB整體容量低于100G。當前采用數(shù)據(jù)泵的方式導(dǎo)入到處。
源環(huán)境:
目標環(huán)境:
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 [email protected]:/archlog
6. 新主機上創(chuàng)建數(shù)據(jù)庫導(dǎo)入目錄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. 開始導(dǎo)入
impdp sys/xxxx@orcldbn1 as sysdba directory=rpsdmp dumpfile=orcldb1_20181127_%U.dmp parallel=4 full=y logfile=exp_orcldb20181127.log
10. 數(shù)據(jù)驗證:
目標環(huán)境:orcldbn1
select count(1) from dba_objects;
11. 將源庫orcldb 關(guān)閉,并修改PDB狀態(tài)為不隨CDB啟動而OPEN。
alter pluggable database orcldb close;
alter pluggable database orcldb save state;
由于此前新環(huán)境做過一次預(yù)演,隨后重建了新環(huán)境,但該新環(huán)境實例為手工創(chuàng)建,但由于手工創(chuàng)建的DB缺少很多非必要組件。在導(dǎo)入過程中導(dǎo)入失敗。
實例創(chuàng)建避免使用手工建庫的方式。
更多精彩干貨分享
點擊下方名片關(guān)注
IT那活兒
文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請注明本文地址:http://systransis.cn/yun/129841.html
閱讀 1356·2023-01-11 13:20
閱讀 1707·2023-01-11 13:20
閱讀 1215·2023-01-11 13:20
閱讀 1906·2023-01-11 13:20
閱讀 4165·2023-01-11 13:20
閱讀 2757·2023-01-11 13:20
閱讀 1402·2023-01-11 13:20
閱讀 3671·2023-01-11 13:20