資源描述:
《oracle數(shù)據(jù)庫的導(dǎo)入導(dǎo)出》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、.導(dǎo)出工具exp1.它是操作系統(tǒng)下一個可執(zhí)行的文件存放目錄/ORACLE_HOME/binexp導(dǎo)出工具將數(shù)據(jù)庫中數(shù)據(jù)備份壓縮成一個二進(jìn)制系統(tǒng)文件.可以在不同OS間遷移它有三種模式:a.用戶模式:導(dǎo)出用戶所有對象以及對象中的數(shù)據(jù);b.表模式:導(dǎo)出用戶所有表或者指定的表;c.整個數(shù)據(jù)庫:導(dǎo)出數(shù)據(jù)庫中所有對象。二.導(dǎo)入工具imp1.它是操作系統(tǒng)下一個可執(zhí)行的文件存放目錄/ORACLE_HOME/binimp導(dǎo)入工具將EXP形成的二進(jìn)制系統(tǒng)文件導(dǎo)入到數(shù)據(jù)庫中.它有三種模式:a.用戶模式:導(dǎo)出用戶所有對象以及對象中的
2、數(shù)據(jù);b.表模式:導(dǎo)出用戶所有表或者指定的表;c.整個數(shù)據(jù)庫:導(dǎo)出數(shù)據(jù)庫中所有對象。只有擁有IMP_FULL_DATABASE和DBA權(quán)限的用戶才能做整個數(shù)據(jù)庫導(dǎo)入下面介紹的是導(dǎo)入導(dǎo)出的實例,導(dǎo)入導(dǎo)出看實例基本上就可以完成,因為導(dǎo)入導(dǎo)出很簡單。數(shù)據(jù)導(dǎo)出:1將數(shù)據(jù)庫TEST完全導(dǎo)出,用戶名system密碼manager導(dǎo)出到D:daochu.dmp中???expsystem/manager@TESTfile=d:daochu.dmpfull=y2將數(shù)據(jù)庫中system用戶與sys用戶的表導(dǎo)出???expsy
3、stem/manager@TESTfile=d:daochu.dmpowner=(system,sys)3將數(shù)據(jù)庫中的表table1、table2導(dǎo)出???expsystem/manager@TESTfile=d:daochu.dmptables=(table1,table2)??4將數(shù)據(jù)庫中的表table1中的字段filed1以"00"打頭的數(shù)據(jù)導(dǎo)出???expsystem/manager@TESTfile=d:daochu.dmptables=(table1)query="wherefiled1l
4、ike’00%’"???上面是常用的導(dǎo)出,對于壓縮我不太在意,用winzip把dmp文件可以很好的壓縮。?????????????????????不過在上面命令后面加上compress=y??就可以了數(shù)據(jù)的導(dǎo)入1將D:daochu.dmp中的數(shù)據(jù)導(dǎo)入TEST數(shù)據(jù)庫中。???impsystem/manager@TEST??file=d:daochu.dmp???上面可能有點問題,因為有的表已經(jīng)存在,然后它就報錯,對該表就不進(jìn)行導(dǎo)入。???在后面加上ignore=y就可以了。2將d:daochu.dmp中
5、的表table1導(dǎo)入impsystem/manager@TEST??file=d:daochu.dmp??tables=(table1)??3將按照用戶(owner=a)導(dǎo)出的表文件file=d:daochu.dmp導(dǎo)入到用戶b的所在表空間中impuserid=b/pwdfile=d:daochu.dmpfromuser=atouser=blogs=d:/xx.log標(biāo)為紅色的地方是很通俗易懂……??另一種方法。兩種解釋方式。Oracle的導(dǎo)入實用程序(Importutility)允許從數(shù)據(jù)庫提取數(shù)據(jù),
6、并且將數(shù)據(jù)寫入操作系統(tǒng)文件。imp使用的基本格式:imp[username[/password[@service]]],以下例舉imp常用用法。1.獲取幫助imphelp=y2.導(dǎo)入一個完整數(shù)據(jù)庫impsystem/managerfile=bible_dblog=dible_dbfull=yignore=y3.導(dǎo)入一個或一組指定用戶所屬的全部表、索引和其他對象impsystem/managerfile=seaparklog=seaparkfromuser=seaparkimpsystem/managerfil
7、e=seaparklog=seaparkfromuser=(seapark,amy,amyc,harold)4.將一個用戶所屬的數(shù)據(jù)導(dǎo)入另一個用戶impsystem/managerfile=tanklog=tankfromuser=seaparktouser=seapark_copyimpsystem/managerfile=tanklog=tankfromuser=(seapark,amy)touser=(seapark1,amy1)5.導(dǎo)入一個表impsystem/managerfile=tanklog=
8、tankfromuser=seaparkTABLES=(a,b)6.從多個文件導(dǎo)入impsystem/managerfile=(paycheck_1,paycheck_2,paycheck_3,paycheck_4)log=paycheck,filesize=1Gfull=y7.使用參數(shù)文件impsystem/managerparfile=bible_tables.parbible_tables.p