COPY_BACKUP at ZDLRA

As you know, ZDLRA is one appliance dedicated to provides you zero data loss in several (planned and unplanned) outages. All the backups are stored inside of the delta store to be processed, and they are deconstructed, meaning that the rman backup set does not exist (as is the formal backup set file).

But sometimes we need to copy/extract some backups outside of ZDLRA and copy it to the filesystem. Maybe because some regulations/compliances need to store for long-term/archival purposes. But some caveats are important to be explained.

The DBMS_RA.COPY_BACKUP (and COPY_BACKUP_PIECE) procedure allows us to copy backups sets from one library to another one. But also allow us to copy to disk, extracting it from ZDLRA.

As you can see in the reference, if we define the “template_name” as null, the backupset is exported to a filesystem mounted at ZDLRA. So, it an easy way that allows us to export backupsets from ZDLRA. The way to do that is to specify the “format” parameter using the same rules/definition as rman and pointing to fs.

Look below some backups for datafile 1 that are stored at ZDLRA:

RMAN> list backup of datafile 1 summary device type sbt_tape;


List of Backups
===============
Key     TY LV S Device Type Completion Time     #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
9372    B  0  A SBT_TAPE    04/10/2020 19:37:39 1       1       YES        TAG20201004T193527
9562    B  1  A SBT_TAPE    04/10/2020 20:07:03 1       1       YES        TAG20201004T200657
9637    B  0  A SBT_TAPE    04/10/2020 20:07:03 1       1       YES        TAG20201004T200657
9832    B  1  A SBT_TAPE    04/10/2020 20:19:10 1       1       YES        COPYBKP
9845    B  0  A SBT_TAPE    04/10/2020 20:19:10 1       1       YES        COPYBKP
9928    B  1  A SBT_TAPE    04/10/2020 20:23:36 1       1       YES        TAG20201004T202331
10083   B  0  A SBT_TAPE    04/10/2020 20:23:36 1       1       YES        TAG20201004T202331

RMAN>  list backup of datafile 1 tag 'COPYBKP';


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


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
9832    Incr 1  80.00K     SBT_TAPE    00:00:02     04/10/2020 20:19:10
        BP Key: 9833   Status: AVAILABLE  Compressed: YES  Tag: COPYBKP
        Handle: VB$_1918343643_9831I   Media:
  List of Datafiles in backup set 9832
  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- ------------------- ----------- ------ ----
  1    1  Incr 2591788    04/10/2020 20:19:08              NO    /u01/app/oracle/oradata/ORCL19C/system01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
9845    Incr 0  323.84M    SBT_TAPE    00:00:02     04/10/2020 20:19:10
        BP Key: 9846   Status: AVAILABLE  Compressed: YES  Tag: COPYBKP
        Handle: VB$_1918343643_9831_1   Media:
  List of Datafiles in backup set 9845
  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- ------------------- ----------- ------ ----
  1    0  Incr 2591788    04/10/2020 20:19:08              NO    /u01/app/oracle/oradata/ORCL19C/system01.dbf

RMAN>

As you can see above I have two backups with the tag COPYBKP for datafile 1. Two virtual backups generated by ZDLRA.

So, I will copy these (and all with the same TAG) to a folder inside of ZDLRA. This is a local folder existing in both nodes of ZDLRA and can be an NFS mount point as well. So, to do that, I connected to the ZDLRA database and called the COPY_BACKUP:

SQL> BEGIN
  2      DBMS_RA.COPY_BACKUP(
  3          tag => 'COPYBKP'
  4          , format => '/radump/copybkp_%d_%U'
  5          , template_name => NULL
  6      );
  7  END;
  8  /

PL/SQL procedure successfully completed.

SQL>

And at “/radump” folder for ZDLRA now we have the backup sets from rman:

