創建導入,導出用戶
sqlplus /nolog conn system/manager GRANT CREATE USER,DROP USER,ALTER USER ,CREATE ANY VIEW , DROP ANY VIEW,EXP_FULL_DATABASE,IMP_FULL_DATABASE, DBA,CONNECT,RESOURCE,CREATE SESSION TO 用戶名字;
導出命令
exp USER/PASSWORD@SID FILE=/opt/oracle/backup/***.DMP //保存數據; exp USER/PASSWORD@SID FILE=/opt/oracle/backup/***.DMP full=y //全部導出;
將資料庫中system用戶與sys用戶的表導出
exp system/password@TEST file=d:\data.dmp owner=(system,sys)
指定導出表
exp system/password@DB1 file= d:\data.dmp tables=(table1,table2)
將資料庫中的表table1中的欄位filed1以"130"打頭的數據導出
exp system/password@TEST file=d:\data.dmp tables=(table1) query=" where filed1 like '130%'"
壓縮導出檔案
exp system/password@TEST file=d:\data.dmp full=y compress=y
導入命令用法
imp user/password@orcl file=/opt/oracle/backup/***.dmp full=y ignore=y;
imp system/password full=y file=database.dmp