Rman tag 恢复问题?RMAN-06023

[复制链接]
查看11 | 回复7 | 2007-3-9 14:24:12 | 显示全部楼层 |阅读模式
本帖最后由 dl0218 于 2014-10-18 04:15 编辑

Rman tag 恢复遇到的问题?两个实例rman和mymic步骤:
1 全库备份mymic
run {
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
backup as backupset tag 'initDB'
format 'CundefinedracleDBBackupinitDBwhole-%s-%t-%u'
keep forever restore point 'initDB' database plus archivelog;
crosscheck backupset;
release channel ch1;
release channel ch2;
}
2 mymic 添加一个表空间 test-datafile number 是 7。
3全库备份mymic
run {
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
backup as backupset tag 'test'
format 'CundefinedracleDBBackuptestwhole-%s-%t-%u'
keep forever restore point 'test' database plus archivelog;
crosscheck backupset;
release channel ch1;
release channel ch2;
}

4 当我想恢复到 restore database from TAG='initDB';错误如下:
--------------------------------------------------------------------------------
RMAN> restore database from TAG='initDB';
Starting restore at Oct 16 2014 11:47:11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 10/16/2014 11:47:12
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 7 found to restore
rman配置如下:
RMAN> show all;
RMAN configuration parameters for database with db_unique_name ××× are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 350 DAYS;
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'CundefinedracleDBBack
upcontrolfile%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOA
D TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'C:ORACLE11GPRODUCT11.2.0DBHOME_1DAT
ABASESNCFMYMICROS.ORA'; # default

请问解决问题的思路,谢谢!!

回复

使用道具 举报

千问 | 2007-3-9 14:24:12 | 显示全部楼层
有人提个醒吗?谢谢!
回复

使用道具 举报

千问 | 2007-3-9 14:24:12 | 显示全部楼层
Up.

Lian
回复

使用道具 举报

千问 | 2007-3-9 14:24:12 | 显示全部楼层
1.你的rman备份增加备份controlfile
2.修改范例如下
run {
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
backup as backupset tag 'initDB'
format 'CundefinedracleDBBackupinitDBwhole-%s-%t-%u'
keep forever restore point 'initDB' database plus archivelog;
backup as copy current controlfile format '\RmanBackupsetFolder\CONTROLFILE_initDB';
crosscheck backupset;
release channel ch1;
release channel ch2;
}
3.restore controlfile from xxxxx 后再接着做 restore 的操作

回复

使用道具 举报

