- [oracle@localhost orcl]$ sqlplus /nolog
- SQL*Plus: Release 11.2.0.1.0 Production on Tue Nov 20 09:47:58 2012
- Copyright (c) 1982, 2009, Oracle. All rights reserved.
- SQL> conn /as sysdba
- Connected to an idle instance.
- SQL> startup
- ORACLE instance started.
- Total System Global Area 1031356416 bytes
- Fixed Size 2219832 bytes
- Variable Size 687866056 bytes
- Database Buffers 335544320 bytes
- Redo Buffers 5726208 bytes
- Database mounted.
- ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
- ORA-01110: data file 6: '/u01/app/oracle/oradata/orcl/test01.dbf'
- SQL> alter database datafile 6 offline;
- Database altered.
- SQL> alter database open;
- Database altered.
- SQL>
对丢失的数据文件离线处理后,打开数据库,下面使用rman恢复丢失的数据文件:
- [oracle@localhost ~]$ rman target/
- Recovery Manager: Release 11.2.0.1.0 - Production on Tue Nov 20 09:49:07 2012
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
- connected to target database: ORCL (DBID=1321265761)
- RMAN> restore datafile 6;
- Starting restore at 2012-11-20 09:49:21
- using target database control file instead of recovery catalog
- allocated channel: ORA_DISK_1
- channel ORA_DISK_1: SID=27 device type=DISK
- 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 00006 to /u01/app/oracle/oradata/orcl/test01.dbf
- channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/ORCL/backupset/2012_11_19/o1_mf_nnndf_TAG20121119T171847_8bmycqht_.bkp
- channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2012_11_19/o1_mf_nnndf_TAG20121119T171847_8bmycqht_.bkp tag=TAG20121119T171847
- channel ORA_DISK_1: restored backup piece 1
- channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
- Finished restore at 2012-11-20 09:49:24
- RMAN> recover datafile 6;
- Starting recover at 2012-11-20 09:49:37
- using channel ORA_DISK_1
- starting media recovery
- media recovery complete, elapsed time: 00:00:00
- Finished recover at 2012-11-20 09:49:38
- RMAN> sql 'alter database datafile 6 online';
- sql statement: alter database datafile 6 online
- RMAN>
至此,丢失的数据文件恢复完毕
阅读(1406) | 评论(0) | 转发(0) |