在系統(tǒng)上線升級(jí)中,經(jīng)過(guò)會(huì)有生產(chǎn)環(huán)境與測(cè)試環(huán)境的數(shù)據(jù)遷移操作;通過(guò)oracle自動(dòng)的命令遷移效率會(huì)比較高;
ORACLE導(dǎo)出導(dǎo)入工具:
exp----邏輯導(dǎo)出工具
imp----邏輯導(dǎo)入工具
實(shí)際上線時(shí)間操作案例:
準(zhǔn)備導(dǎo)數(shù)據(jù)
【注意】防止空表無(wú)法導(dǎo)出:---缺少此步驟可能會(huì)出現(xiàn)部分原庫(kù)的空表在遷移過(guò)程中確實(shí);
先執(zhí)行,然后對(duì)查詢結(jié)果進(jìn)行執(zhí)行
? ? ? ? select? 'alter table '||table_name||' allocate extent(size 64K);'? from tabs? t where not? exists
(select segment_name from user_segments s? where s.segment_name= t.table_name);
--select? 'alter table '||table_name||' allocate extent;'? from? user_tables where num_rows = 0;
--select? *? from? user_tables where num_rows = 0? or? num_rows? is? null;
4.1.2. 系統(tǒng)導(dǎo)出舊庫(kù)數(shù)據(jù)
exp smartyd/*****@orcl file=smartyd.dmp owner=smartyd
[注:***** 為隱藏了密碼]
命令解析? file指定數(shù)據(jù)備份文件的保存文件名。
tables指定要備份的表結(jié)構(gòu),可以導(dǎo)出多個(gè)表,通過(guò)(table1,table2...,tablen)進(jìn)行選擇。
owner 指定要導(dǎo)出的用戶的用戶名,但是前提條件是登錄的用戶得具有訪問(wèn)其它用戶對(duì)象的權(quán)限。一般是使用DBA用戶進(jìn)行登錄??梢灾С侄嘤脩魧?dǎo)出,使用逗號(hào)“,”進(jìn)行隔開(kāi)。
4.1.3. 系統(tǒng)導(dǎo)入新庫(kù)數(shù)據(jù)
imp znck/******@orcl file=smartyd.dmp fromuser=smartyd touser=znck
[注:***** 為隱藏了密碼]
命令解析? file指定數(shù)據(jù)導(dǎo)入文件的來(lái)源文件名。
FROMUSER 所有人用戶名列表
TOUSER 用戶名列表
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
其他常用參數(shù)供參考學(xué)習(xí):

end.