Exp / Expdp como uma solução de backup é como dizer que a loja de autopeças é o seu automóvel de backup. Tecnicamente, você voltará a funcionar, mas não causará nada além de dor e sofrimento.
Exp ou Expdp podem ser usados como um backup secundário para backups frios do sistema de arquivos ou para backups rman hot ou cold (outro software cliente de backup Oracle geralmente executa apenas os comandos RMAN).
A metodologia típica seria a seguinte:
1 cold backup weekly
1 hot backup daily
E se você realmente deseja ser prudente, transporte periodicamente os logs de refazer arquivados do servidor (a cada hora funciona) ou defina um local remoto para um segundo destino de log de arquivamento.
- RMAN * novo -
Minha sessão típica do RMAN:
rman target=/
backup as compressed backupset database plus archivelog delete input;
delete obsolete;
exit
"Backup como conjunto de backup compactado ...": Você também pode fazer uma imagem, que é um byte para cópia em byte dos arquivos de dados. Isso seria bom como esse backup semanal.
"... database ...": bastante óbvio
"... mais archivelogs ...": nos fornece recuperação pontual (e clonagem pontual [comando duplicado no rman])
"... delete input": exclui os arquivos de registro que foram salvos em backup. Você também pode definir isso para excluir os que foram salvos em backup pelo menos duas vezes etc.
"excluir obsoleto": quando você tiver configurado sua política de retenção rman (a minha é de 5 dias), isso excluirá os backups que estão fora dessa janela. Isso não significa que podemos recuperar apenas 5 dias atrás. Você ainda deve ter seus backups em fita / fora do servidor diariamente da área de recuperação flash. Significa apenas que on-line você terá 5 dias de recuperação e depois precisará restaurar itens da área de recuperação flash a partir do backup em fita / fora do servidor e registrá-los no rman para usá-los.
Aqui está um log real de uma sessão, modificado levemente para os caminhos, etc:
oracle@prodserver[PROD]$ rman target=/
Recovery Manager: Release 10.2.0.4.0 - Production on Wed Jan 5 21:00:00 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: PROD (DBID=randomnumber)
RMAN> backup
2> as compressed backupset
3> database
4> include current controlfile
5> plus archivelog delete input;
6> backup spfile;
7> delete obsolete;
8>
Starting backup at 05-JAN-11
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=291 devtype=DISK
channel ORA_DISK_1: starting compressed archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=743 recid=743 stamp=739623589
input archive log thread=1 sequence=744 recid=744 stamp=739623940
input archive log thread=1 sequence=745 recid=745 stamp=739624712
input archive log thread=1 sequence=746 recid=746 stamp=739625380
input archive log thread=1 sequence=747 recid=747 stamp=739659606
channel ORA_DISK_1: starting piece 1 at 05-JAN-11
channel ORA_DISK_1: finished piece 1 at 05-JAN-11
piece handle=/u03/oraflash/PROD/backupset/2011_01_05/o1_mf_annnn_TAG20110105T210008_6lb8kb4o_.bkp tag=TAG20110105T210008 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:26
channel ORA_DISK_1: deleting archive log(s)
archive log filename=/u03/oraflash/PROD/archivelog/2011_01_05/o1_mf_1_743_6l95ckxx_.arc recid=743 stamp=739623589
archive log filename=/u03/oraflash/PROD/archivelog/2011_01_05/o1_mf_1_744_6l95plo2_.arc recid=744 stamp=739623940
archive log filename=/u03/oraflash/PROD/archivelog/2011_01_05/o1_mf_1_745_6l96gpok_.arc recid=745 stamp=739624712
archive log filename=/u03/oraflash/PROD/archivelog/2011_01_05/o1_mf_1_746_6l973l32_.arc recid=746 stamp=739625380
archive log filename=/u03/oraflash/PROD/archivelog/2011_01_05/o1_mf_1_747_6lb8k57v_.arc recid=747 stamp=739659606
Finished backup at 05-JAN-11
Starting backup at 05-JAN-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u02/oradata/PROD/system01.dbf
input datafile fno=00005 name=/u02/oradata/PROD/software.dbf
input datafile fno=00003 name=/u02/oradata/PROD/sysaux01dbf
input datafile fno=00002 name=/u02/oradata/PROD/undotbs01.dbf
input datafile fno=00004 name=/u02/oradata/PROD/users.dbf
channel ORA_DISK_1: starting piece 1 at 05-JAN-11
channel ORA_DISK_1: finished piece 1 at 05-JAN-11
piece handle=/u03/oraflash/PROD/backupset/2011_01_05/o1_mf_nnndf_TAG20110105T210135_6lb8n0y4_.bkp tag=TAG20110105T210135 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:45
channel ORA_DISK_1: starting compressed full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 05-JAN-11
channel ORA_DISK_1: finished piece 1 at 05-JAN-11
piece handle=/u03/oraflash/PROD/backupset/2011_01_05/o1_mf_ncsnf_TAG20110105T210135_6lb8qblm_.bkp tag=TAG20110105T210135 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 05-JAN-11
Starting backup at 05-JAN-11
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=748 recid=748 stamp=739659803
channel ORA_DISK_1: starting piece 1 at 05-JAN-11
channel ORA_DISK_1: finished piece 1 at 05-JAN-11
piece handle=/u03/oraflash/PROD/backupset/2011_01_05/o1_mf_annnn_TAG20110105T210323_6lb8qf3l_.bkp tag=TAG20110105T210323 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
channel ORA_DISK_1: deleting archive log(s)
archive log filename=/u03/oraflash/PROD/archivelog/2011_01_05/o1_mf_1_748_6lb8qcrr_.arc recid=748 stamp=739659803
Finished backup at 05-JAN-11
Starting backup at 05-JAN-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 05-JAN-11
channel ORA_DISK_1: finished piece 1 at 05-JAN-11
piece handle=/u03/oraflash/PROD/backupset/2011_01_05/o1_mf_nnsnf_TAG20110105T210329_6lb8qlnm_.bkp tag=TAG20110105T210329 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 05-JAN-11
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 5 days
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set 55 30-DEC-10
Backup Piece 55 30-DEC-10 /u03/oraflash/PROD/backupset/2010_12_30/o1_mf_nnndf_TAG20101230T210026_6ktg9v8w_.bkp
Backup Set 56 30-DEC-10
Backup Piece 56 30-DEC-10 /u03/oraflash/PROD/backupset/2010_12_30/o1_mf_ncsnf_TAG20101230T210026_6ktgdvnt_.bkp
Backup Set 57 30-DEC-10
Backup Piece 57 30-DEC-10 /u03/oraflash/PROD/backupset/2010_12_30/o1_mf_annnn_TAG20101230T210204_6ktgdy5j_.bkp
Backup Set 58 30-DEC-10
Backup Piece 58 30-DEC-10 /u03/oraflash/PROD/backupset/2010_12_30/o1_mf_nnsnf_TAG20101230T210210_6ktgf3pz_.bkp
Backup Set 59 31-DEC-10
Backup Piece 59 31-DEC-10 /u03/oraflash/PROD/backupset/2010_12_31/o1_mf_annnn_TAG20101231T210008_6kx2ob5r_.bkp
deleted backup piece
backup piece handle=/u03/oraflash/PROD/backupset/2010_12_30/o1_mf_nnndf_TAG20101230T210026_6ktg9v8w_.bkp recid=55 stamp=739141227
deleted backup piece
backup piece handle=/u03/oraflash/PROD/backupset/2010_12_30/o1_mf_ncsnf_TAG20101230T210026_6ktgdvnt_.bkp recid=56 stamp=739141323
deleted backup piece
backup piece handle=/u03/oraflash/PROD/backupset/2010_12_30/o1_mf_annnn_TAG20101230T210204_6ktgdy5j_.bkp recid=57 stamp=739141326
deleted backup piece
backup piece handle=/u03/oraflash/PROD/backupset/2010_12_30/o1_mf_nnsnf_TAG20101230T210210_6ktgf3pz_.bkp recid=58 stamp=739141331
deleted backup piece
backup piece handle=/u03/oraflash/PROD/backupset/2010_12_31/o1_mf_annnn_TAG20101231T210008_6kx2ob5r_.bkp recid=59 stamp=739227610
Deleted 5 objects
Recovery Manager complete.