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 AUGUST 04, 2018

Applies to:

Oracle Database - Enterprise Edition - Version 12.1.0.2 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='TESTTDE';

TABLESPACE_NAME                ENC
------------------------------ ---
TESTTDE                        NO

SQL> select file_id from dba_data_files where tablespace_name='TESTTDE';

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

1. Backup of datafilecopy
RMAN> backup device type disk datafile 968 format '/u02/app_acfs/test/demo%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=test 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=+DATAC2/TEST/540634CC5D93E3B4E05362E098810151/DATAFILE/testtde.1581.975738561
channel ORA_DISK_1: starting piece 1 at 15-MAY-18

channel ORA_DISK_1: finished piece 1 at 15-MAY-18
piece handle=/u02/app_acfs/test/demobbt2u3v5_1_1 tag=TAG20180515T041949 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: +RECOC2/TEST/540634CC5D93E3B4E05362E098810151/DATAFILE/testtde.26291.975741217
       Tag: TAG20180510T021335


RMAN> backup device type disk datafilecopy '+RECOC2/TEST/540634CC5D93E3B4E05362E098810151/DATAFILE/testtde.26291.975741217' format '/u02/app_acfs/test/demo%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=+RECOC2/TEST/540634CC5D93E3B4E05362E098810151/DATAFILE/testtde.26291.975741217
channel ORA_DISK_1: starting piece 1 at 15-MAY-18
channel ORA_DISK_1: finished piece 1 at 15-MAY-18
piece handle=/u02/app_acfs/test/demobdt2u432_1_1 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 testtde offline;

Tablespace altered.

SQL> alter database datafile '+DATAC2/TEST/540634CC5D93E3B4E05362E098810151/DATAFILE/testtde.1581.975738561' encrypt;

Database altered.

SQL>  alter tablespace testtde online;

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

TABLESPACE_NAME                ENC
------------------------------ ---
TESTTDE                        YES

1. Backup of datafile
RMAN>  backup device type disk datafile 968 format '/u02/app_acfs/test/demo%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=obitst1 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=+DATAC2/TEST/540634CC5D93E3B4E05362E098810151/DATAFILE/testtde.1581.975738561
channel ORA_DISK_1: starting piece 1 at 15-MAY-18
channel ORA_DISK_1: finished piece 1 at 15-MAY-18
piece handle=/u02/app_acfs/test/demobet2u4bs_1_1 tag=TAG20180515T042636 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 '+RECOC2/TEST/540634CC5D93E3B4E05362E098810151/DATAFILE/testtde.26291.976181399' format '/u02/app_acfs/test/demo%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=+RECOC2/TEST/540634CC5D93E3B4E05362E098810151/DATAFILE/testtde.26291.976181399
channel ORA_DISK_1: starting piece 1 at 15-MAY-18
channel ORA_DISK_1: finished piece 1 at 15-MAY-18
piece handle=/u02/app_acfs/test/demobit2u4l5_1_1 tag=TAG20180515T043130 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!


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