ZDLRA, Manual Clone to Tape

In my previous post, I showed how the clone to tape occurs for ZDLRA. But as explained, the clones occur through the scheduler and follow some rules. For full backup, as an example, it clones the last available.

But sometimes,  it is needed to call the clone for some specific backup, maybe to do long-term storage to follow some regimentation/law. And if we leverage this for the clone, jobs can maybe take to long, or clone more that you need.

Manual Clone

It is possible to clone one backup piece directly using CLI at ZDLRA. But we need to specify backup piece per backup piece since the parameter is the bp_key. But before clone, I recommend identifying some important things.

The first is the database key inside the rman catalog. A simple list db_unique_name show this:

RMAN> list db_unique_name of database ORCL18C;


List of Databases
DB Key  DB Name  DB ID            Database Role    Db_unique_name
------- ------- ----------------- ---------------  ------------------
15993   ORCL18C  558466555        PRIMARY          ORCL18C

RMAN>

The second is to identify the backupset and the backup piece that you need to clone. In this case, I picked up one from SYSTEM tablespace:

RMAN> list backupset 16512;


List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
16512   Incr 0  330.35M    SBT_TAPE    00:03:03     02/02/2020 16:12:04
        BP Key: 16513   Status: AVAILABLE  Compressed: YES  Tag: BKP-DB-INC0
        Handle: VB$_1891149551_16507I   Media:
  List of Datafiles in backup set 16512
  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- ------------------- ----------- ------ ----
  1    0  Incr 1909028    02/02/2020 16:09:01              NO    /u01/app/oracle/oradata/ORCL18C/system01.dbf

RMAN>

Other are related inside ZDLRA database and are the protection policy linked with the database doing select over ra_database table:

SQL> select policy_name, db_key, db_unique_name from ra_database where db_unique_name = 'ORCL18C';

POLICY_NAME                                            DB_KEY DB_UNIQUE_NAME
-------------------------------------------------- ---------- --------------------------------
ZDLRA_ONLY_TAPE                                         15993 ORCL18C

SQL>

And to finish it needed to discover the template it is associated with the protection policy:

SQL> set linesize 250
SQL> col LIB_NAME format a30
SQL> col TEMPLATE_NAME format a50
SQL> col LAST_SCHEDULE_TIME format a35
SQL> col POLICY_NAME format a50
SQL> select TEMPLATE_NAME, BACKUP_TYPE, LAST_SCHEDULE_TIME, LIB_NAME, DB_UNIQUE_NAME, POLICY_NAME FROM RA_SBT_JOB WHERE LIB_NAME = 'OSBSBT' and POLICY_NAME = 'ZDLRA_ONLY_TAPE' ;

TEMPLATE_NAME                                      BACKUP_TYPE      LAST_SCHEDULE_TIME                  LIB_NAME                       DB_UNIQUE_NAME                 POLICY_NAME
-------------------------------------------------- ---------------- ----------------------------------- ------------------------------ ------------------------------ --------------------------------------------------
ONLYTAPE_FULL_ARCH                                 FULL, ARCH       02-FEB-20 04.40.37.077769 PM +01:00 OSBSBT                                                        ZDLRA_ONLY_TAPE
ONLYTAPE_ARCH                                      ARCH                                                 OSBSBT                                                        ZDLRA_ONLY_TAPE

SQL>

COPY_BACKUP_PIECE

The information collected before it is important because it is needed to use the DBMS_RA.COPY_BACKUP_PIECE procedure.

The parameter for the usage:

  • BP_KEY: Backup piece key that will be cloned.
  • FORMAT: Format to create the name for the backup. It follows the same format as RMAN (including the same wildcards).
  • TEMPLATE_NAME: The template that will be used to clone to tape. This is how ZDLRA discover the library and attributes for the clone.

So, to clone we just need to execute at ZDLRA:

SQL> BEGIN
  2      DBMS_RA.COPY_BACKUP_PIECE(
  3          BP_KEY => 16513,
  4          FORMAT => 'RA_SBT_ORCL18C_16512_16513_%U',
  5          TEMPLATE_NAME => 'ONLYTAPE_FULL_ARCH'
  6      );
  7  END;
  8  /

PL/SQL procedure successfully completed.

SQL>

