網(wǎng)站首頁 編程語言 正文
前言:
先認(rèn)識一個單詞,schema:模式。
再來了解一個概念。
當(dāng)創(chuàng)建一個用戶的時候,會同時創(chuàng)建一個與用戶同名的schema,這個schema的官方解釋是對象的集合。
舉個例子,比如說我就是一個用戶,叫A,住在某個公寓里,假如我住在4-404,那么這個4-404這個房間就是schema,房間名也叫A(意思是用戶A的房間,在oracle里的意思是用戶A的schema)。那么房間里面的東西就是對象了,比如說桌子,冰箱,床之類的。所以說schema是對象的集合。(個人理解,不對之處,請以斧正)
在使用數(shù)據(jù)泵前設(shè)定一個directory,就是存放數(shù)據(jù)泵文件的目錄。
create directory data_dump as '/data_dump';
當(dāng)然,也可以查看有哪些目錄
select directory_name,directory_path from dba_directories;
下面來記一些參數(shù):
- serid:說明使用的是哪個用戶進(jìn)行操作
- directory:說明使用的是哪個邏輯目錄(就是上面創(chuàng)建的那個)
- dumpfile :導(dǎo)出后的文件名字
- logfile:?導(dǎo)出過程中的日志文件
- tables :導(dǎo)出的表
下面是導(dǎo)出腳本及expdp:
cat >exp_table.par<<EOF
userid=' / as sysdba'
directory=data_dump
dumpfile=exp_table_%u.dmp
logfile=exp_table.log
tables=(scott.temp,scott.tjy_test)
cluster=n
parallel=4
exclude=STATISTICS
compression=ALL
EOF
nohup expdp parfile=exp_table.par>exp_table.par.out &
tail -100f exp_table.par.out
對上面參數(shù)進(jìn)行解釋說明:
userid=' / as sydba':說明用的是sys用戶執(zhí)行的數(shù)據(jù)泵操作
directory=data_dump:說明操作路徑是data_dump(也就是上面創(chuàng)建的那個目錄)
dumpfile=exp_table_%u.dmp:這里僅僅是說明導(dǎo)出后的文件命名,exp_表示這是導(dǎo)出的文件,table_表示表級操作,%u表示01-99的自動增長的整數(shù),.dmp表示文件后綴
logfile=exp_table.log:跟上面的解釋差不多。
tables=(scott.temp,scott.test):說明要導(dǎo)出的是scott里的temp表和test表,注意這里的scott指的是schema,而不是username
其他的沒什么好說的,想學(xué)自己百度。
下面是導(dǎo)入腳本及impdp:
cat >imp_table.par<<EOF
userid=' / as sysdba'
directory=DATA_DUMP
dumpfile=exp_table_%u.dmp
logfile=imp_table.log
TABLE_EXISTS_ACTION=append
tables=(scott.temp,scott.test)
remap_schema=scott:sys
cluster=n
parallel=8
EOF
nohup impdp parfile=imp_table.par>imp_table.par.out &
tail -100f imp_table.par.out
這個跟上面的其實沒多大改變,目錄還是那個目錄。
需要注意的是多了一行table_exists_action=append 這行表示在原有表的基礎(chǔ)上添加要導(dǎo)入的數(shù)據(jù)。
還有一行是remap_schema=scott:sys重點是這里,因為scott.temp的scott指的是schema,所以參數(shù)是remap_schema。 scott:sys的意思是在這些個數(shù)據(jù)泵文件里,schema是scott的,換成sys。
原文鏈接:https://www.cnblogs.com/wfkfytmy/p/16491890.html
相關(guān)推薦
- 2022-07-30 jQuery?UI菜單部件Menu?Widget_jquery
- 2023-03-19 一文掌握匯編語言?halt?命令_匯編語言
- 2022-03-27 C++中兩種字符串定義方式和區(qū)別介紹_C 語言
- 2021-12-11 Redis之sql緩存的具體使用_Redis
- 2022-06-16 Rancher+Docker+SpringBoot實現(xiàn)微服務(wù)部署、擴(kuò)容、環(huán)境監(jiān)控_docker
- 2022-06-09 LVGL?PC模擬器安裝步驟詳解_安裝教程
- 2022-06-01 C語言?超詳細(xì)介紹與實現(xiàn)線性表中的帶頭雙向循環(huán)鏈表_C 語言
- 2022-02-19 小程序監(jiān)聽屏幕滾動 判斷滾動方向上下滾動且滾動到一定位置
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡單動態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支