My Oracle Support Banner

RMAN compressed backup of datafilecopy from an Encrypted Tablespace is larger than actual datafilecopy (Doc ID 2410581.1)

Last updated on MARCH 04, 2019

Applies to:

Oracle Database - Enterprise Edition - Version 12.1.0.2 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Information in this document applies to any platform.

Symptoms

The RMAN compressed backup of a datafile copy of datafile from an encrypted tablespace is larger than the actual datafile copy as well as takes more time to complete when compared to the compressed backup of the actual datafile.

RMAN command 'Backup as compressed backupset datafilecopy' of a TDE encrypted datafilecopy isn't compressing


Example of the issue

Case 1. tablespace is not encrypted  datafile backup and datafilecopy backup took same size and size of output is the same.

Case 2 tablespace is encrypted, the datafile backup size and time is same as above case 1, but for the datafilecopy backup its hugely different .


Case 1 (Tablespace is not encrypted)

SQL>  select tablespace_name,encrypted from dba_tablespaces where tablespace_name='<tablesapce_name>';

TABLESPACE_NAME                    ENC
-------------------------------------- ---
<tablespace_name>                      NO

SQL> select file_id from dba_data_files where tablespace_name='<tablesapce_name>';

  FILE_ID
----------
      968

1. Backup of datafilecopy
RMAN> backup device type disk datafile 968 format '<backup_path>/%U';

Starting backup at 15-MAY-18
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
.

.
allocated channel: ORA_DISK_12
channel ORA_DISK_12: SID=588 instance=<instance_name> type=DISK
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00968 name=<path>/DATAFILE/<db_file_name>
channel ORA_DISK_1: starting piece 1 at 15-MAY-18

channel ORA_DISK_1: finished piece 1 at 15-MAY-18
piece handle=<backup_path>/<backup_piece_name> tag=TAG20111115T041949 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
Finished backup at 15-MAY-18

Time taken 35 seconds size 207MB


2, Backup of copy

RMAN> list copy of datafile 968;

List of Datafile Copies
=======================

Key     File S Completion Time Ckp SCN    Ckp Time
------- ---- - --------------- ---------- ---------------
3       968  A 10-MAY-18       6396192182679 10-MAY-18
       Name: <path>/DATAFILE/<db_file_name>
       Tag: TAG20180111T021335


RMAN> backup device type disk datafilecopy '<path>/DATAFILE/<db_file_name>' format '<backup_path>/%U';


Starting backup at 15-MAY-18
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
using channel ORA_DISK_5
using channel ORA_DISK_6
using channel ORA_DISK_7
using channel ORA_DISK_8
using channel ORA_DISK_9
using channel ORA_DISK_10
using channel ORA_DISK_11
using channel ORA_DISK_12
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: including datafile copy of datafile 00968 in backup set
input file name=<path>/DATAFILE/<db_file_name>
channel ORA_DISK_1: starting piece 1 at 15-MAY-18
channel ORA_DISK_1: finished piece 1 at 15-MAY-18
piece handle=<backup_path>/<backup_piece_name> tag=TAG20180515T042151 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
Finished backup at 15-MAY-18

RMAN>

Time taken 35 seconds size 207MB

 


Case 2 Tablespace is encrypted 

SQL> alter tablespace <tablesapce_name> offline;

Tablespace altered.

SQL> alter database datafile '<path>/DATAFILE/<db_file_name>' encrypt;

Database altered.

SQL>  alter tablespace<tablespace_name> online;

SQL> select tablespace_name,encrypted from dba_tablespaces where tablespace_name='<tablespace_name>';

TABLESPACE_NAME                        ENC
------------------------------------------ ---
<tablespace_name>                        YES

1. Backup of datafile
RMAN>  backup device type disk datafile 968 format '<path>/%U';

Starting backup at 15-MAY-18
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
.

.

allocated channel: ORA_DISK_12
channel ORA_DISK_12: SID=1441 instance=<instance_name> device type=DISK
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00968 name=<path>/DATAFILE/<db_file_name>
channel ORA_DISK_1: starting piece 1 at 15-MAY-18
channel ORA_DISK_1: finished piece 1 at 15-MAY-18
piece handle=<backup_path>/<backup_piece_name> tag=TAG2018111T042636 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
Finished backup at 15-MAY-18

Time taken 35 seconds size 204M

2. Backup of datafilecopy

RMAN>  backup device type disk datafilecopy '<path>/DATAFILE/<db_file_name>' format '<backup_path>/>%U';

Starting backup at 15-MAY-18
using channel ORA_DISK_1
.

.

using channel ORA_DISK_11
using channel ORA_DISK_12
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: including datafile copy of datafile 00968 in backup set
input file name=<path>/DATAFILE/<db_file_name>
channel ORA_DISK_1: starting piece 1 at 15-MAY-18
channel ORA_DISK_1: finished piece 1 at 15-MAY-18
piece handle=<backup_path>/<backup_piece_name> tag=TAG2018111T043130 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:03:55
Finished backup at 15-MAY-18

time taken :03:55 minutes size 1.7G

 

Changes

 No changes done.

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.