Oracle数据泵恢复需要用到的命令有:
l create user cqwkhr0605 identified by cqwkhr0605 DEFAULT TABLESPACE nnc_data01 temporary tablespace temp;
l grant connect,dba,resource to cqwkhr0605;
l create directory cqwkhr0605 as 'F:\lscw';
l grant read,write on directory cqwkhr0605 to system;
l exit;
l impdp system/system directory=cqwkhr0605 dumpfile=cqwkhr0605.dmp remap_schema=cqwkhr:cqwkhr0605 logfile= cqwkhr0605.log
说明:
cqwkhr0605:创建的新用户名
nnc_data01:放在哪个表空间
cqwkhr0605:新的用户密码
cqwkhr0605.DMP为要恢复的备份文件
cqwkhr0605:虚拟名称
F:\lscw:数据泵方的目录
System:为数据库用户名
system:为数据库密码
cqwkhr0605.dmp :数据泵文件
cqwkhr:原来的数据库用户名(被备份的数据库用户名)
cqwkhr0605:现在的数据库用户名
cqwkhr0605.log为完成后的日志文件名
remap_schema当你从A用户导出的数据,想要导入到B用户中去,就使用这个:remap_schema=A:B
remap_tablespace 与上面类似,数据库对象本来存在于tbs_a表空间,现在你不想放那儿了,想换到tbs_b,就用这个remap_tablespace=tbs_a:tbs_b 结果是所有tbs_a中的对象都会建在tbs_b表空间中。
具体步骤如下:
(1)新建一个用户cqwkhr0605
(2)给cqwkhr0605授权
(3)在F:\lscw下建立一个虚目录cqwkhr0605
(4)给system授与虚目录权限
(5)退出,并执行导入语句,将cqwkhr对应到cqwkhr0605上。