[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导入原数据,这个也很好理解.--//这样的操作模 ...
随机推荐
- 摩尔投票算法( Boyer-Moore Voting Algorithm)
一.Majority Element题目介绍:给定一个长度为n的数组的时候,找出其中的主元素,即该元素在数组中出现的次数大于n/2的取整.题目中已经假定所给的数组一定含有元素,且主元素一定存在.一下是 ...
- Linux搜索工具
Linux搜索工具 Search搜索工具 yum search all vim ...
- 微信小程序分享至朋友圈的方法
最近研究怎么实现微信小程序分享至朋友圈,对就是朋友圈. 微信小程序目前没有直接提供方法来将小程序分享至朋友圈,不过可以采用曲线救国的方式来达到目的. 方法分两步: 1.通过浏览器将希望分享的东西风向至 ...
- javascript入门 之 用bootstrap-table写一个表格
方法1(对普通的 table 设置 data-toggle="table" 即可): <!DOCTYPE html> <html> <head> ...
- JNDI数据源的配置及使用 (2010-11-21 21:16:43)转载▼
JNDI数据源的配置及使用 (2010-11-21 21:16:43)转载▼ 标签: 杂谈 分类: 数据库 数据源的作用 JDBC操作的步骤: 1. 加载驱动程序 2. 连接数据库 3. 操作数据库 ...
- 【论文笔记】张航和李沐等提出:ResNeSt: Split-Attention Networks(ResNet改进版本)
github地址:https://github.com/zhanghang1989/ResNeSt 论文地址:https://hangzhang.org/files/resnest.pdf 核心就是: ...
- Three.js实现3D地图实例分享
本文主要给大家介绍了关于利用Three.js开发实现3D地图的实践过程,文中通过示例代码介绍的非常详细,对大家学习或者使用three.js具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习 ...
- DNA sequence HDU - 1560(IDA*,迭代加深搜索)
题目大意:有n个DNA序列,构造一个新的序列,使得这n个DNA序列都是它的子序列,然后输出最小长度. 题解:第一次接触IDA*算法,感觉~~好暴力!!思路:维护一个数组pos[i],表示第i个串该匹配 ...
- ORA-0245
经常有客户报错ORA-0245 1.11.2 rac环境, rman存在snap控制文件路径,默认是文件系统[非共享,导致备份控制文件报错] 解决方法:将snap路径配置到ASM磁盘组共享路径[nfs ...
- React AntDesign 引入css
React项目是用umi脚手架搭建的AntDesign,用到一个第三方表格组件Jexcel,npm install 之后组件的样式加载不上,犯了愁,翻阅各种资料,踏平两个小坑. 大家都知道,安装完成的 ...