匯出
exp username/password@orcl file=db.dmp
匯入
imp username/password@orcl file=h:\db.dmp full=y
備註:在匯入之前,請先清除Views、Sequences、Tables
也可以使用Bat檔案匯出
Bat檔案內容如下:
@echo ********************************
@echo 資料庫備份
@echo ********************************
@echo off
set dbbarkfile=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%
set dbbarkdir=d:\application\dbbarkup\%dbbarkfile%
mkdir %dbbarkdir%
@echo ********************************
@echo 備份
@echo ********************************
exp username/password@orcl file=%dbbarkdir%\db%dbbarkfile%.dmp