In this article we will see password based encryption.
Step 1 : Connect to RMAN
[oracle@localhost ~]$ rman target /
Recovery Manager: Release 12.2.0.1.0 - Production on Mon Jan 7 13:44:38 2019
Copyright (c) 1982, 2017, Oracle and/or its affiliates. All rights reserved.
connected to target database: DEMO (DBID=3740643610)
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name DEMO are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/oracle/product/12.2.0/db_1/dbs/snapcf_demo.f'; # default
Step 2 : Set encryption algorithm
RMAN> SET ENCRYPTION ON ALGORITHM 'AES128' IDENTIFIED BY 'orarmanbkp';
executing command: SET encryption
Step 3 : Here I am taking backup of one tablespace in ORCLPDB pluggable database
RMAN> BACKUP DEVICE TYPE DISK TABLESPACE ORCLPDB:DEM_TBS;
Starting backup at 24-APR-19
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=136 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00016 name=/home/appndb/oracle/oradata/ORCL/7D624BBBEC2B4677E0538001A8C06AFB/datafile/o1_mf_dem_tbs_gd0ml9d4_.dbf
channel ORA_DISK_1: starting piece 1 at 24-APR-19
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 04/24/2019 17:25:04
ORA-19914: unable to encrypt backup
ORA-28365: wallet is not open
We can see an error is thrown here , unable to encrypt backup , wallet is not open
Explanation : To set password only encryption we need to apply “ONLY” keyword at the end of this command .
RMAN> SET ENCRYPTION ON ALGORITHM 'AES128' IDENTIFIED BY 'orarmanbkp' ONLY;
executing command: SET encryption
Now let us take backup
RMAN> BACKUP DEVICE TYPE DISK TABLESPACE PDB:DEM_TBS; Starting backup at 07-JAN-19 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=00014 name=/u02/oradata/DEMO/7E8758AC5ED126B4E055000000000001/datafile/o1_mf_dem_tbs_g362hp3q_.dbf channel ORA_DISK_1: starting piece 1 at 07-JAN-19 channel ORA_DISK_1: finished piece 1 at 07-JAN-19 piece handle=/u02/fast_recovery_area/demo/DEMO/7E8758AC5ED126B4E055000000000001/backupset/2019_01_07/o1_mf_nnndf_TAG20190107T135002_g362xl9n_.bkp tag=TAG20190107T135002 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 07-JAN-19 Starting Control File and SPFILE Autobackup at 07-JAN-19 piece handle=/u02/fast_recovery_area/demo/DEMO/autobackup/2019_01_07/o1_mf_s_996933003_g362xn6s_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 07-JAN-19 RMAN>
Thank you for giving your valuable time to read the above information.
If you want to be updated with all our articles send us the Invitation or Follow us:
Telegram Channel: https://t.me/helporacle
Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/
Joel Perez’s LinkedIn: Joel Perez’s Profile
LinkedIn Group: Oracle Cloud DBAAS
Facebook Page: OracleHelp