某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那活兒
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。
轉載請注明本文地址:http://specialneedsforspecialkids.com/yun/129841.html
閱讀 1346·2023-01-11 13:20
閱讀 1684·2023-01-11 13:20
閱讀 1132·2023-01-11 13:20
閱讀 1859·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