Chinaunix首页 | 论坛 | 博客
  • 博客访问: 512965
  • 博文数量: 63
  • 博客积分: 1194
  • 博客等级: 中士
  • 技术积分: 761
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-24 12:44
个人简介

得之坦然,失之淡然,争其必然,顺其自然!

文章分类

全部博文(63)

文章存档

2014年(2)

2013年(22)

2012年(39)

分类: Oracle

2012-11-20 09:52:24

一个或多个数据文件丢失,oracle启动时会报错:

点击(此处)折叠或打开

  1. [oracle@localhost orcl]$ sqlplus /nolog

  2. SQL*Plus: Release 11.2.0.1.0 Production on Tue Nov 20 09:47:58 2012

  3. Copyright (c) 1982, 2009, Oracle. All rights reserved.

  4. SQL> conn /as sysdba
  5. Connected to an idle instance.
  6. SQL> startup
  7. ORACLE instance started.

  8. Total System Global Area 1031356416 bytes
  9. Fixed Size 2219832 bytes
  10. Variable Size 687866056 bytes
  11. Database Buffers 335544320 bytes
  12. Redo Buffers 5726208 bytes
  13. Database mounted.
  14. ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
  15. ORA-01110: data file 6: '/u01/app/oracle/oradata/orcl/test01.dbf'


  16. SQL> alter database datafile 6 offline;

  17. Database altered.

  18. SQL> alter database open;

  19. Database altered.

  20. SQL>
对丢失的数据文件离线处理后,打开数据库,下面使用rman恢复丢失的数据文件:

点击(此处)折叠或打开

  1. [oracle@localhost ~]$ rman target/

  2. Recovery Manager: Release 11.2.0.1.0 - Production on Tue Nov 20 09:49:07 2012

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

  4. connected to target database: ORCL (DBID=1321265761)

  5. RMAN> restore datafile 6;

  6. Starting restore at 2012-11-20 09:49:21
  7. using target database control file instead of recovery catalog
  8. allocated channel: ORA_DISK_1
  9. channel ORA_DISK_1: SID=27 device type=DISK

  10. channel ORA_DISK_1: starting datafile backup set restore
  11. channel ORA_DISK_1: specifying datafile(s) to restore from backup set
  12. channel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/orcl/test01.dbf
  13. 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
  14. 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
  15. channel ORA_DISK_1: restored backup piece 1
  16. channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
  17. Finished restore at 2012-11-20 09:49:24

  18. RMAN> recover datafile 6;

  19. Starting recover at 2012-11-20 09:49:37
  20. using channel ORA_DISK_1

  21. starting media recovery
  22. media recovery complete, elapsed time: 00:00:00

  23. Finished recover at 2012-11-20 09:49:38
  24. RMAN> sql 'alter database datafile 6 online';

  25. sql statement: alter database datafile 6 online

  26. RMAN>
至此,丢失的数据文件恢复完毕
阅读(1329) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~