四、物理增量备份恢复
SQL>set current database mytest;
set current database mytest
设置当前数据库为 'mytest'
time used: 0.124(ms).
SQL>select name,type from systables where type!='S';
name type
1 bk_2 U
2 test_backup U
3 test_backupDMBLOB V
4 test_context U
5 test_contextDMBLOB V
6 test_part V
7 test_part00DMPART P
8 test_part01DMPART P
9 test_part2 H
10 test_part3 R
10 rows got
time used: 0.169(ms).
set current database mytest
设置当前数据库为 'mytest'
time used: 0.124(ms).
SQL>select name,type from systables where type!='S';
name type
1 bk_2 U
2 test_backup U
3 test_backupDMBLOB V
4 test_context U
5 test_contextDMBLOB V
6 test_part V
7 test_part00DMPART P
8 test_part01DMPART P
9 test_part2 H
10 test_part3 R
10 rows got
time used: 0.169(ms).
当前MYTEST库下有10个表,那么我们对这个库进行一个完全备份。
SQL>backup database mytest full to "/u01/dmdb/mytest_bak01";
time used: 25.211(ms).
SQL>create table bk_001(id int);
time used: 0.658(ms).
time used: 25.211(ms).
SQL>create table bk_001(id int);
time used: 0.658(ms).
完全备份完成后,在创建一个新表bk_001,然后再进行增量备份。
SQL>backup database mytest increment to "/u01/dmdb/mytest_bak02";
time used: 17.266(ms).
SQL>select name,type from systables where type!='S';
name type
1 bk_001 U
2 bk_2 U
3 test_backup U
4 test_backupDMBLOB V
5 test_context U
6 test_contextDMBLOB V
7 test_part V
8 test_part00DMPART P
9 test_part01DMPART P
10 test_part2 H
11 test_part3 R
11 rows got
time used: 0.173(ms).
time used: 17.266(ms).
SQL>select name,type from systables where type!='S';
name type
1 bk_001 U
2 bk_2 U
3 test_backup U
4 test_backupDMBLOB V
5 test_context U
6 test_contextDMBLOB V
7 test_part V
8 test_part00DMPART P
9 test_part01DMPART P
10 test_part2 H
11 test_part3 R
11 rows got
time used: 0.173(ms).
可以看到,目前MYTEST库有11张表,然后再删除几张表,把新建的bk_001表也删除。
SQL>drop table bk_001;
SQL>drop table bk_2;
SQL>drop table test_backup;
SQL>exit
SQL>drop table bk_2;
SQL>drop table test_backup;
SQL>exit