首先root登錄
切換到oracle用戶
su - oracle
1. 獲取幫助
imp help=y
2. 導入一個完整數據庫
imp system/manager file=bible_db log=dible_db full=y ignore=y
3. 導入一個或一組指定用戶所屬的全部表、索引和其他對象
imp system/manager file=seapark log=seapark fromuser=seapark
imp system/manager file=seapark log=seapark fromuser=(seapark,amy,amyc,harold)
4. 將一個用戶所屬的數據導入另一個用戶
imp system/manager file=tank log=tank fromuser=seapark touser=seapark_copy
imp system/manager file=tank log=tank fromuser=(seapark,amy) touser=(seapark1, amy1)
5. 導入一個表
imp system/manager file=tank log=tank fromuser=seapark TABLES=(a,b)
6. 從多個文件導入
imp system/manager file=(paycheck_1,paycheck_2,paycheck_3,paycheck_4) log=paycheck,filesize=1G full=y
7. 使用參數文件
imp system/manager parfile=bible_tables.par
bible_tables.par參數文件:
#Import the sample tables used for the Oracle8i Database Administrator's
#Bible.
fromuser=seapark touser=seapark_copy file=seapark log=seapark_import
8. 增量導入(9i中已經取消)
imp system./manager inctype= RECTORE FULL=Y FILE=A
數據的導入
1 將D:\daochu.dmp 中的數據導入 TEST數據庫中。
imp system/manager@TEST file=d:\daochu.dmp
imp aichannel/aichannel@HUST full=y file=file= d:\data\newsmgnt.dmp ignore=y
上面可能有點問題,因為有的表已經存在,然后它就報錯,對該表就不進行導入。
在后面加上 ignore=y 就可以了。
2 將d:\daochu.dmp中的表table1 導入
imp system/manager@TEST file=d:\daochu.dmp tables=(table1)