Backing Up Archived Redo Logs

Realizando o backup de todos os archived logs (como backupset e copy image):

[oracle@oel8 ~]$ rman target /
 
Recovery Manager: Release 18.0.0.0.0 - Production on Mon Mar 15 10:37:19 2021
Version 18.3.0.0.0
 
Copyright (c) 1982, 2018, Oracle and/or its affiliates.  All rights reserved.
 
connected to target database: RMANDB (DBID=3825250984)
 
RMAN> BACKUP ARCHIVELOG ALL;
 
Starting backup at 2021-03-15:10:40:59
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=71 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=12 RECID=1 STAMP=1036965361
input archived log thread=1 sequence=13 RECID=2 STAMP=1039373324
input archived log thread=1 sequence=14 RECID=3 STAMP=1039385578
input archived log thread=1 sequence=15 RECID=4 STAMP=1039730500
input archived log thread=1 sequence=16 RECID=5 STAMP=1039730621
input archived log thread=1 sequence=17 RECID=6 STAMP=1039730703
input archived log thread=1 sequence=18 RECID=7 STAMP=1041720392
input archived log thread=1 sequence=19 RECID=8 STAMP=1065592715
input archived log thread=1 sequence=20 RECID=9 STAMP=1065710266
input archived log thread=1 sequence=21 RECID=10 STAMP=1065714954
input archived log thread=1 sequence=22 RECID=11 STAMP=1065717962
input archived log thread=1 sequence=23 RECID=12 STAMP=1066831250
input archived log thread=1 sequence=24 RECID=13 STAMP=1066972921
input archived log thread=1 sequence=25 RECID=14 STAMP=1066977292
input archived log thread=1 sequence=26 RECID=15 STAMP=1066977317
input archived log thread=1 sequence=27 RECID=16 STAMP=1067251262
channel ORA_DISK_1: starting piece 1 at 2021-03-15:10:41:04
channel ORA_DISK_1: finished piece 1 at 2021-03-15:10:41:39
piece handle=/oracle/fra/RMANDB/backupset/2021_03_15/o1_mf_annnn_TAG20210315T104104_j4yrzjob_.bkp tag=TAG20210315T104104 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
Finished backup at 2021-03-15:10:41:39
 
Starting Control File and SPFILE Autobackup at 2021-03-15:10:41:39
piece handle=/oracle/fra/RMANDB/autobackup/2021_03_15/o1_mf_s_1067251299_j4ys0nyo_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2021-03-15:10:41:42
 
RMAN>
RMAN> BACKUP AS COPY ARCHIVELOG ALL;
 
Starting backup at 2021-03-15:10:42:35
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=20 RECID=9 STAMP=1065710266
output file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_20_j4ys2cvs_.arc RECID=18 STAMP=1067251357
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=18 RECID=7 STAMP=1041720392
output file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_18_j4ys2gyj_.arc RECID=19 STAMP=1067251360
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=19 RECID=8 STAMP=1065592715
output file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_19_j4ys2l37_.arc RECID=20 STAMP=1067251363
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=15 RECID=4 STAMP=1039730500
output file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_15_j4ys2o7s_.arc RECID=21 STAMP=1067251366
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=12 RECID=1 STAMP=1036965361
output file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_12_j4ys2rq4_.arc RECID=22 STAMP=1067251370
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=23 RECID=12 STAMP=1066831250
output file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_23_j4ys2vt1_.arc RECID=23 STAMP=1067251373
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=22 RECID=11 STAMP=1065717962
output file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_22_j4ys2z32_.arc RECID=24 STAMP=1067251376
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=17 RECID=6 STAMP=1039730703
output file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_17_j4ys32g6_.arc RECID=25 STAMP=1067251380
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=14 RECID=3 STAMP=1039385578
output file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_14_j4ys35g5_.arc RECID=26 STAMP=1067251382
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=16 RECID=5 STAMP=1039730621
output file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_16_j4ys38ml_.arc RECID=27 STAMP=1067251386
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=21 RECID=10 STAMP=1065714954
output file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_21_j4ys3crh_.arc RECID=28 STAMP=1067251389
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=27 RECID=16 STAMP=1067251262
output file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_27_j4ys3gvm_.arc RECID=29 STAMP=1067251392
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=13 RECID=2 STAMP=1039373324
output file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_13_j4ys3l2j_.arc RECID=30 STAMP=1067251395
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=24 RECID=13 STAMP=1066972921
output file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_24_j4ys3o6t_.arc RECID=31 STAMP=1067251397
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=25 RECID=14 STAMP=1066977292
output file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_25_j4ys3p9r_.arc RECID=32 STAMP=1067251398
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=26 RECID=15 STAMP=1066977317
output file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_26_j4ys3qgj_.arc RECID=33 STAMP=1067251399
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=28 RECID=17 STAMP=1067251355
output file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_28_j4ys3rmf_.arc RECID=34 STAMP=1067251400
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 2021-03-15:10:43:21
 
