oracle19c之匯入、匯出
阿新 • • 發佈:2021-08-17
一、exp命令
1、匯出
exp c##sl/123456 buffer=64000 file=./full.sql full=y --匯出整個資料庫 exp c##sl/123456 buffer=64000 file=./sl.sql owner=c##sl --匯出使用者c##sl下的物件 exp c##sl/123456 buffer=64000 file=./book.sql tables=book --匯出book表
exp c##sl/123456 buffer=64000 file=./book.sql tables=book,book2; --匯出book、book2表
二、imp命令
1、匯入
exp c##sl/123456 buffer=64000 file=./book.sql tables=book drop table book; imp c##sl/123456 buffer=64000 file=./book.sql tables=book --需要先刪除表,再匯入,否則報錯
exp c##sl/123456 buffer=64000 file=./book.sql tables=book
imp c##sl/123456 buffer=64000 ignore=y file=./book.sql tables=book--只會匯入主鍵不衝突的資料,衝突的忽略
exp c##sl/123456 buffer=64000 file=./sl.sql owner=c##sl
imp c##sl/123456 buffer=64000 ignore=y file=./sl.sql full=y --匯入sl.sql中的全部檔案
imp c##sl/123456 buffer=64000 ignore=y file=./sl.sql tables=book,book2 --匯入sl.sql中的表book、與book2
說明:tables指定匯入或匯出的表;full=y表示匯入或匯出全部;ignore=y表示跳過主鍵衝突執行