oracle11g 云迁移报错 ORA-01180: can not create datafile 1

1,今天进行oracle云迁移,执行到rman的restore database;的时候报错信息:

 

	RMAN> restore database;


	Starting restore at 21-MAR-16
	using channel ORA_DISK_1


	creating datafile file number=1 name=/data/oracle/powerdes/system01.dbf
	RMAN-00571: ===========================================================
	RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
	RMAN-00571: ===========================================================
	RMAN-03002: failure of restore command at 03/21/2016 20:47:09
	ORA-01180: can not create datafile 1
	ORA-01110: data file 1: '/data/oracle/powerdes/system01.dbf'


	RMAN> exit




2,方案一:看到不能create,查看到/data/oracle/powerdes目录已经有 ,所以移除mv,此方案不能生效
[oracle@yueworldoracle_crm backup]$ mkdir /tmp/oracle/
[oracle@yueworldoracle_crm backup]$ mv /data/oracle/powerdes/*.dbf /tmp/oracle/




3,方案二:重新去原idc库上备份控制文件,再进行恢复,此方案还是不通
去原来的库上,备份控制文件:
RMAN> backup current controlfile;


Starting backup at 21-MAR-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=139 device type=DISK
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 21-MAR-16
channel ORA_DISK_1: finished piece 1 at 21-MAR-16
piece handle=/oracle/app/oracle/flash_recovery_area/POWERDES/backupset/2016_03_21/o1_mf_ncnnf_TAG20160321T211047_cgzwprbc_.bkp tag=TAG20160321T211047 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 21-MAR-16


RMAN> exit


将控制文件传输到云库上面:
[oracle@wgq__web_3_90 data]$ scp -P5001 /oracle/app/oracle/flash_recovery_area/POWERDES/backupset/2016_03_21/o1_mf_ncnnf_TAG20160321T211047_cgzwprbc_.bkp 2.15.27.6:/oracle/backup/
oracle@42.159.237.46's password: 
o1_mf_ncnnf_TAG20160321T211047_cgzwprbc_.bkp                                                                                                                                                                                                100% 9600KB   4.7MB/s   00:02    
[oracle@wgq__web_3_90 data]$ 


RMAN> restore controlfile to '/oracle/app/oracle/powerdes/control01.ctl' from '/oracle/backup/o1_mf_ncnnf_TAG20160321T211047_cgzwprbc_.bkp';


Starting restore at 21-MAR-16
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:03
Finished restore at 21-MAR-16


RMAN> 
......省略alter database mount; catalog start with 过程...
RMAN> restore database;


Starting restore at 21-MAR-16
using channel ORA_DISK_1


creating datafile file number=1 name=/data/oracle/powerdes/system01.dbf
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 03/21/2016 21:23:09
ORA-01180: can not create datafile 1
ORA-01110: data file 1: '/data/oracle/powerdes/system01.dbf'


RMAN> 

 

 

 

        文章来源地址:http://blog.csdn.net/mchdba/article/details/50951880,未经过原作者mchdba允许,谢绝转载。


4,方案三:闪回区有归档,影响了restore,所以删除闪存区的归档日志
搜索归档目录,发现处于闪回区的目录下面:
[root@yueworldoracle_crm soft]# find /data -name archivelog
/data/oracle/app/oracle/flash_recovery_area/POWERDES/archivelog
[root@yueworldoracle_crm soft]# su - oracle
[oracle@yueworldoracle_crm ~]$ cd /data/oracle/app/oracle/flash_recovery_area/POWERDES/archivelog
[oracle@yueworldoracle_crm archivelog]$ ll
total 20
drwxrwxrwx. 2 oracle oinstall 4096 Mar 17 22:05 2016_03_17
drwxrwxrwx. 2 oracle oinstall 4096 Mar 18 22:17 2016_03_18
drwxrwxrwx. 2 oracle oinstall 4096 Mar 19 17:02 2016_03_19
drwxrwxrwx. 2 oracle oinstall 4096 Mar 20 06:00 2016_03_20
drwxrwxrwx. 2 oracle oinstall 4096 Mar 21 00:29 2016_03_21
[oracle@yueworldoracle_crm archivelog]$ du -sh *
40M 2016_03_17
237M 2016_03_18
210M 2016_03_19
177M 2016_03_20
182M 2016_03_21

将这些归档日志移除到临时目录:
[oracle@yueworldoracle_crm archivelog]$ mkdir /data/backup2/
[oracle@yueworldoracle_crm archivelog]$ mv * /data/backup2/
[oracle@yueworldoracle_crm archivelog]$ ll
[oracle@yueworldoracle_crm archivelog]$ ll
total 0
[oracle@yueworldoracle_crm archivelog]$ pwd
/data/oracle/app/oracle/flash_recovery_area/POWERDES/archivelog

开始再做rman恢复操作,先启动到nomount状态:
[oracle@yueworldoracle_crm archivelog]$ rlwrap sqlplus / as sysdba


SQL*Plus: Release 11.2.0.1.0 Production on Mon Mar 21 23:43:37 2016


Copyright (c) 1982, 2009, Oracle.  All rights reserved.




Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> shutdown immediate
ORA-01109: database not open




Database dismounted.
ORACLE instance shut down.
SQL> startup nomount pfile='/oracle/backup/pfile_20160321.ora';
ORACLE instance started.


Total System Global Area 1603411968 bytes
Fixed Size    2213776 bytes
Variable Size 1023412336 bytes
Database Buffers  570425344 bytes
Redo Buffers    7360512 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

开始rman恢复控制文件:
[oracle@yueworldoracle_crm archivelog]$ rlwrap rman target /


Recovery Manager: Release 11.2.0.1.0 - Production on Mon Mar 21 23:44:08 2016


Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.


connected to target database: POWERDES (not mounted)


RMAN> restore controlfile to '/data/oracle/powerdes/control01.ctl' from  '/oracle/backup/2016-03-21_2/full_POWERDES_20160321_25.bak';


Starting restore at 21-MAR-16
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
Finished restore at 21-MAR-16


加载到mount状态:
RMAN> alter database mount
2> ;


database mounted
released channel: ORA_DISK_1


RMAN> 

注册备份集:
RMAN> catalog start with '/oracle/backup/2016-03-21_2';


Starting implicit crosscheck backup at 21-MAR-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=134 device type=DISK
Crosschecked 6 objects
Finished implicit crosscheck backup at 21-MAR-16


Starting implicit crosscheck copy at 21-MAR-16
using channel ORA_DISK_1
Finished implicit crosscheck copy at 21-MAR-16


searching for all files in the recovery area
cataloging files...
no files cataloged


searching for all files that match the pattern /oracle/backup/2016-03-21_2


List of Files Unknown to the Database
=====================================
File Name: /oracle/backup/2016-03-21_2/rman_backup.log
File Name: /oracle/backup/2016-03-21_2/full_POWERDES_20160321_25.bak
File Name: /oracle/backup/2016-03-21_2/arch_POWERDES_20160321_26.bak
File Name: /oracle/backup/2016-03-21_2/full_POWERDES_20160321_24.bak


Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done


List of Cataloged Files
=======================
File Name: /oracle/backup/2016-03-21_2/full_POWERDES_20160321_25.bak
File Name: /oracle/backup/2016-03-21_2/arch_POWERDES_20160321_26.bak
File Name: /oracle/backup/2016-03-21_2/full_POWERDES_20160321_24.bak


List of Files Which Where Not Cataloged
=======================================
File Name: /oracle/backup/2016-03-21_2/rman_backup.log
 RMAN-07517: Reason: The file header is corrupted


进行restore操作,将备份集恢复到数据文件,看到恢复正常不报错了:
RMAN> restore database;


Starting restore at 21-MAR-16
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 /data/oracle/powerdes/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /data/oracle/powerdes/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /data/oracle/powerdes/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /data/oracle/powerdes/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /data/oracle/powerdes/powerdesk01.dbf
channel ORA_DISK_1: restoring datafile 00006 to /data/oracle/powerdes/plas01.dbf
channel ORA_DISK_1: restoring datafile 00007 to /data/oracle/powerdes/plcrm01.dbf
channel ORA_DISK_1: restoring datafile 00008 to /data/oracle/powerdes/pl01.dbf
channel ORA_DISK_1: restoring datafile 00009 to /data/oracle/powerdes/help01.dbf
channel ORA_DISK_1: reading from backup piece /oracle/backup/2016-03-21_2/full_POWERDES_20160321_24.bak
......

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值