Important there is the FORMAT. Look that that I used RA_SBT in the beginning to follow the same used by the normal clone to the tape of ZDLRA, after I added the DB_UNIQUE_NAME, with <BS_KEY>_<BP_KEY>, and %U to generate a unique name.

If we look internally, the backup was scheduled:

SQL> SELECT TASK_ID, STATE, DB_UNIQUE_NAME, ERROR_TEXT, BS_KEY, PIECE# FROM RA_SBT_TASK WHERE LIB_NAME = 'OSBSBT' AND  DB_UNIQUE_NAME = 'ORCL18C' and BS_KEY = 16512;

   TASK_ID STATE                DB_UNIQUE_NAME                 ERROR_TEXT                                             BS_KEY     PIECE#
---------- -------------------- ------------------------------ -------------------------------------------------- ---------- ----------
     33857 EXECUTABLE           ORCL18C                                                                                16512          1

SQL>

And OSB executed it:

[root@zdlras1n1 ~]# obtool lsjob
Job ID           Sched time  Contents                       State
---------------- ----------- ------------------------------ ---------------------------------------
oracle/42        none        database ORCL18C (dbid=558466555) processed; Oracle job(s) scheduled
oracle/42.1      none        datafile backup                running since 2020/02/02.20:48
[root@zdlras1n1 ~]#
[root@zdlras1n1 ~]# cat /usr/etc/ob/xcr/oracle@42.1
[4100000001]2020/02/02.20:48:35 ______________________________________________________________________
[4100000001]2020/02/02.20:48:35
[4100000002]2020/02/02.20:48:35         Transcript for job oracle/42.1 running on zdlras1n1
[4100000002]2020/02/02.20:48:35
[1100000003]2020/02/02.20:48:35 (amh)  qdv__automount_in_mh entered
[1100000004]2020/02/02.20:48:35 (amh)  qdv__automount_in_mh tape03 at 2020/02/02.20:48:35, flags 0x100
[1100000005]2020/02/02.20:48:35 (amh)  mount volume options list contains:
[1100000006]2020/02/02.20:48:35 (amh)     vtype 3 (app), vid (null), vs_create 0, family zdlras1-osbmf, retain (null), size 0, mediainfo 2, scratch 0
[1100000007]2020/02/02.20:48:36 (amh)  don't preserve previous mh automount state
[1100000008]2020/02/02.20:48:36 (gep)  getting reservation for element 0x3 (dte)
[1100000009]2020/02/02.20:48:36 (una)  unload_anywhere entered
[110000000A]2020/02/02.20:48:36 (amh) attempting automount with lm based volume selection
[110000000B]2020/02/02.20:48:36 (ulg)  1,(lm_amh)  beginning pass 1, mediainfo pass 1 at 2020/02/02.20:48:36
[110000000C]2020/02/02.20:48:36 (ulg)  1,(lm_amh)    1 no vid
[110000000D]2020/02/02.20:48:36 (ulg)  1,(lm_amh)    2 no vid
[110000000E]2020/02/02.20:48:36 (ulg)  1,(lm_amh)    3 no vid
[110000000F]2020/02/02.20:48:36 (ulg)  1,(lm_amh)    4 no vid
[1100000010]2020/02/02.20:48:36 (ulg)  1,(lm_mmr)  need next volume after oid 146 (vid zdlras1-osbmf-000001, tag E01005L4, create_time 1577658912, mediainfo 0) for append; its oid 155
[1100000011]2020/02/02.20:48:36 (ulg)  1,(lm_amh)    5 oid 146 doesn't meet mount requirements - the next volume of this set is needed (OB device mgr)
[1100000012]2020/02/02.20:48:36 (ulg)  1,(lm_amh) oid 146 is added to state
[1100000013]2020/02/02.20:48:36 (ulg)  1,(lm_mmr)  need next volume after oid 148 (vid zdlras1-osbmf-000002, tag E01006L4, create_time 1577658918, mediainfo 4) for append; its oid 157
[1100000014]2020/02/02.20:48:36 (ulg)  1,(lm_amh)    6 oid 148 doesn't meet mount requirements - the next volume of this set is needed (OB device mgr)
[1100000015]2020/02/02.20:48:36 (ulg)  1,(lm_amh) oid 148 is added to state
[1100000016]2020/02/02.20:48:36 (ulg)  1,(lm_mmr)  need next volume after oid 150 (vid zdlras1-osbmf-000003, tag E01007L4, create_time 1577658926, mediainfo 4) for append; its oid 153
[1100000017]2020/02/02.20:48:36 (ulg)  1,(lm_amh)    7 oid 150 doesn't meet mount requirements - the next volume of this set is needed (OB device mgr)
[1100000018]2020/02/02.20:48:36 (ulg)  1,(lm_amh) oid 150 is added to state
[1100000019]2020/02/02.20:48:36 (ulg)  1,(lm_mmr)  family zdlras1-osbmf != RMAN-DEFAULT
[110000001A]2020/02/02.20:48:36 (ulg)  1,(lm_mmr)  oid 151 (vid RMAN-DEFAULT-000001, tag E01008L4, create_time 1577034094, mediainfo 0) fails mount criteria
[110000001B]2020/02/02.20:48:36 (ulg)  1,(lm_amh)    8 oid 151 doesn't meet mount requirements - volume doesn't meet mount criteria (OB device mgr)
[110000001C]2020/02/02.20:48:36 (ulg)  1,(lm_amh) oid 151 is added to state
[110000001D]2020/02/02.20:48:36 (ulg)  1,(lm_mmr)  oid 153 (vid zdlras1-osbmf-000004, tag E01009L4, create_time 1577658926, mediainfo 4) passes criteria
[110000001E]2020/02/02.20:48:36 (ulg)  1,(lm_amh)    9 appendable volume found
[110000001F]2020/02/02.20:48:36 (ulg)  1,(lm_mmr)  oid 155 (vid zdlras1-osbmf-000005, tag E01010L4, create_time 1577658912, mediainfo 0) passes criteria
[1100000020]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   10 better appendable volume found
[1100000021]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   10 available space 159744,   9                                               available space 233472
[1100000022]2020/02/02.20:48:36 (ulg)  1,(lm_mmr)  oid 157 (vid zdlras1-osbmf-000006, tag E01011L4, create_time 1577658918, mediainfo 0) passes criteria
[1100000023]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   11 better appendable volume found
[1100000024]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   11 available space 18432,  10                                               available space 159744
[1100000025]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   12 no vid
[1100000026]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   13 no vid
[1100000027]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   14 no vid
[1100000028]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   15 no vid
[1100000029]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   16 no vid
[110000002A]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   17 no vid
[110000002B]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   18 no vid
[110000002C]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   19 no vid
[110000002D]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   20 no vid
[110000002E]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   21 vacant
[110000002F]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   22 no vid
[1100000030]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   23 no vid
[1100000031]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   24 vacant
[1100000032]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   25 vacant
[1100000033]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   26 vacant
[1100000034]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   27 vacant
[1100000035]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   28 vacant
[1100000036]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   29 vacant
[1100000037]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   30 no vid
[1100000038]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   31 no vid
[1100000039]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   32 no vid
[110000003A]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   33 no vid
[110000003B]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   34 no vid
[110000003C]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   35 no vid
[110000003D]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   36 no vid
[110000003E]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   37 no vid
[110000003F]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   38 no vid
[1100000040]2020/02/02.20:48:36 (ulg)  1,(lm_amh)   39 no vid
[1100000041]2020/02/02.20:48:36 (ulg)  1,(lm_amh)  end of pass 1 at 2020/02/02.20:48:362020/02/02.20:48:36
[1100000042]2020/02/02.20:48:36 (amh)  qlm__select_volume returned se state for vid = zdlras1-osbmf-000006 last_se = 0
[1100000043]2020/02/02.20:48:36 (amh)  state.pass = 1
[1100000044]2020/02/02.20:48:36 (amh)  state.last_se_checked = 11
[1100000045]2020/02/02.20:48:36 (amh)  state.mediainfo_pass = 1
[1100000046]2020/02/02.20:48:36 (amh)  state.mediainfo_loops = 1
[1100000047]2020/02/02.20:48:36 (amh)  state.rls_eltype = se
[1100000048]2020/02/02.20:48:36 (amh)  state.rls_elnum = 11
[1100000049]2020/02/02.20:48:36 (amh)   11 loading
[110000004A]2020/02/02.20:48:38 (atv)  qdv__automount_this_vol entered
[110000004B]2020/02/02.20:48:38 (atv)  calling qdv__mount
[110000004C]2020/02/02.20:48:38 (mt)   qdv__read_mount_db() succeeded, found vol_oid 0
[110000004D]2020/02/02.20:48:38 (mt)   qdv__read_label() succeeded; read 65536 bytes
[110000004E]2020/02/02.20:48:38 (mt)   exp time obtained from label
[110000004F]2020/02/02.20:48:38 (mt)   qdb__label_event() returned vol_oid 157
[1100000050]2020/02/02.20:48:38 (mt)   setting vol_oid in mount_info to 157
[1100000051]2020/02/02.20:48:38 (mt)   updated volume close time from db
[1100000052]2020/02/02.20:48:38 (atv)  qdv__mount succeeded
[1100000053]2020/02/02.20:48:38 (atv)  automount worked
[1100000054]2020/02/02.20:48:38 (atv)  qdv__automount_this_vol exited
[1100000055]2020/02/02.20:48:38 (gep)  getting reservation for element 0x3 (dte)
[1100000056]2020/02/02.20:48:38 (amh)   11 automount worked - returning
[1100000057]2020/02/02.20:48:38 (amh)  end of automount at 2020/02/02.20:48:38 (0x0)
[1100000058]2020/02/02.20:48:38 (amh)  returning from qdv__automount_in_mh
[3100000059]2020/02/02.20:48:38 Info: volume in tape03 is usable for this operation.
[110000005A]2020/02/02.20:48:38 (pvfw) at BOT
[110000005B]2020/02/02.20:48:38 (pvfw) previous state is invalid
[110000005C]2020/02/02.20:48:38 (alv)  backup image label is valid, file 19, section 2
[110000005D]2020/02/02.20:48:38 (pvfw) invalidating tape position in mount db
[110000005E]2020/02/02.20:48:38 (ial)  invalidate backup image label (was valid)
[110000005F]2020/02/02.20:48:38 (pvfw) space to EOD
[1100000060]2020/02/02.20:48:38 (pvfw) inspect_recs BSR: rtypes [0] = filemark
[1100000061]2020/02/02.20:48:38 (pvfw) inspect_recs BSR: rtypes [1] = filemark
[1100000062]2020/02/02.20:48:38 (pvfw) inspect_recs BSR: rtypes [2] = data
[1100000063]2020/02/02.20:48:38 (pvfw) inspect_recs BSR: rtypes [3] = filemark
[1100000064]2020/02/02.20:48:38 (pvfw) inspect_recs FSF
[1100000065]2020/02/02.20:48:38 (pvfw) inspect_recs ready to mount
[1100000066]2020/02/02.20:48:38 (pvfw) mounting at inspect_rec's request in rw_mode 2
[1100000067]2020/02/02.20:48:38 (pvfw) mounted ok
[1100000068]2020/02/02.20:48:38 (pvfw) at OB EOD, returning (2)
[1100000069]2020/02/02.20:48:38 (pvfw) pos_vol_cleanup not returning pstate
[010000006A]2020/02/02.20:48:38 (dmap) tape03 success
[410000006B]Volume label:
[410000006C]    Volume tag:             E01011L4
[410000006D]    Volume UUID:            a1f8db28-109b-1038-847b-080027b2a93d
[410000006E]    Volume ID:              zdlras1-osbmf-000006
[410000006F]    Volume set ID:          zdlras1-osbmf-000002
[4100000070]    Previous volume:        zdlras1-osbmf-000002
[4100000071]    Volume sequence:        2
[4100000072]    Volume set owner:       root
[4100000073]    Volume set created:     Sun Dec 29 23:35:18 2019
[4100000074]    Volume set closes:      Wed Oct 19 00:35:18 2022 (no writes after this time)
[4000000075]    Media family:           zdlras1-osbmf
[4100000076]
[4100000077]    Volume set expires: never; content manages reuse
[4100000078]
[4100000079]Archive label:
[410000007A]    File number:            24
[410000007B]    File section:           1
[410000007C]    Owner:                  root
[410000007D]    Client host:            zdlras1n1
[410000007E]    Backup level:           0
[410000007F]    S/w compression:        no
[4100000080]    Archive created:        Sun Feb 02 20:48:38 2020
[4100000081]    Archive owner:          oracle (UUID bbad0004-01a9-1038-abb2-080027b2a93d)
[4100000082]    Owner class:            oracle (UUID a43aa638-01a9-1038-8809-080027b2a93d)
[4100000083]    Backup piece name:      RA_SBT_ORCL18C_16512_16513_2tunhkot_1_2_0_qEdAn
[4100000084]    Backup db name:         ORCL18C
[4100000085]    Backup db id:           558466555
[4100000086]    Backup copy number:     not applicable
[4100000087]    Backup content:         full
[4100000088]    Encryption:             off
[4100000089]    Catalog data:           no
[410000008A]    Backup image UUID:      8cb63f94-281a-1038-86d5-080027b2a93d
[410000008B]    Backup instance UUID:   8cb63f9e-281a-1038-86d5-080027b2a93d
[410000008C]    Backup instance created:Sun Feb 02 20:48:38 2020
[410000008D]
[410000008E]
[410000008E]End of tape has been reached.  Please wait while I rewind and unload the tape.
[410000008F]The Volume ID of the next tape to be written is zdlras1-osbmf-000007.
[4100000090]The tape has been unloaded.
[4100000090]
[4100000091]Volume label:
[4100000092]    Volume tag:             E01012L4
[4100000093]    Volume UUID:            93cb6548-281a-1038-86d5-080027b2a93d
[4100000094]    Volume ID:              zdlras1-osbmf-000007
[4100000095]    Volume set ID:          zdlras1-osbmf-000002
[4100000096]    Previous volume:        zdlras1-osbmf-000006
[4100000097]    Volume sequence:        3
[4100000098]    Volume set owner:       root
[4100000099]    Volume set created:     Sun Dec 29 23:35:18 2019
[410000009A]    Volume set closes:      Wed Oct 19 00:35:18 2022 (no writes after this time)
[400000009B]    Media family:           zdlras1-osbmf
[410000009C]
[410000009D]    Volume set expires: never; content manages reuse
[410000009E]
[410000009F]Archive label:
[41000000A0]    File number:            24
[41000000A1]    File section:           2
[41000000A2]    Owner:                  root
[41000000A3]    Client host:            zdlras1n1
[41000000A4]    Backup level:           0
[41000000A5]    S/w compression:        no
[41000000A6]    Archive created:        Sun Feb 02 20:48:38 2020
[41000000A7]    Archive owner:          oracle (UUID bbad0004-01a9-1038-abb2-080027b2a93d)
[41000000A8]    Owner class:            oracle (UUID a43aa638-01a9-1038-8809-080027b2a93d)
[41000000A9]    Backup piece name:      RA_SBT_ORCL18C_16512_16513_2tunhkot_1_2_0_qEdAn
[41000000AA]    Backup db name:         ORCL18C
[41000000AB]    Backup db id:           558466555
[41000000AC]    Backup copy number:     not applicable
[41000000AD]    Backup content:         full
[41000000AE]    Encryption:             off
[41000000AF]    Catalog data:           no
[41000000B0]    Backup image UUID:      8cb63f94-281a-1038-86d5-080027b2a93d
[41000000B1]    Backup instance UUID:   8cb63f9e-281a-1038-86d5-080027b2a93d
[41000000B2]    Backup instance created:Sun Feb 02 20:48:38 2020
[41000000B3]
[41000000B4]
[41000000B4]Backup statistics:
[41000000B5]status 0
[40000000B6]devices
[40000000B7] tape03
[41000000B8]
[40000000B9]volumes
[40000000BA] zdlras1-osbmf-000006
[41000000BB]
[40000000BC]voltags
[40000000BD] E01011L4
[41000000BE]
[41000000BF]file 24
[41000000C0]host zdlras1n1
[41000000C1]encryption off
[41000000C2]compression no
[41000000C3]start_time  Sun Feb 02 2020 at 20:48:38 (1580672918)
[41000000C4]end_time    Sun Feb 02 2020 at 20:49:36 (1580672976)
[41000000C5]backup_time Sun Feb 02 2020 at 20:48:38 (1580672918)
[41000000C6]dev_kbytes 769938
[41000000C7]dev_iosecs 53
[41000000C8]dev_iorate 14.9 MB/S
[41000000C9]wrt_iosecs 58
[41000000CA]wrt_iorate 13.6 MB/S
[41000000CB]physical_blks_written 376
[41000000CC]write_errors 0
[41000000CD]physical_blks_read 0
[41000000CE]read_errors 0
[41000000CF]error_rate 0%
[41000000D0]piece RA_SBT_ORCL18C_16512_16513_2tunhkot_1_2_0_qEdAn completed, status 0
[root@zdlras1n1 ~]#

