您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Oracle 数据泵 content=data_only

2024/4/6 2:21:10发布29次查看
oracle数据泵,逻辑备份和恢复工具,他直接在逻辑从面操作,不能想象成单纯的insert , 而且只导出数据,然后恢复数据时候,可以
下面看一个试验 ,验证的是只导出数据后,,可以恢复,就算是表结构已经变化了,他也能把相应的列恢复,
1)sql> desc liuwenhe.liuwenhe;
 name                                      null?    type
 ----------------------------------------- -------- ----------------------------
 x                                        not null number(38)
 y                                                  number(38)
2)sql> select * from liuwenhe.liuwenhe;
        x          y
---------- ----------
        1
        3
        3
        3
        2
        4
        4
        5
        5
        8
        6
        9
6 rows selected.
3)[oracle@rac1 expdp]$ expdp system/manager123 directory=bak dumpfile=hhhf.dmp tables=liuwenhe.liuwenhe;
export: release 11.2.0.3.0 - production on mon jul 6 11:52:56 2015
copyright (c) 1982, 2011, oracle and/or its affiliates.  all rights reserved.
connected to: oracle database 11g enterprise edition release 11.2.0.3.0 - 64bit production
with the partitioning, real application clusters, olap, data mining
and real application testing options
starting system.sys_export_table_03:  system/******** directory=bak dumpfile=hhhf.dmp tables=liuwenhe.liuwenhe
estimate in progress using blocks method...
processing object type table_export/table/table_data
total estimation using blocks method: 64 kb
processing object type table_export/table/table
processing object type table_export/table/index/index
processing object type table_export/table/constraint/constraint
processing object type table_export/table/index/statistics/index_statistics
processing object type table_export/table/statistics/table_statistics
. . exported liuwenhe.liuwenhe                      5.492 kb      6 rows
master table system.sys_export_table_03 successfully loaded/unloaded
******************************************************************************
dump file set for system.sys_export_table_03 is:
  /backup/expdp/hhhf.dmp
job system.sys_export_table_03 successfully completed at 11:53:10
4)sql> alter table liuwenhe.liuwenhe  drop column y;
table altered.
5)sql> truncate table liuwenhe.liuwenhe;
table truncated.
6)[oracle@rac1 expdp]$ impdp system/manager123 directory=bak dumpfile=hhhf.dmp tables=liuwenhe.liuwenhe  content=data_only;
import: release 11.2.0.3.0 - production on mon jul 6 11:55:07 2015
copyright (c) 1982, 2011, oracle and/or its affiliates.  all rights reserved.
connected to: oracle database 11g enterprise edition release 11.2.0.3.0 - 64bit production
with the partitioning, real application clusters, olap, data mining
and real application testing options
master table system.sys_import_table_04 successfully loaded/unloaded
starting system.sys_import_table_04:  system/******** directory=bak dumpfile=hhhf.dmp tables=liuwenhe.liuwenhe content=data_only
processing object type table_export/table/table_data
. . imported liuwenhe.liuwenhe                      5.492 kb      6 rows
job system.sys_import_table_04 successfully completed at 11:55:13
7)sql> select * from liuwenhe.liuwenhe;
        x
----------
        1
        2
        3
        4
        5
        6
6 rows selected.
总结:oracle数据泵,逻辑备份和恢复工具,他直接在逻辑从面操作,不能想象成单纯的insert , 而且只导出数据,然后恢复数据时候,可以不用写remap_tablespace这个参数 ,tables=liuwenhe.liuwenhe  这里要是没有写前缀liuwenhe,而写成tables=liuwenhe,系统就认为是system用户下的liuwenhe表,而出错。
本文永久更新链接地址:
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product