数据库备份恢复--恢复控制文件,不使用使用FRA,控制文件自动备份到别的位置,控制文件全部丢失

控制文件丢失后果

1.数据库无法正常关闭

2,数据库重启失败

现象:

1.关闭实例,报错

SYS@ocp> shutdown immediate
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/OCP/controlfile/o1_mf_fb8w60b0_.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory

2.无法启动实例

扫描二维码关注公众号,回复: 3103804 查看本文章

3.无法登录rman

[oracle@bonda1 trace]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Sun Sep 9 12:00:52 2018

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

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-06003: ORACLE error from target database:
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/app/oracle/oradata/OCP/controlfile/o1_mf_fb8w60b0_.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory

思路:

1,强制关闭数据库

2.从备份中恢复旧的控制文件

操作

1.强制关闭数据

SYS@ocp> shutdown abort
ORACLE instance shut down.

2.指定oracle_sid

[oracle@bonda1 dbs]$ export ORACLE_SID=ocp

 

3.启动到nomount状态

[oracle@bonda1 dbs]$ rman target /

connected to target database (not started)

RMAN> startup nomount

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/db_1/dbs/initocp.ora'

starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started

Total System Global Area 1068937216 bytes

Fixed Size 2260088 bytes
Variable Size 281019272 bytes
Database Buffers 780140544 bytes
Redo Buffers 5517312 bytes

 

4.rman设定dbid

RMAN> set dbid=2866727024;

executing command: SET DBID

 

5.controlfile自动备份的位置,恢复参数文件

RMAN> run
2> {
3> set controlfile autobackup format for device type disk to '/u01/test%F';
4> allocate channel c1 device type disk;
5> restore controlfile from autobackup;
6> }

executing command: SET CONTROLFILE AUTOBACKUP FORMAT

allocated channel: c1
channel c1: SID=921 device type=DISK

Starting restore at 09-SEP-18

recovery area destination: /u01/FRA
database name (or database unique name) used for search: OCP
channel c1: no AUTOBACKUPS found in the recovery area
channel c1: looking for AUTOBACKUP on day: 20180909
channel c1: AUTOBACKUP found: /u01/testc-2866727024-20180909-01
channel c1: restoring control file from AUTOBACKUP /u01/testc-2866727024-20180909-01
channel c1: control file restore from AUTOBACKUP complete
output file name=/u01/app/oracle/oradata/OCP/controlfile/o1_mf_fb8w60b0_.ctl
output file name=/u01/app/oracle/fast_recovery_area/OCP/controlfile/o1_mf_fb8w60n4_.ctl
Finished restore at 09-SEP-18
released channel: c1

 

5.数据库mount

RMAN> alter database mount;

database mounted

6.还原数据文件

RMAN> recover database;

Starting recover at 09-SEP-18
Starting implicit crosscheck backup at 09-SEP-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=921 device type=DISK
Crosschecked 5 objects
Finished implicit crosscheck backup at 09-SEP-18

Starting implicit crosscheck copy at 09-SEP-18
using channel ORA_DISK_1
Finished implicit crosscheck copy at 09-SEP-18

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u01/FRA/OCP/archivelog/2018_09_09/o1_mf_1_131_fsbbcxbc_.arc
File Name: /u01/FRA/OCP/archivelog/2018_09_09/o1_mf_1_132_fsbj5smt_.arc

using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 131 is already on disk as file /u01/FRA/OCP/archivelog/2018_09_09/o1_mf_1_131_fsbbcxbc_.arc
archived log for thread 1 with sequence 132 is already on disk as file /u01/FRA/OCP/archivelog/2018_09_09/o1_mf_1_132_fsbj5smt_.arc
archived log for thread 1 with sequence 133 is already on disk as file /u01/app/oracle/fast_recovery_area/OCP/onlinelog/o1_mf_1_fb8w649k_.log
archived log file name=/u01/FRA/OCP/archivelog/2018_09_09/o1_mf_1_131_fsbbcxbc_.arc thread=1 sequence=131
archived log file name=/u01/FRA/OCP/archivelog/2018_09_09/o1_mf_1_132_fsbj5smt_.arc thread=1 sequence=132
archived log file name=/u01/app/oracle/fast_recovery_area/OCP/onlinelog/o1_mf_1_fb8w649k_.log thread=1 sequence=133
media recovery complete, elapsed time: 00:00:02
Finished recover at 09-SEP-18

7.打开数据库

RMAN> alter database open resetlogs;

database opened

8.重启数据库

RMAN> startup force

Oracle instance started
database mounted
database opened

 

猜你喜欢

转载自www.cnblogs.com/bondait/p/9616138.html