数据库逻辑备份与还原dexp/dimp
1 全库
[dmdba@dcp1 ~]$ dexp help
[dmdba@dcp1 ~]$ dexp SYSDBA/dameng123 file=full_%U.dmp log=full_%U.log directory=/dm/backup full=y parallel=4 filesize=128m
[dmdba@dcp1 ~]$dimp SYSDBA/dameng123 file=full01.dmp log=dimp%U.log directory=/dm/dmbackup full=y table_exists_action=replace
2 用户级
[dmdba@dcp1 ~]$ dexp SYSDBA/dameng123 file=dmhr%U.dmp log=dmhr%U.log directory=/dm/backup owner=dmhr parallel=4 filesize=128m
导入到原用户:
[dmdba@dcp1 ~]$dimp SYSDBA/dameng123 FILE=dmhr_01.dmp LOG=dmhr_imp.log directory=/dm/backup owner=dmhr table_exists_action=replace
导入到其它用户:
remap_schema中的模式名要用大写,否则会导入原来的模式中:
[dmdba@dcp1 ~]$dimp SYSDBA/dameng123 FILE=dmhr_01.dmp LOG=dmhr_imp.log directory=/dm/backup remap_schema=DMHR:CNDBA table_exists_action=replace
3 表级
[dmdba@dcp1 ~]$ dexp cndba/dameng123 file=tables.dmp log=tables.log directory=/dm/backup tables=ustc,hefei
表导入原用户下:
[dmdba@dcp1 ~]$dimp cndba/dameng123 file=tables.dmp log=tables.log directory=/dm/backup tables=ustc,hefei table_exists_action=replace
表导入其它用户下。这里连接用户必须是对象的原用户,然后加上remap_schema=DEXP:DIMP 就可以导入到新用户下
[dmdba@dcp1 ~]$dimp cndba/dameng123 file=tables.dmp log=tables.log directory=/dm/backup tables=ustc,hefei table_exists_action=replace remap_schema=CNDBA:DMHR
文章
阅读量
获赞