我最近收到了即将被迁移的Oracle数据库的转储文件。 我已经安装了Oracle 10g,现在我需要恢复原始数据库。
任何人都可以给我一步一步如何从.dmp文件恢复它的过程?
谢谢。
这取决于你正在做什么,但一个简短的答案是:
imp system/password@sid file=(filename) log=imp.log fromuser=(existing user) touser=(new user)
最后3这里: log , fromuser , touser是可选的。 如果这样做没有帮助,你可以提供一些关于你在做什么的细节。
这取决于从原始数据库完成的导出(转储)的types。 Oracle有四种types的输出(称为模式):
假设一个完整的导出已经完成了,你可以这样做:
SET ORACLE_SID=dbsid imp system/manager FULL=y FILE=database.dmp LOG=import.log STATISTICS=recalculate
话虽如此,您应该通读有关imp的Oracle文档 。
请记住.dmp文件可能意味着它是使用exp或expdp导出的。 如果遇到任何问题,请运行imp帮助= y或impdp help = y。
我通常只恢复我想要的模式:
imp userid=SYSTEM/ART@cscdap1 fromuser=MDSBI touser=MDSBI grants=y indexes=y commit=y ignore=y buffer=10240000 file=MDSBI.dmp log=imp_MDSBI.log imp userid=SYSTEM/ART@cscdap1 fromuser=MDS_GRS touser=MDS_GRS grants=y indexes=y commit=y ignore=y buffer=10240000 file=MDS_GRS.dmp log=imp_MDS_GRS.log imp userid=SYSTEM/ART@cscdap1 fromuser=ODM touser=ODM grants=y indexes=y commit=y ignore=y buffer=10240000 file=ODM.dmp log=imp_ODM.log imp userid=SYSTEM/ART@cscdap1 fromuser=ODIWORK touser=ODIWORK grants=y indexes=y commit=y ignore=y buffer=10240000 file=ODIWORK.dmp log=imp_ODIWORK.log imp userid=SYSTEM/ART@cscdap1 fromuser=ODIMASTER touser=ODIMASTER grants=y indexes=y commit=y ignore=y buffer=10240000 file=ODIMASTER.dmp log=imp_ODIMASTER.log imp userid=SYSTEM/ART@cscdap1 fromuser=EPADMRT touser=EPADMRT grants=y indexes=y commit=y ignore=y buffer=10240000 file=EPADMRT.dmp log=imp_EPADMRT.log imp userid=SYSTEM/ART@cscdap1 fromuser=OEMUSER touser=OEMUSER grants=y indexes=y commit=y ignore=y buffer=10240000 file=OEMUSER.dmp log=imp_OEMUSER.log imp userid=SYSTEM/ART@cscdap1 fromuser=HERNA236 touser=HERNA236 grants=y indexes=y commit=y ignore=y buffer=10240000 file=HERNA236.dmp log=imp_HERNA236.log imp userid=SYSTEM/ART@cscdap1 fromuser=MAURYAKO touser=MAURYAKO grants=y indexes=y commit=y ignore=y buffer=10240000 file=MAURYAKO.dmp log=imp_MAURYAKO.log imp userid=SYSTEM/ART@cscdap1 fromuser=SAWANTRO touser=SAWANTRO grants=y indexes=y commit=y ignore=y buffer=10240000 file=SAWANTRO.dmp log=imp_SAWANTRO.log imp userid=SYSTEM/ART@cscdap1 fromuser=ABDERHOB touser=ABDERHOB grants=y indexes=y commit=y ignore=y buffer=10240000 file=ABDERHOB.dmp log=imp_ABDERHOB.log imp userid=SYSTEM/ART@cscdap1 fromuser=CHECK_DB touser=CHECK_DB grants=y indexes=y commit=y ignore=y buffer=10240000 file=CHECK_DB.dmp log=imp_CHECK_DB.log imp userid=SYSTEM/ART@cscdap1 fromuser=SABATAJA touser=SABATAJA grants=y indexes=y commit=y ignore=y buffer=10240000 file=SABATAJA.dmp log=imp_SABATAJA.log