Backup com RMAN em MODO ARCHIVELOG
Posted by Emerson on 06:54 with 2 comments
Olá galera!
No post passado falamos sobre Os modos ARCHIVELOG e NOARCHIVELOG, mostrando a diferença básica de cada modo de operação dos bancos de dados Oracle.
Hoje iremos mostrar como fazer backup do banco de dados e seus archives gerados com o RMAN(Recovery Manager).
O RMAN é uma ferramenta de backup poderosa gratuita disponibilizada pela Oracle.
Através dela é possível fazer backup dos Controlfiles, SFiles, Datafiles,Tablespaces,Archive Logs, FRA,etc, nos modos citados acima, apenas com restrições para o Modo NOARCHIVELOG, que iremos demonstrar posteriormente.
Cenário:
SO: Oracle Enterprise Linux 5
BD: Oracle 11g R2
Modo: Archivelog
Repositorio:Não
1 - Criando o script de backup online usando RMAN:
Por padrão setei as variável SCRIPTs nas minhas variáveis de ambiente do arquivo .bash_profile do oracle:
BACKUP=/u03/rman; export BACKUP
SCRIPTS=/u03/scripts; export SCRIPTS
#Full,Archives e Controlfile
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export ORACLE_SID=DB11G
RMAN_LOG_FILE=/u03/rman/hot_database_backup.`date +%y%m%d%H%M`.out
# -----------------------------------------------------------------
# Inicializando o arquivo de log.
# -----------------------------------------------------------------
echo>> $RMAN_LOG_FILE
chmod 666 $RMAN_LOG_FILE
echo Script $0>> $RMAN_LOG_FILE
echo ==== started on `date` ====>> $RMAN_LOG_FILE
echo>> $RMAN_LOG_FILE
ORACLE_USER=oracle
TARGET_CONNECT_STR=sys/s
RMAN=$ORACLE_HOME/bin/rman
BACKUP_TYPE="INCREMENTAL LEVEL 0"
# ---------------------------------------------------------------------------
# Escrevendo a saida e valores das variaveis de ambiente setada neste script.
# ---------------------------------------------------------------------------
echo>> $RMAN_LOG_FILE
echo "RMAN: $RMAN">> $RMAN_LOG_FILE
echo "ORACLE_SID: $ORACLE_SID">> $RMAN_LOG_FILE
echo "ORACLE_USER: $ORACLE_USER">> $RMAN_LOG_FILE
echo "ORACLE_HOME: $ORACLE_HOME">> $RMAN_LOG_FILE
echo "BACKUP_TYPE: $BACKUP_TYPE">> $RMAN_LOG_FILE
# ---------------------------------------------------------------------------
echo >> $RMAN_LOG_FILE
CMD_STR=""
#Descomentar a linha abaixo se estiver usando repositorio
#$RMAN target $TARGET_CONNECT_STR catalog rman/r@rmandb << EOF
$RMAN target / <
RUN {
ALLOCATE CHANNEL ch00 TYPE disk ;
ALLOCATE CHANNEL ch01 TYPE disk ;
ALLOCATE CHANNEL ch02 TYPE disk ;
ALLOCATE CHANNEL ch03 TYPE disk ;
BACKUP
$BACKUP_TYPE
SKIP INACCESSIBLE
TAG hot_db_bk_level0
FILESPERSET 5
# formato de backup do banco
FORMAT '/u03/rman/bkdb_%s_%p_%t'
DATABASE;
sql 'alter system archive log current';
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
RELEASE CHANNEL ch02;
RELEASE CHANNEL ch03;
# formato backup dos archive logs
ALLOCATE CHANNEL ch00 TYPE disk;
ALLOCATE CHANNEL ch01 TYPE disk;
BACKUP
SKIP INACCESSIBLE
filesperset 20
FORMAT '/u03/rman/archives_%s_%p_%t'
ARCHIVELOG ALL DELETE INPUT;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
ALLOCATE CHANNEL ch00 TYPE disk;
BACKUP
# formato backup do controlfile
FORMAT '/u03/rman/cntrl_%s_%p_%t'
CURRENT CONTROLFILE;
RELEASE CHANNEL ch00;
}
EOF
2 - Setamos permissão de execução para o script.
[oracle@oralinux scripts]$ chmod +x hot_database_backup_disk.sh
No post passado falamos sobre Os modos ARCHIVELOG e NOARCHIVELOG, mostrando a diferença básica de cada modo de operação dos bancos de dados Oracle.
Hoje iremos mostrar como fazer backup do banco de dados e seus archives gerados com o RMAN(Recovery Manager).
O RMAN é uma ferramenta de backup poderosa gratuita disponibilizada pela Oracle.
Através dela é possível fazer backup dos Controlfiles, SFiles, Datafiles,Tablespaces,Archive Logs, FRA,etc, nos modos citados acima, apenas com restrições para o Modo NOARCHIVELOG, que iremos demonstrar posteriormente.
Cenário:
SO: Oracle Enterprise Linux 5
BD: Oracle 11g R2
Modo: Archivelog
Repositorio:Não
Por padrão setei as variável SCRIPTs nas minhas variáveis de ambiente do arquivo .bash_profile do oracle:
BACKUP=/u03/rman; export BACKUP
SCRIPTS=/u03/scripts; export SCRIPTS
vim hot_database_backup_disk.sh
#/usr/bin/ksh
#Script de backup Online(hot)#Full,Archives e Controlfile
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export ORACLE_SID=DB11G
RMAN_LOG_FILE=/u03/rman/hot_database_backup.`date +%y%m%d%H%M`.out
# -----------------------------------------------------------------
# Inicializando o arquivo de log.
# -----------------------------------------------------------------
echo>> $RMAN_LOG_FILE
chmod 666 $RMAN_LOG_FILE
echo Script $0>> $RMAN_LOG_FILE
echo ==== started on `date` ====>> $RMAN_LOG_FILE
echo>> $RMAN_LOG_FILE
ORACLE_USER=oracle
TARGET_CONNECT_STR=sys/s
RMAN=$ORACLE_HOME/bin/rman
BACKUP_TYPE="INCREMENTAL LEVEL 0"
# ---------------------------------------------------------------------------
# Escrevendo a saida e valores das variaveis de ambiente setada neste script.
# ---------------------------------------------------------------------------
echo>> $RMAN_LOG_FILE
echo "RMAN: $RMAN">> $RMAN_LOG_FILE
echo "ORACLE_SID: $ORACLE_SID">> $RMAN_LOG_FILE
echo "ORACLE_USER: $ORACLE_USER">> $RMAN_LOG_FILE
echo "ORACLE_HOME: $ORACLE_HOME">> $RMAN_LOG_FILE
echo "BACKUP_TYPE: $BACKUP_TYPE">> $RMAN_LOG_FILE
# ---------------------------------------------------------------------------
echo >> $RMAN_LOG_FILE
CMD_STR=""
#Descomentar a linha abaixo se estiver usando repositorio
#$RMAN target $TARGET_CONNECT_STR catalog rman/r@rmandb << EOF
$RMAN target / <
RUN {
ALLOCATE CHANNEL ch00 TYPE disk ;
ALLOCATE CHANNEL ch01 TYPE disk ;
ALLOCATE CHANNEL ch02 TYPE disk ;
ALLOCATE CHANNEL ch03 TYPE disk ;
BACKUP
$BACKUP_TYPE
SKIP INACCESSIBLE
TAG hot_db_bk_level0
FILESPERSET 5
# formato de backup do banco
FORMAT '/u03/rman/bkdb_%s_%p_%t'
DATABASE;
sql 'alter system archive log current';
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
RELEASE CHANNEL ch02;
RELEASE CHANNEL ch03;
# formato backup dos archive logs
ALLOCATE CHANNEL ch00 TYPE disk;
ALLOCATE CHANNEL ch01 TYPE disk;
BACKUP
SKIP INACCESSIBLE
filesperset 20
FORMAT '/u03/rman/archives_%s_%p_%t'
ARCHIVELOG ALL DELETE INPUT;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
ALLOCATE CHANNEL ch00 TYPE disk;
BACKUP
# formato backup do controlfile
FORMAT '/u03/rman/cntrl_%s_%p_%t'
CURRENT CONTROLFILE;
RELEASE CHANNEL ch00;
}
EOF
2 - Setamos permissão de execução para o script.
[oracle@oralinux scripts]$ chmod +x hot_database_backup_disk.sh
3 - executando o backup
Recovery Manager: Release 11.2.0.1.0 - Production on Fri Nov 25 09:01:25 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: DB11G (DBID=237491421)
RMAN> 2> 3> 4> 5> 6> 7> 8> 9> 10> 11> 12> 13> 14> 15> 16> 17> 18> 19> 20> 21> 22> 23> 24> 25> 26> 27> 28> 29> 30> 31> 32> 33> 34> 35>
using target database control file instead of recovery catalog
allocated channel: ch00
channel ch00: SID=37 device type=DISK
allocated channel: ch01
channel ch01: SID=57 device type=DISK
allocated channel: ch02
channel ch02: SID=53 device type=DISK
allocated channel: ch03
channel ch03: SID=47 device type=DISK
Starting backup at 25-NOV-11
channel ch00: starting incremental level 0 datafile backup set
channel ch00: specifying datafile(s) in backup set
input datafile file number=00005 name=/u01/app/oracle/oradata/DB11G/
USER01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/DB11G/undotbs01.dbf
channel ch00: starting piece 1 at 25-NOV-11
channel ch01: starting incremental level 0 datafile backup set
channel ch01: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/DB11G/system01.dbf
channel ch01: starting piece 1 at 25-NOV-11
channel ch02: starting incremental level 0 datafile backup set
channel ch02: specifying datafile(s) in backup set
input datafile file number=00002 name=/u01/app/oracle/oradata/DB11G/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/DB11G/users01.dbf
channel ch02: starting piece 1 at 25-NOV-11
channel ch03: starting incremental level 0 datafile backup set
channel ch03: specifying datafile(s) in backup set
including current control file in backup set
channel ch03: starting piece 1 at 25-NOV-11
channel ch03: finished piece 1 at 25-NOV-11
piece handle=/u03/rman/bkdb_4_1_768128494 tag=HOT_DB_BK_LEVEL0 comment=NONE
channel ch03: backup set complete, elapsed time: 00:00:55
channel ch03: starting incremental level 0 datafile backup set
channel ch03: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ch03: starting piece 1 at 25-NOV-11
channel ch00: finished piece 1 at 25-NOV-11
piece handle=/u03/rman/bkdb_1_1_768128492 tag=HOT_DB_BK_LEVEL0 comment=NONE
channel ch00: backup set complete, elapsed time: 00:02:17
channel ch03: finished piece 1 at 25-NOV-11
piece handle=/u03/rman/bkdb_5_1_768128575 tag=HOT_DB_BK_LEVEL0 comment=NONE
channel ch03: backup set complete, elapsed time: 00:00:47
channel ch01: finished piece 1 at 25-NOV-11
piece handle=/u03/rman/bkdb_2_1_768128492 tag=HOT_DB_BK_LEVEL0 comment=NONE
channel ch01: backup set complete, elapsed time: 00:02:37
channel ch02: finished piece 1 at 25-NOV-11
piece handle=/u03/rman/bkdb_3_1_768128492 tag=HOT_DB_BK_LEVEL0 comment=NONE
channel ch02: backup set complete, elapsed time: 00:02:47
Finished backup at 25-NOV-11
sql statement: alter system archive log current
released channel: ch00
released channel: ch01
released channel: ch02
released channel: ch03
allocated channel: ch00
channel ch00: SID=37 device type=DISK
allocated channel: ch01
channel ch01: SID=57 device type=DISK
Starting backup at 25-NOV-11
current log archived
channel ch00: starting archived log backup set
channel ch00: specifying archived log(s) in backup set
input archived log thread=1 sequence=23 RECID=1 STAMP=767996428
input archived log thread=1 sequence=24 RECID=2 STAMP=767996436
input archived log thread=1 sequence=25 RECID=3 STAMP=767996445
input archived log thread=1 sequence=26 RECID=4 STAMP=767996455
input archived log thread=1 sequence=27 RECID=5 STAMP=767996463
input archived log thread=1 sequence=28 RECID=6 STAMP=767996474
input archived log thread=1 sequence=29 RECID=7 STAMP=767996483
input archived log thread=1 sequence=30 RECID=8 STAMP=767996490
input archived log thread=1 sequence=31 RECID=9 STAMP=767996499
input archived log thread=1 sequence=32 RECID=10 STAMP=767996508
input archived log thread=1 sequence=33 RECID=11 STAMP=767996516
input archived log thread=1 sequence=34 RECID=12 STAMP=767996524
input archived log thread=1 sequence=35 RECID=13 STAMP=767996533
input archived log thread=1 sequence=36 RECID=14 STAMP=767996540
input archived log thread=1 sequence=37 RECID=15 STAMP=767996549
input archived log thread=1 sequence=38 RECID=16 STAMP=767996557
channel ch00: starting piece 1 at 25-NOV-11
channel ch01: starting archived log backup set
channel ch01: specifying archived log(s) in backup set
input archived log thread=1 sequence=39 RECID=17 STAMP=767996564
input archived log thread=1 sequence=40 RECID=18 STAMP=767996572
input archived log thread=1 sequence=41 RECID=19 STAMP=767996581
input archived log thread=1 sequence=42 RECID=20 STAMP=767996588
input archived log thread=1 sequence=43 RECID=21 STAMP=767996597
input archived log thread=1 sequence=44 RECID=22 STAMP=767996606
input archived log thread=1 sequence=45 RECID=23 STAMP=767996615
input archived log thread=1 sequence=46 RECID=24 STAMP=767996622
input archived log thread=1 sequence=47 RECID=25 STAMP=767996631
input archived log thread=1 sequence=48 RECID=26 STAMP=767996641
input archived log thread=1 sequence=49 RECID=27 STAMP=767996648
input archived log thread=1 sequence=50 RECID=28 STAMP=767996657
input archived log thread=1 sequence=51 RECID=29 STAMP=767996669
input archived log thread=1 sequence=52 RECID=30 STAMP=767996680
input archived log thread=1 sequence=53 RECID=31 STAMP=767996689
input archived log thread=1 sequence=54 RECID=32 STAMP=767996698
channel ch01: starting piece 1 at 25-NOV-11
channel ch00: finished piece 1 at 25-NOV-11
piece handle=/u03/rman/archives_6_1_768128664 tag=TAG20111125T090423 comment=NONE
channel ch00: backup set complete, elapsed time: 00:03:16
channel ch00: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_23_7dtzxt9q_.arc RECID=1 STAMP=767996428
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_24_7dtzy2rb_.arc RECID=2 STAMP=767996436
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_25_7dtzycvt_.arc RECID=3 STAMP=767996445
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_26_7dtzypgz_.arc RECID=4 STAMP=767996455
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_27_7dtzyy6k_.arc RECID=5 STAMP=767996463
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_28_7dtzz9fy_.arc RECID=6 STAMP=767996474
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_29_7dtzzl70_.arc RECID=7 STAMP=767996483
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_30_7dtzzswx_.arc RECID=8 STAMP=767996490
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_31_7dv002rr_.arc RECID=9 STAMP=767996499
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_32_7dv00ccx_.arc RECID=1 0 STAMP=767996508
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_33_7dv00mmc_.arc RECID=1 1 STAMP=767996516
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_34_7dv00vfc_.arc RECID=1 2 STAMP=767996524
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_35_7dv0144t_.arc RECID=1 3 STAMP=767996533
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_36_7dv01cov_.arc RECID=1 4 STAMP=767996540
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_37_7dv01nrj_.arc RECID=1 5 STAMP=767996549
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_38_7dv01wvh_.arc RECID=1 6 STAMP=767996557
channel ch00: starting archived log backup set
channel ch00: specifying archived log(s) in backup set
input archived log thread=1 sequence=55 RECID=33 STAMP=767996710
input archived log thread=1 sequence=56 RECID=34 STAMP=767996721
input archived log thread=1 sequence=57 RECID=35 STAMP=767996726
input archived log thread=1 sequence=58 RECID=36 STAMP=767996732
input archived log thread=1 sequence=59 RECID=37 STAMP=767996737
input archived log thread=1 sequence=60 RECID=38 STAMP=767996747
input archived log thread=1 sequence=61 RECID=39 STAMP=767996752
input archived log thread=1 sequence=62 RECID=40 STAMP=767996765
input archived log thread=1 sequence=63 RECID=41 STAMP=767996780
input archived log thread=1 sequence=64 RECID=42 STAMP=767996791
input archived log thread=1 sequence=65 RECID=43 STAMP=767996806
input archived log thread=1 sequence=66 RECID=44 STAMP=767996819
input archived log thread=1 sequence=67 RECID=45 STAMP=767996835
input archived log thread=1 sequence=68 RECID=46 STAMP=767996849
input archived log thread=1 sequence=69 RECID=47 STAMP=767996863
input archived log thread=1 sequence=70 RECID=48 STAMP=767996875
channel ch00: starting piece 1 at 25-NOV-11
channel ch01: finished piece 1 at 25-NOV-11
piece handle=/u03/rman/archives_7_1_768128664 tag=TAG20111125T090423 comment=NONE
channel ch01: backup set complete, elapsed time: 00:03:38
channel ch01: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_39_7dv023vd_.arc RECID=1 7 STAMP=767996564
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_40_7dv02c5w_.arc RECID=1 8 STAMP=767996572
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_41_7dv02ngt_.arc RECID=1 9 STAMP=767996581
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_42_7dv02vwv_.arc RECID=2 0 STAMP=767996588
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_43_7dv034vf_.arc RECID=2 1 STAMP=767996597
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_44_7dv03fg5_.arc RECID=2 2 STAMP=767996606
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_45_7dv03ors_.arc RECID=2 3 STAMP=767996615
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_46_7dv03xcc_.arc RECID=2 4 STAMP=767996622
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_47_7dv044y0_.arc RECID=2 5 STAMP=767996631
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_48_7dv04g9p_.arc RECID=2 6 STAMP=767996641
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_49_7dv04pg7_.arc RECID=2 7 STAMP=767996648
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_50_7dv04ydk_.arc RECID=2 8 STAMP=767996657
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_51_7dv05b4r_.arc RECID=2 9 STAMP=767996669
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_52_7dv05nn8_.arc RECID=3 0 STAMP=767996680
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_53_7dv05xxz_.arc RECID=3 1 STAMP=767996689
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_54_7dv066xl_.arc RECID=3 2 STAMP=767996698
channel ch01: starting archived log backup set
channel ch01: specifying archived log(s) in backup set
input archived log thread=1 sequence=71 RECID=49 STAMP=767996890
input archived log thread=1 sequence=72 RECID=50 STAMP=767996912
input archived log thread=1 sequence=73 RECID=51 STAMP=767996929
input archived log thread=1 sequence=74 RECID=52 STAMP=767996951
input archived log thread=1 sequence=75 RECID=53 STAMP=767996967
input archived log thread=1 sequence=76 RECID=54 STAMP=767996996
input archived log thread=1 sequence=77 RECID=55 STAMP=767997017
input archived log thread=1 sequence=78 RECID=56 STAMP=767997032
input archived log thread=1 sequence=79 RECID=57 STAMP=768002476
input archived log thread=1 sequence=80 RECID=58 STAMP=768006017
input archived log thread=1 sequence=81 RECID=59 STAMP=768031239
input archived log thread=1 sequence=82 RECID=60 STAMP=768058241
input archived log thread=1 sequence=83 RECID=61 STAMP=768085208
input archived log thread=1 sequence=84 RECID=62 STAMP=768092422
input archived log thread=1 sequence=85 RECID=63 STAMP=768117665
input archived log thread=1 sequence=86 RECID=64 STAMP=768128662
input archived log thread=1 sequence=87 RECID=65 STAMP=768128663
channel ch01: starting piece 1 at 25-NOV-11
channel ch01: finished piece 1 at 25-NOV-11
piece handle=/u03/rman/archives_9_1_768128894 tag=TAG20111125T090423 comment=NONE
channel ch01: backup set complete, elapsed time: 00:02:33
channel ch01: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_71_7dv0d6x3_.arc RECID=49 STAMP=767996890
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_72_7dv0dw0c_.arc RECID=50 STAMP=767996912
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_73_7dv0fg23_.arc RECID=51 STAMP=767996929
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_74_7dv0g30w_.arc RECID=52 STAMP=767996951
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_75_7dv0gmf9_.arc RECID=53 STAMP=767996967
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_76_7dv0hgkj_.arc RECID=54 STAMP=767996996
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_77_7dv0j5ql_.arc RECID=55 STAMP=767997017
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_78_7dv0jmnw_.arc RECID=56 STAMP=767997032
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_79_7dv5tomg_.arc RECID=57 STAMP=768002476
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_80_7dv99hcd_.arc RECID=58 STAMP=768006017
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_24/o1_mf_1_81_7dw1xo8o_.arc RECID=59 STAMP=768031239
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_24/o1_mf_1_82_7dww9gxp_.arc RECID=60 STAMP=768058241
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_24/o1_mf_1_83_7dxpn64c_.arc RECID=61 STAMP=768085208
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_24/o1_mf_1_84_7dxxoncd_.arc RECID=62 STAMP=768092422
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_25/o1_mf_1_85_7dypbdnv_.arc RECID=63 STAMP=768117665
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_25/o1_mf_1_86_7dz125rh_.arc RECID=64 STAMP=768128662
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_25/o1_mf_1_87_7dz127d5_.arc RECID=65 STAMP=768128663
channel ch00: finished piece 1 at 25-NOV-11
piece handle=/u03/rman/archives_8_1_768128881 tag=TAG20111125T090423 comment=NONE
channel ch00: backup set complete, elapsed time: 00:03:28
channel ch00: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_55_7dv06l77_.arc RECID=33 STAMP=767996710
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_56_7dv06yyr_.arc RECID=34 STAMP=767996721
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_57_7dv075dw_.arc RECID=35 STAMP=767996726
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_58_7dv07cbs_.arc RECID=36 STAMP=767996732
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_59_7dv07k4c_.arc RECID=37 STAMP=767996737
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_60_7dv07tgw_.arc RECID=38 STAMP=767996747
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_61_7dv07zhs_.arc RECID=39 STAMP=767996752
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_62_7dv089n6_.arc RECID=40 STAMP=767996765
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_63_7dv08sn5_.arc RECID=41 STAMP=767996780
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_64_7dv094t9_.arc RECID=42 STAMP=767996791
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_65_7dv09m3r_.arc RECID=43 STAMP=767996806
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_66_7dv0b0q7_.arc RECID=44 STAMP=767996819
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_67_7dv0bh6p_.arc RECID=45 STAMP=767996835
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_68_7dv0by8y_.arc RECID=46 STAMP=767996849
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_69_7dv0cf3c_.arc RECID=47 STAMP=767996863
archived log file name=/u01/app/oracle/flash_recovery_area/DB11G/archivelog/2011_11_23/o1_mf_1_70_7dv0cs7b_.arc RECID=48 STAMP=767996875
Finished backup at 25-NOV-11
released channel: ch00
released channel: ch01
allocated channel: ch00
channel ch00: SID=37 device type=DISK
Starting backup at 25-NOV-11
channel ch00: starting full datafile backup set
channel ch00: specifying datafile(s) in backup set
including current control file in backup set
channel ch00: starting piece 1 at 25-NOV-11
channel ch00: finished piece 1 at 25-NOV-11
piece handle=/u03/rman/cntrl_10_1_768129092 tag=TAG20111125T091132 comment=NONE
channel ch00: backup set complete, elapsed time: 00:00:01
Finished backup at 25-NOV-11
released channel: ch00
RMAN>
Recovery Manager complete.
[oracle@oralinux scripts]$
4 - Visualizando os arquivos gerados do na partição de backup
[oracle@oralinux rman]$ pwd
/u03/rman
[oracle@oralinux rman]$ ls -lah
total 5,6G
drwxr-xr-x 2 oracle oinstall 4,0K Nov 26 08:38 .
drwxr-xr-x 6 oracle oinstall 4,0K Nov 25 04:39 ..
-rw-r----- 1 oracle oinstall 768M Nov 25 09:07 archives_6_1_768128664
-rw-r----- 1 oracle oinstall 755M Nov 25 09:07 archives_7_1_768128664
-rw-r----- 1 oracle oinstall 750M Nov 25 09:11 archives_8_1_768128881
-rw-r----- 1 oracle oinstall 669M Nov 25 09:10 archives_9_1_768128894
-rw-r----- 1 oracle oinstall 447M Nov 26 08:36 bkdb_11_1_768213241
-rw-r----- 1 oracle oinstall 514M Nov 25 09:03 bkdb_1_1_768128492
-rw-r----- 1 oracle oinstall 9,7M Nov 26 08:35 bkdb_14_1_768213243
-rw-r----- 1 oracle oinstall 96K Nov 26 08:36 bkdb_15_1_768213373
-rw-r----- 1 oracle oinstall 601M Nov 26 08:37 bkdb_16_1_768213419
-rw-r----- 1 oracle oinstall 598M Nov 25 09:04 bkdb_2_1_768128492
-rw-r----- 1 oracle oinstall 507M Nov 25 09:04 bkdb_3_1_768128492
-rw-r----- 1 oracle oinstall 9,7M Nov 25 09:01 bkdb_4_1_768128494
-rw-r----- 1 oracle oinstall 96K Nov 25 09:03 bkdb_5_1_768128575
-rw-r----- 1 oracle oinstall 9,7M Nov 25 09:11 cntrl_10_1_768129092
-rw-rw-rw- 1 oracle oinstall 262 Nov 25 08:54 hot_database_backup.1111250854.out
-rw-rw-rw- 1 oracle oinstall 262 Nov 25 08:57 hot_database_backup.1111250857.out
-rw-rw-rw- 1 oracle oinstall 262 Nov 25 09:00 hot_database_backup.1111250900.out
-rw-rw-rw- 1 oracle oinstall 262 Nov 25 09:01 hot_database_backup.1111250901.out
-rw-rw-rw- 1 root root 526 Nov 26 08:33 hot_database_backup.1111260833.out
Visualizando o log do backup:
Visualizando o log do backup:
[oracle@oralinux rman]$ cat hot_database_backup.1111250901.out
Script ./hot_database_backup_disk.sh
==== started on Sex Nov 25 09:01:25 BRT 2011 ====
RMAN: /u01/app/oracle/product/11.2.0/db_1/bin/rman
ORACLE_SID: DB11G
ORACLE_USER: oracle
ORACLE_HOME: /u01/app/oracle/product/11.2.0/db_1
BACKUP_TYPE: INCREMENTAL LEVEL 0
[oracle@oralinux rman]$
5 - Nossos arquivos estão prontos para serem enviado para uma mídia externa (disco bkp,fita, etc):
6 - Listando o conteudo de nossos backup via RMAN:
[oracle@oralinux rman]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Sat Nov 26 08:46:44 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: DB11G (DBID=237491421)
RMAN> list backup summary;
using target database control file instead of recovery catalog
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
1 B 0 A DISK 25-NOV-11 1 1 NO HOT_DB_BK_LEVEL0
2 B 0 A DISK 25-NOV-11 1 1 NO HOT_DB_BK_LEVEL0
3 B 0 A DISK 25-NOV-11 1 1 NO HOT_DB_BK_LEVEL0
4 B 0 A DISK 25-NOV-11 1 1 NO HOT_DB_BK_LEVEL0
5 B 0 A DISK 25-NOV-11 1 1 NO HOT_DB_BK_LEVEL0
6 B A A DISK 25-NOV-11 1 1 NO TAG20111125T090423
7 B A A DISK 25-NOV-11 1 1 NO TAG20111125T090423
8 B A A DISK 25-NOV-11 1 1 NO TAG20111125T090423
9 B A A DISK 25-NOV-11 1 1 NO TAG20111125T090423
10 B F A DISK 25-NOV-11 1 1 NO TAG20111125T091132
11 B 0 A DISK 26-NOV-11 1 1 NO HOT_DB_BK_LEVEL0
12 B 0 A DISK 26-NOV-11 1 1 NO HOT_DB_BK_LEVEL0
13 B 0 A DISK 26-NOV-11 1 1 NO HOT_DB_BK_LEVEL0
14 B 0 A DISK 26-NOV-11 1 1 NO HOT_DB_BK_LEVEL0
RMAN> list backup;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Incr 0 9.61M DISK 00:00:27 25-NOV-11
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: HOT_DB_BK_LEVEL0
Piece Name: /u03/rman/bkdb_4_1_768128494
Control File Included: Ckp SCN: 1321530 Ckp time: 25-NOV-11
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2 Incr 0 80.00K DISK 00:00:40 25-NOV-11
BP Key: 2 Status: AVAILABLE Compressed: NO Tag: HOT_DB_BK_LEVEL0
Piece Name: /u03/rman/bkdb_5_1_768128575
SPFILE Included: Modification time: 23-NOV-11
SPFILE db_unique_name: DB11G
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Incr 0 513.55M DISK 00:02:07 25-NOV-11
BP Key: 3 Status: AVAILABLE Compressed: NO Tag: HOT_DB_BK_LEVEL0
Piece Name: /u03/rman/bkdb_1_1_768128492
List of Datafiles in backup set 3
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
3 0 Incr 1321528 25-NOV-11 /u01/app/oracle/oradata/DB11G/undotbs01.dbf
5 0 Incr 1321528 25-NOV-11 /u01/app/oracle/oradata/DB11G/
USER01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4 Incr 0 597.66M DISK 00:02:32 25-NOV-11
BP Key: 4 Status: AVAILABLE Compressed: NO Tag: HOT_DB_BK_LEVEL0
Piece Name: /u03/rman/bkdb_2_1_768128492
List of Datafiles in backup set 4
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 0 Incr 1321529 25-NOV-11 /u01/app/oracle/oradata/DB11G/system01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
5 Incr 0 506.79M DISK 00:02:40 25-NOV-11
BP Key: 5 Status: AVAILABLE Compressed: NO Tag: HOT_DB_BK_LEVEL0
Piece Name: /u03/rman/bkdb_3_1_768128492
List of Datafiles in backup set 5
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
2 0 Incr 1321530 25-NOV-11 /u01/app/oracle/oradata/DB11G/sysaux01.dbf
4 0 Incr 1321530 25-NOV-11 /u01/app/oracle/oradata/DB11G/users01.dbf
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
6 767.24M DISK 00:03:06 25-NOV-11
BP Key: 6 Status: AVAILABLE Compressed: NO Tag: TAG20111125T090423
Piece Name: /u03/rman/archives_6_1_768128664
List of Archived Logs in backup set 6
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 23 1074276 23-NOV-11 1110309 23-NOV-11
1 24 1110309 23-NOV-11 1110969 23-NOV-11
1 25 1110969 23-NOV-11 1111627 23-NOV-11
1 26 1111627 23-NOV-11 1112282 23-NOV-11
1 27 1112282 23-NOV-11 1112931 23-NOV-11
1 28 1112931 23-NOV-11 1113604 23-NOV-11
1 29 1113604 23-NOV-11 1114271 23-NOV-11
1 30 1114271 23-NOV-11 1114884 23-NOV-11
1 31 1114884 23-NOV-11 1115537 23-NOV-11
1 32 1115537 23-NOV-11 1116202 23-NOV-11
1 33 1116202 23-NOV-11 1116851 23-NOV-11
1 34 1116851 23-NOV-11 1117511 23-NOV-11
1 35 1117511 23-NOV-11 1118172 23-NOV-11
1 36 1118172 23-NOV-11 1118822 23-NOV-11
1 37 1118822 23-NOV-11 1119460 23-NOV-11
1 38 1119460 23-NOV-11 1120117 23-NOV-11
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
7 754.51M DISK 00:03:36 25-NOV-11
BP Key: 7 Status: AVAILABLE Compressed: NO Tag: TAG20111125T090423
Piece Name: /u03/rman/archives_7_1_768128664
List of Archived Logs in backup set 7
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 39 1120117 23-NOV-11 1120686 23-NOV-11
1 40 1120686 23-NOV-11 1121339 23-NOV-11
1 41 1121339 23-NOV-11 1121993 23-NOV-11
1 42 1121993 23-NOV-11 1122592 23-NOV-11
1 43 1122592 23-NOV-11 1123252 23-NOV-11
1 44 1123252 23-NOV-11 1123911 23-NOV-11
1 45 1123911 23-NOV-11 1124560 23-NOV-11
1 46 1124560 23-NOV-11 1125213 23-NOV-11
1 47 1125213 23-NOV-11 1125871 23-NOV-11
1 48 1125871 23-NOV-11 1126520 23-NOV-11
1 49 1126520 23-NOV-11 1127071 23-NOV-11
1 50 1127071 23-NOV-11 1127711 23-NOV-11
1 51 1127711 23-NOV-11 1128424 23-NOV-11
1 52 1128424 23-NOV-11 1129068 23-NOV-11
1 53 1129068 23-NOV-11 1129706 23-NOV-11
1 54 1129706 23-NOV-11 1130345 23-NOV-11
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
8 668.43M DISK 00:02:25 25-NOV-11
BP Key: 8 Status: AVAILABLE Compressed: NO Tag: TAG20111125T090423
Piece Name: /u03/rman/archives_9_1_768128894
List of Archived Logs in backup set 8
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 71 1144270 23-NOV-11 1145203 23-NOV-11
1 72 1145203 23-NOV-11 1146147 23-NOV-11
1 73 1146147 23-NOV-11 1147093 23-NOV-11
1 74 1147093 23-NOV-11 1148038 23-NOV-11
1 75 1148038 23-NOV-11 1148892 23-NOV-11
1 76 1148892 23-NOV-11 1149828 23-NOV-11
1 77 1149828 23-NOV-11 1150784 23-NOV-11
1 78 1150784 23-NOV-11 1151627 23-NOV-11
1 79 1151627 23-NOV-11 1162193 23-NOV-11
1 80 1162193 23-NOV-11 1172163 23-NOV-11
1 81 1172163 23-NOV-11 1199706 24-NOV-11
1 82 1199706 24-NOV-11 1230948 24-NOV-11
1 83 1230948 24-NOV-11 1262774 24-NOV-11
1 84 1262774 24-NOV-11 1278495 24-NOV-11
1 85 1278495 24-NOV-11 1309029 25-NOV-11
1 86 1309029 25-NOV-11 1321682 25-NOV-11
1 87 1321682 25-NOV-11 1321720 25-NOV-11
BS Key Size Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
9 749.38M DISK 00:03:28 25-NOV-11
BP Key: 9 Status: AVAILABLE Compressed: NO Tag: TAG20111125T090423
Piece Name: /u03/rman/archives_8_1_768128881
List of Archived Logs in backup set 9
Thrd Seq Low SCN Low Time Next SCN Next Time
---- ------- ---------- --------- ---------- ---------
1 55 1130345 23-NOV-11 1130992 23-NOV-11
1 56 1130992 23-NOV-11 1131674 23-NOV-11
1 57 1131674 23-NOV-11 1132602 23-NOV-11
1 58 1132602 23-NOV-11 1133527 23-NOV-11
1 59 1133527 23-NOV-11 1134466 23-NOV-11
1 60 1134466 23-NOV-11 1135345 23-NOV-11
1 61 1135345 23-NOV-11 1136282 23-NOV-11
1 62 1136282 23-NOV-11 1137168 23-NOV-11
1 63 1137168 23-NOV-11 1137981 23-NOV-11
1 64 1137981 23-NOV-11 1138860 23-NOV-11
1 65 1138860 23-NOV-11 1139807 23-NOV-11
1 66 1139807 23-NOV-11 1140650 23-NOV-11
1 67 1140650 23-NOV-11 1141551 23-NOV-11
1 68 1141551 23-NOV-11 1142487 23-NOV-11
1 69 1142487 23-NOV-11 1143431 23-NOV-11
1 70 1143431 23-NOV-11 1144270 23-NOV-11
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
10 Full 9.61M DISK 00:00:02 25-NOV-11
BP Key: 10 Status: AVAILABLE Compressed: NO Tag: TAG20111125T091132
Piece Name: /u03/rman/cntrl_10_1_768129092
Control File Included: Ckp SCN: 1322520 Ckp time: 25-NOV-11
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
11 Incr 0 9.61M DISK 00:01:07 26-NOV-11
BP Key: 11 Status: AVAILABLE Compressed: NO Tag: HOT_DB_BK_LEVEL0
Piece Name: /u03/rman/bkdb_14_1_768213243
Control File Included: Ckp SCN: 1435210 Ckp time: 26-NOV-11
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
12 Incr 0 446.88M DISK 00:02:40 26-NOV-11
BP Key: 12 Status: AVAILABLE Compressed: NO Tag: HOT_DB_BK_LEVEL0
Piece Name: /u03/rman/bkdb_11_1_768213241
List of Datafiles in backup set 12
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
2 0 Incr 1435199 26-NOV-11 /u01/app/oracle/oradata/DB11G/sysaux01.dbf
3 0 Incr 1435199 26-NOV-11 /u01/app/oracle/oradata/DB11G/undotbs01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
13 Incr 0 80.00K DISK 00:00:30 26-NOV-11
BP Key: 13 Status: AVAILABLE Compressed: NO Tag: HOT_DB_BK_LEVEL0
Piece Name: /u03/rman/bkdb_15_1_768213373
SPFILE Included: Modification time: 23-NOV-11
SPFILE db_unique_name: DB11G
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
14 Incr 0 600.00M DISK 00:01:01 26-NOV-11
BP Key: 14 Status: AVAILABLE Compressed: NO Tag: HOT_DB_BK_LEVEL0
Piece Name: /u03/rman/bkdb_16_1_768213419
List of Datafiles in backup set 14
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
1 0 Incr 1435376 26-NOV-11 /u01/app/oracle/oradata/DB11G/system01.dbf
RMAN>
Pronto!Em outro post iremos abordar a Restore e Recover de banco de dados através do RMAN.
Categories: RMAN
Grande Emerson,
ResponderExcluirmandou muito bem neste artigo, já está dominando o RMAN, é assim que se faz. Sucesso pra você sempre parceiro.
Abraço.
Valeu meu caro!Dominando ainda não..Mas o foco é esse.Rsss...Vamos que vamos..
ResponderExcluir