Oracle Backup & Recovery – ENCRYPTION
Esta abaixo é uma das situações de RECOVER que os alunos executarão no Treinamento Oracle Backup & Recovery, na Nerv. Este treinamento tem a duração de 3 Sábados, e o próximo iniciará em 03/07/2010.
Veja todo o conteúdo programático aqui.
Maiores informações: contato@nervinformatica.com.br.
Seu Banco de Dados está seguro? Você utiliza senhas fortes para o usuário oracle, o sys e o system, certo?
De que adianta, se seus Backups não estão seguros? Quem tem acesso aos Backups?
Na posse de um Backup, é simples restaura-lo em outra máquina com RMAN, e ter acesso completo aos seus dados.
A Criptografia do RMAN pode ser configurada de três formas: Transparent (só utilizando o Oracle Wallet), Password, ou Dual Mode.
A forma mais simples, é o Password, como demonstrado abaixo:
[oracle@CentOS5-01 ~]$ rman TARGET /
Recovery Manager: Release 11.2.0.1.0 - Production on Mon Jun 7 07:01:36 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1245905782)
RMAN> SHOW ENCRYPTION FOR DATABASE;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE ENCRYPTION FOR DATABASE OFF;
RMAN> SET ENCRYPTION ON IDENTIFIED BY 'MyPasswordIsHard' ONLY;
executing command: SET encryption
RMAN> BACKUP DATAFILE 5;
Starting backup at 07-JUN-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=28 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=00005 name=/u01/oradata/example01.NEW.dbf
channel ORA_DISK_1: starting piece 1 at 07-JUN-10
channel ORA_DISK_1: finished piece 1 at 07-JUN-10
piece handle=/u01/flash_recovery_area/ORCL/backupset/2010_06_07/o1_mf_nnndf_TAG20100607T070217_60sjx9j8_.bkp tag=TAG20100607T070217 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:27
Finished backup at 07-JUN-10
Starting Control File and SPFILE Autobackup at 07-JUN-10
piece handle=/u01/flash_recovery_area/ORCL/autobackup/2010_06_07/o1_mf_s_721033364_60sjy7h7_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 07-JUN-10
RMAN> EXIT
Recovery Manager complete.
[oracle@CentOS5-01 ~]$ rman TARGET /
Recovery Manager: Release 11.2.0.1.0 - Production on Mon Jun 7 07:23:18 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL (DBID=1245905782)
RMAN> SQL 'ALTER TABLESPACE EXAMPLE OFFLINE';
sql statement: ALTER TABLESPACE EXAMPLE OFFLINE
RMAN> RESTORE DATAFILE 5;
Starting restore at 07-JUN-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=35 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 00005 to /u01/oradata/example01.NEW.dbf
channel ORA_DISK_1: reading from backup piece /u01/flash_recovery_area/ORCL/backupset/2010_06_07/o1_mf_nnndf_TAG20100607T070217_60sjx9j8_.bkp
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/07/2010 07:23:49
ORA-19870: error while restoring backup piece /u01/flash_recovery_area/ORCL/backupset/2010_06_07/o1_mf_nnndf_TAG20100607T070217_60sjx9j8_.bkp
ORA-19913: unable to decrypt backup
ORA-28365: wallet is not open
RMAN> SHOW ENCRYPTION FOR DATABASE;
RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE ENCRYPTION FOR DATABASE OFF;
RMAN> SET DECRYPTION IDENTIFIED BY 'MyPasswordIsHard';
executing command: SET decryption
RMAN> RESTORE DATAFILE 5;
Starting restore at 07-JUN-10
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 00005 to /u01/oradata/example01.NEW.dbf
channel ORA_DISK_1: reading from backup piece /u01/flash_recovery_area/ORCL/backupset/2010_06_07/o1_mf_nnndf_TAG20100607T070217_60sjx9j8_.bkp
channel ORA_DISK_1: piece handle=/u01/flash_recovery_area/ORCL/backupset/2010_06_07/o1_mf_nnndf_TAG20100607T070217_60sjx9j8_.bkp tag=TAG20100607T070217
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:15
Finished restore at 07-JUN-10
RMAN>