Welcome 微信登录

首页 / 数据库 / MySQL / Oracle非归档模式Media Recovery错误之--ORA-26040

系统环境:操作系统:Linux RH55Oracle:  Oracle 11gR2模拟案例:1、查看数据库模式18:12:36 SYS@ prod>archive log list;Database log mode              No Archive ModeAutomatic archival            DisabledArchive destination            /dsk4/arch1Oldest online log sequence    1Current log sequence          32、创建新的Tablespace18:13:19 SYS@ prod>create tablespace tbs218:13:30  2  datafile "/u01/app/oracle/oradata/prod/tbs2.dbf" size 10m;Tablespace created.3、对数据库进行冷备[oracle@rh6 ~]$ rman target /Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jul 24 18:14:30 2014Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.connected to target database: PROD (DBID=239333010)RMAN> run {2> shutdown immediate;3> startup mount;4> backup database format "/dsk3/bak/%s_%d.bak";5> alter database open;6> }4、备份完成在新的Tablesapce上创建Object18:19:40 SYS@ prod>conn scott/tigerConnected.18:30:13 SCOTT@ prod>create table t1 tablespace tbs2 as select * from emp;Table created.Elapsed: 00:00:01.0018:30:45 SCOTT@ prod>select count(*) from t1;  COUNT(*)----------        14Elapsed: 00:00:00.0218:30:56 SCOTT@ prod>insert into t1 select * from t1 where rownum=1;1 row created.Elapsed: 00:00:00.0218:31:16 SCOTT@ prod>commit;Commit complete.Elapsed: 00:00:00.0418:31:18 SCOTT@ prod>insert into t1 select * from t1 where rownum=1;1 row created.Elapsed: 00:00:00.0118:31:23 SCOTT@ prod>select count(*) from t1;  COUNT(*)----------        16
5、查看Redo Log信息18:32:14 SYS@ prod>select group#,sequence# ,status from v$log;    GROUP#  SEQUENCE# STATUS---------- ---------- ----------------        1          4 CURRENT        2          2 INACTIVE        3          3 INACTIVEElapsed: 00:00:00.05--------------------------------------分割线 --------------------------------------Oracle 11G RAC 修改归档模式 http://www.linuxidc.com/Linux/2013-07/87704.htmOracle手工完全恢复案例(归档模式) http://www.linuxidc.com/Linux/2013-06/86719.htmOracle手工恢复案例(非归档模式) http://www.linuxidc.com/Linux/2013-06/86718.htmOracle归档模式设置的相关指令与简要说明 http://www.linuxidc.com/Linux/2013-04/82512.htmOracle 10g 归档模式下备份脚本 http://www.linuxidc.com/Linux/2012-10/73045.htmOracle 归档模式与非归档模式的切换 http://www.linuxidc.com/Linux/2013-12/94535.htm--------------------------------------分割线 --------------------------------------6、模拟数据文件被破坏[oracle@rh6 ~]$ rm /u01/app/oracle/oradata/prod/tbs2.dbf18:32:28 SYS@ prod>shutdown abortORACLE instance shut down.重新启动Instance到mount,查看redo log,日志没有发生switch18:33:06 SYS@ prod>startup mount;ORACLE instance started.Total System Global Area  835104768 bytesFixed Size                  2217952 bytesVariable Size            775948320 bytesDatabase Buffers          54525952 bytesRedo Buffers                2412544 bytesDatabase mounted.18:33:42 SYS@ prod>select group#,sequence# ,status from v$log;    GROUP#  SEQUENCE# STATUS---------- ---------- ----------------        1          4 CURRENT        3          3 INACTIVE        2          2 INACTIVE
Open database出现数据文件丢失错误:18:34:17 SYS@ prod>alter database open;alter database open*ERROR at line 1:ORA-01157: cannot identify/lock data file 9 - see DBWR trace fileORA-01110: data file 9: "/u01/app/oracle/oradata/prod/tbs2.dbf"7、对Database做Media Recovery(因为没有日志切换,做complete recover)[oracle@rh6 ~]$ rman target /Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jul 24 18:34:35 2014Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.connected to target database: PROD (DBID=239333010, not open)RMAN> restore datafile 9;Starting restore at 24-JUL-14using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=18 device type=DISKchannel ORA_DISK_1: starting datafile backup set restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setchannel ORA_DISK_1: restoring datafile 00009 to /u01/app/oracle/oradata/prod/tbs2.dbfchannel ORA_DISK_1: reading from backup piece /dsk3/bak/34_PROD.bakchannel ORA_DISK_1: piece handle=/dsk3/bak/34_PROD.bak tag=TAG20140724T181640channel ORA_DISK_1: restored backup piece 1channel ORA_DISK_1: restore complete, elapsed time: 00:00:01Finished restore at 24-JUL-14RMAN> recover datafile 9;Starting recover at 24-JUL-14using channel ORA_DISK_1starting media recoverymedia recovery complete, elapsed time: 00:00:01Finished recover at 24-JUL-14
查看告警日志:Thu Jul 24 18:34:49 2014Full restore complete of datafile 9 /u01/app/oracle/oradata/prod/tbs2.dbf.  Elapsed time: 0:00:00  checkpoint is 2168258Thu Jul 24 18:34:57 2014alter database recover datafile list clearCompleted: alter database recover datafile list clearalter database recover if needed datafile 9Media Recovery StartSerial Media Recovery startedRecovery of Online Redo Log: Thread 1 Group 3 Seq 3 Reading mem 0  Mem# 0: /dsk1/oradata/prod/redo03a.log  Mem# 1: /dsk2/oradata/prod/redo03b.logRecovery of Online Redo Log: Thread 1 Group 1 Seq 4 Reading mem 0  Mem# 0: /dsk1/oradata/prod/redo01a.log  Mem# 1: /dsk2/oradata/prod/redo01b.logMedia Recovery Complete (prod)Completed: alter database recover if needed datafile 9通过group1和3,进行了media recovery !更多详情见请继续阅读下一页的精彩内容: http://www.linuxidc.com/Linux/2014-07/104744p2.htm
  • 1
  • 2
  • 3
  • 下一页
如何在Linux上检查MySQL数据表的存储引擎类型Oracle 11g 在RedHat Linux 5.8_x64平台的安装手册相关资讯      Oracle非归档模式  ORA-26040 
  • Oracle在非归档模式下不能更改表空  (05/15/2015 08:39:39)
  • Oracle手工恢复案例(非归档模式)  (06/30/2013 07:21:38)
  • 错误ORA-26040: Data block was   (11/13/2014 18:53:01)
本文评论 查看全部评论 (0)
表情: 姓名: 字数