Starting Control File and SPFILE Autobackup at 2021-03-15:10:43:21
piece handle=/oracle/fra/RMANDB/autobackup/2021_03_15/o1_mf_s_1067251401_j4ys3t95_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2021-03-15:10:43:24
 
RMAN>

Deletando arquivos de backup:

RMAN> DELETE BACKUPSET OF ARCHIVELOG ALL;
 
using channel ORA_DISK_1
 
List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
37      37      1   1   AVAILABLE   DISK        /oracle/fra/RMANDB/backupset/2021_03_15/o1_mf_annnn_TAG20210315T104104_j4yrzjob_.bkp
 
Do you really want to delete the above objects (enter YES or NO)? YES
deleted backup piece
backup piece handle=/oracle/fra/RMANDB/backupset/2021_03_15/o1_mf_annnn_TAG20210315T104104_j4yrzjob_.bkp RECID=37 STAMP=1067251264
Deleted 1 objects
 
 
RMAN> DELETE COPY OF ARCHIVELOG ALL;
 
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=71 device type=DISK
List of Archived Log Copies for database with db_unique_name RMANDB
=====================================================================
 
Key     Thrd Seq     S Low Time
------- ---- ------- - -------------------
22      1    12      A 2020-04-05:21:52:19
        Name: /oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_12_j4ys2rq4_.arc
 
30      1    13      A 2020-04-05:21:56:00
        Name: /oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_13_j4ys3l2j_.arc
 
26      1    14      A 2020-05-02:18:48:42
        Name: /oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_14_j4ys35g5_.arc
 
21      1    15      A 2020-05-02:22:12:55
        Name: /oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_15_j4ys2o7s_.arc
 
27      1    16      A 2020-05-06:22:01:37
        Name: /oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_16_j4ys38ml_.arc
 
25      1    17      A 2020-05-06:22:03:38
        Name: /oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_17_j4ys32g6_.arc
 
19      1    18      A 2020-05-06:22:05:00
        Name: /oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_18_j4ys2gyj_.arc
 
7       1    18      A 2020-05-06:22:05:00
        Name: /oracle/archives/1_18_1036964654.dbf
 
20      1    19      A 2020-05-29:22:46:30
        Name: /oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_19_j4ys2l37_.arc
 
8       1    19      A 2020-05-29:22:46:30
        Name: /oracle/archives/1_19_1036964654.dbf
 
18      1    20      A 2021-02-27:05:58:32
        Name: /oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_20_j4ys2cvs_.arc
 
9       1    20      A 2021-02-27:05:58:32
        Name: /oracle/archives/1_20_1036964654.dbf
 
28      1    21      A 2021-02-28:14:37:43
        Name: /oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_21_j4ys3crh_.arc
 
10      1    21      A 2021-02-28:14:37:43
        Name: /oracle/archives/1_21_1036964654.dbf
 
24      1    22      A 2021-02-28:15:55:52
        Name: /oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_22_j4ys2z32_.arc
 
11      1    22      A 2021-02-28:15:55:52
        Name: /oracle/archives/1_22_1036964654.dbf
 
23      1    23      A 2021-02-28:16:46:00
        Name: /oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_23_j4ys2vt1_.arc
 
12      1    23      A 2021-02-28:16:46:00
        Name: /oracle/archives/1_23_1036964654.dbf
 
31      1    24      A 2021-03-10:14:00:47
        Name: /oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_24_j4ys3o6t_.arc
 
13      1    24      A 2021-03-10:14:00:47
        Name: /oracle/archives/1_24_1036964654.dbf
 
