You are on page 1of 4

sqlplus / as sysdba

archive log list;


----------if no archivelog list-----------
shutdown immediate;
startup mount;
alter database archivelog;

archive log list;

sqlplus / as sysdba

cd /u02

mkdir wallet

pwd /u02/wallet

cd /u01/app/oracle/product/12.2.0/db_1/network/admin

vi sqlnet.ora

cat sqlnet.ora

# sqlnet.ora Network Configuration File:


/u01/app/oracle/product/12.2.0/db_1/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.

NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)


ADR_BASE = /u02

ENCRYPTION_WALLET_LOCATION=
(SOURCE=
(METHOD=FILE)
(METHOD_DATA=
(DIRECTORY=/u02/wallet)
)
)

rman target /

show all;

CONFIGURE ENCRYPTION FOR DATABASE ON;

sqlplus / as sysdba

administer key management create keystore '/u02/wallet' identified by password;

administer key management set keystore open identified by password;

administer key management set key identified by password with backup using
'master';

select WRL_PARAMETER,STATUS,WALLET_TYPE from v$encryption_wallet;


WRL_PARAMETER
--------------------------------------------------------------------------------
STATUS WALLET_TYPE
------------------------------ --------------------
/u02/wallet/
OPEN PASSWORD

administer key management backup keystore identified by password;

cd /u02/wallet/

rman target /

show all;

set encryption on identified by password only;

sqlplus / as sysdba

select WRL_PARAMETER,STATUS,WALLET_TYPE from v$encryption_wallet;

if close then open


------------------

administer key management set keystore open identified by password;

rman target /

run{
allocate channel c1 type disk;
backup as backupset format '/u02/rman_bkp/df_%d_%s_%p'
incremental level 0 database;
backup as backupset format '/u02/rman_bkp/ar_%d_%s_%p'
archivelog all delete input;
}

cd /u01/app/oracle/oradata/orcl/

rm -rf users01.dbf

rman target /

restore tablespace users; <---if database is not open then startup mount mode and
perform this operation

recover tablespace users;

alter database open;

sqlplus / as sysdba

SELECT TABLESPACE_NAME, STATUS, CONTENTS


FROM USER_TABLESPACES;

==================================================================================
---------or another error solution-----------

rman target /

restore tablespace users;

Starting restore at 16-APR-21


using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore


channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00007 to
/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: reading from backup piece /u02/rman_bkp/df_ORCL_11_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 04/16/2021 12:55:16
ORA-19870: error while restoring backup piece /u02/rman_bkp/df_ORCL_11_1
ORA-19913: unable to decrypt backup

--------------
or
-----
rman target /

Starting restore at 11-MAY-21


allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=34 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore


channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00007 to
/u01/app/oracle/oradata/orcl/users01.dbf
channel ORA_DISK_1: reading from backup piece /u02/rman_bkp/df_ORCL_17_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 05/11/2021 15:05:42
ORA-19870: error while restoring backup piece /u02/rman_bkp/df_ORCL_17_1
ORA-19913: unable to decrypt backup
ORA-28365: wallet is not open

set DECRYPTION identified by 'password';

sqlplus / as sysdba

administer key management set keystore open identified by password;

rman target /

restore tablespace users;

recover tablespace users;


alter database open;

sqlplus / as sysdba

SELECT TABLESPACE_NAME, STATUS, CONTENTS


FROM USER_TABLESPACES;

You might also like