一、導出資料庫
1.已管理者身份運作cmd

2.輸入指令:
cmd> exp test/[email protected] file=D:\oracle_bf\xzmis02.dmp owner=tablename
注意:此處賬号需要有dba權限
3.導出中
4.導出成功
二、導入資料
1.導入資料:imp 使用者名/密碼@服務名 file=導入的dmp檔案路徑 full=y
cmd> imp test/[email protected] file=D:\oracle_bf\xzmis02.dmp full=y
注意:要将資料導入到哪個庫下就使用那個庫對應的賬号,比如需要将資料導入到 test2 中,就需要輸入 test2 的賬号密碼
三、exp/imp 不導出空表的解決方案
1.查詢空表生成sql語句
sql> select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows IS NULL;
2.複制結果執行即可