32      1    25      A 2021-03-12:05:21:59
        Name: /oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_25_j4ys3p9r_.arc
 
14      1    25      A 2021-03-12:05:21:59
        Name: /oracle/archives/1_25_1036964654.dbf
 
33      1    26      A 2021-03-12:06:34:52
        Name: /oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_26_j4ys3qgj_.arc
 
15      1    26      A 2021-03-12:06:34:52
        Name: /oracle/archives/1_26_1036964654.dbf
 
29      1    27      A 2021-03-12:06:35:17
        Name: /oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_27_j4ys3gvm_.arc
 
16      1    27      A 2021-03-12:06:35:17
        Name: /oracle/archives/1_27_1036964654.dbf
 
34      1    28      A 2021-03-15:10:40:59
        Name: /oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_28_j4ys3rmf_.arc
 
17      1    28      A 2021-03-15:10:40:59
        Name: /oracle/archives/1_28_1036964654.dbf
 
 
Do you really want to delete the above objects (enter YES or NO)? YES
deleted archived log
archived log file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_12_j4ys2rq4_.arc RECID=22 STAMP=1067251370
deleted archived log
archived log file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_13_j4ys3l2j_.arc RECID=30 STAMP=1067251395
deleted archived log
archived log file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_14_j4ys35g5_.arc RECID=26 STAMP=1067251382
deleted archived log
archived log file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_15_j4ys2o7s_.arc RECID=21 STAMP=1067251366
deleted archived log
archived log file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_16_j4ys38ml_.arc RECID=27 STAMP=1067251386
deleted archived log
archived log file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_17_j4ys32g6_.arc RECID=25 STAMP=1067251380
deleted archived log
archived log file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_18_j4ys2gyj_.arc RECID=19 STAMP=1067251360
deleted archived log
archived log file name=/oracle/archives/1_18_1036964654.dbf RECID=7 STAMP=1041720392
deleted archived log
archived log file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_19_j4ys2l37_.arc RECID=20 STAMP=1067251363
deleted archived log
archived log file name=/oracle/archives/1_19_1036964654.dbf RECID=8 STAMP=1065592715
deleted archived log
archived log file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_20_j4ys2cvs_.arc RECID=18 STAMP=1067251357
deleted archived log
archived log file name=/oracle/archives/1_20_1036964654.dbf RECID=9 STAMP=1065710266
deleted archived log
archived log file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_21_j4ys3crh_.arc RECID=28 STAMP=1067251389
deleted archived log
archived log file name=/oracle/archives/1_21_1036964654.dbf RECID=10 STAMP=1065714954
deleted archived log
archived log file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_22_j4ys2z32_.arc RECID=24 STAMP=1067251376
deleted archived log
archived log file name=/oracle/archives/1_22_1036964654.dbf RECID=11 STAMP=1065717962
deleted archived log
archived log file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_23_j4ys2vt1_.arc RECID=23 STAMP=1067251373
deleted archived log
archived log file name=/oracle/archives/1_23_1036964654.dbf RECID=12 STAMP=1066831250
deleted archived log
archived log file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_24_j4ys3o6t_.arc RECID=31 STAMP=1067251397
deleted archived log
archived log file name=/oracle/archives/1_24_1036964654.dbf RECID=13 STAMP=1066972921
deleted archived log
archived log file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_25_j4ys3p9r_.arc RECID=32 STAMP=1067251398
deleted archived log
archived log file name=/oracle/archives/1_25_1036964654.dbf RECID=14 STAMP=1066977292
deleted archived log
archived log file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_26_j4ys3qgj_.arc RECID=33 STAMP=1067251399
deleted archived log
archived log file name=/oracle/archives/1_26_1036964654.dbf RECID=15 STAMP=1066977317
deleted archived log
archived log file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_27_j4ys3gvm_.arc RECID=29 STAMP=1067251392
deleted archived log
archived log file name=/oracle/archives/1_27_1036964654.dbf RECID=16 STAMP=1067251262
deleted archived log
archived log file name=/oracle/fra/RMANDB/archivelog/2021_03_15/o1_mf_1_28_j4ys3rmf_.arc RECID=34 STAMP=1067251400
deleted archived log
archived log file name=/oracle/archives/1_28_1036964654.dbf RECID=17 STAMP=1067251355
Deleted 28 objects
 
 
RMAN>

