[20170616]recover copy of datafile 6.txt
[20170616]no copy of datafile 6 found to recover.txt
--//最近几天一直被这个问题纠缠,我虽然不知道问题在哪来,还是找到简单的解决方法,做1个记录:
--//链接:http://www.itpub.net/thread-2088843-1-1.html
1.环境:
SYS@book> @ &r/ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
RMAN> show CONTROLFILE AUTOBACKUP ;
RMAN configuration parameters for database with db_unique_name BOOK are:
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
RMAN> report schema ;
Report of database schema for database with db_unique_name BOOK
List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 760 SYSTEM *** /mnt/ramdisk/book/system01.dbf
2 940 SYSAUX *** /mnt/ramdisk/book/sysaux01.dbf
3 865 UNDOTBS1 *** /mnt/ramdisk/book/undotbs01.dbf
4 146 USERS *** /mnt/ramdisk/book/users01.dbf
5 346 EXAMPLE *** /mnt/ramdisk/book/example01.dbf
6 40 TEA *** /mnt/ramdisk/book/tea01.dbf
List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 414 TEMP 32767 /mnt/ramdisk/book/temp01.dbf
--//我的目的很简单是否可以给1个copy的数据文件做增量scn.
2.测试:
RMAN> list backup ;
specification does not match any backup in the repository
RMAN> list copy of database ;
specification does not match any datafile copy in the repository
--//测试前我把以前的全部备份删除.
RMAN> backup as copy datafile 6 format '/home/oracle/backup/tea01.dbf';
Starting backup at 2017-06-16 17:18:26
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=/mnt/ramdisk/book/tea01.dbf
output file name=/home/oracle/backup/tea01.dbf tag=TAG20170616T171826 RECID=52 STAMP=946833506
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 2017-06-16 17:18:27
RMAN> list copy of datafile 6;
List of Datafile Copies
=======================
Key File S Completion Time Ckp SCN Ckp Time
------- ---- - ------------------- ---------- -------------------
52 6 A 2017-06-16 17:18:26 13277281436 2017-06-16 17:18:26
Name: /home/oracle/backup/tea01.dbf
Tag: TAG20170616T171826
--//备份记录的Ckp SCN=13277281436.如果我执行如下
RMAN> recover copy of datafile 6 ;
Starting recover at 2017-06-16 17:19:31
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
no copy of datafile 6 found to recover
Finished recover at 2017-06-16 17:19:31
--//可以发现没有应用.必须做一个关于这个数据文件的增量备份.
RMAN> backup incremental from scn 13277281500 datafile 6 format '/home/oracle/backup/%U';
Starting backup at 2017-06-16 17:21:11
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
RMAN-06755: WARNING: datafile 6: incremental-start SCN is too recent; using checkpoint SCN 13277281436 instead
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/mnt/ramdisk/book/tea01.dbf
channel ORA_DISK_1: starting piece 1 at 2017-06-16 17:21:11
channel ORA_DISK_2: starting full datafile backup set
channel ORA_DISK_2: specifying datafile(s) in backup set
channel ORA_DISK_1: finished piece 1 at 2017-06-16 17:21:12
piece handle=/home/oracle/backup/jes6v287_1_1 tag=TAG20170616T172111 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
including current control file in backup set
channel ORA_DISK_2: starting piece 1 at 2017-06-16 17:21:12
channel ORA_DISK_2: finished piece 1 at 2017-06-16 17:21:13
piece handle=/home/oracle/backup/jfs6v287_1_1 tag=TAG20170616T172111 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:01
Finished backup at 2017-06-16 17:21:13
--//说明一下,正常应该执行 from scn 13277281436,我选择从13277281500,备份程序自动纠正我的错误,选择正确的scn=13277281436
--//RMAN-06755: WARNING: datafile 6: incremental-start SCN is too recent; using checkpoint SCN 13277281436 instead.
--//接着增量恢复:
RMAN> recover copy of datafile 6 ;
Starting recover at 2017-06-16 17:22:48
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
no copy of datafile 6 found to recover
Finished recover at 2017-06-16 17:22:48
--//提示no copy of datafile 6 found to recover,很明显rman什么事情都没有做.
3.分析:
--//实际上我做了rman的跟踪:
$ rman target / debug recover,sql level=10 trace=tracefile.trc
DBGSQL: TARGET>
DECLARE
allCopies BOOLEAN;
BEGIN
dbms_rcvman.resetthisBackupAge;
IF ( :allCopies > 0)
THEN
allCopies := TRUE;
ELSE
allCopies := FALSE;
END IF;
:rc :=
dbms_rcvman.computeRecoveryActions
(
fno => :fno
,crescn => :crescn
,df_rlgscn => :rlgscn
,df_rlgtime => :rlgtime
,df_ckpscn => :ckpscn
,offlscn => :offlscn
,onlscn => :onlscn
,onltime => :onltime
,cleanscn => :cleanscn
,clean2scn => :clean2scn
,clean2time => :clean2time
,allowfuzzy => FALSE
,partial_rcv => FALSE
,cf_scn => :cfscn
,cf_cretime => :cfcretime
,cf_offrrid => :cfoffrrid
,allCopies => allCopies
,df_cretime => :cretime
,rmanCmd => :rmanCmd
,foreignDbid => :foreignDbid
,pluggedRonly => :pluggedRonly
,pluginSCN => :pluginSCN
,pluginRlgSCN => :pluginRlgSCN
,pluginRlgTime => :pluginRlgTime
,creation_thread => :creation_thread
,creation_size => :creation_size
);
IF ( :maxact > 0)
THEN
dbms_rcvman.trimRecoveryActions
(
maxActions => :maxact
,containerMask => dbms_rcvman.proxyCopy_con_t
+ dbms_rcvman.imageCopy_con_t
+ dbms_rcvman.backupSet_con_t
,actionMask => dbms_rcvman.full_act_t
);
END IF;
END;
DBGSQL: sqlcode = 0
DBGSQL: B :rc = 1
DBGSQL: B :allCopies = 0
DBGSQL: B :fno = 6
DBGSQL: B :crescn = 13276257767
DBGSQL: B :rlgscn = NULL
DBGSQL: B :rlgtime = NULL
DBGSQL: B :ckpscn = NULL
DBGSQL: B :offlscn = 0
DBGSQL: B :onlscn = 0
DBGSQL: B :onltime = "1988-01-01 00:01:01"
DBGSQL: B :cleanscn = 0
DBGSQL: B :clean2scn = 0
DBGSQL: B :clean2time = "1988-01-01 00:00:00"
DBGSQL: B :cfscn = 13277242031
DBGSQL: B :cfcretime = "2015-11-24 09:11:10"
DBGSQL: B :cfoffrrid = 0
DBGSQL: B :cretime = "2017-02-13 15:09:58"
DBGSQL: B :rmanCmd = 2
DBGSQL: B :maxact = 0
DBGSQL: B :foreignDbid = 0
DBGSQL: B :pluggedRonly = 0
DBGSQL: B :pluginSCN = 0
DBGSQL: B :pluginRlgSCN = 0
DBGSQL: B :pluginRlgTime = NULL
DBGSQL: B :creation_thread = 1
DBGSQL: B :creation_size = 5120
RMAN-05017: no copy of datafile 6 found to recover
RMAN-03091: Finished recover at 2017-06-15 16:53:13
--//target那行语句太长,我在toad下做了格式化处理.语句我也没看,明显增量备份没有记录.
RMAN> list backup ;
specification does not match any backup in the repository
--//从这里也说明问题,不知道为什么增量备份在控制文件中没有记录.catalog看看结果如何?
$ ls -l /home/oracle/backup/j*
-rw-r----- 1 oracle oinstall 40960 2017-06-16 17:21:11 /home/oracle/backup/jes6v287_1_1
-rw-r----- 1 oracle oinstall 11042816 2017-06-16 17:21:12 /home/oracle/backup/jfs6v287_1_1
RMAN> catalog backuppiece '/home/oracle/backup/jes6v287_1_1';
using target database control file instead of recovery catalog
cataloged backup piece
backup piece handle=/home/oracle/backup/jes6v287_1_1 RECID=253 STAMP=946834214
RMAN> catalog backuppiece '/home/oracle/backup/jfs6v287_1_1';
cataloged backup piece
backup piece handle=/home/oracle/backup/jfs6v287_1_1 RECID=254 STAMP=946834225
RMAN> list backup ;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
252 Incr 32.00K DISK 00:00:00 2017-06-16 17:21:11
BP Key: 253 Status: AVAILABLE Compressed: NO Tag: TAG20170616T172111
Piece Name: /home/oracle/backup/jes6v287_1_1
List of Datafiles in backup set 252
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- ------------------- ----
6 Incr 13277281639 2017-06-16 17:21:11 /mnt/ramdisk/book/tea01.dbf
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ -------------------
253 Incr 10.52M DISK 00:00:00 2017-06-16 17:21:11
BP Key: 254 Status: AVAILABLE Compressed: NO Tag: TAG20170616T172111
Piece Name: /home/oracle/backup/jfs6v287_1_1
Control File Included: Ckp SCN: 13277281639 Ckp time: 2017-06-16 17:21:11
--//很明显做增量时还做了控制文件的备份.
RMAN> recover copy of datafile 6 until scn 13277281500;
Starting recover at 2017-06-16 17:32:49
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=101 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=123 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=134 device type=DISK
no copy of datafile 6 found to recover
Finished recover at 2017-06-16 17:32:50
--//执行没报错,但是还是no copy of datafile 6 found to recover,去掉until scn 13277281500;参数看看.
--//我本来的想法就是通过这样的方式恢复到特定的scn,看来不行.这也是我最初的目的..
RMAN> recover copy of datafile 6 ;
Starting recover at 2017-06-16 17:34:26
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: specifying datafile copies to recover
recovering datafile copy file number=00006 name=/home/oracle/backup/tea01.dbf
channel ORA_DISK_1: reading from backup piece /home/oracle/backup/jes6v287_1_1
channel ORA_DISK_1: piece handle=/home/oracle/backup/jes6v287_1_1 tag=TAG20170616T172111
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished recover at 2017-06-16 17:34:28
--//OK,成功!!
RMAN> list copy of datafile 6;
List of Datafile Copies
=======================
Key File S Completion Time Ckp SCN Ckp Time
------- ---- - ------------------- ---------- -------------------
53 6 A 2017-06-16 17:34:27 13277281639 2017-06-16 17:21:11
Name: /home/oracle/backup/tea01.dbf
Tag: TAG20170616T171826
--//我现在备份的数据文件scn=13277281639,也与前面做的增量一致.
4.总结:
--//感觉这个是bug,我在11.2.0.3也做了类似测试,没有问题.
--//不知道有什么好方法恢复到特定的scn,必须要通过辅助实例吗?这是我测试的目的....
[20170616]recover copy of datafile 6.txt的更多相关文章
- RMAN-06023: no backup or copy of datafile 6 found to restore
一:问题描述 我用指定备份集恢复时,报错: RMAN> run { 2> shutdown immediate; 3> startup mount; 4> allocate c ...
- RMAN-06023: no backup or copy of datafile 1 found to restore
在ORACLE 10g数据库还原过程遭遇RMAN-06023: no backup or copy of datafile x found to restore,具体情况如下所示 .......... ...
- 异机恢复 RMAN-06023: no backup or copy of datafile 17 found to restore
前不久因工作需要使用RMAN异机恢复,很基础也很具有代表性和普遍性,希望对需要的人有所帮助. 具体过程如下: 先拷贝原库的口令文件和参数文件到备库. 然后使用如下脚本对原库进行备份: run { al ...
- 复制D:\\day05目录下的所有文件到D:\\copy,并将.txt文件改为.java文件。
**解题思路: 1.首先定义一个静态的refile方法,参数传入两个文件路径 2.要复制目录下的所有文件,首先查询File类的方法,可以使用listFiles方法得到目录下的文件 3.想到这问题基本就 ...
- [20171121]rman backup as copy 2.txt
[20171121]rman backup as copy 2.txt --//昨天测试backup as copy ,备份时备份文件的文件头什么时候更新.是最后完成后还是顺序写入备份文件.--//我 ...
- [20180718]拷贝数据文件从dg库.txt
[20180718]拷贝数据文件从dg库.txt 1.测试环境:SCOTT@book> @ ver1PORT_STRING VERSION B ...
- [20170627]使用TSPITR恢复表空间.txt
[20170627]使用TSPITR恢复表空间.txt --//RMAN提供了一种实现所谓TSPITR(Tablespace Point-In-Time Recovery)的技术,通过简单的一个语句, ...
- [20170623]利用传输表空间恢复数据库2.txt
[20170623]利用传输表空间恢复数据库2.txt --//继续上午的测试,测试truncate,是否可行,理论讲应该没有问题.我主要的目的测试是否要切换日志.--//参考链接 : http:// ...
- [20170623]利用传输表空间恢复部分数据.txt
[20170623]利用传输表空间恢复部分数据.txt --//昨天我测试使用传输表空间+dblink,上午补充测试发现表空间设置只读才能执行impdp导入原数据,这个也很好理解.--//这样的操作模 ...
随机推荐
- 1015 Reversible Primes (20 分)
A reversible prime in any number system is a prime whose "reverse" in that number system i ...
- 通过 plsql 连接远程 Oracle
方法一:通过 plsql 工具和 oracle client(不是即时客户端 instantclient) 的方式来连接 Oracle 一. 安装 oracle client,(本教程已经下载并解压) ...
- .NET Core项目部署到Linux(Centos7)(八)为.NET Core项目创建Supervisor进程守护监控
目录 1.前言 2.环境和软件的准备 3.创建.NET Core API项目 4.VMware Workstation虚拟机及Centos 7安装 5.Centos 7安装.NET Core环境 6. ...
- 汇编刷题:屏幕显示 HOW ARE YOU!
DATA SEGMENT INFO DB 'HOW ARE YOU!$' DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START: MOV AX,DAT ...
- 05-CSV文件读取(问题)
1.支持.txt,.log,.json三种格式 并且也支持.csv格式文件类型----.csv在使用时会出现乱码情况 2.当时遇到问题: CSV文件.txt文本内有数据,如:user ,pwd adm ...
- 刮刮乐自定义view
说明:该代码是参考鸿洋大神的刮刮乐自定义view来写的. 实现:刮刮乐-刮奖的效果,如下效果 下面直接放代码了:只有一个自定义view,要实现真正的功能还需要进一步封装 /** * 自定义view-刮 ...
- Daily Scrum 12/23/2015
Process: Zhaoyang: Compile the Caffe IOS version and make it run in the IOS9. Yandong: Finish the Az ...
- D. Minimax Problem Codeforces 1288D binary_search+二进制
题目大意:n*m的矩阵中,找到两行数,可以形成两个一维数组,数组1的位置i和数组2的位置i去最大构成新数组b的元素b[i],最终目的要使数组b中最小的数尽可能的大 题解: m的范围是(1,8),比较小 ...
- tensorflow--filter、strides
最近还在看<TensorFlow 实战Google深度学习框架第二版>这本书,根据第六章里面对于卷基层和池化层的介绍可以发现,在执行 tf.nn.conv2d 和 tf.nn.max_po ...
- Windows线程+进程通信
一 Windows线程进程 1)定义 按照MS的定义, Windows中的进程简单地说就是一个内存中的可执行程序, 提供程序运行的各种资源. 进程拥有虚拟的地址空间, 可执行代码, 数据, 对象句柄集 ...