欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Oracle数据库中EXP的增量备份讲解

程序员文章站 2022-04-02 07:59:30
EXP的增量备份最小的差异单元是表,也就是说只要一个表的数据有变动,那么这个表就要被全表导出。 如果表的数据自上次备份以来没有任何变动,则该表将不会被再次导出。 实验数据库版本...

EXP的增量备份最小的差异单元是表,也就是说只要一个表的数据有变动,那么这个表就要被全表导出。

如果表的数据自上次备份以来没有任何变动,则该表将不会被再次导出。

实验数据库版本:

SQL> select * from v$version;

BANNER

--------------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

PL/SQL Release 11.2.0.4.0 - Production

CORE 11.2.0.4.0 Production

TNS for Linux: Version 11.2.0.4.0 - Production

NLSRTL Version 11.2.0.4.0 - Production

测试数据:

SQL> select * from test;

ID

----------

1

3

2

导出全库数据,其中test表数据3行:

[oracle@yfsl ~]$ exp test/test inctype=complete file=test-1.dmp

...

. about to export TEST's tables via Conventional Path ...

. . exporting table TEST 3 rows exported

. exporting synonyms

...

Export terminated successfully with warnings.

再次在表test中插入一条数据:

SQL> insert into test values(4);

1 row created.

SQL> commit;

Commit complete.

执行增量导出,导出test表结果为4行(此处验证只要表test中有一行数据变更,则会导出全表数据):

[oracle@yfsl ~]$ exp test/test inctype=incremental file=test-2.dmp

...

. about to export SCOTT's tables via Conventional Path ...

. about to export TEST's tables via Conventional Path ...

. . exporting table TEST 4 rows exported

. exporting synonyms

. exporting views

...

Export terminated successfully with warnings.

对表test不做任何操作,再次增量导出,表test未重新导出数据(因为此时表test没有任何变更):

[oracle@yfsl ~]$ exp test/test inctype=incremental file=test-3.dmp

...

. about to export OWBSYS_AUDIT's tables via Conventional Path ...

. about to export SCOTT's tables via Conventional Path ...

. about to export TEST's tables via Conventional Path ...

. exporting synonyms

. exporting views

...

Export terminated successfully with warnings.