DB Recovery through RMAN usin Redo Archivelog
Hi,
I want to know that, am I be able to Recover Database using RMAN, If I was only taking Backups of Redo Archive Logs.
Regards,
Raza
The minimum set of datafiles required would be SYSTEM and UNDO -- in fact all the datafiles that were created before the database was set to ARCHIVELOG.
If a database is created either with a CREATE DATABASE or with dbca extracting it from a template, the initial set of datafile creation isn't in ARCHIVELOG. Oracle switches to ARCHIVELOG mode only later.
Therefore, it wouldn't be possible to recover until and unless the minimum set of datafiles -- ie the first database backup IS available_.
Similar Messages
-
Problems doing an active Database duplication through RMAN
Hi,
I'm trying to do active Database duplication through RMAN (http://docs.oracle.com/cd/B28359_01/backup.111/b28270/rcmdupdb.htm#).
My OS is Sun Solaris 5
Oracle version: 11gR1 Database on a 11gR2 Grid.
I'm receiving the error
RMAN> connect auxiliary sys/sys@rac402
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-04006: error from auxiliary database: ORA-12528: TNS:listener: all appropriate instances are blocking new connections
I'm seeing the listeners are in blocked state as mt auxiliary Database is in nomount state.
Service "rac40" has 1 instance(s).
Instance "rac402", status BLOCKED, has 1 handler(s) for this service...
Service "rac40_XPT" has 1 instance(s).
Instance "rac402", status BLOCKED, has 1 handler(s) for this service...
If I connect directly, I'm able to connect ("connect auxiliary / " after setting ORACLE_SID)
But active RMAN is saying
RMAN-03002: failure of Duplicate Db command at 06/18/2012 01:37:14
RMAN-06217: not connected to auxiliary database with a net service name (I don't know why Oracle is so specific in connecting through net service name only!!!)
So, how could I move forward?? any help is greatly appreciated!!!
Thanks in advance.
Regards,
CSMHi ,
I have issue to active Database duplication issue and getting below error. Can someone suggest something on this error ?
RMAN> duplicate target database to 'ub305' from active database;
Starting Duplicate Db at 07-AUG-2012 13:33:22
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=2 device type=DISK
contents of Memory Script:
sql clone "create spfile from memory";
executing Memory Script
sql statement: create spfile from memory
contents of Memory Script:
shutdown clone immediate;
startup clone nomount;
executing Memory Script
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 21512572928 bytes
Fixed Size 2235984 bytes
Variable Size 11005854128 bytes
Database Buffers 10468982784 bytes
Redo Buffers 35500032 bytes
contents of Memory Script:
sql clone "alter system set control_files =
''+DG_075_DATA01/ub305/controlfile/current.345.790692287'', ''+DG_075_FRA01/ub305/controlfile/current.292.790692289'' comment=
''Set by RMAN'' scope=spfile";
sql clone "alter system set db_name =
''UA305'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''UB305'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
backup as copy current controlfile auxiliary format '+DG_075_DATA01/ub305/controlfile/current.345.790692287';
restore clone controlfile to '+DG_075_FRA01/ub305/controlfile/current.292.790692289' from
'+DG_075_DATA01/ub305/controlfile/current.345.790692287';
sql clone "alter system set control_files =
''+DG_075_DATA01/ub305/controlfile/current.345.790692287'', ''+DG_075_FRA01/ub305/controlfile/current.292.790692289'' comment=
''Set by RMAN'' scope=spfile";
shutdown clone immediate;
startup clone nomount;
alter clone database mount;
executing Memory Script
sql statement: alter system set control_files = ''+DG_075_DATA01/ub305/controlfile/current.345.790692287'', ''+DG_075_FRA01/ub305/controlfile/current.292.790692289'' comment= ''Set by RMAN'' scope=spfile
sql statement: alter system set db_name = ''UA305'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''UB305'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 21512572928 bytes
Fixed Size 2235984 bytes
Variable Size 11005854128 bytes
Database Buffers 10468982784 bytes
Redo Buffers 35500032 bytes
Starting backup at 07-AUG-2012 13:34:11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1333 instance=ua3051 device type=DISK
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_ua3051.f tag=TAG20120807T133412 RECID=17 STAMP=790695252
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 07-AUG-2012 13:34:15
Starting restore at 07-AUG-2012 13:34:15
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=2 device type=DISK
channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 07-AUG-2012 13:34:16
sql statement: alter system set control_files = ''+DG_075_DATA01/ub305/controlfile/current.345.790692287'', ''+DG_075_FRA01/ub305/controlfile/current.292.790692289'' comment= ''Set by RMAN'' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 21512572928 bytes
Fixed Size 2235984 bytes
Variable Size 11005854128 bytes
Database Buffers 10468982784 bytes
Redo Buffers 35500032 bytes
database mounted
RMAN-05529: WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.
contents of Memory Script:
set newname for datafile 1 to
"+dg_075_data01";
set newname for datafile 2 to
"+dg_075_data01";
set newname for datafile 3 to
"+dg_075_data01";
set newname for datafile 4 to
"+dg_075_data01";
set newname for datafile 5 to
"+dg_075_data01";
set newname for datafile 6 to
"+dg_075_data01";
set newname for datafile 7 to
"+dg_075_data01";
set newname for datafile 8 to
"+DG_075_DATA01/ub305/datafile/ts001_rsa.ora";
backup as copy reuse
datafile 1 auxiliary format
"+dg_075_data01" datafile
2 auxiliary format
"+dg_075_data01" datafile
3 auxiliary format
"+dg_075_data01" datafile
4 auxiliary format
"+dg_075_data01" datafile
5 auxiliary format
"+dg_075_data01" datafile
6 auxiliary format
"+dg_075_data01" datafile
7 auxiliary format
"+dg_075_data01" datafile
8 auxiliary format
"+DG_075_DATA01/ub305/datafile/ts001_rsa.ora" ;
sql 'alter system archive log current';
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting backup at 07-AUG-2012 13:34:46
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00008 name=+DG_305_DATA01/ua305/datafile/ts001_rsa.ora
output file name=+DG_075_DATA01/ub305/datafile/ts001_rsa.ora tag=TAG20120807T133447
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:05
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DG_305_DATA01/ua305/datafile/system.256.788357663
output file name=+DG_075_DATA01/ub305/datafile/system.322.790695353 tag=TAG20120807T133447
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=+DG_305_DATA01/ua305/datafile/sysaux.257.788357663
output file name=+DG_075_DATA01/ub305/datafile/sysaux.321.790695359 tag=TAG20120807T133447
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00007 name=+DG_305_DATA01/ua305/datafile/ata_apm.271.788369355
output file name=+DG_075_DATA01/ub305/datafile/ata_apm.320.790695367 tag=TAG20120807T133447
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=+DG_305_DATA01/ua305/datafile/undotbs1.258.788357663
output file name=+DG_075_DATA01/ub305/datafile/undotbs1.319.790695373 tag=TAG20120807T133447
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+DG_305_DATA01/ua305/datafile/users.259.788357663
output file name=+DG_075_DATA01/ub305/datafile/users.316.790695377 tag=TAG20120807T133447
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=+DG_305_DATA01/ua305/datafile/undotbs2.264.788357815
output file name=+DG_075_DATA01/ub305/datafile/undotbs2.315.790695381 tag=TAG20120807T133447
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=+DG_305_DATA01/ua305/datafile/ata_mds.270.788369353
output file name=+DG_075_DATA01/ub305/datafile/ata_mds.314.790695383 tag=TAG20120807T133447
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 07-AUG-2012 13:36:24
sql statement: alter system archive log current
contents of Memory Script:
backup as copy reuse
archivelog like "+DG_305_FRA01/ua305/archivelog/2012_08_07/thread_1_seq_223.572.790694523" auxiliary format
"+DG_075_FRA01" archivelog like
"+DG_305_FRA01/ua305/archivelog/2012_08_07/thread_1_seq_224.573.790695385" auxiliary format
"+DG_075_FRA01" archivelog like
"+DG_305_FRA01/ua305/archivelog/2012_08_07/thread_2_seq_91.574.790695387" auxiliary format
"+DG_075_FRA01" ;
catalog clone recovery area;
switch clone datafile all;
executing Memory Script
Starting backup at 07-AUG-2012 13:36:30
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=223 RECID=311 STAMP=790694522
output file name=+DG_075_FRA01/ub305/archivelog/2012_08_07/thread_1_seq_223.299.790695391 RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=224 RECID=312 STAMP=790695384
output file name=+DG_075_FRA01/ub305/archivelog/2012_08_07/thread_1_seq_224.267.790695393 RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log copy
input archived log thread=2 sequence=91 RECID=313 STAMP=790695386
output file name=+DG_075_FRA01/ub305/archivelog/2012_08_07/thread_2_seq_91.283.790695393 RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 07-AUG-2012 13:36:34
searching for all files in the recovery area
List of Files Unknown to the Database
=====================================
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_1_seq_220.279.790692475
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_1_seq_221.312.790692477
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_1_seq_222.311.790692479
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_2_seq_89.310.790692479
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_2_seq_89.309.790694525
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_2_seq_90.261.790694527
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_1_seq_223.262.790694527
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_1_seq_223.299.790695391
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_1_seq_224.267.790695393
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_2_seq_91.283.790695393
File Name: +dg_075_fra01/UB305/CONTROLFILE/Current.289.790692289
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_1_seq_220.279.790692475
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_1_seq_221.312.790692477
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_1_seq_222.311.790692479
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_2_seq_89.310.790692479
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_2_seq_89.309.790694525
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_2_seq_90.261.790694527
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_1_seq_223.262.790694527
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_1_seq_223.299.790695391
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_1_seq_224.267.790695393
File Name: +dg_075_fra01/UB305/ARCHIVELOG/2012_08_07/thread_2_seq_91.283.790695393
List of Files Which Where Not Cataloged
=======================================
File Name: +dg_075_fra01/UB305/CONTROLFILE/Current.289.790692289
RMAN-07517: Reason: The file header is corrupted
datafile 1 switched to datafile copy
input datafile copy RECID=17 STAMP=790695395 file name=+DG_075_DATA01/ub305/datafile/system.322.790695353
datafile 2 switched to datafile copy
input datafile copy RECID=18 STAMP=790695395 file name=+DG_075_DATA01/ub305/datafile/sysaux.321.790695359
datafile 3 switched to datafile copy
input datafile copy RECID=19 STAMP=790695395 file name=+DG_075_DATA01/ub305/datafile/undotbs1.319.790695373
datafile 4 switched to datafile copy
input datafile copy RECID=20 STAMP=790695395 file name=+DG_075_DATA01/ub305/datafile/users.316.790695377
datafile 5 switched to datafile copy
input datafile copy RECID=21 STAMP=790695395 file name=+DG_075_DATA01/ub305/datafile/undotbs2.315.790695381
datafile 6 switched to datafile copy
input datafile copy RECID=22 STAMP=790695395 file name=+DG_075_DATA01/ub305/datafile/ata_mds.314.790695383
datafile 7 switched to datafile copy
input datafile copy RECID=23 STAMP=790695395 file name=+DG_075_DATA01/ub305/datafile/ata_apm.320.790695367
datafile 8 switched to datafile copy
input datafile copy RECID=24 STAMP=790695395 file name=+DG_075_DATA01/ub305/datafile/ts001_rsa.ora
contents of Memory Script:
set until scn 8950952;
recover
clone database
delete archivelog
executing Memory Script
executing command: SET until clause
Starting recover at 07-AUG-2012 13:36:35
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=191 device type=DISK
starting media recovery
archived log for thread 1 with sequence 224 is already on disk as file +DG_075_FRA01/ub305/archivelog/2012_08_07/thread_1_seq_224.267.790695393
archived log for thread 2 with sequence 91 is already on disk as file +DG_075_FRA01/ub305/archivelog/2012_08_07/thread_2_seq_91.283.790695393
archived log file name=+DG_075_FRA01/ub305/archivelog/2012_08_07/thread_1_seq_224.267.790695393 thread=1 sequence=224
archived log file name=+DG_075_FRA01/ub305/archivelog/2012_08_07/thread_2_seq_91.283.790695393 thread=2 sequence=91
media recovery complete, elapsed time: 00:00:01
Finished recover at 07-AUG-2012 13:36:38
Oracle instance started
Total System Global Area 21512572928 bytes
Fixed Size 2235984 bytes
Variable Size 11005854128 bytes
Database Buffers 10468982784 bytes
Redo Buffers 35500032 bytes
contents of Memory Script:
sql clone "alter system set db_name =
''UB305'' comment=
''Reset to original value by RMAN'' scope=spfile";
sql clone "alter system reset db_unique_name scope=spfile";
shutdown clone immediate;
startup clone nomount;
executing Memory Script
sql statement: alter system set db_name = ''UB305'' comment= ''Reset to original value by RMAN'' scope=spfile
sql statement: alter system reset db_unique_name scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 21512572928 bytes
Fixed Size 2235984 bytes
Variable Size 11005854128 bytes
Database Buffers 10468982784 bytes
Redo Buffers 35500032 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "UB305" RESETLOGS ARCHIVELOG
MAXLOGFILES 192
MAXLOGMEMBERS 3
MAXDATAFILES 1024
MAXINSTANCES 32
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( '+dg_075_fra01', '+dg_305_data01' ) SIZE 100 M REUSE,
GROUP 2 ( '+dg_075_fra01', '+dg_305_data01' ) SIZE 100 M REUSE
DATAFILE
'+DG_075_DATA01/ub305/datafile/system.322.790695353'
CHARACTER SET AL32UTF8
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 08/07/2012 13:37:18
RMAN-05501: aborting duplication of target database
RMAN-06136: ORACLE error from auxiliary database: ORA-01503: CREATE CONTROLFILE failed
ORA-00349: failure obtaining block size for '+dg_305_data01'
ORA-15001: diskgroup "DG_305_DATA01" does not exist or is not mounted -
Error while taking backup through RMAN in 10g XE
While taking backup through RMAN in XE instance , an error comes out.
The contents of oxe_backup_current file is as below :
XE Backup Log
Recovery Manager: Release 10.2.0.1.0 - Production on Wed Jul 6 15:49:51 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: XE (DBID=2635631092)
RMAN>
echo set on
RMAN> shutdown immediate;
using target database control file instead of recovery catalog
database closed
database dismounted
Oracle instance shut down
RMAN> startup mount;
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 805306368 bytes
Fixed Size 1261444 bytes
Variable Size 209715324 bytes
Database Buffers 591396864 bytes
Redo Buffers 2932736 bytes
RMAN> configure retention policy to redundancy 2;
old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
new RMAN configuration parameters are successfully stored
RMAN> configure controlfile autobackup format for device type disk clear;
RMAN configuration parameters are successfully reset to default value
RMAN> configure controlfile autobackup on;
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
RMAN> sql "create pfile=''/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/dbs/spfile2init.ora'' from spfile";
*sql statement: create pfile=''/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/dbs/spfile2init.ora'' from spfile*
*RMAN-00571: ===========================================================*
*RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============*
*RMAN-00571: ===========================================================*
*RMAN-03009: failure of sql command on default channel at 07/06/2011 15:50:57*
*RMAN-11003: failure during parse/execution of SQL statement: create pfile='/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/dbs/spfile2init.ora' from spfile*
*ORA-27086: unable to lock file - already in use*
*Linux Error: 11: Resource temporarily unavailable*
Additional information: 8
Additional information: 16476
RMAN> backup as backupset device type disk database;
Starting backup at 06-JUL-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=102 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00003 name=/usr/lib/oracle/xe/oradata/XE/sysaux.dbf
input datafile fno=00005 name=/usr/lib/oracle/xe/oradata/XE/ftress_data_log01.dbf
input datafile fno=00006 name=/usr/lib/oracle/xe/oradata/XE/ftress_data_lrg01.dbf
input datafile fno=00001 name=/usr/lib/oracle/xe/oradata/XE/system.dbf
input datafile fno=00009 name=/usr/lib/oracle/xe/oradata/XE/ftress_indx_log01.dbf
input datafile fno=00010 name=/usr/lib/oracle/xe/oradata/XE/ftress_indx_lrg01.dbf
input datafile fno=00002 name=/usr/lib/oracle/xe/oradata/XE/undo.dbf
input datafile fno=00004 name=/usr/lib/oracle/xe/oradata/XE/users.dbf
input datafile fno=00008 name=/usr/lib/oracle/xe/oradata/XE/ftress_data_sml01.dbf
input datafile fno=00012 name=/usr/lib/oracle/xe/oradata/XE/ftress_indx_sml01.dbf
input datafile fno=00011 name=/usr/lib/oracle/xe/oradata/XE/ftress_indx_mdm01.dbf
input datafile fno=00007 name=/usr/lib/oracle/xe/oradata/XE/ftress_data_mdm01.dbf
channel ORA_DISK_1: starting piece 1 at 06-JUL-11
channel ORA_DISK_1: finished piece 1 at 06-JUL-11
piece handle=/usr/lib/oracle/xe/app/oracle/flash_recovery_area/XE/backupset/2011_07_06/o1_mf_nnndf_TAG20110706T155057_718dw649_.bkp tag=TAG20110706T155057 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
Finished backup at 06-JUL-11
Starting Control File and SPFILE Autobackup at 06-JUL-11
piece handle=/usr/lib/oracle/xe/app/oracle/flash_recovery_area/XE/autobackup/2011_07_06/o1_mf_s_755797849_718dwofy_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 06-JUL-11
RMAN> configure controlfile autobackup off;
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
new RMAN configuration parameters are successfully stored
RMAN> alter database open;
database opened
RMAN> delete noprompt obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 2
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type Key Completion Time Filename/Handle
Backup Set 3 06-JUL-11
Backup Piece 3 06-JUL-11 /usr/lib/oracle/xe/app/oracle/flash_recovery_area/XE/backupset/2011_07_06/o1_mf_nnndf_TAG20110706T133443_7184wr4d_.bkp
Backup Set 4 06-JUL-11
Backup Piece 4 06-JUL-11 /usr/lib/oracle/xe/app/oracle/flash_recovery_area/XE/autobackup/2011_07_06/o1_mf_s_755789675_7184x7fp_.bkp
deleted backup piece
backup piece handle=/usr/lib/oracle/xe/app/oracle/flash_recovery_area/XE/backupset/2011_07_06/o1_mf_nnndf_TAG20110706T133443_7184wr4d_.bkp recid=3 stamp=755789684
deleted backup piece
backup piece handle=/usr/lib/oracle/xe/app/oracle/flash_recovery_area/XE/autobackup/2011_07_06/o1_mf_s_755789675_7184x7fp_.bkp recid=4 stamp=755789699
Deleted 2 objects
RMAN>
Recovery Manager complete.
RMAN error: See log for details.I think it is trying to overwrite exiting file. Either give a different name or cleanup the files in preferred location.
-
Problem in performing multiple Point-In-Time Database Recovery using RMAN
Hello Experts,
I am getting an error while performing database point in time recovery multiple times using RMAN. Details are as follows :-
Environment:
Oracle 11g, ASM,
Database DiskGroups : DG_DATA (Data files), DG_ARCH(Archive logs), DG_REDO(Redo logs Control file).
Snapshot DiskGroups :
Snapshot1 (taken at 9 am): SNAP1_DATA, SNAP1_ARCH, +SNAP1_REDO
Snapshot2 (taken at 10 am): SNAP2_DATA, SNAP2_ARCH, +SNAP2_REDO
Steps performed for point in time recovery:
1. Restore control file from snapshot 2.
RMAN> RESTORE CONTROLFILE from '+SNAP2_REDO/orcl/CONTROLFILE/Current.256.777398261';
2. For 2nd recovery, reset incarnation of database to snapshot 2 incarnation (Say 2).
3. Catalog data files from snapshot 1.
4. Catalog archive logs from snapshot 2.
5. Perform point in time recovery till given time.
STARTUP MOUNT;
RUN {
SQL "ALTER SESSION SET NLS_DATE_FORMAT = ''dd-mon-yyyy hh24:mi:ss''";
SET UNTIL TIME "06-mar-2013 09:30:00";
RESTORE DATABASE;
RECOVER DATABASE;
ALTER DATABASE OPEN RESETLOGS;
Results:
Recovery 1: At 10.30 am, I performed first point in time recovery till 9:30 am, it was successful. Database incarnation was raised from *2* to *3*.
Recovery 2: At 11:10 am, I performed another point in time recovery till 9:45 am, while doing it I reset the incarnation of DB to *2*, it failed with following error :-
Starting recover at 28-FEB-13
using channel ORA_DISK_1
starting media recovery
media recovery failed
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 03/06/2013 11:10:57
ORA-00283: recovery session canceled due to errors
RMAN-11003: failure during parse/execution of SQL statement: alter database recover if needed
start until time 'MAR 06 2013 09:45:00'
ORA-00283: recovery session canceled due to errors
ORA-00313: open failed for members of log group 1 of thread 1
ORA-00312: online log 1 thread 1: '+DG_REDO/orcl/onlinelog/group_1.257.807150859'
ORA-17503: ksfdopn:2 Failed to open file +DG_REDO/orcl/onlinelog/group_1.257.807150859
ORA-15012: ASM file '+DG_REDO/orcl/onlinelog/group_1.257.807150859' does not exist
Doubts:
1. Why did recovery failed 2nd time, but not 1st time and why is RMAN looking for online redo log group_1.257.807150859 in 2nd recovery ?
3. I tried restoring control file from AutoBackup, in that case both 1st and 2nd recovery succeeded.
However for this to work, I always need to keep the AutoBackup feature enabled.
How reliable is control file AutoBackup ? Is there any alternative to using AutoBackup, can I restore control file from snapshot backup only ?
4. If I restore control file from AutoBackup, then from what point of time/SCN does RMAN restores the control file ?
Please help me out in this issue.
Thanks.992748 wrote:
Hello experts,
I'm little newbie to RMAN recovery. Please help me in these doubts:
1. If I have datafiles, archive logs & control files backup, but current online REDO logs are lost, then can I perform incomplete database recovery ?yes, if you have backups of everything else
2. Till what maximum time/scn can incomplete database recovery be performed ??Assuming the only thing lost is the redo logs, you can recover to the last scn in the last archivelog.
3. What is role of online REDO logs in incomplete database recovery ? They provide the final redo changes - the ones that have not been written to archivelogs
Are they required for incomplete recovery ?It depends on how much incomplete recovery you need to do.
Think of all of your changes as a constant stream of redo information. As a redolog fills, it is copied to archive, then (eventually) reused. over time, your redo stream is in archivelog_1, continuing into archvivelog_2, then to 3, and eventually, when you get to the last archivelog, into the online redo. A recovery will start with the oldest necessary point in the redo stream and continue forward. Whether or not you need the online redo for a PIT recovery depends on how far forward you need to recover.
But you should take every precaution to prevent loss of online redo logs .. starting with having multiple members in each redo group ... and keeping those multiple members on physically separate disks. -
Taking tablespace offline through RMAN command line
I am taking a Oracle 9i Backup and Recovery class. One of the hands-on assignments is to simulate a lost datafile. The instructions say to shut down the database through RMAN, delete the INDX01.dbf datafile through my operating system, mount the database, take the INDX tablespace offline, open the database, recover the INDX01.dbf datafile, and then place the INDX tablespace online again.
My problem is that when I issue the command (in RMAN) to take the INDX tablespace offline (remember, database is mounted), I get an error saying the database is not open. The command I am issuing through RMAN is this: >sql 'ALTER TABLESPACE INDX OFFLINE IMMEDIATE'; I can't get any further because of the error message that my database is not open. Is my instruction book wrong in that I can't take the tablespace offline if the database is in a mounted state? Does the database have to be open to do this?4. Mount the database and take the tablespace corresponding to Indx01.dbf data file offline.There could be a misunderstanding about the command to be used. ALTER TABLESPACE command needs an open DB to work, but you can use
RMAN> sql 'alter database datafile <file name or file number> offline drop';
that will work with DB in mount state. See this example :
RMAN> startup mount
connected to target database (not started)
Oracle instance started
database mounted
Total System Global Area 130023424 bytes
Fixed Size 1218100 bytes
Variable Size 104860108 bytes
Database Buffers 20971520 bytes
Redo Buffers 2973696 bytes
RMAN> sql 'alter tablespace test offline immediate';
sql statement: alter tablespace test offline immediate
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 05/21/2006 18:51:06
RMAN-11003: failure during parse/execution of SQL statement: alter tablespace test offline immediate
ORA-01109: database not open
RMAN> sql 'alter database datafile 5 offline drop';
sql statement: alter database datafile 5 offline drop
RMAN> alter database open;
database opened
RMAN> restore datafile 5;
Starting restore at 21-MAY-06
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=145 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00005 to
channel ORA_DISK_1: restore complete, elapsed time: 00:00:08
Finished restore at 21-MAY-06
RMAN> recover datafile 5;
Starting recover at 21-MAY-06
using channel ORA_DISK_1
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 21-MAY-06
RMAN> sql 'alter database datafile 5 online';
sql statement: alter database datafile 5 online
RMAN> -
Error to restoring database through rman
Hi all,
I am trying to restore database through rman its showing error. The error is
RMAN> recover database;
Starting recover at 13-APR-09
using channel ORA_DISK_1
starting media recovery
unable to find archive log
archive log thread=1 sequence=5
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 04/13/2009 13:00:44
RMAN-06054: media recovery requesting unknown log: thread 1 seq 5 lowscn 543566
Please let me know how to resolved this error;
Thanks in advance
NomanThere's no "full or partial" recovery in Oracle.
There are :
1. Database Recovery and Tablespace Point In Time Recovery (aka TSPITR)
In the former case, it is the database that is recovered.
In TSPITR, a Tablespace is recovered to an (older) point in time, different from the rest of the database. Since a database must be consistent, a TSPITR is done by using an Auxiliary Instance -- only SYSTEM, UNDO and the required Tablespace are recovered to their own consistent point in time and then the Tablespace data is copied and and plugged back into the Target Database.
2. Complete Recovery and Incomplete Recovery
Complete Recovery is right upto the current point in time -- ie upto the last transaction in the online redo logs.
Incomplete Recovery is upto any point of before the current online redo log (a Timestamp, SCN or LogSequenceNumber) .
The scenario we are talking of is an Incomplete Recovery -- because we do not have the Online Redo Logs. -
ORACLE8: RECOVERY MANAGER 사용 방법(RMAN)
제품 : ORACLE SERVER
작성날짜 : 1997-11-17
Oracle 8 NEW : Recovery manager 란 ?
====================================
- 소개
Oracle 8 은 새로운 backup와 recovery 방법인 Recovery manager 를 제공한다.
Recovery manager(이하 RMAN) 는 backup,restore,recover process를 관리하는
tool 이다. Oracle Enterprise Manager 를 통해 GUI mode 로 가능하고,
rman 이라는 command line interface 를 함께 제공한다.
특히, OS device control 기능이 보완 되었기 때문에, 현재 backup catalog 를
유지하고, 이 정보를 이용해 OS level 에서 file 을 auto-restore 해 주기
때문에, database recovery 전에 file 을 manual 하게 restore 할 필요가
없어졌다.
Incremental backup 을 제공하고, backup 이나 restore 중에 current block
detection 을 해 주며(v$backup_corruption, v$copy_corruption 또는 alert
log 에 report), Rman 작업시에 parallelization 을 제공하며, open database
backup 동안 특별한 redo 를 발생하지 않는다.
- 구조
Recovery
manager in OEM(oracle
enterprise ---> Database
manager) <--- (catalog)
or RMAN
/| |
| |/
DATABASE ---> OS
(target to backup) <--- Device
- 구성 요소 설명
1) recovery manager
Command 를 해석하고, backup, restore, recover 를 실행하기 위해 target
database 로 command 를 전달한다. recovery catalog 를 update 한다. 실행
과정을 조정, 모니터링 한다.
2) Target database
backup,restore,recovery action 이 수행될 데이타베이스
3) Recovery Catalog
Information 저장장소. 즉, target database 의 물리적 스키마, datafile 과
archivelog 의 backup sets 과 pieces, backup script 등을 포함하고 있음.
rman 작업시 recovery catalog 정보를 이용한다.
4) channel
allocation channel 은 target database 의 backup,restore,recover 에 대한
server process 초기화를 한다. 즉, 이 channel 은 disk 를 포함 기타 OS
device 를 지정하게 되며, 이 갯수에 따라 parallelization 의 degree 가 결정
된다.
- recovery catalog 를 사용할 것인지를 결정하기
catalog 없이 RMAN 을 사용할 때의 단점은 recovery catalog 의 overhead 가
없는 대신, Point-In-Time recovery 를 쉽게 할 수 없다. 또한, control file
손상시에 recovery 할 수 없고, stored script 를 사용할 수 없다.
(datafile 이 20개 이상일 경우에는 recovery catalog 사용을 권장한다.)
- Setup
가. Recovery catalog 생성
1. Backup(target) db 외의 별도의 db 생성 (8.0.3 이상)
2. catalog DB 에 분리된 tablespace 생성
create tablespace rcvcat datafile '/oracle/rcvcat/rcvcat01.dbf'
size 20 M;
3. catalog 의 owner 생성과 권한부여
create user rman identified by rman
temporary tablespace temp
default tablespace rcvcat;
grant dba,connect,resource,recovery_catalog_owner to rman;
4. catalog 저장에 필요한 object 생성
cd $ORACLE_HOME/rdbms/admin
sqlplus rman/rman
@catrman
나. Recovery manager 기동
1. recovery catalog DB 를 사용하는 경우
rman target \"system/manager\" rcvcat \"rman/rman@orabeta1\"
(orabeta1 은 catalog DB 로 접속하는 tnsname 입니다.
즉, sqlplus rman/rman@orabeta1 하면, catalog db 와 접속되어야 합니다.)
2. recovery catalog DB 를 사용하지 않는 경우
rman target system/manager@target nocatalog
위 경우 모두, target database 를 catalog 에 등록해야 한다.
RMAN> register database;
다. Backup 시작
- Backup 은 database 가 open 또는 close(close 후에는 반드시 mount
상태이어야 한다)
- Backup 의 단위
full database
tablespace
datafile
control file
archived logs
- Backup 의 예
--full database
run {
allocate channel dev1 type disk;
allocate channel dev2 type disk;
backup full filesperset 2
(database format '/user7/ora8/backup.%n_%p') ;
release channel dev1;
release channel dev2;
-- tablespace
run {
allocate channel dev_1 type disk ;
backup incremental level 0
filesperset 1
(tablespace system channel dev_1 format '/vol312/net8%d_%u');
release channel dev_1;
-- datafile
run{
allocate channel dev1 type disk;
copy datafile "/vo3/orabeta6/backup/copy_tools.dbf"
to "/vo3/orabeta6/oradata/orabeta6/tools01.dbf"
tag "org_tools";
release channel dev1;
-- archived logs
create script beta_arch_full {
allocate channel dev1 type disk;
allocate channel dev2 type disk;
backup full filesperset 10
(archivelog all delete input
format '/vo3/orabeta6/backup/beta_arch.%s_%p') ;
release channel dev1;
release channel dev2;
-- backup to tape
run {
allocate channel t1 type 'sbt_tape';
backup
format 'dbfull_sunday_s%s_t%t'
tag 'Sunday full backup'
(database);
라. Restore
- Backup 으로 부터 원래 위치로 복원
- Archive log file 은 manual 하게 restore 할 수도 있고, 필요하다면
recovery 시 자동으로 restore 된다.
restore (archivelog all| like <filename | <archivelog range>);
- restore 명령
database : restore (database);
tablespace : restore (tablespace <name>,...,<name>);
datafile : restore (datafile <name>,...,<name>);
control file : restore control file to location;
- recovery 시에 database 는 어떤 상태에 있어야 하는가 ?
1) control file restore - not mount
SVRMGRL> startup nomount
2) whole database, or system tablespace - not open
SVRMGRL> startup mount
3) tablespace or datafile - open but tablespace or datafile offline
SVRMGRL> alter tablespace user_data offline temporary;
SVRMGRL> alter database datafile '/oracle/file/user_data1.dbf' offline;
마, Recovery
- Recoervy 는 file restore 후의 과정이다.
1) Archive log mode : complete recovery, incomplete recovery 가 가능하다
2) No archive log mode : consistent whole database backup 으로 부터
restore 하는 것이 유일한 option 이다.
- whole database recovery 의 예
svrmgrl
connect internal
shutdown abort
startup mount
rman target \"system/manager\" rcvcat \"rman/rman@orabeta1\"
run {
allocate channel dev1 type disk;
allocate channel dev2 type disk;
restore database;
recover database;
release channel dev1;
release channel dev2;
or
run {
allocate channel dev1 type disk;
allocate channel dev2 type disk;
restore tablespace 'SYSTEM';
restore tablespace 'USERS';
recover tablespace 'SYSTEM';
recover tablespace 'USERS';
sql "alter database open ";
release channel dev1;
release channel dev2;
- datafile 하나가 사용할 수 없을 경우의 recovery
가정) full backup set 이 있을 경우
ORA-01157: cannot identify data file 3 - file not found
ORA-01110: data file 3: '/user7/ora8/oradata/ORA8/temp01.dbf'
SVRMGR> startup mount
rman target \"system/manager\" rcvcat \"rman/rman@orabeta1\"
RMAN> run {
allocate channel dev1 type disk;
restore database;
recover database;
release channel dev1;
};Check the TSM logs for errors, the error stack here doesn't show any useful information (only informational messages and an undefined exit code). This is an 8i problem, later releases transfer much better messages from the media management software.
-
Error while creating Auxiliary database through RMAN on the same host.
I got the following error while cloning a stand by database through RMAN.
I got the following error while cloning a stand by database through RMAN.
[oracle@localhost admin]$ rman auxiliary sys/clonedb@clonedb
Recovery Manager: Release 11.1.0.6.0 - Production on Mon Sep 19 10:51:48 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04006: error from auxiliary database: ORA-12154: TNS:could not resolve the connect identifier specified
My LISTENER looks like this:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_1)
(SID_NAME = ora11g)
(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_1)
(SID_NAME = CLONEDB)
TNS Names:
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCL)
CLONEDB=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost) (PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = CLONEDB)
And SQLNet.ora
NAMES.DIRECTORY_PATH= (TNSNAMES,HOSTNAME, EZCONNECT)
Any help would be highly appreciated.
Thanks,
-Revku.Hello,
I think there is something wrong with the ")" in the listener.ora : the second SID_DESC is not part of the SID_LIST.
Instead of
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_1)
(SID_NAME = ora11g)
(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_1)
(SID_NAME = CLONEDB)
)It should be :
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_1)
(SID_NAME = ora11g)
(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_1)
(SID_NAME = CLONEDB)
)Hope it will help.
Regards,
Sylvie -
Control File error while duplicating Database through Rman
Hi,
Oracle Ver: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
Os:Win Xp
I am trying to create a Standby through Rman....
I am using this Run Block to take backup of Primary Database.......
run {
allocate channel d1 type disk;
allocate channel d2 type disk;
setlimit channel d1 kbytes 2097150;
setlimit channel d2 kbytes 2097150;
backup incremental level 0 format 'e:\Oracle\standby\rman\df_%U' database
include current controlfile for standby;
sql "alter system archive log current";
backup
archivelog all format 'e:\Oracle\standby\rman\al_%U' delete input;
}After taking the Backup when I am trying to create the standby with Duplicate command it s giving me Error...
The Run Block I am using is ......
RMAN> run {
2> allocate auxiliary channel dup1 type disk;
3> allocate auxiliary channel dup2 type disk;
4> set newname for datafile 1 to 'E:\Oracle\standby\system01.dbf';
5> set newname for datafile 2 to 'E:\Oracle\standby\UNDOTBS01.DBF';
6> set newname for datafile 3 to 'E:\Oracle\standby\SYSAUX01.DBF';
7> set newname for datafile 4 to 'E:\Oracle\standby\USERS01.DBF';
8> duplicate target database for standby
9> dorecover;
10> }
allocated channel: dup1
channel dup1: sid=37 devtype=DISK
allocated channel: dup2
channel dup2: sid=36 devtype=DISK
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting Duplicate Db at 02-OCT-08
contents of Memory Script:
set until scn 1105194;
restore clone standby controlfile;
sql clone 'alter database mount standby database';
executing Memory Script
executing command: SET until clause
Starting restore at 02-OCT-08
channel dup1: starting datafile backupset restore
channel dup1: restoring control file
channel dup1: reading from backup piece E:\ORACLE\STANDBY\RMAN\DF_0VJS4RS7_1_1
channel dup1: restored backup piece 1
piece handle=E:\ORACLE\STANDBY\RMAN\DF_0VJS4RS7_1_1 tag=TAG20081002T124502
channel dup1: restore complete, elapsed time: 00:00:01
output filename=D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\CTL1STANDBY.ORA
Finished restore at 02-OCT-08
sql statement: alter database mount standby database
released channel: dup1
released channel: dup2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 10/02/2008 13:01:43
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of sql command on clone_default channel at 10/02/2008 13:01:43
RMAN-11003: failure during parse/execution of SQL statement: alter database mount standby database
*ORA-00201: control file version 10.2.0.1.0 incompatible with ORACLE version 10.2.0.0.0*
ORA-00202: control file: 'D:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\CTL1STANDBY.ORA'Why i am getting this Incomaptable Control File error inspite of Backing up the control File.....
Regards,
Prosenjit MukherjeeCheck the value for the parameter "COMPATIBLE" in the source and standby database instance parameter files.
"COMPATIBLE" should be the same.
See http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/create_ps.htm#i70517
"... ensure the COMPATIBLE initialization parameter is set to the same value on both the primary and standby databases"
Edited by: Hemant K Chitale on Oct 2, 2008 4:09 PM
Added link and quote from 10g doc -
10g Physical Standby to be used for Backup through RMAN
Dear All,
I have 10g Database Primary and Standby Server which is operating in Maximum Performance Mode. I want to use Standby Database for performing Weekly Full and Daily Incremental Backups through RMAN. Kindly inform me is it possible, if yes how should I configure it. I will also be using Compression and Encryption while performing backups.
Best Regards,
AsifYes, that is possible.
Because the standby databases are in mount mode, they can be accessed through the SYS account .
I use the following RMAN script for the same purpose. Please note that we have configure the flashback area, so we are not letting RMAN delete the archive files:
run {
sql 'alter system archive log current';
sql 'alter system archive log current';
allocate channel ch1 type 'sbt_tape' parms 'ENV=(TDPO_OPTFILE=/usr/tivoli/tsm/client/oracle/bin64/tdpo.opt)';
backup
incremental level 0
tag full_bk_db_webshop
format 'df_%d_t%t_s%s_p%p'
(database include current controlfile);
backup archivelog all;
This script is for a FULL backup ( level 0 ). You could also use the "backup full" command
You can easily change the level of the Backup for incremental purposes.
Starting RMAN - if configured correctly - is the same as with an open database
export ORACLE_SID=<STDBYSID>
rman target / rcvcat <rman/rman>@<catalogsid>
the user for, and the catalogsid are merely examples
Edited by: fjfranken on Mar 24, 2009 4:07 AM -
Doubt about database point in time recovery using rman
Hi Everyone,
I have been practising various rman restore and recovery scenarios . I have a doubt regarding database point in time recovery using rman. Imagine i have a full database backup including controlfile scheduled to run at 10 PM everyday. today is 20th dec 2013. imagine i want to restore the database to a prior point in time ( say 18th dec till 8 AM). so i would restore all the datafiles from 17th night's backup and apply archives till 8 AM of 18th dec . in this scenario should i restore the controlfile too from 17th dec bkp ( i am assuming yes we should ) or can we use the current controlfile ( assuming it is intact). i found the below from oracle docs.
Performing Point-in-Time Recovery with a Current Control File
The database must be closed to perform database point-in-time recovery. If you are recovering to a time, then you should set the time format environment variables before invoking RMAN. The following are sample Globalization Support settings:
NLS_LANG = american_america.us7ascii
NLS_DATE_FORMAT="Mon DD YYYY HH24:MI:SS"
To recover the database until a specified time, SCN, or log sequence number:
After connecting to the target database and, optionally, the recovery catalog database, ensure that the database is mounted. If the database is open, shut it down and then mount it:
2. SHUTDOWN IMMEDIATE;
3. STARTUP MOUNT;
4.
Determine the time, SCN, or log sequence that should end recovery. For example, if you discover that a user accidentally dropped a tablespace at 9:02 a.m., then you can recover to 9 a.m.--just before the drop occurred. You will lose all changes to the database made after that time.
You can also examine the alert.log to find the SCN of an event and recover to a prior SCN. Alternatively, you can determine the log sequence number that contains the recovery termination SCN, and then recover through that log. For example, query V$LOG_HISTORY to view the logs that you have archived.
RECID STAMP THREAD# SEQUENCE# FIRST_CHAN FIRST_TIM NEXT_CHANG
1 344890611 1 1 20037 24-SEP-02 20043
2 344890615 1 2 20043 24-SEP-02 20045
3 344890618 1 3 20045 24-SEP-02 20046
Perform the following operations within a RUN command:
Set the end recovery time, SCN, or log sequence. If specifying a time, then use the date format specified in the NLS_LANG and NLS_DATE_FORMAT environment variables.
If automatic channels are not configured, then manually allocate one or more channels.
Restore and recover the database.
The following example performs an incomplete recovery until November 15 at 9 a.m.
RUN
SET UNTIL TIME 'Nov 15 2002 09:00:00';
# SET UNTIL SCN 1000; # alternatively, specify SCN
# SET UNTIL SEQUENCE 9923; # alternatively, specify log sequence number
RESTORE DATABASE;
RECOVER DATABASE;
If recovery was successful, then open the database and reset the online logs:
5. ALTER DATABASE OPEN RESETLOGS;
I did not quiet understand why the above scenario is using current controlfile as the checkpoint scn in the current controlfile and the checkpoint scn in the datafile headers do not match after the restore and recovery. Thanks in Advance for your help.
Thanks
satyaThanks for the reply ... but what about the checkpoint scn in the controlfile . my understanding is that unless the checkpoint scn in the controlfile and datafiles do not match the database will not open. so assuming the checkpoint scn in my current controlfile is 1500 and i want to recover my database till scn 1200. so the scn in the datafiles (which is 1200) is not not matching with the scn in the controlfile(1500). so will the database open in such cases.
Thanks
Satya -
BACKUP AND RECOVERY USING RMAN
제품 : ORACLE SERVER
작성날짜 : 2003-08-04
BACKUP AND RECOVERY USING RMAN
==============================
1. Backup Method
1.1 backing up in noarchivelog mode
SVRMGR> shutdown;
SVRMGR> startup mount
rman을 가동시킨 후 다음을 수행
run {
# backup the database to disk
allocate channel dev1 type disk;
backup (database format '/oracle/backups/bp_%s_%p'); }
1.2 Backing up databases and tablespaces in archivelog mode >
- database 단위 backup script
run {
allocate channel dev1 type 'sbt_tape';
backup skip offline (database format '/oracle/backups/%d_%u');
release channel dev1;
- tablespace 단위 backup script
run {
allocate channel dev1 type disk;
backup
(tablespace system,tbs_1,tbs_2,tbs_3,tbs_4,tbs_5
format '/oracle/backups/bp_%s_%p');
- datafile 단위 backup script
run {
allocate channel dev1 type disk;
backup
(datafile '?/dbs/t_dbs1.f'
format '/oracle/backups/%d_%u');
- control file backup script
control file은 system datafile의 첫번째 화일을 백업받을 때 백업되며 다음과
같은 방법으로도 백업받을 수 있다.
run {
allocate channel dev1 type 'sbt_tape';
backup
(tablespace tbs_5 include current controlfile
format '%d_%u');
- archived logs backup script
NLS_LANG=american
NLS_DATE_FORMAT='Mon DD YYYY HH24:MI:SS'
run {
allocate channel dev1 type 'sbt_tape';
backup
(archivelog from time 'Nov 13 1996 20:57:13'
until time 'Nov 13 1996 21:06:05'
all
format '%d_%u');
run {
allocate channel dev1 type 'sbt_tape';
backup
(archivelog low logseq 288 high logseq 301 thread 1
all delete input
format '%d_%u');
- copying datafiles
run {
allocate channel dev1 type disk;
copy datafile '?/dbs/tbs_01.f/dbs/tbs_01.f' to '?/copy/temp3.f';
- incremental backups
새로운 데이타화일이 추가되거나 테이블스페이스가 추가된다면 level 0의 backup을
반드시 수행한다.
run {
allocate channel dev1 type 'sbt_tape';
backup incremental level 0
(database
format '%d_%u');
run {
allocate channel dev1 type 'sbt_tape';
backup incremental level 1
(database
format '&d_%u');
2. Recovery Method
- tablespace recovery
run {
allocate channel dev1 type disk;
allocate channel dev2 type 'sbt_tape';
sql "alter tablespace tbs_1 offline immediate" ;
set newname for datafile 'disk7/oracle/tbs11.f'
to 'disk9/oracle/tbs11.f' ;
restore (tablespace tbs_1) ;
switch datafile all ;
recover tablespace tbs_1 ;
sql "alter tablespace tbs_1 online" ;
release channel dev1;
release channel dev2;
- point-in-time recovery
TBS_1 테이블스페이스는 두 개의 데이타 화일 소유. TEMP1은 백업이 없으나 user
data는 없는 temporary segemnt만 가지고 있음.
NLS_LANG=american
NLS_DATE_FORMAT='Mon DD YYYY HH24:MI:SS'
SVRMGR> shutdown abort;
SVRMGR> startup nomount;
run {
# recover database until 3pm after restoring tbs_1 to a new location
allocate channel dev1 type disk;
allocate channel dev2 type 'sbt_tape';
set until time 'Nov 15 1996 15:00:00'
set newname for datafile '/vobs/oracle/dbs/tbs_11.f'
to '?/dbs/temp1.f' ;
set newname for datafile '?/dbs/tbs_12.f'
to '?/dbs/temp2.f' ;
restore controlfile to '/vobs/oracle/dbs/cf1.f' ;
replicate controlfile from '/vobs/oracle/dbs/cf1.f';
sql "alter database mount" ;
restore database skip tablespace temp1;
switch datafile all;
recover database skip tablespace temp1;
sql "alter database open resetlogs";
sql "drop tablespace temp1";
sql "create tablespace temp1 datafile '/vobs/oracle/dbs/temp1.f' size 10M";
release channel dev1;
release channel dev2;
- 전체 데이타베이스를 복구하려 할때
current redologfile이 존재할때 다음과 같은 작업으로 전체 데이타베이스를 복구할
수 있다.
replace script restore_recover_db_cf {
execute script restore_cf;
sql 'alter database mount';
execute script restore_db;
execute script recover_db;
sql 'alter database open resetlogs';
replace script alloc_1_disk {
allocate channel d1 type disk;
setlimit channel d1 kbytes 2097150 maxopenfiles 32 readrate 200;
replace script rel_1_disk {
release channel d1;
replace script restore_cf {
execute script alloc_1_disk;
restore
controlfile to '/private/db_files/twih/dbf/ctrl_twih_1.ctl';
replicate
controlfile from '/private/db_files/twih/dbf/ctrl_twih_1.ctl';
execute script rel_1_disk;
replace script restore_db {
execute script alloc_1_disk;
restore
(database);
execute script rel_1_disk;
replace script recover_db {
execute script alloc_1_disk;
recover
database;
execute script rel_1_disk;
Reference Documents
<Note:104796.1>Hi Alok,
why there is a need for standby here? you mean to say standby db?
what i exactly need is , whether i will be making use of archivelogs which are all archived during that backup period (in mount stage) after some days, if i face any problem with the PRODUCTION Database.. -
Hi guys.
I am new in oracle database.my database is in no archive mode
i want to take backup through RMAN .
rman target sys/oracle
backup database;
but fail to backup. please see error
ORA -19602: cannot backup or copy active file in noarchivelog modeEnable archiving in 10g
1. shutdown immediate;
2. edit init.ora set log_archive_start=TRUE /*Set this if your database is 9i. If 10g DB then ignore this step*/
3. startup mount;
4. alter database archivelog;
5. alter database flashback on; /*Not required to enable archiving. Just extra info to enable flashback logs*/
6. alter database open;
7. archive log list;
Now take backup
run
allocate channel ch1 type disk format '%D_%d_%t_%T_%s.bak';
backup database plus archivelog;
report obsolete;
delete noprompt obsolete;
crosscheck backupset;
crosscheck archivelog all;
resync catalog;
Sami Malik
[email protected] -
Find how many archive logs are generated and backup through RMAN
friends,
how many arhcive logs are generating between 2 consecutive backups through RMAN.
Ur help is really appricated.
ThanksSorry, I misunderstood the question
I think you are not asking how many logs are generated since last backup. My initial repy was the answer for this
The answer of you question on 10G R2 is like below. Query groups your archivelog backup sessions and counts the logs in one session which is the number of generated archivelog file between two backup session/.
select session_key,count(sequence#) from V$BACKUP_ARCHIVELOG_DETAILS group by session_key order by 1 desc
Coskan Gundogar
http://coskan.wordpress.com -
Recovery doesn't see old archivelog backups
I am doing weekly full backups
backup
as compressed backupset
channel=disk1
full
database
include current controlfile
plus archivelog
delete all input;
Point-in-time recovery worked fine using:
set until scn $1 ;
restore database;
recover database delete archivelog;
release channel c1;
alter database open resetlogs;
Untill today, when I tried recovering using backupset that is two weeks old.
Restore database worked fine. But media recovery failed with errors like this:
RMAN-03002: failure of recover command at 09/28/2006 21:06:58
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of log thread 1 seq 10992 lowscn 200869768 found to restore
RMAN-06025: no backup of log thread 1 seq 10991 lowscn 200868902 found to restore
database recovery was unable to find archivelog backups.
What was confusing is that 'list backup' would show me the missing backups as available:
BS Key Size Device Type Elapsed Time Completion Time
1653 497.50K DISK 00:00:01 17-SEP-06
BP Key: 1868 Status: AVAILABLE Compressed: YES Tag: TAG2006_09_17
Piece Name: /disk0/oradata/live/LIVE/backupset/2006_09_17/live_2006_09_17_archivelog_mohtfs3a_1_1.bck
List of Archived Logs in backup set 1653
Thrd Seq Low SCN Low Time Next SCN Next Time
1 10992 200869768 17-SEP-06 200870470 17-SEP-06
I tried all what I could think of to get rman to see those backups.
Finally, I changed computer system time to two weeks ago - and recovery worked !
Why is recovery ignoring old archivelog backups ? How to make recovery see those old files ? Is there a more elegant way to recover to a point in time that doesn't require me to change computer clock ? Using 'set until scn' is the standard way I do it but it seems to work only within a certain time frame.I don't think that's the problem. I use backupsets to create a copy of database on another machine. So, I never (knock on the wood) do recovery of the database that is being backed up.
This is how the script looks like:
set dbid 123123;
startup nomount
run
allocate channel c1 device type disk;
restore controlfile from autobackup maxdays = 100;
alter database mount;
set until scn 7878787;
restore database;
recover database delete archivelog; -- it fails when it gets to this phase, complaining about missing files
release channel c1;
alter database open resetlogs;
}
Maybe you are looking for
-
Job for httpd.service failed. See 'systemctl status httpd.service' and
Hello, I am the problem. I change "/etc/httpd/conf/httpd.conf" to install php5 on apache. sudo systemctl start httpd Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details. systemctl status httpd.service ●
-
The transferring of mp3 to Creative Zen Style 100 stops
Hello, several weeks ago i bought Creative Zen Style 00. Everything worked perfectly for the first 2 times (I mean the transferring from PC to the player) but then something went wrong - it transfers or a few songs from the album and then it stops (s
-
HT4796 how long should it take to transfer this material from a PC to my Mac?
How long should a data migration from a PC to my Mac take?
-
ITunes updated and now it won't start
I updated iTunes a few days ago, and now I can't get it to start. When I click the quicklink on my desktop or in the home menu, it says the file it links to (itunes.exe) has been moved or altered, and it tries to remove the quicklink (I said yes once
-
Cant get into windows with bootcamp
I don't why this is happen but when i start bootcamp windows xp. It says it was not shut down properly and tells me how to restart it. (safe mode,Normal, etc..)after i select it, it reboots the macbook into mac os and i have to hold down the option k