Look that above you can see that one tape became full and OSB used another to finish.

After the Clone

Returning to rman to check the same list we have:

RMAN> list backupset 16512;


List of Backup Sets
===================


BS Key  Type LV Size
------- ---- -- ----------
16512   Incr 0  330.35M
  List of Datafiles in backup set 16512
  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- ------------------- ----------- ------ ----
  1    0  Incr 1909028    02/02/2020 16:09:01              NO    /u01/app/oracle/oradata/ORCL18C/system01.dbf

  Backup Set Copy #1 of backup set 16512
  Device Type Elapsed Time Completion Time     Compressed Tag
  ----------- ------------ ------------------- ---------- ---
  SBT_TAPE    03:40:36     02/02/2020 16:12:04 YES        BKP-DB-INC0

    List of Backup Pieces for backup set 16512 Copy #1
    BP Key  Pc# Status      Media                   Piece Name
    ------- --- ----------- ----------------------- ----------
    16513   1   AVAILABLE                           VB$_1891149551_16507I

  Backup Set Copy #2 of backup set 16512
  Device Type Elapsed Time Completion Time     Compressed Tag
  ----------- ------------ ------------------- ---------- ---
  SBT_TAPE    03:40:36     02/02/2020 19:49:37 NO         BKP-DB-INC0

    List of Backup Pieces for backup set 16512 Copy #2
    BP Key  Pc# Status      Media                   Piece Name
    ------- --- ----------- ----------------------- ----------
    16921   1   AVAILABLE   zdlras1-osbmf-000006,zdlras1-osbmf-000007 RA_SBT_ORCL18C_16512_16513_2tunhkot_1_2_0_qEdAn