Neste ponto, farei o backup dos archived logs utilizando o SCN como parâmetro:

RMAN> BACKUP ARCHIVELOG FROM SCN 1821271;
 
Starting backup at 2021-03-15:10:53:22
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=34 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=29 RECID=35 STAMP=1067251785
input archived log thread=1 sequence=30 RECID=36 STAMP=1067251787
input archived log thread=1 sequence=31 RECID=37 STAMP=1067251790
input archived log thread=1 sequence=32 RECID=38 STAMP=1067251791
input archived log thread=1 sequence=33 RECID=39 STAMP=1067251791
input archived log thread=1 sequence=34 RECID=40 STAMP=1067252003
channel ORA_DISK_1: starting piece 1 at 2021-03-15:10:53:23
channel ORA_DISK_1: finished piece 1 at 2021-03-15:10:53:24
piece handle=/oracle/fra/RMANDB/backupset/2021_03_15/o1_mf_annnn_TAG20210315T105323_j4yspmn7_.bkp tag=TAG20210315T105323 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2021-03-15:10:53:24
 
Starting Control File and SPFILE Autobackup at 2021-03-15:10:53:24
piece handle=/oracle/fra/RMANDB/autobackup/2021_03_15/o1_mf_s_1067252004_j4yspo7t_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2021-03-15:10:53:25
 
RMAN>
RMAN> BACKUP ARCHIVELOG FROM SCN 1821271 UNTIL SCN 1822035;
 
Starting backup at 2021-03-15:10:54:08
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=29 RECID=35 STAMP=1067251785
input archived log thread=1 sequence=30 RECID=36 STAMP=1067251787
channel ORA_DISK_1: starting piece 1 at 2021-03-15:10:54:09
channel ORA_DISK_1: finished piece 1 at 2021-03-15:10:54:10
piece handle=/oracle/fra/RMANDB/backupset/2021_03_15/o1_mf_annnn_TAG20210315T105408_j4ysr11w_.bkp tag=TAG20210315T105408 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2021-03-15:10:54:10
 
Starting Control File and SPFILE Autobackup at 2021-03-15:10:54:10
piece handle=/oracle/fra/RMANDB/autobackup/2021_03_15/o1_mf_s_1067252050_j4ysr2or_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2021-03-15:10:54:13
 
RMAN>
RMAN> BACKUP ARCHIVELOG UNTIL SCN 1822032;
 
Starting backup at 2021-03-15:10:54:52
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=29 RECID=35 STAMP=1067251785
channel ORA_DISK_1: starting piece 1 at 2021-03-15:10:54:52
channel ORA_DISK_1: finished piece 1 at 2021-03-15:10:54:53
piece handle=/oracle/fra/RMANDB/backupset/2021_03_15/o1_mf_annnn_TAG20210315T105452_j4yssdpk_.bkp tag=TAG20210315T105452 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2021-03-15:10:54:53
 
Starting Control File and SPFILE Autobackup at 2021-03-15:10:54:53
piece handle=/oracle/fra/RMANDB/autobackup/2021_03_15/o1_mf_s_1067252093_j4yssg88_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2021-03-15:10:54:56
 
RMAN>
RMAN> BACKUP ARCHIVELOG SCN BETWEEN 1821271 AND 1822035;
 
Starting backup at 2021-03-15:10:55:36
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=29 RECID=35 STAMP=1067251785
input archived log thread=1 sequence=30 RECID=36 STAMP=1067251787
channel ORA_DISK_1: starting piece 1 at 2021-03-15:10:55:36
channel ORA_DISK_1: finished piece 1 at 2021-03-15:10:55:37
piece handle=/oracle/fra/RMANDB/backupset/2021_03_15/o1_mf_annnn_TAG20210315T105536_j4ystrhy_.bkp tag=TAG20210315T105536 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2021-03-15:10:55:37
 
Starting Control File and SPFILE Autobackup at 2021-03-15:10:55:37
piece handle=/oracle/fra/RMANDB/autobackup/2021_03_15/o1_mf_s_1067252137_j4ystt1x_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2021-03-15:10:55:40

Também podemos realizar os backups utilizando o parâmetro SEQUENCE, como nos exemplos abaixo:

RMAN> BACKUP ARCHIVELOG FROM SEQUENCE 29;
 
