|
Oracle Suggested Backup策略:
要做实验,请把weekli备份放在第4天:
第一天:
- Recovery Manager: Release 11.2.0.1.0 - Production on Tue Jun 19 20:15:23 2018
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
- RMAN>
- connected to target database: ORCL (DBID=1359978017)
- using target database control file instead of recovery catalog
- RMAN>
- echo set on
- RMAN> run {
- 2> allocate channel oem_disk_backup device type disk;
- 3> recover copy of database with tag 'ORA_OEM_LEVEL_0';
- 4> backup incremental level 1 cumulative copies=1 for recover of copy with tag 'ORA_OEM_LEVEL_0' database;
- 5> release channel oem_disk_backup;
- 6> allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
- 7> allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
- 8> backup archivelog all not backed up;
- 9> }
- allocated channel: oem_disk_backup
- channel oem_disk_backup: SID=197 device type=DISK
- Starting recover at 2018-06-19:20:15:24
- no copy of datafile 1 found to recover
- no copy of datafile 2 found to recover
- no copy of datafile 3 found to recover
- no copy of datafile 4 found to recover
- no copy of datafile 5 found to recover
- no copy of datafile 6 found to recover
- no copy of datafile 7 found to recover
- Finished recover at 2018-06-19:20:15:24
- Starting backup at 2018-06-19:20:15:25
- no parent backup or copy of datafile 1 found
- no parent backup or copy of datafile 2 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 4 found
- no parent backup or copy of datafile 6 found
- no parent backup or copy of datafile 7 found
- channel oem_disk_backup: starting datafile copy
- input datafile file number=00001 name=+DATA/orcl/datafile/system.256.978643425
- output file name=+FRA/orcl/datafile/system.304.979244125 tag=ORA_OEM_LEVEL_0 RECID=11 STAMP=979244151
- channel oem_disk_backup: datafile copy complete, elapsed time: 00:00:35
- channel oem_disk_backup: starting datafile copy
- input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.258.978643425
- output file name=+FRA/orcl/datafile/sysaux.305.979244161 tag=ORA_OEM_LEVEL_0 RECID=12 STAMP=979244182
- channel oem_disk_backup: datafile copy complete, elapsed time: 00:00:25
- channel oem_disk_backup: starting datafile copy
- input datafile file number=00003 name=+DATA/orcl/datafile/undotbs1.259.978643423
- output file name=+FRA/orcl/datafile/undotbs1.357.979244187 tag=ORA_OEM_LEVEL_0 RECID=13 STAMP=979244197
- channel oem_disk_backup: datafile copy complete, elapsed time: 00:00:15
- channel oem_disk_backup: starting datafile copy
- input datafile file number=00005 name=+DATA/orcl/datafile/example.257.978643425
- output file name=+FRA/orcl/datafile/example.358.979244201 tag=ORA_OEM_LEVEL_0 RECID=14 STAMP=979244209
- channel oem_disk_backup: datafile copy complete, elapsed time: 00:00:15
- channel oem_disk_backup: starting datafile copy
- input datafile file number=00004 name=+DATA/orcl/datafile/users.265.978645015
- output file name=+FRA/orcl/datafile/users.356.979244217 tag=ORA_OEM_LEVEL_0 RECID=15 STAMP=979244216
- channel oem_disk_backup: datafile copy complete, elapsed time: 00:00:01
- channel oem_disk_backup: starting datafile copy
- input datafile file number=00006 name=+DATA/orcl/datafile/tbs1.267.978952849
- output file name=+FRA/orcl/datafile/tbs1.359.979244217 tag=ORA_OEM_LEVEL_0 RECID=16 STAMP=979244218
- channel oem_disk_backup: datafile copy complete, elapsed time: 00:00:01
- channel oem_disk_backup: starting datafile copy
- input datafile file number=00007 name=+DATA/orcl/datafile/tbs2.268.978952865
- output file name=+FRA/orcl/datafile/tbs2.352.979244219 tag=ORA_OEM_LEVEL_0 RECID=17 STAMP=979244219
- channel oem_disk_backup: datafile copy complete, elapsed time: 00:00:01
- Finished backup at 2018-06-19:20:16:59
- Starting Control File and SPFILE Autobackup at 2018-06-19:20:17:00
- piece handle=+FRA/orcl/autobackup/2018_06_19/s_979244220.351.979244221 comment=NONE
- Finished Control File and SPFILE Autobackup at 2018-06-19:20:17:03
- released channel: oem_disk_backup
- allocated channel: oem_sbt_backup1
- channel oem_sbt_backup1: SID=197 device type=SBT_TAPE
- channel oem_sbt_backup1: Oracle Secure Backup
- allocated channel: oem_sbt_backup2
- channel oem_sbt_backup2: SID=144 device type=SBT_TAPE
- channel oem_sbt_backup2: Oracle Secure Backup
- Starting backup at 2018-06-19:20:17:04
- current log archived
- channel oem_sbt_backup1: starting archived log backup set
- channel oem_sbt_backup1: specifying archived log(s) in backup set
- input archived log thread=1 sequence=3 RECID=104 STAMP=978944162
- channel oem_sbt_backup1: starting piece 1 at 2018-06-19:20:17:05
- channel oem_sbt_backup2: starting archived log backup set
- channel oem_sbt_backup2: specifying archived log(s) in backup set
- input archived log thread=1 sequence=12 RECID=113 STAMP=979244225
- channel oem_sbt_backup2: starting piece 1 at 2018-06-19:20:17:05
- channel oem_sbt_backup1: finished piece 1 at 2018-06-19:20:18:30
- piece handle=39t5s561_1_1 tag=TAG20180619T201705 comment=API Version 2.0,MMS Version 10.3.0.2
- channel oem_sbt_backup1: backup set complete, elapsed time: 00:01:25
- channel oem_sbt_backup2: finished piece 1 at 2018-06-19:20:18:30
- piece handle=3at5s561_1_1 tag=TAG20180619T201705 comment=API Version 2.0,MMS Version 10.3.0.2
- channel oem_sbt_backup2: backup set complete, elapsed time: 00:01:25
- Finished backup at 2018-06-19:20:18:30
- Starting Control File and SPFILE Autobackup at 2018-06-19:20:18:30
- piece handle=c-1359978017-20180619-01 comment=API Version 2.0,MMS Version 10.3.0.2
- Finished Control File and SPFILE Autobackup at 2018-06-19:20:19:06
- released channel: oem_sbt_backup1
- released channel: oem_sbt_backup2
- RMAN> allocate channel for maintenance device type 'SBT_TAPE' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
- allocated channel: ORA_MAINT_SBT_TAPE_1
- channel ORA_MAINT_SBT_TAPE_1: SID=197 device type=SBT_TAPE
- channel ORA_MAINT_SBT_TAPE_1: Oracle Secure Backup
- RMAN> delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';
- no obsolete backups found
- RMAN> exit;
- Recovery Manager complete.
复制代码
第二天:
- Recovery Manager: Release 11.2.0.1.0 - Production on Wed Jun 20 20:15:27 2018
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
- RMAN>
- connected to target database: ORCL (DBID=1359978017)
- using target database control file instead of recovery catalog
- RMAN>
- echo set on
- RMAN> run {
- 2> allocate channel oem_disk_backup device type disk;
- 3> recover copy of database with tag 'ORA_OEM_LEVEL_0';
- 4> backup incremental level 1 cumulative copies=1 for recover of copy with tag 'ORA_OEM_LEVEL_0' database;
- 5> release channel oem_disk_backup;
- 6> allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
- 7> allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
- 8> backup archivelog all not backed up;
- 9> }
- allocated channel: oem_disk_backup
- channel oem_disk_backup: SID=12 device type=DISK
- Starting recover at 2018-06-20:20:15:29
- no copy of datafile 1 found to recover
- no copy of datafile 2 found to recover
- no copy of datafile 3 found to recover
- no copy of datafile 4 found to recover
- no copy of datafile 5 found to recover
- no copy of datafile 6 found to recover
- no copy of datafile 7 found to recover
- Finished recover at 2018-06-20:20:15:29
- Starting backup at 2018-06-20:20:15:29
- channel oem_disk_backup: starting incremental level 1 datafile backup set
- channel oem_disk_backup: specifying datafile(s) in backup set
- input datafile file number=00001 name=+DATA/orcl/datafile/system.256.978643425
- input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.258.978643425
- input datafile file number=00003 name=+DATA/orcl/datafile/undotbs1.259.978643423
- input datafile file number=00005 name=+DATA/orcl/datafile/example.257.978643425
- input datafile file number=00004 name=+DATA/orcl/datafile/users.265.978645015
- input datafile file number=00006 name=+DATA/orcl/datafile/tbs1.267.978952849
- input datafile file number=00007 name=+DATA/orcl/datafile/tbs2.268.978952865
- channel oem_disk_backup: starting piece 1 at 2018-06-20:20:15:29
- channel oem_disk_backup: finished piece 1 at 2018-06-20:20:15:36
- piece handle=+FRA/orcl/backupset/2018_06_20/nnndn1_ora_oem_level_0_0.323.979330531 tag=ORA_OEM_LEVEL_0 comment=NONE
- channel oem_disk_backup: backup set complete, elapsed time: 00:00:07
- Finished backup at 2018-06-20:20:15:36
- Starting Control File and SPFILE Autobackup at 2018-06-20:20:15:36
- piece handle=+FRA/orcl/autobackup/2018_06_20/s_979330536.355.979330537 comment=NONE
- Finished Control File and SPFILE Autobackup at 2018-06-20:20:15:39
- released channel: oem_disk_backup
- allocated channel: oem_sbt_backup1
- channel oem_sbt_backup1: SID=12 device type=SBT_TAPE
- channel oem_sbt_backup1: Oracle Secure Backup
- allocated channel: oem_sbt_backup2
- channel oem_sbt_backup2: SID=17 device type=SBT_TAPE
- channel oem_sbt_backup2: Oracle Secure Backup
- Starting backup at 2018-06-20:20:15:41
- current log archived
- skipping archived log file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_3.346.978944161; already backed on 2018-06-19:20:18:28
- skipping archived log file +FRA/orcl/archivelog/2018_06_19/thread_1_seq_12.267.979244225; already backed on 2018-06-19:20:18:24
- channel oem_sbt_backup1: starting archived log backup set
- channel oem_sbt_backup1: specifying archived log(s) in backup set
- input archived log thread=1 sequence=13 RECID=114 STAMP=979330541
- channel oem_sbt_backup1: starting piece 1 at 2018-06-20:20:15:42
- channel oem_sbt_backup1: finished piece 1 at 2018-06-20:20:16:47
- piece handle=3et5upfe_1_1 tag=TAG20180620T201541 comment=API Version 2.0,MMS Version 10.3.0.2
- channel oem_sbt_backup1: backup set complete, elapsed time: 00:01:05
- Finished backup at 2018-06-20:20:16:47
- Starting Control File and SPFILE Autobackup at 2018-06-20:20:16:47
- piece handle=c-1359978017-20180620-01 comment=API Version 2.0,MMS Version 10.3.0.2
- Finished Control File and SPFILE Autobackup at 2018-06-20:20:17:22
- released channel: oem_sbt_backup1
- released channel: oem_sbt_backup2
- RMAN> allocate channel for maintenance device type 'SBT_TAPE' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
- allocated channel: ORA_MAINT_SBT_TAPE_1
- channel ORA_MAINT_SBT_TAPE_1: SID=12 device type=SBT_TAPE
- channel ORA_MAINT_SBT_TAPE_1: Oracle Secure Backup
- RMAN> delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';
- no obsolete backups found
- RMAN> exit;
- Recovery Manager complete.
复制代码
第三天(把0级镜像拷贝的时间向前推动):
第四天(周备份):
- Recovery Manager: Release 11.2.0.1.0 - Production on Fri Jun 22 20:15:27 2018
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
- RMAN>
- connected to target database: ORCL (DBID=1359978017)
- using target database control file instead of recovery catalog
- RMAN>
- echo set on
- RMAN> run {
- 2> allocate channel oem_disk_backup device type disk;
- 3> recover copy of database with tag 'ORA_OEM_LEVEL_0';
- 4> backup incremental level 1 cumulative copies=1 for recover of copy with tag 'ORA_OEM_LEVEL_0' database;
- 5> release channel oem_disk_backup;
- 6> allocate channel oem_sbt_backup1 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
- 7> allocate channel oem_sbt_backup2 type 'SBT_TAPE' format '%U' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
- 8> backup recovery area;
- 9> }
- allocated channel: oem_disk_backup
- channel oem_disk_backup: SID=135 device type=DISK
- Starting recover at 2018-06-22:20:15:28
- channel oem_disk_backup: starting incremental datafile backup set restore
- channel oem_disk_backup: specifying datafile copies to recover
- recovering datafile copy file number=00001 name=+FRA/orcl/datafile/system.304.979244125
- recovering datafile copy file number=00002 name=+FRA/orcl/datafile/sysaux.305.979244161
- recovering datafile copy file number=00003 name=+FRA/orcl/datafile/undotbs1.357.979244187
- recovering datafile copy file number=00004 name=+FRA/orcl/datafile/users.356.979244217
- recovering datafile copy file number=00005 name=+FRA/orcl/datafile/example.358.979244201
- recovering datafile copy file number=00006 name=+FRA/orcl/datafile/tbs1.359.979244217
- recovering datafile copy file number=00007 name=+FRA/orcl/datafile/tbs2.352.979244219
- channel oem_disk_backup: reading from backup piece +FRA/orcl/backupset/2018_06_21/nnndn1_ora_oem_level_0_0.345.979416935
- channel oem_disk_backup: piece handle=+FRA/orcl/backupset/2018_06_21/nnndn1_ora_oem_level_0_0.345.979416935 tag=ORA_OEM_LEVEL_0
- channel oem_disk_backup: restored backup piece 1
- channel oem_disk_backup: restore complete, elapsed time: 00:00:03
- Finished recover at 2018-06-22:20:15:32
- Starting backup at 2018-06-22:20:15:33
- channel oem_disk_backup: starting incremental level 1 datafile backup set
- channel oem_disk_backup: specifying datafile(s) in backup set
- input datafile file number=00001 name=+DATA/orcl/datafile/system.256.978643425
- input datafile file number=00002 name=+DATA/orcl/datafile/sysaux.258.978643425
- input datafile file number=00003 name=+DATA/orcl/datafile/undotbs1.259.978643423
- input datafile file number=00005 name=+DATA/orcl/datafile/example.257.978643425
- input datafile file number=00004 name=+DATA/orcl/datafile/users.265.978645015
- input datafile file number=00006 name=+DATA/orcl/datafile/tbs1.267.978952849
- input datafile file number=00007 name=+DATA/orcl/datafile/tbs2.268.978952865
- channel oem_disk_backup: starting piece 1 at 2018-06-22:20:15:34
- channel oem_disk_backup: finished piece 1 at 2018-06-22:20:15:41
- piece handle=+FRA/orcl/backupset/2018_06_22/nnndn1_ora_oem_level_0_0.337.979503335 tag=ORA_OEM_LEVEL_0 comment=NONE
- channel oem_disk_backup: backup set complete, elapsed time: 00:00:07
- Finished backup at 2018-06-22:20:15:41
- Starting Control File and SPFILE Autobackup at 2018-06-22:20:15:41
- piece handle=+FRA/orcl/autobackup/2018_06_22/s_979503341.336.979503341 comment=NONE
- Finished Control File and SPFILE Autobackup at 2018-06-22:20:15:44
- released channel: oem_disk_backup
- allocated channel: oem_sbt_backup1
- channel oem_sbt_backup1: SID=135 device type=SBT_TAPE
- channel oem_sbt_backup1: Oracle Secure Backup
- allocated channel: oem_sbt_backup2
- channel oem_sbt_backup2: SID=140 device type=SBT_TAPE
- channel oem_sbt_backup2: Oracle Secure Backup
- Starting backup at 2018-06-22:20:15:45
- skipping archived log file +FRA/orcl/archivelog/2018_06_16/thread_1_seq_3.346.978944161; already backed up 1 time(s)
- skipping archived log file +FRA/orcl/archivelog/2018_06_19/thread_1_seq_12.267.979244225; already backed up 1 time(s)
- skipping archived log file +FRA/orcl/archivelog/2018_06_20/thread_1_seq_13.354.979330541; already backed up 1 time(s)
- skipping archived log file +FRA/orcl/archivelog/2018_06_21/thread_1_seq_14.338.979416947; already backed up 1 time(s)
- channel oem_sbt_backup1: starting full datafile backup set
- channel oem_sbt_backup1: including datafile copy of datafile 00002 in backup set
- input file name=+FRA/orcl/datafile/sysaux.305.979244161
- channel oem_sbt_backup1: including datafile copy of datafile 00003 in backup set
- input file name=+FRA/orcl/datafile/undotbs1.357.979244187
- channel oem_sbt_backup1: including datafile copy of datafile 00005 in backup set
- input file name=+FRA/orcl/datafile/example.358.979244201
- channel oem_sbt_backup1: starting piece 1 at 2018-06-22:20:15:46
- channel oem_sbt_backup2: starting full datafile backup set
- channel oem_sbt_backup2: including datafile copy of datafile 00001 in backup set
- input file name=+FRA/orcl/datafile/system.304.979244125
- channel oem_sbt_backup2: including datafile copy of datafile 00004 in backup set
- input file name=+FRA/orcl/datafile/users.356.979244217
- channel oem_sbt_backup2: including datafile copy of datafile 00006 in backup set
- input file name=+FRA/orcl/datafile/tbs1.359.979244217
- channel oem_sbt_backup2: including datafile copy of datafile 00007 in backup set
- input file name=+FRA/orcl/datafile/tbs2.352.979244219
- channel oem_sbt_backup2: starting piece 1 at 2018-06-22:20:15:46
- channel oem_sbt_backup2: finished piece 1 at 2018-06-22:20:17:41
- piece handle=3nt6427i_1_1 tag=TAG20180622T201545 comment=API Version 2.0,MMS Version 10.3.0.2
- channel oem_sbt_backup2: backup set complete, elapsed time: 00:01:55
- channel oem_sbt_backup2: input backup set: count=104, stamp=979244220, piece=1
- channel oem_sbt_backup2: starting piece 1 at 2018-06-22:20:17:42
- channel oem_sbt_backup2: backup piece +FRA/orcl/autobackup/2018_06_19/s_979244220.351.979244221
- channel oem_sbt_backup1: finished piece 1 at 2018-06-22:20:18:07
- piece handle=3mt6427h_1_1 tag=TAG20180622T201545 comment=API Version 2.0,MMS Version 10.3.0.2
- channel oem_sbt_backup1: backup set complete, elapsed time: 00:02:21
- channel oem_sbt_backup1: input backup set: count=108, stamp=979330529, piece=1
- channel oem_sbt_backup1: starting piece 1 at 2018-06-22:20:18:07
- channel oem_sbt_backup1: backup piece +FRA/orcl/backupset/2018_06_20/nnndn1_ora_oem_level_0_0.323.979330531
- piece handle=c-1359978017-20180619-00 comment=API Version 2.0,MMS Version 10.3.0.2
- channel oem_sbt_backup2: finished piece 1 at 2018-06-22:20:18:32
- channel oem_sbt_backup2: backup piece complete, elapsed time: 00:00:50
- channel oem_sbt_backup2: input backup set: count=109, stamp=979330536, piece=1
- channel oem_sbt_backup2: starting piece 1 at 2018-06-22:20:18:32
- channel oem_sbt_backup2: backup piece +FRA/orcl/autobackup/2018_06_20/s_979330536.355.979330537
- piece handle=3ct5upf1_1_2 comment=API Version 2.0,MMS Version 10.3.0.2
- channel oem_sbt_backup1: finished piece 1 at 2018-06-22:20:18:57
- channel oem_sbt_backup1: backup piece complete, elapsed time: 00:00:50
- channel oem_sbt_backup1: input backup set: count=112, stamp=979416935, piece=1
- channel oem_sbt_backup1: starting piece 1 at 2018-06-22:20:18:57
- channel oem_sbt_backup1: backup piece +FRA/orcl/backupset/2018_06_21/nnndn1_ora_oem_level_0_0.345.979416935
- piece handle=c-1359978017-20180620-00 comment=API Version 2.0,MMS Version 10.3.0.2
- channel oem_sbt_backup2: finished piece 1 at 2018-06-22:20:19:04
- channel oem_sbt_backup2: backup piece complete, elapsed time: 00:00:32
- channel oem_sbt_backup2: input backup set: count=113, stamp=979416942, piece=1
- channel oem_sbt_backup2: starting piece 1 at 2018-06-22:20:19:04
- channel oem_sbt_backup2: backup piece +FRA/orcl/autobackup/2018_06_21/s_979416942.286.979416943
- piece handle=3gt61dr7_1_2 comment=API Version 2.0,MMS Version 10.3.0.2
- channel oem_sbt_backup1: finished piece 1 at 2018-06-22:20:19:40
- channel oem_sbt_backup1: backup piece complete, elapsed time: 00:00:43
- channel oem_sbt_backup1: input backup set: count=116, stamp=979503333, piece=1
- channel oem_sbt_backup1: starting piece 1 at 2018-06-22:20:19:40
- channel oem_sbt_backup1: backup piece +FRA/orcl/backupset/2018_06_22/nnndn1_ora_oem_level_0_0.337.979503335
- piece handle=c-1359978017-20180621-00 comment=API Version 2.0,MMS Version 10.3.0.2
- channel oem_sbt_backup2: finished piece 1 at 2018-06-22:20:19:43
- channel oem_sbt_backup2: backup piece complete, elapsed time: 00:00:39
- channel oem_sbt_backup2: input backup set: count=117, stamp=979503341, piece=1
- channel oem_sbt_backup2: starting piece 1 at 2018-06-22:20:19:43
- channel oem_sbt_backup2: backup piece +FRA/orcl/autobackup/2018_06_22/s_979503341.336.979503341
- piece handle=3kt64275_1_2 comment=API Version 2.0,MMS Version 10.3.0.2
- channel oem_sbt_backup1: finished piece 1 at 2018-06-22:20:20:28
- channel oem_sbt_backup1: backup piece complete, elapsed time: 00:00:48
- piece handle=c-1359978017-20180622-00 comment=API Version 2.0,MMS Version 10.3.0.2
- channel oem_sbt_backup2: finished piece 1 at 2018-06-22:20:20:28
- channel oem_sbt_backup2: backup piece complete, elapsed time: 00:00:45
- Finished backup at 2018-06-22:20:20:28
- Starting Control File and SPFILE Autobackup at 2018-06-22:20:20:28
- piece handle=c-1359978017-20180622-01 comment=API Version 2.0,MMS Version 10.3.0.2
- Finished Control File and SPFILE Autobackup at 2018-06-22:20:21:03
- released channel: oem_sbt_backup1
- released channel: oem_sbt_backup2
- RMAN> allocate channel for maintenance device type 'SBT_TAPE' parms 'ENV=(OB_MEDIA_FAMILY=station86)';
- allocated channel: ORA_MAINT_SBT_TAPE_1
- channel ORA_MAINT_SBT_TAPE_1: SID=135 device type=SBT_TAPE
- channel ORA_MAINT_SBT_TAPE_1: Oracle Secure Backup
- RMAN> delete noprompt obsolete recovery window of 31 days device type 'SBT_TAPE';
- no obsolete backups found
- RMAN> exit;
- Recovery Manager complete.
复制代码
ASM迁移(学习使用控制文件脚本set 1进行恢复):
- select name from v$datafile;
- select * from v$controlfile;
- select member from v$logfile;
- --------------------------------------
- select * from v$log;
- alter database drop logfile group 1;
- alter database add logfile group 1 '/u01/app/oracle/oradata/orcl/redo01.log' size 50M;
- alter database drop logfile group 2;
- alter database add logfile group 2 '/u01/app/oracle/oradata/orcl/redo02.log' size 50M;
- alter system switch logfile;
- alter system checkpoint;
- alter database drop logfile group 3;
- alter database add logfile group 3 '/u01/app/oracle/oradata/orcl/redo03.log' size 50M;
复制代码- RMAN> run {
- 2> allocate channel c1 device type disk format '/u01/app/oracle/oradata/orcl/system01.dbf';
- 3> backup as copy datafile 1;
- 4> release channel c1;
- 5> allocate channel c1 device type disk format '/u01/app/oracle/oradata/orcl/sysaux01.dbf';
- 6> backup as copy datafile 2;
- 7> release channel c1;
- 8> allocate channel c1 device type disk format '/u01/app/oracle/oradata/orcl/undotbs1.dbf';
- 9> backup as copy datafile 3;
- 10> release channel c1;
- 11> allocate channel c1 device type disk format '/u01/app/oracle/oradata/orcl/users01.dbf';
- 12> backup as copy datafile 4;
- 13> release channel c1;
- 14> allocate channel c1 device type disk format '/u01/app/oracle/oradata/orcl/example01.dbf';
- 15> backup as copy datafile 5;
- 16> release channel c1;
- 17> allocate channel c1 device type disk format '/u01/app/oracle/oradata/orcl/tbs1.dbf';
- 18> backup as copy datafile 6;
- 19> release channel c1;
- 20> allocate channel c1 device type disk format '/u01/app/oracle/oradata/orcl/tbs2.dbf';
- 21> backup as copy datafile 7;
- 22> release channel c1;
- 23> }
复制代码
- [oracle@station86 ~]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.1.0 Production on Fri Jun 22 21:14:30 2018
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- SQL> conn / as sysdba
- Connected.
- SQL> alter database backup controlfile to trace as '/home/oracle/control8c.sql';
- Database altered.
- SQL>
复制代码
set 1 脚本:
- CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS ARCHIVELOG
- MAXLOGFILES 16
- MAXLOGMEMBERS 3
- MAXDATAFILES 100
- MAXINSTANCES 8
- MAXLOGHISTORY 292
- LOGFILE
- GROUP 1 '/u01/app/oracle/oradata/orcl/redo01.log' SIZE 50M BLOCKSIZE 512,
- GROUP 2 '/u01/app/oracle/oradata/orcl/redo02.log' SIZE 50M BLOCKSIZE 512,
- GROUP 3 '/u01/app/oracle/oradata/orcl/redo03.log' SIZE 50M BLOCKSIZE 512
- DATAFILE
- '/u01/app/oracle/oradata/orcl/system01.dbf',
- '/u01/app/oracle/oradata/orcl/sysaux01.dbf',
- '/u01/app/oracle/oradata/orcl/undotbs1.dbf',
- '/u01/app/oracle/oradata/orcl/users01.dbf',
- '/u01/app/oracle/oradata/orcl/example01.dbf',
- '/u01/app/oracle/oradata/orcl/tbs1.dbf',
- '/u01/app/oracle/oradata/orcl/tbs2.dbf'
- CHARACTER SET AL32UTF8
- ;
- -- Configure RMAN configuration record 1
- VARIABLE RECNO NUMBER;
- EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('RETENTION POLICY','TO RECOVERY WINDOW OF 1 DAYS');
- -- Configure RMAN configuration record 2
- VARIABLE RECNO NUMBER;
- EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('BACKUP OPTIMIZATION','ON');
- -- Configure RMAN configuration record 3
- VARIABLE RECNO NUMBER;
- EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CONTROLFILE AUTOBACKUP','ON');
- -- Configure RMAN configuration record 4
- VARIABLE RECNO NUMBER;
- EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('DEVICE TYPE','DISK PARALLELISM 8 BACKUP TYPE TO BACKUPSET');
- -- Configure RMAN configuration record 5
- VARIABLE RECNO NUMBER;
- EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('DEFAULT DEVICE TYPE TO','DISK');
- -- Configure RMAN configuration record 6
- VARIABLE RECNO NUMBER;
- EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('DEVICE TYPE','''SBT_TAPE'' PARALLELISM 2 BACKUP TYPE TO BACKUPSET');
- -- Configure RMAN configuration record 7
- VARIABLE RECNO NUMBER;
- EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CHANNEL','1 DEVICE TYPE ''SBT_TAPE'' PARMS ''ENV=(OB_MEDIA_FAMILY=station86)''');
- -- Configure RMAN configuration record 8
- VARIABLE RECNO NUMBER;
- EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CHANNEL','2 DEVICE TYPE ''SBT_TAPE'' PARMS ''ENV=(OB_MEDIA_FAMILY=station86)''');
- -- Configure RMAN configuration record 9
- VARIABLE RECNO NUMBER;
- EXECUTE :RECNO := SYS.DBMS_BACKUP_RESTORE.SETCONFIG('CHANNEL','DEVICE TYPE ''SBT_TAPE'' PARMS ''ENV=(OB_MEDIA_FAMILY=station86)''');
复制代码
|
|