RMAN>

As you can see, the backupset 16512 (of backup piece 16513) has two copies. One in ZDLRA database and another at OSB (look the media because of lack of space in one).

QUEUE_SBT_BACKUP_TASK

Another way to call manually the clone is to use the DBMS_RA.QUEUE_SBT_BACKUP_TASK. And in this case, everything that is linked with the template is cloned to tape. This a good way to force one clone one database entirely.

Look below that I have some archivedlogs that was not cloned yet:

RMAN> list copy of archivelog all;

List of Archived Log Copies for database with db_unique_name ORCL18C
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - -------------------
16943   1    22      A 02/02/2020 16:28:28
        Name: /u01/app/oracle/oradata/ORCL18C/archivelog/2020_02_02/o1_mf_1_22_h3gbs5fk_.arc

16965   1    23      A 02/02/2020 21:03:49
        Name: /u01/app/oracle/oradata/ORCL18C/archivelog/2020_02_02/o1_mf_1_23_h3gcfwc8_.arc


RMAN> BACKUP DEVICE TYPE SBT ARCHIVELOG ALL DELETE ALL INPUT TAG 'BKP-ARCH';

Starting backup at 02/02/2020 21:15:09
current log archived
using channel ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: starting archived log backup set
channel ORA_SBT_TAPE_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=22 RECID=16 STAMP=1031346234
input archived log thread=1 sequence=23 RECID=17 STAMP=1031346892
input archived log thread=1 sequence=24 RECID=18 STAMP=1031346910
channel ORA_SBT_TAPE_1: starting piece 1 at 02/02/2020 21:15:11
channel ORA_SBT_TAPE_1: finished piece 1 at 02/02/2020 21:15:36
piece handle=ORCL18C_6nuni6mv_1_1 tag=BKP-ARCH comment=API Version 2.0,MMS Version 12.2.0.2
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:25
channel ORA_SBT_TAPE_1: deleting archived log(s)
archived log file name=/u01/app/oracle/oradata/ORCL18C/archivelog/2020_02_02/o1_mf_1_22_h3gbs5fk_.arc RECID=16 STAMP=1031346234
archived log file name=/u01/app/oracle/oradata/ORCL18C/archivelog/2020_02_02/o1_mf_1_23_h3gcfwc8_.arc RECID=17 STAMP=1031346892
archived log file name=/u01/app/oracle/oradata/ORCL18C/archivelog/2020_02_02/o1_mf_1_24_h3gcgg15_.arc RECID=18 STAMP=1031346910
Finished backup at 02/02/2020 21:15:36