[root@zdlras1n1 ~]# ls -lh /radump/copybkp_*
-rw-r----- 1 oracle dba 218M Oct  4 20:29 /radump/copybkp_ZDLRAS1_24vc5961_1_2
-rw-r----- 1 oracle dba 168K Oct  4 20:30 /radump/copybkp_ZDLRAS1_5gvc595s_1_2
-rw-r----- 1 oracle dba 160K Oct  4 20:29 /radump/copybkp_ZDLRAS1_5hvc595t_1_2
-rw-r----- 1 oracle dba 216K Oct  4 20:29 /radump/copybkp_ZDLRAS1_5ivc595u_1_2
-rw-r----- 1 oracle dba 112K Oct  4 20:29 /radump/copybkp_ZDLRAS1_5kvc5961_1_2
-rw-r----- 1 oracle dba  48K Oct  4 20:29 /radump/copybkp_ZDLRAS1_5lvc5962_1_2
-rw-r----- 1 oracle dba 208K Oct  4 20:29 /radump/copybkp_ZDLRAS1_5ovc5964_1_2
-rw-r----- 1 oracle dba  48K Oct  4 20:29 /radump/copybkp_ZDLRAS1_5pvc5965_1_2
-rw-r----- 1 oracle dba  48K Oct  4 20:29 /radump/copybkp_ZDLRAS1_5qvc5966_1_2
-rw-r----- 1 oracle dba 3.7M Oct  4 20:29 /radump/copybkp_ZDLRAS1_7ivc595u_1_2
-rw-r----- 1 oracle dba 453K Oct  4 20:29 /radump/copybkp_ZDLRAS1_8svc596e_1_2
-rw-r----- 1 oracle dba 1.2M Oct  4 20:29 /radump/copybkp_ZDLRAS1_bqvc5966_1_2
-rw-r----- 1 oracle dba 356M Oct  4 20:29 /radump/copybkp_ZDLRAS1_f1vc595t_1_2
-rw-r----- 1 oracle dba 2.3M Oct  4 20:29 /radump/copybkp_ZDLRAS1_h9vc5965_1_2
-rw-r----- 1 oracle dba 1.6M Oct  4 20:30 /radump/copybkp_ZDLRAS1_j8vc5964_1_2
-rw-r----- 1 oracle dba 194M Oct  4 20:29 /radump/copybkp_ZDLRAS1_qlvc5962_1_2
-rw-r----- 1 oracle dba 767M Oct  4 20:29 /radump/copybkp_ZDLRAS1_u0vc595s_1_2
[root@zdlras1n1 ~]#

These files are all the backup set with tag COPYBKP and you can see that the catalog was updated too. Now we have two copies of these backup sets:

RMAN> list backup of datafile 1 summary device type sbt_tape tag 'COPYBKP';


List of Backups
===============
Key     TY LV S Device Type Completion Time     #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
9832    B  1  A SBT_TAPE    04/10/2020 20:30:08 1       2       NO         COPYBKP
9845    B  0  A SBT_TAPE    04/10/2020 20:29:26 1       2       NO         COPYBKP

RMAN> list backup of datafile 1 summary device type sbt_tape;


List of Backups
===============
Key     TY LV S Device Type Completion Time     #Pieces #Copies Compressed Tag
------- -- -- - ----------- ------------------- ------- ------- ---------- ---
9372    B  0  A SBT_TAPE    04/10/2020 19:37:39 1       1       YES        TAG20201004T193527
9562    B  1  A SBT_TAPE    04/10/2020 20:07:03 1       1       YES        TAG20201004T200657
9637    B  0  A SBT_TAPE    04/10/2020 20:07:03 1       1       YES        TAG20201004T200657
9832    B  1  A SBT_TAPE    04/10/2020 20:30:08 1       2       NO         COPYBKP
9845    B  0  A SBT_TAPE    04/10/2020 20:29:26 1       2       YES        COPYBKP
9928    B  1  A SBT_TAPE    04/10/2020 20:23:36 1       1       YES        TAG20201004T202331
10083   B  0  A SBT_TAPE    04/10/2020 20:23:36 1       1       YES        TAG20201004T202331

RMAN> list backupset 9832;


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


