龙空技术网

oracle11g rman恢复:ORA-01180

咔卟IT 157

前言:

当前我们对“oracle11g异机还原”可能比较着重,我们都需要知道一些“oracle11g异机还原”的相关知识。那么小编在网络上搜集了一些对于“oracle11g异机还原””的相关内容,希望咱们能喜欢,看官们一起来了解一下吧!

记一次rman 数据恢复问题处理案例:

为了省去创建参数文件等和目录文件的麻烦,直接通过创建实例法恢复。

执行恢复时 报错rman恢复 ORA-01180: can not create datafile 1

闪回区有归档,影响了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

标签: #oracle11g异机还原