Starting backup at 2021-03-15:10:58:42
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=29 RECID=35 STAMP=1067251785
input archived log thread=1 sequence=30 RECID=36 STAMP=1067251787
input archived log thread=1 sequence=31 RECID=37 STAMP=1067251790
input archived log thread=1 sequence=32 RECID=38 STAMP=1067251791
input archived log thread=1 sequence=33 RECID=39 STAMP=1067251791
input archived log thread=1 sequence=34 RECID=40 STAMP=1067252003
input archived log thread=1 sequence=35 RECID=41 STAMP=1067252322
channel ORA_DISK_1: starting piece 1 at 2021-03-15:10:58:42
channel ORA_DISK_1: finished piece 1 at 2021-03-15:10:58:43
piece handle=/oracle/fra/RMANDB/backupset/2021_03_15/o1_mf_annnn_TAG20210315T105842_j4yt0lq2_.bkp tag=TAG20210315T105842 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2021-03-15:10:58:43
 
Starting Control File and SPFILE Autobackup at 2021-03-15:10:58:43
piece handle=/oracle/fra/RMANDB/autobackup/2021_03_15/o1_mf_s_1067252323_j4yt0n94_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2021-03-15:10:58:44
RMAN> BACKUP ARCHIVELOG FROM SEQUENCE 29 UNTIL SEQUENCE 30;
 
Starting backup at 2021-03-15:11:00:20
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=29 RECID=35 STAMP=1067251785
input archived log thread=1 sequence=30 RECID=36 STAMP=1067251787
channel ORA_DISK_1: starting piece 1 at 2021-03-15:11:00:20
channel ORA_DISK_1: finished piece 1 at 2021-03-15:11:00:21
piece handle=/oracle/fra/RMANDB/backupset/2021_03_15/o1_mf_annnn_TAG20210315T110020_j4yt3nln_.bkp tag=TAG20210315T110020 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2021-03-15:11:00:21
 
Starting Control File and SPFILE Autobackup at 2021-03-15:11:00:21
piece handle=/oracle/fra/RMANDB/autobackup/2021_03_15/o1_mf_s_1067252421_j4yt3pn3_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2021-03-15:11:00:24
RMAN> BACKUP ARCHIVELOG SEQUENCE BETWEEN 29 AND 32;
 
Starting backup at 2021-03-15:11:00:48
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=29 RECID=35 STAMP=1067251785
input archived log thread=1 sequence=30 RECID=36 STAMP=1067251787
input archived log thread=1 sequence=31 RECID=37 STAMP=1067251790
input archived log thread=1 sequence=32 RECID=38 STAMP=1067251791
channel ORA_DISK_1: starting piece 1 at 2021-03-15:11:00:48
channel ORA_DISK_1: finished piece 1 at 2021-03-15:11:00:49
piece handle=/oracle/fra/RMANDB/backupset/2021_03_15/o1_mf_annnn_TAG20210315T110048_j4yt4jj9_.bkp tag=TAG20210315T110048 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2021-03-15:11:00:49
 
Starting Control File and SPFILE Autobackup at 2021-03-15:11:00:49
piece handle=/oracle/fra/RMANDB/autobackup/2021_03_15/o1_mf_s_1067252449_j4yt4l52_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2021-03-15:11:00:50

Também podemos usar o recurso de datas:

RMAN> BACKUP ARCHIVELOG FROM TIME 'SYSDATE-1';
 
Starting backup at 2021-03-15:11:01:49
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=29 RECID=35 STAMP=1067251785
input archived log thread=1 sequence=30 RECID=36 STAMP=1067251787
input archived log thread=1 sequence=31 RECID=37 STAMP=1067251790
input archived log thread=1 sequence=32 RECID=38 STAMP=1067251791
input archived log thread=1 sequence=33 RECID=39 STAMP=1067251791
input archived log thread=1 sequence=34 RECID=40 STAMP=1067252003
input archived log thread=1 sequence=35 RECID=41 STAMP=1067252322
input archived log thread=1 sequence=36 RECID=42 STAMP=1067252510
channel ORA_DISK_1: starting piece 1 at 2021-03-15:11:01:50
channel ORA_DISK_1: finished piece 1 at 2021-03-15:11:01:51
piece handle=/oracle/fra/RMANDB/backupset/2021_03_15/o1_mf_annnn_TAG20210315T110150_j4yt6g8q_.bkp tag=TAG20210315T110150 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2021-03-15:11:01:51
 