千问 | 2007-3-9 14:24:12 | 显示全部楼层
binhu 发表于 2014-10-21 09:27
1.你的rman备份增加备份controlfile
2.修改范例如下
run {

谢谢!!我试试!
回复

使用道具 举报

千问 | 2007-3-9 14:24:12 | 显示全部楼层
本帖最后由 dl0218 于 2014-10-21 23:15 编辑
binhu 发表于 2014-10-21 09:27
1.你的rman备份增加备份controlfile
2.修改范例如下
run {
即使我使用了旧的控制文件,基于tag恢复的时候,rman还是要找tag之后添加的数据文件7.restore controlfile from 'C:\oracleDBBackup\controlfile\CONTROLFILE_initDB'
Starting restore at Oct 21 2014 10:37:03
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
channel ORA_DISK_1: copied control file copy
output file name=C:\ORADATAMYMICROS\MYMICROS\CONTROL01.CTL
output file name=C:\ORACLE11G\FLASH_RECOVERY_AREA\MYMICROS\CONTROL02.CTL
Finished restore at Oct 21 2014 10:37:08
RMAN>restore database from TAG='initDB';
Starting restore at Oct 21 2014 10:38:06
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 10/21/2014 10:38:08
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 7 found to restore
同样的错误提示。有啥建议吗?我试试一个表空间一个表空间恢复。

回复

使用道具 举报

千问 | 2007-3-9 14:24:12 | 显示全部楼层
我的备份脚本:
run {
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
backup as backupset tag 'initDB'
format 'C:\oracleDBBackup\initDB\whole-%s-%t-%u'
keep forever restore point 'initDB' database plus archivelog;
backup as copy current controlfile format 'C:\oracleDBBackup\controlfile\CONTROLFILE_initDB';
crosscheck backupset;
release channel ch1;
release channel ch2;
}
回复

使用道具 举报

千问 | 2007-3-9 14:24:12 | 显示全部楼层
1.先查看现在的datafile
RMAN> report schema;
using target database control file instead of recovery catalog
Report of database schema for database with db_unique_name FDB
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1810SYSTEM
*** D:\ORACLE\ORADATA\FDB\SYSTEM01.DBF
2600SYSAUX
*** D:\ORACLE\ORADATA\FDB\SYSAUX01.DBF
3500NEW_UNDO_01
*** D:\ORACLE\ORADATA\FDB\NEW_UNDO_01.DBF
45USERS
*** D:\ORACLE\ORADATA\FDB\USERS01.DBF
5100TPFDA
*** D:\ORACLE\ORADATA\FDB\TPFDA.DBF
6100NEW_UNDO
*** D:\ORACLE\ORADATA\FDB\NEW_UNDO.DBF
7100TBS
*** D:\ORACLE\ORADATA\FDB\TBS_01.DBF
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
10TEMP02
0 D:\ORACLE\ORADATA\FDB\TEMP02.DBF
21024 TEMP03
1024D:\ORACLE\ORADATA\FDB\TEMP03.DBF
2.进行DB备份
RMAN> backup as compressed backupset database;
Starting backup at 24-OCT-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=133 device type=DISK
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=D:\ORACLE\ORADATA\FDB\SYSTEM01.DBF
input datafile file number=00002 name=D:\ORACLE\ORADATA\FDB\SYSAUX01.DBF
input datafile file number=00003 name=D:\ORACLE\ORADATA\FDB\NEW_UNDO_01.DBF
input datafile file number=00005 name=D:\ORACLE\ORADATA\FDB\TPFDA.DBF
input datafile file number=00006 name=D:\ORACLE\ORADATA\FDB\NEW_UNDO.DBF
input datafile file number=00007 name=D:\ORACLE\ORADATA\FDB\TBS_01.DBF
input datafile file number=00004 name=D:\ORACLE\ORADATA\FDB\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 24-OCT-14
channel ORA_DISK_1: finished piece 1 at 24-OCT-14
piece handle=D:\ORACLE\FRA\FDB\BACKUPSET\2014_10_24\O1_MF_NNNDF_TAG20141024T145532_B4MXZ52X_.BKP tag=TAG20141024T145532
comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:56
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 24-OCT-14
channel ORA_DISK_1: finished piece 1 at 24-OCT-14
piece handle=D:\ORACLE\FRA\FDB\BACKUPSET\2014_10_24\O1_MF_NCSNF_TAG20141024T145532_B4MY0X8T_.BKP tag=TAG20141024T145532
comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-OCT-14
3.进行controfile的备份
RMAN> backup current controlfile ;
Starting backup at 24-OCT-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 24-OCT-14
channel ORA_DISK_1: finished piece 1 at 24-OCT-14
piece handle=D:\ORACLE\FRA\FDB\BACKUPSET\2014_10_24\O1_MF_NCNNF_TAG20141024T145709_B4MY2711_.BKP tag=TAG20141024T145709
comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-OCT-14
RMAN> exit

4.建立新的tablespace
SYS@FDB> create tablespace inc_tbs datafile 'd:\oracle\oradata\fdb\inc_tbs.dbf' size 100m;
Tablespace created.
SYS@FDB> exit
5.重新备份DB
RMAN> backup as compressed backupset database;
Starting backup at 24-OCT-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=125 device type=DISK
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=D:\ORACLE\ORADATA\FDB\SYSTEM01.DBF
input datafile file number=00002 name=D:\ORACLE\ORADATA\FDB\SYSAUX01.DBF
input datafile file number=00003 name=D:\ORACLE\ORADATA\FDB\NEW_UNDO_01.DBF
input datafile file number=00005 name=D:\ORACLE\ORADATA\FDB\TPFDA.DBF
input datafile file number=00006 name=D:\ORACLE\ORADATA\FDB\NEW_UNDO.DBF
input datafile file number=00007 name=D:\ORACLE\ORADATA\FDB\TBS_01.DBF
input datafile file number=00008 name=D:\ORACLE\ORADATA\FDB\INC_TBS.DBF
input datafile file number=00004 name=D:\ORACLE\ORADATA\FDB\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 24-OCT-14
channel ORA_DISK_1: finished piece 1 at 24-OCT-14
piece handle=D:\ORACLE\FRA\FDB\BACKUPSET\2014_10_24\O1_MF_NNNDF_TAG20141024T150029_B4MY8GP4_.BKP tag=TAG20141024T150029
comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 24-OCT-14
channel ORA_DISK_1: finished piece 1 at 24-OCT-14
piece handle=D:\ORACLE\FRA\FDB\BACKUPSET\2014_10_24\O1_MF_NCSNF_TAG20141024T150029_B4MY9WBY_.BKP tag=TAG20141024T150029
comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-OCT-14
RMAN> exit
6.停止db
SYS@FDB> shutdown abort;
ORACLE instance shut down.
SYS@FDB> exit
7.进行还原,并指定tag/controlfile
RMAN> startup nomount;
Oracle instance started
RMAN> restore controlfile from 'D:\ORACLE\FRA\FDB\BACKUPSET\2014_10_24\O1_MF_NCNNF_TAG20141024T145709_B4MY2711_.BKP';
Starting restore at 24-OCT-14
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=134 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=D:\ORACLE\ORADATA\FDB\CONTROL01.CTL
output file name=D:\ORACLE\ORADATA\FDB\CONTROL02.CTL
Finished restore at 24-OCT-14
RMAN> restore database from tag='TAG20141024T145532';
Starting restore at 24-OCT-14
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to D:\ORACLE\ORADATA\FDB\SYSTEM01.DBF
channel ORA_DISK_1: restoring datafile 00002 to D:\ORACLE\ORADATA\FDB\SYSAUX01.DBF
channel ORA_DISK_1: restoring datafile 00003 to D:\ORACLE\ORADATA\FDB\NEW_UNDO_01.DBF
channel ORA_DISK_1: restoring datafile 00004 to D:\ORACLE\ORADATA\FDB\USERS01.DBF
channel ORA_DISK_1: restoring datafile 00005 to D:\ORACLE\ORADATA\FDB\TPFDA.DBF
channel ORA_DISK_1: restoring datafile 00006 to D:\ORACLE\ORADATA\FDB\NEW_UNDO.DBF
channel ORA_DISK_1: restoring datafile 00007 to D:\ORACLE\ORADATA\FDB\TBS_01.DBF
channel ORA_DISK_1: reading from backup piece D:\ORACLE\FRA\FDB\BACKUPSET\2014_10_24\O1_MF_NNNDF_TAG20141024T145532_B4MX
Z52X_.BKP
channel ORA_DISK_1: piece handle=D:\ORACLE\FRA\FDB\BACKUPSET\2014_10_24\O1_MF_NNNDF_TAG20141024T145532_B4MXZ52X_.BKP tag
=TAG20141024T145532
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:56
Finished restore at 24-OCT-14
RMAN> recover database noredo;
Starting recover at 24-OCT-14
using channel ORA_DISK_1
Finished recover at 24-OCT-14
RMAN> exit
8.把db开起来,并且确认没有测试时增加inc_tab datafile
SYS@FDB> select error from v$recover_file;
no rows selected
SYS@FDB> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: 'D:\ORACLE\ORADATA\FDB\SYSTEM01.DBF'

SYS@FDB> recover database using backup controlfile until cancel;
ORA-00279: change 1718328 generated at 10/24/2014 14:55:33 needed for thread 1
ORA-00289: suggestion :
D:\ORACLE\ORADATA\FDB\ARCH\ARC0000000030_0861557326.0001
ORA-00280: change 1718328 for thread 1 is in sequence #30
Specify log: {=suggested | filename | AUTO | CANCEL}
cancel
Media recovery cancelled.
SYS@FDB> alter database open resetlogs;
Database altered.
SYS@FDB> select status from v$instance;
STATUS
------------
OPEN
SYS@FDB> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
D:\ORACLE\ORADATA\FDB\SYSTEM01.DBF
D:\ORACLE\ORADATA\FDB\SYSAUX01.DBF
D:\ORACLE\ORADATA\FDB\NEW_UNDO_01.DBF
D:\ORACLE\ORADATA\FDB\USERS01.DBF
D:\ORACLE\ORADATA\FDB\TPFDA.DBF
D:\ORACLE\ORADATA\FDB\NEW_UNDO.DBF
D:\ORACLE\ORADATA\FDB\TBS_01.DBF
7 rows selected.
你看一下自已做的地方跟我差在那里?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行