【控制文件丢失-恢复-1】(一)

2015-01-25 21:06:01 · 作者: · 浏览: 34
控制文件恢复:
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Nov 6 10:35:08 2014
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engine
and Real Application Testing options

SQL> alter system set control_files='/u01/oracle/oradata/jadl10g/control01.ctl','/u01/oracle/flash_recovery_area/jadl10g/control02.ctl' scope=spfile;
System altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> ho cp /u01/oracle/oradata/jadl10g/control02.ctl /u01/oracle/flash_recovery_area/jadl10g/control02.ctl

SQL> startup
ORACLE instance started.
Total System Global Area 599785472 bytes
Fixed Size 2098112 bytes
Variable Size 163580992 bytes
Database Buffers 427819008 bytes
Redo Buffers 6287360 bytes
Database mounted.
Database opened.
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/u01/oracle/oradata/jadl10g/control01.ctl
/u01/oracle/flash_recovery_area/jadl10g/control02.ctl

进入rman确定存在控制文件的备份集:
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
6 Full 6.80M DISK 00:00:01 06-NOV-14
BP Key: 6 Status: AVAILABLE Compressed: NO Tag: TAG20141106T103719
Piece Name: /u01/oracle/flash_recovery_area/JADL10G/backupset/2014_11_06/o1_mf_ncsnf_TAG20141106T103719_b5oqr4bc_.bkp
Control File Included: Ckp SCN: 457789 Ckp time: 06-NOV-14

1.部分丢失:
[oracle@oracle ~]$ rm /u01/oracle/oradata/jadl10g/control01.ctl
[oracle@oracle ~]$ rman target /
Recovery Manager: Release 10.2.0.5.0 - Production on Thu Nov 6 10:39:42 2014
Copyright (c) 1982, 2007, Oracle. 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/oracle/oradata/jadl10g/control01.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
rman的备份信息是记录在控制文件中的,连接到rman时会报错的。但是可以连接到sqlplus。
能执行的操作是查询等,不涉及控制文件的变化,涉及控制文件的变化就会出错。
[oracle@oracle ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Thu Nov 6 10:43:43 2014
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engine
and Real Application Testing options

SQL>
conn scott/tiger Connected. SQL> select * from dept; DEPTNO DNAME LOC ---------- -------------- ------------- 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON 此时不能一致性关闭数据库(shutdown immediate),是不能触发ck