Re: Configuring RMAN to use controlfile instead of Recovery Catalog
Date: Thu, 29 Sep 2011 00:09:40 +0000 (UTC)
Message-ID: <pan.2011.09.29.00.09.40_at_gmail.com>
On Wed, 28 Sep 2011 03:40:08 -0700, Sundar K wrote:
> I have a doubt.
>
> Is it possible to make RMAN to use controlfile, from using Recovery
> Catalog(RC) DB ?
>
> The scenario is like this:
> I have a target db and a RC db. The RMAN presently uses RC db for
> backup and recovery.
>
> Due to some reasons, I want the RMAN to use target db controlfile,
> instead of RC.
> Is there anyway to perform this?
> If yes, I need the RMAN to understand and use backup sets, which are
> taken before switching to controlfile based backup (That is, controlfile
> should understand backup sets, which have backed-up using RC )
>
> Is there a way to perform these tasks?
For better or worse, here is a brief example:
[oracle_at_medo ~]$ rman target / nocatalog
Recovery Manager: Release 11.2.0.3.0 - Production on Wed Sep 28 19:51:53 2011
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: HOME (DBID=873600373) using target database control file instead of recovery catalog
RMAN> run {
2> allocate channel c0 device type disk format '/data/bkp/homedb%U.bak'; 3> backup database plus archivelog; 4> backup current controlfile; 5> }
allocated channel: c0
channel c0: SID=28 device type=DISK
Starting backup at 28-SEP-11
current log archived
channel c0: starting archived log backup set
channel c0: specifying archived log(s) in backup set
input archived log thread=1 sequence=22 RECID=14 STAMP=762973232
input archived log thread=1 sequence=23 RECID=15 STAMP=763069961
channel c0: starting piece 1 at 28-SEP-11
channel c0: finished piece 1 at 28-SEP-11
piece handle=/data/bkp/homedb01mnn1g9_1_1.bak tag=TAG20110928T195241
comment=NONE
channel c0: backup set complete, elapsed time: 00:00:15
Finished backup at 28-SEP-11
Starting backup at 28-SEP-11
channel c0: starting full datafile backup set
channel c0: specifying datafile(s) in backup set
input datafile file number=00002 name=/data/oracle/dgdata/HOME/datafile/
o1_mf_sysaux_6v6nob75_.dbf
input datafile file number=00001 name=/data/oracle/dgdata/HOME/datafile/
o1_mf_system_6v6nob2h_.dbf
input datafile file number=00003 name=/data/oracle/dgdata/HOME/datafile/
o1_mf_undotbs1_6v6nob8d_.dbf
input datafile file number=00005 name=/data/oracle/dgdata/HOME/datafile/
o1_mf_example_6v6nwwvt_.dbf
input datafile file number=00006 name=/data/oracle/dgdata/HOME/datafile/
o1_mf_htmldb_d_71wp7zdo_.dbf
input datafile file number=00004 name=/data/oracle/dgdata/HOME/datafile/
o1_mf_users_6v6nobc1_.dbf
channel c0: starting piece 1 at 28-SEP-11
channel c0: finished piece 1 at 28-SEP-11
piece handle=/data/bkp/homedb02mnn1gp_1_1.bak tag=TAG20110928T195257
comment=NONE
channel c0: backup set complete, elapsed time: 00:01:25 channel c0: starting full datafile backup set channel c0: specifying datafile(s) in backup setincluding current control file in backup set including current SPFILE in backup set
channel c0: starting piece 1 at 28-SEP-11 channel c0: finished piece 1 at 28-SEP-11 piece handle=/data/bkp/homedb03mnn1je_1_1.bak tag=TAG20110928T195257 comment=NONE
channel c0: backup set complete, elapsed time: 00:00:02 Finished backup at 28-SEP-11
Starting backup at 28-SEP-11
current log archived
channel c0: starting archived log backup set
channel c0: specifying archived log(s) in backup set
input archived log thread=1 sequence=24 RECID=16 STAMP=763070065
channel c0: starting piece 1 at 28-SEP-11
channel c0: finished piece 1 at 28-SEP-11
piece handle=/data/bkp/homedb04mnn1jh_1_1.bak tag=TAG20110928T195425
comment=NONE
channel c0: backup set complete, elapsed time: 00:00:01
Finished backup at 28-SEP-11
Starting backup at 28-SEP-11
channel c0: starting full datafile backup set
channel c0: specifying datafile(s) in backup set
including current control file in backup set
channel c0: starting piece 1 at 28-SEP-11
channel c0: finished piece 1 at 28-SEP-11
piece handle=/data/bkp/homedb05mnn1jj_1_1.bak tag=TAG20110928T195426
comment=NONE
channel c0: backup set complete, elapsed time: 00:00:01
Finished backup at 28-SEP-11
released channel: c0
RMAN> There are many ramifications, especially with device type SBT which I don't have on my home computer, archivelog records, compressed backup sets, incremental backups etc. This is a basic example how to backup database.
Then you can check what backups you have: RMAN> list backup of database;
List of Backup Sets
BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ ---------------
2 Full 1.44G DISK 00:01:21 28-SEP-11 BP Key: 2 Status: AVAILABLE Compressed: NO Tag: TAG20110928T195257 Piece Name: /data/bkp/homedb02mnn1gp_1_1.bakList of Datafiles in backup set 2
File LV Type Ckp SCN Ckp Time Name
- -- ---- ---------- --------- ---- 1 Full 3278467 28-SEP-11 /data/oracle/dgdata/HOME/datafile/ o1_mf_system_6v6nob2h_.dbf 2 Full 3278467 28-SEP-11 /data/oracle/dgdata/HOME/datafile/ o1_mf_sysaux_6v6nob75_.dbf 3 Full 3278467 28-SEP-11 /data/oracle/dgdata/HOME/datafile/ o1_mf_undotbs1_6v6nob8d_.dbf 4 Full 3278467 28-SEP-11 /data/oracle/dgdata/HOME/datafile/ o1_mf_users_6v6nobc1_.dbf 5 Full 3278467 28-SEP-11 /data/oracle/dgdata/HOME/datafile/ o1_mf_example_6v6nwwvt_.dbf 6 Full 3278467 28-SEP-11 /data/oracle/dgdata/HOME/datafile/ o1_mf_htmldb_d_71wp7zdo_.dbf
RMAN> You can also see whether the backup is good:
RMAN> validate backupset 2;
Starting validate at 28-SEP-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=28 device type=DISK channel ORA_DISK_1: starting validation of datafile backup set channel ORA_DISK_1: reading from backup piece /data/bkp/homedb02mnn1gp_1_1.bak
channel ORA_DISK_1: piece handle=/data/bkp/homedb02mnn1gp_1_1.bak tag=TAG20110928T195257
channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: validation complete, elapsed time: 00:00:25 Finished validate at 28-SEP-11
You can also remove backups:
RMAN> delete backup of database;
using channel ORA_DISK_1
List of Backup Pieces
BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
2 2 1 1 AVAILABLE DISK /data/bkp/
homedb02mnn1gp_1_1.bak
Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/data/bkp/homedb02mnn1gp_1_1.bak RECID=2
STAMP=763069978
Deleted 1 objects
RMAN> delete backup of archivelog all;
using channel ORA_DISK_1
List of Backup Pieces
BP Key BS Key Pc# Cp# Status Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
1 1 1 1 AVAILABLE DISK /data/bkp/
homedb01mnn1g9_1_1.bak
4 4 1 1 AVAILABLE DISK /data/bkp/
homedb04mnn1jh_1_1.bak
Do you really want to delete the above objects (enter YES or NO)? yes
deleted backup piece
backup piece handle=/data/bkp/homedb01mnn1g9_1_1.bak RECID=1
STAMP=763069962
deleted backup piece
backup piece handle=/data/bkp/homedb04mnn1jh_1_1.bak RECID=4
STAMP=763070065
Deleted 2 objects
This is a brief example. For everything else, you should use the available literature.
-- http://mgogala.byethost5.comReceived on Wed Sep 28 2011 - 19:09:40 CDT