[20160329]backup as copy问题.txt

[20160329]backup as copy问题.txt

--别人问的一个问题,想通过dg建立测试库,我建议他停止日志应用,然后使用拷贝的方式建立测试库,只要路径一样,生成一个新的控
--制文件就ok了。本来一个很简单通过nfs mount文件系统,cp就ok了。没有选择cp而使用rman的backup as copy命令方式,遇到一点点
--小问题,自己重复测试看看:

1.环境:
SCOTT@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

2.我仅仅拷贝system表空间数据文件(copy database也一样):

RMAN> backup as copy datafile 1 format '/home/oracle/backup/%b' ;

Starting backup at 2016-03-29 09:24:24
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=123 device type=DISK
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/mnt/ramdisk/book/system01.dbf
output file name=/home/oracle/backup/system01.dbf tag=TAG20160329T092425 RECID=3 STAMP=907752267
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
copying current control file
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 03/29/2016 09:24:28
ORA-19715: invalid format b for generated name
ORA-27302: failure occurred at: slgpn
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 2016-03-29 09:24:29
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 03/29/2016 09:24:29
ORA-19715: invalid format b for generated name
ORA-27302: failure occurred at: slgpn

$ ls -l /home/oracle/backup/
total 789264
-rw-r----- 1 oracle oinstall 807411712 2016-03-29 09:24:26 system01.dbf

--实际上文件系统拷贝成功,由于使用%b格式(保留原文件名),因为拷贝system文件,会触发oracle自动备份spfile以及控制文件
--产生触发错误。
--实际上使用没有问题。

3.我看一些文档,好像还真的无法规避这个问题:
--可以使用DB_FILE_NAME_CONVERT来实现,不过很奇怪的是database必须放在最后。

BACKUP AS COPY DB_FILE_NAME_CONVERT=('/mnt/ramdisk/book/','/home/oracle/backup/') FORMAT='/home/oracle/backup/spfile_and_control_%U' database;

RMAN> BACKUP AS COPY DB_FILE_NAME_CONVERT=('/mnt/ramdisk/book/','/home/oracle/backup/') FORMAT='/home/oracle/backup/spfile_and_control_%U' datafile 1;
Starting backup at 2016-03-29 10:03:47
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/mnt/ramdisk/book/system01.dbf
output file name=/home/oracle/backup/system01.dbf tag=TAG20160329T100347 RECID=31 STAMP=907754629
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/home/oracle/backup/spfile_and_control_cf_D-BOOK_id-1337401710_4pr1mf46 tag=TAG20160329T100347 RECID=32 STAMP=907754631
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 2016-03-29 10:03:52
channel ORA_DISK_1: finished piece 1 at 2016-03-29 10:03:53
piece handle=/home/oracle/backup/spfile_and_control_4qr1mf48_1_1 tag=TAG20160329T100347 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2016-03-29 10:03:53

时间: 2024-07-31 19:10:25

[20160329]backup as copy问题.txt的相关文章

[20171121]rman backup as copy 2.txt

[20171121]rman backup as copy 2.txt --//昨天测试backup as copy ,备份时备份文件的文件头什么时候更新.是最后完成后还是顺序写入备份文件. --//我测试的数据文件使用数据文件2(表空间sysaux),也许是文件不够大,应该减慢备份速度来测试看看. 1.环境: SCOTT@book> @ &r/ver1 PORT_STRING                    VERSION        BANNER ----------------

[20171121]rman backup as copy.txt

[20171121]rman backup as copy.txt --//上个星期做数据文件块头恢复时,提到使用rman备份数据文件时,文件头数据库信息是最后写入备份集文件的,在filesperset=1的情况 --//下写入备份集文件中的倒数第2块就是文件头的备份.参考链接: http://blog.itpub.net/267265/viewspace-2147297/=>[20171115]恢复数据文件块头4补充.txt --//而且我最后还做了测试证明如果resotre数据文件,实际上文

[20160421]backup as copy问题2.txt

[20160421]backup as copy问题2.txt http://blog.itpub.net/267265/viewspace-2070878/ --前面提到使用backup as copy datafile 1 format '/home/oracle/backup/%b' ;这样的方式会报错 RMAN-03009: failure of backup command on ORA_DISK_1 channel at 03/29/2016 09:24:29 ORA-19715:

[20121126]backup as copy datafile 1的问题.txt

[20121126]backup as copy datafile 1的问题.txt SQL> select * from v$version where rownumBANNER--------------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production RMA

[20171122]rman backup as copy的备份问题

[20171122]rman backup as copy的备份问题.txt --//以前曾经写过一篇[20160524]rman备份与检查点4.txt=>链接:http://blog.itpub.net/267265/viewspace-2106087/ --//里面提到加入备份时间很长,这样可能会出现数据块里面的scn号大于文件头scn号.我提到视图v$backup_datafile --//的ABSOLUTE_FUZZY_CHANGE#字段记录了备份时块最大的scn号.查询视图: sele

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,具体情况如下所示 ..................................................................................... File Name: /u03/flash_recovery_area/EPPS/archivelog/2015_01_26/o1_mf_1_10_

[20140823]在sqlplus使用copy注意.txt

[20140823]在sqlplus使用copy注意.txt --有时候使用copy来复制表数据,但是前几天我的测试遇到一些小问题,做一个记录,总之还是小心注意这些细节. SCOTT@test01p> @ver BANNER                                                                               CON_ID ----------------------------------------------------

[20171121]rman使用copy image恢复.txt

[20171121]rman使用copy image恢复.txt --//上个星期做数据文件块头恢复时,提到使用rman备份数据文件时,文件头数据库信息是最后写入备份集文件的,在filesperset=1的情况 --//下写入备份集文件中的倒数第2块就是文件头的备份.参考链接: http://blog.itpub.net/267265/viewspace-2147297/=>[20171115]恢复数据文件块头4补充.txt --//而且我最后还做了测试证明如果resotre数据文件,实际上文件

[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 ---------------