Starting Control File and SPFILE Autobackup at 2021-03-15:11:01:51
piece handle=/oracle/fra/RMANDB/autobackup/2021_03_15/o1_mf_s_1067252511_j4yt6j2k_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2021-03-15:11:01:52
RMAN> BACKUP ARCHIVELOG UNTIL TIME "TO_DATE('16/03/2021', 'DD/MM/YYYY')";
 
Starting backup at 2021-03-15:11:03:07
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=29 RECID=35 STAMP=1067251785
input archived log thread=1 sequence=30 RECID=36 STAMP=1067251787
input archived log thread=1 sequence=31 RECID=37 STAMP=1067251790
input archived log thread=1 sequence=32 RECID=38 STAMP=1067251791
input archived log thread=1 sequence=33 RECID=39 STAMP=1067251791
input archived log thread=1 sequence=34 RECID=40 STAMP=1067252003
input archived log thread=1 sequence=35 RECID=41 STAMP=1067252322
input archived log thread=1 sequence=36 RECID=42 STAMP=1067252510
channel ORA_DISK_1: starting piece 1 at 2021-03-15:11:03:07
channel ORA_DISK_1: finished piece 1 at 2021-03-15:11:03:08
piece handle=/oracle/fra/RMANDB/backupset/2021_03_15/o1_mf_annnn_TAG20210315T110307_j4yt8vfw_.bkp tag=TAG20210315T110307 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2021-03-15:11:03:08
 
Starting Control File and SPFILE Autobackup at 2021-03-15:11:03:08
piece handle=/oracle/fra/RMANDB/autobackup/2021_03_15/o1_mf_s_1067252588_j4yt8x06_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2021-03-15:11:03:09

Por fim, também é possível realizar o backup dos archivelogs no mesmo comando de backup do banco de dados. Nos bastidores, o Oracle executa um “ALTER SYSTEM ARCHIVE LOG CURRENT;”, depois um “BACKUP ARCHIVELOG ALL;”, realiza o backup solicitado do banco (por exemplo BACKUP DATABASE) e por fim um “ALTER SYSTEM ARCHIVE LOG CURRENT;” é executado e os archives restantes são contemplados no backup. Vide exemplo abaixo:

RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
 
 
Starting backup at 2021-03-15:11:05:55
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=29 RECID=35 STAMP=1067251785
input archived log thread=1 sequence=30 RECID=36 STAMP=1067251787
input archived log thread=1 sequence=31 RECID=37 STAMP=1067251790
input archived log thread=1 sequence=32 RECID=38 STAMP=1067251791
input archived log thread=1 sequence=33 RECID=39 STAMP=1067251791
input archived log thread=1 sequence=34 RECID=40 STAMP=1067252003
input archived log thread=1 sequence=35 RECID=41 STAMP=1067252322
input archived log thread=1 sequence=36 RECID=42 STAMP=1067252510
input archived log thread=1 sequence=37 RECID=43 STAMP=1067252755
channel ORA_DISK_1: starting piece 1 at 2021-03-15:11:05:55
channel ORA_DISK_1: finished piece 1 at 2021-03-15:11:05:56
piece handle=/oracle/fra/RMANDB/backupset/2021_03_15/o1_mf_annnn_TAG20210315T110555_j4ytg3vn_.bkp tag=TAG20210315T110555 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2021-03-15:11:05:56
 
Starting backup at 2021-03-15:11:05:57
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oracle/dados/RMANDB/datafile/o1_mf_system_h8nynqfx_.dbf
input datafile file number=00003 name=/oracle/dados/RMANDB/datafile/o1_mf_sysaux_h8nyq35q_.dbf
input datafile file number=00004 name=/oracle/dados/RMANDB/datafile/o1_mf_undotbs1_h8nyrjdr_.dbf
input datafile file number=00005 name=/oracle/dados/RMANDB/datafile/ts_cortex_catalog.dbf
input datafile file number=00007 name=/oracle/dados/RMANDB/datafile/o1_mf_users_h8nyrkn7_.dbf
channel ORA_DISK_1: starting piece 1 at 2021-03-15:11:05:57
channel ORA_DISK_1: finished piece 1 at 2021-03-15:11:07:02
piece handle=/oracle/fra/RMANDB/backupset/2021_03_15/o1_mf_nnndf_TAG20210315T110557_j4ytg5bd_.bkp tag=TAG20210315T110557 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:05
Finished backup at 2021-03-15:11:07:02
 
