如何解决oracle1de的错误: ORA-01180: can not create datafile 1

手册/FAQ (666) 2016-03-30 14:24:09

今天进行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  

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

方案二:重新去原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> 

THE END