Oracle簡單匯入匯出

2021-08-30 21:04:49 字數 1739 閱讀 8031

該熱備份及還原採用exp/imp方式匯入匯出

匯出資料:

資料庫匯出有四種模式full(全庫匯出),   owner(使用者匯出),   table(表匯出),   tablespace(表空間匯出).   

full(   全庫匯出):   匯出除ordsys,mdsys,ctxsys,ordplugins,lbacsys   這些系統使用者之外的所有使用者的資料.   

owner(   使用者匯出):   匯出某個或某些使用者的所有許可權和資料.   

tables(   表匯出):   匯出某些表(可以是不同使用者的)的結構和資料.   

tablespace(   表空間匯出):表空間匯出資料.   

這裡只是簡要測試了前兩種模式:

以shell命令模式匯出匯入

1.將使用者blog中的所有資料匯出,outdata.log為匯出日誌記錄

exp   userid=system/lxf@orcl   owner=blog   file=d:\outdata.dmp log=d:\outdata.log;

如果資料檔案較大,file=(d:\temp\outdata1.dmp, ..) filesize=2gb

2.完全匯出資料庫

exp   userid=system/lxf@orcl   full=y   file=d:\outdata.dmp log=d:\outdata.log;

3.匯入資料庫

imp flower

/lxf@

orcl full=y  file= 

d:\outdata.dmp

ignore=y ;

imp 

system/lxf@

orcl file=d:\

outdata

.dmp;

imp userid=system/manager full=y file=*.dmp

表空間的匯出匯入,需要以sysdba德身份執行,且表空間檔案為唯讀

sql> alter tablespace test read only;

表空間匯出

exp """/@orcl as sysdba""" file=trans.dmp transport_tablespace=y tablespaces=flower_tbs triggers=n constraints=y grants=y

sql> host exp 

'sys/lxf@

orcl sysdba' transport_tablespace=y file=d:\exp\tablespace.dmp tablespaces=smallts;

sql> alter tablespace flower_tbs read write;

表空間匯入

imp """/@orcl as sysdba""" file=trans.dmp transport_tablespace=y datafiles='

e:\orcldatafile\smallfile.dbf 

' tablespaces=test tts_owners=yangtk --使用者名稱

sql> host imp '/ as sysdba'  transport_tablespace=y file=d:\exp\tablespace.dmp datafiles=e:\orcldatafile\smallfile.dbf fromuser=tr touser=system;

sql> alter tablespace smallts read write;

oracle匯出,匯入

匯出,在dos下執行 1.exp username userpassword databasename 可以是資料庫也可是遠端的,如username userpassword caac135 2.enter array fetch buffer size 4096 回車 3.export file ...

oracle匯入匯出

sqlplus system system egov create directory dump dir as d dbback exit expdp system system egov directory dump dir dumpfile urbanyw.dmp schemas urbanyw...

Oracle匯入匯出

最簡單 exp duser duser remote localinstancename owner duser file file path dmp imp duser duser remote localinstancename file file path dmp 詳細出處參考 win10下o...