Starting backup at 2021-03-15:11:07:02
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=38 RECID=44 STAMP=1067252822
channel ORA_DISK_1: starting piece 1 at 2021-03-15:11:07:02
channel ORA_DISK_1: finished piece 1 at 2021-03-15:11:07:03
piece handle=/oracle/fra/RMANDB/backupset/2021_03_15/o1_mf_annnn_TAG20210315T110702_j4ytj6gv_.bkp tag=TAG20210315T110702 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2021-03-15:11:07:03
 
Starting Control File and SPFILE Autobackup at 2021-03-15:11:07:03
piece handle=/oracle/fra/RMANDB/autobackup/2021_03_15/o1_mf_s_1067252823_j4ytj85h_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2021-03-15:11:07:06

Caso queiramos que todos os archivelogs sejam removidos após o backup, basta adicionar o parâmetro DELETE ALL INPUT:

RMAN> BACKUP ARCHIVELOG ALL DELETE ALL INPUT;
 
Starting backup at 2021-03-15:11:08:58
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=29 RECID=35 STAMP=1067251785
input archived log thread=1 sequence=30 RECID=36 STAMP=1067251787
input archived log thread=1 sequence=31 RECID=37 STAMP=1067251790
input archived log thread=1 sequence=32 RECID=38 STAMP=1067251791
input archived log thread=1 sequence=33 RECID=39 STAMP=1067251791
input archived log thread=1 sequence=34 RECID=40 STAMP=1067252003
input archived log thread=1 sequence=35 RECID=41 STAMP=1067252322
input archived log thread=1 sequence=36 RECID=42 STAMP=1067252510
input archived log thread=1 sequence=37 RECID=43 STAMP=1067252755
input archived log thread=1 sequence=38 RECID=44 STAMP=1067252822
input archived log thread=1 sequence=39 RECID=45 STAMP=1067252938
channel ORA_DISK_1: starting piece 1 at 2021-03-15:11:08:58
channel ORA_DISK_1: finished piece 1 at 2021-03-15:11:08:59
piece handle=/oracle/fra/RMANDB/backupset/2021_03_15/o1_mf_annnn_TAG20210315T110858_j4ytmtkx_.bkp tag=TAG20210315T110858 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/oracle/archives/1_29_1036964654.dbf RECID=35 STAMP=1067251785
archived log file name=/oracle/archives/1_30_1036964654.dbf RECID=36 STAMP=1067251787
archived log file name=/oracle/archives/1_31_1036964654.dbf RECID=37 STAMP=1067251790
archived log file name=/oracle/archives/1_32_1036964654.dbf RECID=38 STAMP=1067251791
archived log file name=/oracle/archives/1_33_1036964654.dbf RECID=39 STAMP=1067251791
archived log file name=/oracle/archives/1_34_1036964654.dbf RECID=40 STAMP=1067252003
archived log file name=/oracle/archives/1_35_1036964654.dbf RECID=41 STAMP=1067252322
archived log file name=/oracle/archives/1_36_1036964654.dbf RECID=42 STAMP=1067252510
archived log file name=/oracle/archives/1_37_1036964654.dbf RECID=43 STAMP=1067252755
archived log file name=/oracle/archives/1_38_1036964654.dbf RECID=44 STAMP=1067252822
archived log file name=/oracle/archives/1_39_1036964654.dbf RECID=45 STAMP=1067252938
Finished backup at 2021-03-15:11:08:59
 
Starting Control File and SPFILE Autobackup at 2021-03-15:11:08:59
piece handle=/oracle/fra/RMANDB/autobackup/2021_03_15/o1_mf_s_1067252939_j4ytmwkl_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 2021-03-15:11:09:02

Obs: Este procedimento foi criado pelo senhor Ahmed Baraka (www.ahmedbaraka.com) e foi apenas reproduzido por mim em um laboratório pessoal para fins de aprendizado.

Leave a Comment

Your email address will not be published.