块损坏模拟+恢复
来源:互联网 发布:窗帘销售软件 编辑:程序博客网 时间:2024/05/16 16:46
SQL> create tablespace test datafile '/u01/app/oracle/oradata/orcldg/test.dbf' size 1m;Tablespace created.SQL> create user test identified by test default tablespace test;User created.SQL> grant dba to test;Grant succeeded.SQL> conn test/testConnected.SQL> create table test1(id number,name varchar2(100));Table created.SQL> declare 2 begin 3 for i in 1..100 loop 4 insert into test1 values(i,'liming'||i); 5 end loop; 6 commit; 7 end; 8 /PL/SQL procedure successfully completed.一直搞到ERROR at line 1:ORA-01653: unable to extend table TEST.TEST2 by 8 in tablespace TESTORA-06512: at line 4SQL> select count(1) from test1; COUNT(1)---------- 40002关掉数据库,破坏数据文件。[oracle@lmsingledg orcldg]$ cd /u01/app/oracle/oradata/orcldg/[oracle@lmsingledg orcldg]$ vi test.dbf眼花,随便找一个不是数据的乱码,删掉。ORACLE instance shut down.SQL> startupORACLE instance started.Total System Global Area 1603411968 bytesFixed Size 2253664 bytesVariable Size 989858976 bytesDatabase Buffers 603979776 bytesRedo Buffers 7319552 bytesDatabase mounted.Database opened.SQL> conn test/testselect * from test1;ERROR:ORA-01578: ORACLE data block corrupted (file # 5, block # 13)ORA-01110: data file 5: '/u01/app/oracle/oradata/orcldg/test.dbf'750 rows selected.SQL> SELECT tablespace_name, segment_type, owner, segment_name FROM dba_extents WHERE file_id = 5 and 13 between block_id AND block_id + blocks - 1 ;TABLESPACE_NAME SEGMENT_TYPE OWNER------------------------------ ------------------ ------------------------------SEGMENT_NAME--------------------------------------------------------------------------------TEST TABLE TESTTEST1果断看备份。RMAN> list backup of datafile 5;using target database control file instead of recovery catalogspecification does not match any backup in the repository这时候导出数据:[oracle@lmsingledg ~]$ exp test/test tables=test1 file=/home/oracle/test3.dmpExport: Release 11.2.0.4.0 - Production on Thu Oct 22 22:34:17 2015Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsExport done in US7ASCII character set and AL16UTF16 NCHAR character setserver uses ZHS16GBK character set (possible charset conversion)About to export specified tables via Conventional Path .... . exporting table TEST1EXP-00056: ORACLE error 1578 encounteredORA-01578: ORACLE data block corrupted (file # 5, block # 13)ORA-01110: data file 5: '/u01/app/oracle/oradata/orcldg/test.dbf'Export terminated successfully with warnings.[oracle@lmsingledg ~]$设置内部事件,导出的时候跳出这些块。SQL> ALTER SYSTEM SET EVENTS='10231 trace name context forever,level 10' ;System altered.[oracle@lmsingledg ~]$ exp test/test tables=test1 file=/home/oracle/test2.dmpExport: Release 11.2.0.4.0 - Production on Thu Oct 22 22:35:44 2015Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsExport done in US7ASCII character set and AL16UTF16 NCHAR character setserver uses ZHS16GBK character set (possible charset conversion)About to export specified tables via Conventional Path .... . exporting table TEST1 756 rows exportedEXP-00091: Exporting questionable statistics.Export terminated successfully with warnings.就导出了756条数据。最后,取消设置alter system set events='10231 trace name context off';损失了40002-756条数据。把表drop了,重新建表,插数。所以说,备份是必须的,多么痛的领悟呀。
0 0
- 块损坏模拟+恢复
- Oracle 10G 模拟块损坏后恢复
- 数据块损坏恢复
- 模拟块损坏
- Oracle数据块损坏恢复
- 数据文件块损坏及其恢复方法
- Oracle数据块损坏恢复总结
- ORA-01578 数据库块损坏 恢复过程
- Oracle数据块损坏恢复总结
- Oracle数据块损坏恢复总结
- Oracle 数据块损坏与恢复详解
- Oracle数据块损坏恢复总结
- Oracle 数据块损坏与恢复详解
- BBED模拟表数据块的损坏
- 冷备份--模拟磁盘损坏恢复
- 模拟MBR的备份、损坏、恢复
- Oracle损坏数据块的处理与恢复
- exp/imp(expdp/impdp)恢复损坏的数据块
- MyBatis(3)Mapper XML文件
- 【Android成长之路】Toast的简单应用
- Objective-C中不同方式实现锁
- hdu4825 Xor Sum 字典树与异或(经典)
- XXX.dll 不是有效的 Office 加载项,解决方法
- 块损坏模拟+恢复
- 手机分配短讯id的面试题目
- Spring注解详解
- Andrew Ng Machine Learning 专题【Recommender Systems】
- Ubuntu12 配置Bugzilla
- 如何在工作的头三年让自己变得强大
- 关于css3动画与H5动画的比较(2015年10月22日)
- Reveal 的安装和使用
- HTTP状态码