Starting Control File and SPFILE Autobackup at 02/02/2020 21:15:37
piece handle=c-558466555-20200202-03 comment=API Version 2.0,MMS Version 12.2.0.2
Finished Control File and SPFILE Autobackup at 02/02/2020 21:15:54

RMAN> list backup of archivelog sequence between 22 and 24;


List of Backup Sets
===================


BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ -------------------
16991   25.25M     SBT_TAPE    00:00:20     02/02/2020 21:15:31
        BP Key: 16992   Status: AVAILABLE  Compressed: NO  Tag: BKP-ARCH
        Handle: ORCL18C_6nuni6mv_1_1   Media: Recovery Appliance (ZDLRAS1)

  List of Archived Logs in backup set 16991
  Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
  ---- ------- ---------- ------------------- ---------- ---------
  1    22      1910746    02/02/2020 16:28:28 1923481    02/02/2020 21:03:49
  1    23      1923481    02/02/2020 21:03:49 1924479    02/02/2020 21:14:52
  1    24      1924479    02/02/2020 21:14:52 1924521    02/02/2020 21:15:09

RMAN>

And I called the template backup that I defined just for archivelogs (see my previous post) manually:

SQL> BEGIN
  2      DBMS_RA.QUEUE_SBT_BACKUP_TASK('ONLYTAPE_ARCH');
  3  END;
  4  /

