Pular para o conteúdo

Como armazenar scripts de backup no catálogo do RMAN e garantir a segurança dos dados (RMAN – Stored Script)

RMAN – Stored Script

Uma funcionalidade muito legal do RMAN (se você estiver usando o CATALOG), e pouco aproveitada, é o armazenamento dos seus scripts de backup no próprio catálogo.

Desta forma, se perder o servidor todo, você não ficará desesperado procurando backups dos scripts, ou tentando lembrar como era o backup exatamente, para refazer o script.

[oracle@labdb ~]$ rman CATALOG=RMAN_USER/RMAN_USER@ORCL TARGET /

Recovery Manager: Release 11.1.0.7.0 - Production on Thu Jul 23 16:47:24 2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: ORCL (DBID=1217465568)
connected to recovery catalog database

RMAN> CREATE SCRIPT backup_tablespace_users
2> {
3> BACKUP TABLESPACE USERS PLUS ARCHIVELOG;
4> }

created script backup_tablespace_users

RMAN> EXIT;

Recovery Manager complete.

[oracle@labdb ~]$ rman CATALOG=RMAN_USER/RMAN_USER@ORCL TARGET /

Recovery Manager: Release 11.1.0.7.0 - Production on Thu Jul 23 16:48:28 2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: ORCL (DBID=1217465568)
connected to recovery catalog database

RMAN> RUN {EXECUTE SCRIPT backup_tablespace_users;}

executing script: backup_tablespace_users

Starting backup at 23-JUL-09
current log archived
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=209 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=189 device type=DISK
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=176 RECID=125 STAMP=692987570
channel ORA_DISK_1: starting piece 1 at 23-JUL-09
channel ORA_DISK_2: starting compressed archived log backup set
channel ORA_DISK_2: specifying archived log(s) in backup set
input archived log thread=1 sequence=181 RECID=130 STAMP=692987578
input archived log thread=1 sequence=182 RECID=132 STAMP=692988542
channel ORA_DISK_2: starting piece 1 at 23-JUL-09
channel ORA_DISK_1: finished piece 1 at 23-JUL-09
piece handle=/u01/backup/ORCL_20090723_79_1 tag=TAG20090723T164905 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=177 RECID=131 STAMP=692987932
input archived log thread=1 sequence=178 RECID=127 STAMP=692987572
input archived log thread=1 sequence=179 RECID=128 STAMP=692987572
input archived log thread=1 sequence=180 RECID=129 STAMP=692987577
channel ORA_DISK_1: starting piece 1 at 23-JUL-09
channel ORA_DISK_2: finished piece 1 at 23-JUL-09
piece handle=/u02/backup/ORCL_20090723_80_1 tag=TAG20090723T164905 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:04
channel ORA_DISK_1: finished piece 1 at 23-JUL-09
piece handle=/u01/backup/ORCL_20090723_81_1 tag=TAG20090723T164905 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 23-JUL-09

Starting backup at 23-JUL-09
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=/u01/app/oradata/ORCL/users01.dbf
channel ORA_DISK_1: starting piece 1 at 23-JUL-09
channel ORA_DISK_2: starting compressed full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
input datafile file number=00013 name=/u01/app/oradata/ORCL/users03.dbf
input datafile file number=00007 name=/u01/app/oradata/ORCL/users02.dbf
channel ORA_DISK_2: starting piece 1 at 23-JUL-09
channel ORA_DISK_2: finished piece 1 at 23-JUL-09
piece handle=/u02/backup/ORCL_20090723_83_1 tag=TAG20090723T164912 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:03
channel ORA_DISK_1: finished piece 1 at 23-JUL-09
piece handle=/u01/backup/ORCL_20090723_82_1 tag=TAG20090723T164912 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
Finished backup at 23-JUL-09

Starting backup at 23-JUL-09
current log archived
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=183 RECID=133 STAMP=692988610
channel ORA_DISK_1: starting piece 1 at 23-JUL-09
channel ORA_DISK_1: finished piece 1 at 23-JUL-09
piece handle=/u01/backup/ORCL_20090723_84_1 tag=TAG20090723T165013 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 23-JUL-09

Starting Control File and SPFILE Autobackup at 23-JUL-09

piece handle=/u01/app/flash_recovery_area/ORCL/autobackup/2009_07_23/o1_mf_s_692988617_56khqvmg_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 23-JUL-09

RMAN>
RMAN> EXIT;

Recovery Manager complete.
[oracle@labdb ~]$

Quão útil foi este post ?

Clique em uma estrela para classificar o post

nota média 0 / 5. Contagem de votos: 0

Sem votos ! Seja o primeiro a classificar !

Marcações:

2 comentários em “Como armazenar scripts de backup no catálogo do RMAN e garantir a segurança dos dados (RMAN – Stored Script)”

  1. Avatar de Regis Araujo

    Salve Mestre Portilho..!!

    Uma dúvida.. eu utilizo em um dos servidores os Scripts salvos no Catalogo.. mas eu precisei criar o mesmo script no catalogo para cada instância..

    Tbm sei que existe o Create GLOBAL Script no RMAN.. mas ainda não testei a criação deste tipo de script.. será que o GLOBAL é criado para ser utilizado independente da Instância “setada”??

    Obs.: Comecei a utilizar os Scripts por ser bem mais fácil doq ficar digitando todos os comandos a cada geração de Backup..

    Abraços..!!

  2. Avatar de Ricardo Portilho Proni

    Oi Regis !
    Estou na mesma que você… só precisei criar scripts para uma instância específica, porque para a outra instância, os backups iriam utilizar outra TAG.
    Mas vou testar o GLOBAL também.
    Abraço !

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

plugins premium WordPress