BS Key  Type LV Size
------- ---- -- ----------
9832    Incr 1  80.00K
  List of Datafiles in backup set 9832
  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- ------------------- ----------- ------ ----
  1    1  Incr 2591788    04/10/2020 20:19:08              NO    /u01/app/oracle/oradata/ORCL19C/system01.dbf

  Backup Set Copy #1 of backup set 9832
  Device Type Elapsed Time Completion Time     Compressed Tag
  ----------- ------------ ------------------- ---------- ---
  SBT_TAPE    00:11:00     04/10/2020 20:19:10 YES        COPYBKP

    List of Backup Pieces for backup set 9832 Copy #1
    BP Key  Pc# Status      Media                   Piece Name
    ------- --- ----------- ----------------------- ----------
    9833    1   AVAILABLE                           VB$_1918343643_9831I

  Backup Set Copy #2 of backup set 9832
  Device Type Elapsed Time Completion Time     Compressed Tag
  ----------- ------------ ------------------- ---------- ---
  SBT_TAPE    00:11:00     04/10/2020 20:30:08 NO         COPYBKP

    List of Backup Pieces for backup set 9832 Copy #2
    BP Key  Pc# Status      Media                   Piece Name
    ------- --- ----------- ----------------------- ----------
    10203   1   AVAILABLE                           /radump/copybkp_ZDLRAS1_5gvc595s_1_2

RMAN> list backupset 9845;


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


BS Key  Type LV Size
------- ---- -- ----------
9845    Incr 0  766.46M
  List of Datafiles in backup set 9845
  File LV Type Ckp SCN    Ckp Time            Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- ------------------- ----------- ------ ----
  1    0  Incr 2591788    04/10/2020 20:19:08              NO    /u01/app/oracle/oradata/ORCL19C/system01.dbf

  Backup Set Copy #2 of backup set 9845
  Device Type Elapsed Time Completion Time     Compressed Tag
  ----------- ------------ ------------------- ---------- ---
  SBT_TAPE    00:10:18     04/10/2020 20:29:26 NO         COPYBKP

    List of Backup Pieces for backup set 9845 Copy #2
    BP Key  Pc# Status      Media                   Piece Name
    ------- --- ----------- ----------------------- ----------
    10154   1   AVAILABLE                           /radump/copybkp_ZDLRAS1_u0vc595s_1_2

  Backup Set Copy #1 of backup set 9845
  Device Type Elapsed Time Completion Time     Compressed Tag
  ----------- ------------ ------------------- ---------- ---
  SBT_TAPE    00:10:18     04/10/2020 20:19:10 YES        COPYBKP

    List of Backup Pieces for backup set 9845 Copy #1
    BP Key  Pc# Status      Media                   Piece Name
    ------- --- ----------- ----------------------- ----------
    9846    1   AVAILABLE                           VB$_1918343643_9831_1

RMAN>

Look above that for bs 9832 and 9845 now we have two copies. But the caveat here is that these copies have the same retention that the original backup set. If you are thinking to use the COPY_BACKUP as one way to have archival backups stored outside they are not the best option. They will be deleted from the rman catalog after the RECOVERY_WINDOW of it expired. And if you try to extend this time window frame, you will affect all the backupsets and probably impose pressure of used spaced for ZDLRA. The best option is to use the KEED backups for rman.

If you want to copy just one backup set you can use the DBMS_RA.COPY_BACKUP_PIECE, it will work ate the same way as COPY_BACKUP. Another option is to copy between libraries/tapes to improve the consolidation of the tapes. I already show how to do this in one previous post.

 

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. Post protected by copyright.”

2 thoughts on “COPY_BACKUP at ZDLRA

  1. Jan Hoekstra

    Dear,
    A good story, but can it also be used in combination with “move_backup”?
    Due to lack of space on the zdlra, we want to keep the long kept only externally (nfs).

    Reply
    1. Simon Post author

      Hi,
      Yes, this I will cover in my next posts (that will be released in the next week). Stay tuned.
      Best regards.

      Reply

Leave a Reply

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