会计考友 发表于 2012-8-4 14:06:19

Oracle性能调优:数据文件的丢失恢复

1.1 在wwl表空间上创建5张表,并添加数据。
   
    SQL> create table wwl01 (id number(3),namevarchar2(10));
   
    Table created.
   
    SQL> insert into wwl01 values(1,'wwl');
   
    1 row created.
   
    SQL> insert into wwl01 values(2,'wm');
   
    1 row created.
   
    SQL> insert into wwl01 values(3,'zq');
   
    1 row created.
   
    SQL> insert into wwl01 values(4,'wbq');
   
    1 row created.
   
    SQL> insert into wwl01 values(5,'wq');
   
    1 row created.
   
    SQL> create table wwl02 as select * from wwl01;
   
    Table created.
   
    SQL> create table wwl03 as select * from wwl01;
   
    Table created.
   
    SQL> create table wwl04 as select * from wwl01;
   
    Table created.
   
    SQL> create table wwl05 as select * from wwl01;
   
    Table created.
   
    查看表中的数据:
   
    SQL> select * from tab;
   
    TNAME TABTYPE CLUSTERID
   
    ---------- ------- ----------
   
    WWL01 TABLE
   
    WWL02 TABLE
   
    WWL03 TABLE
   
    WWL04 TABLE
   
    WWL05 TABLE
   
    1.2 执行全库备份
   
    $ rman target /
   
    Recovery Manager: Release 10.2.0.1.0 - Production on Fri Jun 2200:59:59 2012
   
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
   
    connected to target database: WWL (DBID=5520179)
   
    RMAN> backup database;
   
    1.3 模拟数据丢失,手动删除数据文件wwl001.dbf
   
    $ rm -rfwwl001.dbf
   
    1.4 再次启动数据库,无法启动并报错不能锁定数据文件5,查看dbwr的跟踪文件。
   
    SQL>startup force;
   
    ORACLEinstance started.
   
    TotalSystem Global Area 285212672 bytes
   
    FixedSize 1218968 bytes
   
    VariableSize 92276328 bytes
   
    DatabaseBuffers 184549376 bytes
   
    RedoBuffers 7168000 bytes
   
    Databasemounted.
   
    ORA-01157:cannot identify/lock data file 5 - see DBWR trace file
   
    ORA-01110: data file 5:'/DBData/WWL/wwl001.dbf'
   
    1.5 检查跟踪文件,报如下错误,非常的清楚的告诉了找不到的文件:
   
    Errors in file /DBSoft/admin/WWL/bdump/wwl_dbw0_29185.trc:
   
    ORA-01157: Message 1157 not found; No messagefile for product=RDBMS, facility=ORA; arguments:
   
    ORA-01110: Message 1110 not found; No messagefile for product=RDBMS, facility=ORA; arguments:
   
    ORA-27037: Message 27037 not found; No messagefile for product=RDBMS, facility=ORA
   
    Linux Error: 2: No such file or directory
   
    Additional information: 3
   
    ORA-1157 signalled during: ALTER DATABASEOPEN…
页: [1]
查看完整版本: Oracle性能调优:数据文件的丢失恢复