- 论坛徽章:
- 0
|
oracle 10g rman增量合并测试
rman0级备份数据库:
oracle@linux:/free/oracle> rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on 星期二 11月 14 18:56:48 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1132959697)
RMAN> backup as compressed backupset incremental level 0 database;
Starting backup at 14-11月-06
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=158 devtype=DISK
channel ORA_DISK_1: starting compressed incremental level 0 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/free/oracle/oradata/orcl/system01.dbf
input datafile fno=00003 name=/free/oracle/oradata/orcl/sysaux01.dbf
input datafile fno=00005 name=/free/oracle/oradata/orcl/exitgogodb.dbf
input datafile fno=00002 name=/free/oracle/oradata/orcl/undotbs01.dbf
input datafile fno=00004 name=/free/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: starting piece 1 at 14-11月-06
channel ORA_DISK_1: finished piece 1 at 14-11月-06
piece handle=/free/oracle/flash_recovery_area/ORCL/backupset/2006_11_14/o1_mf_nnnd0_TAG20061114T185913_2om8d3bo_.bkp tag=TAG20061114T185913 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:03:55
Finished backup at 14-11月-06
Starting Control File and SPFILE Autobackup at 14-11月-06
piece handle=/free/oracle/orabak/c-1132959697-20061114-13 comment=NONE
Finished Control File and SPFILE Autobackup at 14-11月-06
RMAN> quit
Recovery Manager complete.
oracle@linux:/free/oracle> ls
admin createtablespace.pl flash_recovery_area oradata product
change.log create_tablespaces.sh orabak oraInventory
oracle@linux:/free/oracle> sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on 星期二 11月 14 19:09:07 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
继续添加测试数据:
SQL> create table gaojf456 as select * from tab;
Table created.
SQL> insert into gaojf456 select * from tab;
3644 rows created.
SQL> /
3644 rows created.
SQL> /
3644 rows created.
SQL> /
3644 rows created.
SQL> /
3644 rows created.
SQL> /
3644 rows created.
SQL> insert into gaojf456 select * from gaojf456;
25508 rows created.
SQL> /
51016 rows created.
SQL> /
102032 rows created.
SQL> /
204064 rows created.
SQL> commit;
Commit complete.
SQL> /
Commit complete.
SQL> quit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
rman执行1级备份,增量合并:
oracle@linux:/free/oracle> rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on 星期二 11月 14 19:10:26 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: ORCL (DBID=1132959697)
RMAN> backup incremental level 1 for recover of copy with tag TAG20061114T185913 database;
Starting backup at 14-11月-06
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=152 devtype=DISK
no parent backup or copy of datafile 1 found
no parent backup or copy of datafile 3 found
no parent backup or copy of datafile 5 found
no parent backup or copy of datafile 2 found
no parent backup or copy of datafile 4 found
channel ORA_DISK_1: starting datafile copy
input datafile fno=00001 name=/free/oracle/oradata/orcl/system01.dbf
output filename=/free/oracle/flash_recovery_area/ORCL/datafile/o1_mf_system_2om935mk_.dbf tag=TAG20061114T185913 recid=51 stamp=606510752
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:05
channel ORA_DISK_1: starting datafile copy
input datafile fno=00003 name=/free/oracle/oradata/orcl/sysaux01.dbf
output filename=/free/oracle/flash_recovery_area/ORCL/datafile/o1_mf_sysaux_2om95594_.dbf tag=TAG20061114T185913 recid=52 stamp=606510785
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:36
channel ORA_DISK_1: starting datafile copy
input datafile fno=00005 name=/free/oracle/oradata/orcl/exitgogodb.dbf
output filename=/free/oracle/flash_recovery_area/ORCL/datafile/o1_mf_exitgogo_2om968y7_.dbf tag=TAG20061114T185913 recid=53 stamp=606510809
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile fno=00002 name=/free/oracle/oradata/orcl/undotbs01.dbf
output filename=/free/oracle/flash_recovery_area/ORCL/datafile/o1_mf_undotbs1_2om9731b_.dbf tag=TAG20061114T185913 recid=54 stamp=606510821
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile fno=00004 name=/free/oracle/oradata/orcl/users01.dbf
output filename=/free/oracle/flash_recovery_area/ORCL/datafile/o1_mf_users_2om97b5n_.dbf tag=TAG20061114T185913 recid=55 stamp=606510826
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 14-11月-06
Starting Control File and SPFILE Autobackup at 14-11月-06
piece handle=/free/oracle/orabak/c-1132959697-20061114-14 comment=NONE
Finished Control File and SPFILE Autobackup at 14-11月-06
RMAN> quit
Recovery Manager complete.
以下操作继续添加测试数据,然后执行一级备份,步骤省略!
最后查看rman备份
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
34 Incr 0 106.10M DISK 00:03:46 14-11月-06
BP Key: 34 Status: AVAILABLE Compressed: YES Tag: TAG20061114T185913
Piece Name: /free/oracle/flash_recovery_area/ORCL/backupset/2006_11_14/o1_mf_nnnd0_TAG20061114T185913_2om8d3bo_.bkp
List of Datafiles in backup set 34
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
1 0 Incr 553409 14-11月-06 /free/oracle/oradata/orcl/system01.dbf
2 0 Incr 553409 14-11月-06 /free/oracle/oradata/orcl/undotbs01.dbf
3 0 Incr 553409 14-11月-06 /free/oracle/oradata/orcl/sysaux01.dbf
4 0 Incr 553409 14-11月-06 /free/oracle/oradata/orcl/users01.dbf
5 0 Incr 553409 14-11月-06 /free/oracle/oradata/orcl/exitgogodb.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
35 Full 6.80M DISK 00:00:01 14-11月-06
BP Key: 35 Status: AVAILABLE Compressed: NO Tag: TAG20061114T190310
Piece Name: /free/oracle/orabak/c-1132959697-20061114-13
Control File Included: Ckp SCN: 553495 Ckp time: 14-11月-06
SPFILE Included: Modification time: 14-11月-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
36 Full 6.80M DISK 00:00:02 14-11月-06
BP Key: 36 Status: AVAILABLE Compressed: NO Tag: TAG20061114T191347
Piece Name: /free/oracle/orabak/c-1132959697-20061114-14
Control File Included: Ckp SCN: 554106 Ckp time: 14-11月-06
SPFILE Included: Modification time: 14-11月-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
37 Incr 1 15.58M DISK 00:00:05 14-11月-06
BP Key: 37 Status: AVAILABLE Compressed: NO Tag: TAG20061114T191650
Piece Name: /free/oracle/flash_recovery_area/ORCL/backupset/2006_11_14/o1_mf_nnnd1_TAG20061114T191650_2om9f6gk_.bkp
List of Datafiles in backup set 37
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
1 1 Incr 554289 14-11月-06 /free/oracle/oradata/orcl/system01.dbf
2 1 Incr 554289 14-11月-06 /free/oracle/oradata/orcl/undotbs01.dbf
3 1 Incr 554289 14-11月-06 /free/oracle/oradata/orcl/sysaux01.dbf
4 1 Incr 554289 14-11月-06 /free/oracle/oradata/orcl/users01.dbf
5 1 Incr 554289 14-11月-06 /free/oracle/oradata/orcl/exitgogodb.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
38 Full 6.80M DISK 00:00:01 14-11月-06
BP Key: 38 Status: AVAILABLE Compressed: NO Tag: TAG20061114T191659
Piece Name: /free/oracle/orabak/c-1132959697-20061114-15
Control File Included: Ckp SCN: 554296 Ckp time: 14-11月-06
SPFILE Included: Modification time: 14-11月-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
39 Incr 1 31.73M DISK 00:00:06 14-11月-06
BP Key: 39 Status: AVAILABLE Compressed: NO Tag: TAG20061114T191844
Piece Name: /free/oracle/flash_recovery_area/ORCL/backupset/2006_11_14/o1_mf_nnnd1_TAG20061114T191844_2om9jr17_.bkp
List of Datafiles in backup set 39
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
1 1 Incr 554456 14-11月-06 /free/oracle/oradata/orcl/system01.dbf
2 1 Incr 554456 14-11月-06 /free/oracle/oradata/orcl/undotbs01.dbf
3 1 Incr 554456 14-11月-06 /free/oracle/oradata/orcl/sysaux01.dbf
4 1 Incr 554456 14-11月-06 /free/oracle/oradata/orcl/users01.dbf
5 1 Incr 554456 14-11月-06 /free/oracle/oradata/orcl/exitgogodb.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
40 Full 7.08M DISK 00:00:02 14-11月-06
BP Key: 40 Status: AVAILABLE Compressed: NO Tag: TAG20061114T191852
Piece Name: /free/oracle/orabak/c-1132959697-20061114-16
Control File Included: Ckp SCN: 554463 Ckp time: 14-11月-06
SPFILE Included: Modification time: 14-11月-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
41 Incr 1 60.94M DISK 00:00:10 14-11月-06
BP Key: 41 Status: AVAILABLE Compressed: NO Tag: TAG20061114T192249
Piece Name: /free/oracle/flash_recovery_area/ORCL/backupset/2006_11_14/o1_mf_nnnd1_TAG20061114T192249_2om9rgjb_.bkp
List of Datafiles in backup set 41
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ---------- ----
1 1 Incr 554705 14-11月-06 /free/oracle/oradata/orcl/system01.dbf
2 1 Incr 554705 14-11月-06 /free/oracle/oradata/orcl/undotbs01.dbf
3 1 Incr 554705 14-11月-06 /free/oracle/oradata/orcl/sysaux01.dbf
4 1 Incr 554705 14-11月-06 /free/oracle/oradata/orcl/users01.dbf
5 1 Incr 554705 14-11月-06 /free/oracle/oradata/orcl/exitgogodb.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
42 Full 7.08M DISK 00:00:02 14-11月-06
BP Key: 42 Status: AVAILABLE Compressed: NO Tag: TAG20061114T192305
Piece Name: /free/oracle/orabak/c-1132959697-20061114-17
Control File Included: Ckp SCN: 554715 Ckp time: 14-11月-06
SPFILE Included: Modification time: 14-11月-06
RMAN> quit
然后关闭数据库,删除所有数据文件,用rman恢复。
RMAN> restore database;
Starting restore at 14-11月-06
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=157 devtype=DISK
channel ORA_DISK_1: restoring datafile 00001
input datafile copy recid=51 stamp=606510752 filename=/free/oracle/flash_recovery_area/ORCL/datafile/o1_mf_system_2om935mk_.dbf
destination for restore of datafile 00001: /free/oracle/oradata/orcl/system01.dbf
channel ORA_DISK_1: copied datafile copy of datafile 00001
output filename=/free/oracle/oradata/orcl/system01.dbf recid=56 stamp=606511723
channel ORA_DISK_1: restoring datafile 00002
input datafile copy recid=54 stamp=606510821 filename=/free/oracle/flash_recovery_area/ORCL/datafile/o1_mf_undotbs1_2om9731b_.dbf
destination for restore of datafile 00002: /free/oracle/oradata/orcl/undotbs01.dbf
channel ORA_DISK_1: copied datafile copy of datafile 00002
output filename=/free/oracle/oradata/orcl/undotbs01.dbf recid=57 stamp=606511734
channel ORA_DISK_1: restoring datafile 00003
input datafile copy recid=52 stamp=606510785 filename=/free/oracle/flash_recovery_area/ORCL/datafile/o1_mf_sysaux_2om95594_.dbf
destination for restore of datafile 00003: /free/oracle/oradata/orcl/sysaux01.dbf
channel ORA_DISK_1: copied datafile copy of datafile 00003
output filename=/free/oracle/oradata/orcl/sysaux01.dbf recid=58 stamp=606511764
channel ORA_DISK_1: restoring datafile 00004
input datafile copy recid=55 stamp=606510826 filename=/free/oracle/flash_recovery_area/ORCL/datafile/o1_mf_users_2om97b5n_.dbf
destination for restore of datafile 00004: /free/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: copied datafile copy of datafile 00004
output filename=/free/oracle/oradata/orcl/users01.dbf recid=59 stamp=606511770
channel ORA_DISK_1: restoring datafile 00005
input datafile copy recid=53 stamp=606510809 filename=/free/oracle/flash_recovery_area/ORCL/datafile/o1_mf_exitgogo_2om968y7_.dbf
destination for restore of datafile 00005: /free/oracle/oradata/orcl/exitgogodb.dbf
channel ORA_DISK_1: copied datafile copy of datafile 00005
output filename=/free/oracle/oradata/orcl/exitgogodb.dbf recid=60 stamp=606511788
Finished restore at 14-11月-06
RMAN> recover database;
Starting recover at 14-11月-06
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: /free/oracle/oradata/orcl/system01.dbf
destination for restore of datafile 00002: /free/oracle/oradata/orcl/undotbs01.dbf
destination for restore of datafile 00003: /free/oracle/oradata/orcl/sysaux01.dbf
destination for restore of datafile 00004: /free/oracle/oradata/orcl/users01.dbf
destination for restore of datafile 00005: /free/oracle/oradata/orcl/exitgogodb.dbf
channel ORA_DISK_1: reading from backup piece /free/oracle/flash_recovery_area/ORCL/backupset/2006_11_14/o1_mf_nnnd1_TAG20061114T192249_2om9rgjb_.bkp
channel ORA_DISK_1: restored backup piece 1
piece handle=/free/oracle/flash_recovery_area/ORCL/backupset/2006_11_14/o1_mf_nnnd1_TAG20061114T192249_2om9rgjb_.bkp tag=TAG20061114T192249
channel ORA_DISK_1: restore complete, elapsed time: 00:00:17
starting media recovery
media recovery complete, elapsed time: 00:00:03
Finished recover at 14-11月-06
RMAN>
可以看到rman在recover数据库的时候用到了最后一次rman一级备份的文件,按照oracle10g增量合并的原理来说,应该是只要一个0级的备份加上日志即可,
但是上面的测试却是rman的levle 0+最后的level 1+归档日志。
感觉有点与oracle选出的增量合并不太吻合!请大家指点一二! |
|