PL/SQL procedure successfully completed.

SQL>

After that we can see the list backup again:

RMAN> list backup of archivelog sequence between 22 and 24;


List of Backup Sets
===================


BS Key  Size
------- ----------
16991   25.25M

  List of Archived Logs in backup set 16991
  Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
  ---- ------- ---------- ------------------- ---------- ---------
  1    22      1910746    02/02/2020 16:28:28 1923481    02/02/2020 21:03:49
  1    23      1923481    02/02/2020 21:03:49 1924479    02/02/2020 21:14:52
  1    24      1924479    02/02/2020 21:14:52 1924521    02/02/2020 21:15:09

  Backup Set Copy #1 of backup set 16991
  Device Type Elapsed Time Completion Time     Compressed Tag
  ----------- ------------ ------------------- ---------- ---
  SBT_TAPE    00:29:22     02/02/2020 21:15:35 NO         BKP-ARCH

    List of Backup Pieces for backup set 16991 Copy #1
    BP Key  Pc# Status      Media                   Piece Name
    ------- --- ----------- ----------------------- ----------
    16992   1   AVAILABLE   Recovery Appliance (ZDLRAS1) ORCL18C_6nuni6mv_1_1

  Backup Set Copy #2 of backup set 16991
  Device Type Elapsed Time Completion Time     Compressed Tag
  ----------- ------------ ------------------- ---------- ---
  SBT_TAPE    00:29:22     02/02/2020 20:45:49 NO         BKP-ARCH

    List of Backup Pieces for backup set 16991 Copy #2
    BP Key  Pc# Status      Media                   Piece Name
    ------- --- ----------- ----------------------- ----------
    17065   1   AVAILABLE   zdlras1-osbmf-000005    RA_SBT_ORCL18C_558466555_16850_6nuni6mv_1_2_16991

RMAN>

And now we can see that we have a second copy for the backupset 16991.

Conclusion

Sometimes it is needed to manually clone the backups for tape. Remember that for full backups the ZDLRA only clones the last full backup. If you need, for some reason, clone other backups for long-term retention you can call manually the clone to tape. The options allow one to one clone or the entire template.

 

Disclaimer: “The postings on this site are my own and don’t necessarily represent my actual employer positions, strategies or opinions. The information here was edited to be useful for general purpose, specific data and identifications were removed to allow reach the generic audience and to be useful for the community.”

Leave a Reply

Your email address will not be published. Required fields are marked *