RM 刪除資料檔案恢復操作

ygzhou518發表於2012-03-16

[oracle@ygzhou01 ygzhou01]$ rm -rf ygzhou01.dbf

[oracle@ygzhou01 ygzhou01]$ ps -ef|grep dbw|grep -v grep

oracle    6081     1  0 Mar14 ?        00:00:12 ora_dbw0_ygzhou01

[oracle@ygzhou01 ygzhou01]$ ll /proc/6081/fd/

lr-x------  1 oracle oinstall 64 Mar 15 08:39 0 -> /dev/null

lr-x------  1 oracle oinstall 64 Mar 15 08:39 1 -> /dev/null

lr-x------  1 oracle oinstall 64 Mar 15 08:39 10 -> /dev/zero

lr-x------  1 oracle oinstall 64 Mar 15 08:39 11 -> /dev/zero

lr-x------  1 oracle oinstall 64 Mar 15 08:39 12 -> /u01/app/oracle/product/10.2.0/dbhome_1/rdbms/mesg/oraus.msb

lrwx------  1 oracle oinstall 64 Mar 15 08:39 13 -> /u01/app/oracle/product/10.2.0/dbhome_1/dbs/hc_ygzhou01.dat

lrwx------  1 oracle oinstall 64 Mar 15 08:39 14 -> /u01/app/oracle/product/10.2.0/dbhome_1/dbs/lkYGZHOU01

lrwx------  1 oracle oinstall 64 Mar 15 08:39 15 -> /u01/app/oracle/oradata/ygzhou01/control01.ctl

lrwx------  1 oracle oinstall 64 Mar 15 08:39 16 -> /u01/app/oracle/oradata/ygzhou01/control02.ctl

lrwx------  1 oracle oinstall 64 Mar 15 08:39 17 -> /u01/app/oracle/oradata/ygzhou01/control03.ctl

lrwx------  1 oracle oinstall 64 Mar 15 08:39 18 -> /u01/app/oracle/oradata/ygzhou01/system01.dbf

lrwx------  1 oracle oinstall 64 Mar 15 08:39 19 -> /u01/app/oracle/oradata/ygzhou01/undotbs01.dbf

lr-x------  1 oracle oinstall 64 Mar 15 08:39 2 -> /dev/null

lrwx------  1 oracle oinstall 64 Mar 15 08:39 20 -> /u01/app/oracle/oradata/ygzhou01/sysaux01.dbf

lrwx------  1 oracle oinstall 64 Mar 15 08:39 21 -> /u01/app/oracle/oradata/ygzhou01/users01.dbf

lrwx------  1 oracle oinstall 64 Mar 15 08:39 22 -> socket:[12711]

lrwx------  1 oracle oinstall 64 Mar 15 08:39 23 -> /u01/app/oracle/oradata/ygzhou01/tbs_stream01.dbf

lrwx------  1 oracle oinstall 64 Mar 15 08:39 24 -> /u01/app/oracle/oradata/ygzhou01/ygzhou01.dbf (deleted)

lrwx------  1 oracle oinstall 64 Mar 15 08:39 25 -> /u01/app/oracle/oradata/ygzhou01/temp01.dbf

lr-x------  1 oracle oinstall 64 Mar 15 08:39 26 -> /u01/app/oracle/product/10.2.0/dbhome_1/rdbms/mesg/oraus.msb

lr-x------  1 oracle oinstall 64 Mar 15 08:39 3 -> /dev/null

lr-x------  1 oracle oinstall 64 Mar 15 08:39 4 -> /dev/null

l-wx------  1 oracle oinstall 64 Mar 15 08:39 5 -> /u01/app/oracle/admin/ygzhou01/udump/ygzhou01_ora_6073.trc

l-wx------  1 oracle oinstall 64 Mar 15 08:39 6 -> /u01/app/oracle/admin/ygzhou01/bdump/alert_ygzhou01.log

lrwx------  1 oracle oinstall 64 Mar 15 08:39 7 -> /u01/app/oracle/product/10.2.0/dbhome_1/dbs/lkinstygzhou01 (deleted)

l-wx------  1 oracle oinstall 64 Mar 15 08:39 8 -> /u01/app/oracle/admin/ygzhou01/bdump/alert_ygzhou01.log

lrwx------  1 oracle oinstall 64 Mar 15 08:39 9 -> /u01/app/oracle/product/10.2.0/dbhome_1/dbs/hc_ygzhou01.dat

[oracle@ygzhou01 ygzhou01]$ cp /proc/6081/fd/24 /u01/app/oracle/oradata/ygzhou01/ygzhou01.dbf

[oracle@ygzhou01 ygzhou01]$ ll -ht

-rw-r-----  1 oracle oinstall 7.3M Mar 15 08:47 control01.ctl

-rw-r-----  1 oracle oinstall 7.3M Mar 15 08:47 control02.ctl

-rw-r-----  1 oracle oinstall 7.3M Mar 15 08:47 control03.ctl

-rw-r-----  1 oracle oinstall  51M Mar 15 08:47 redo02.log

-rw-r-----  1 oracle oinstall 127M Mar 15 08:47 ygzhou01.dbf

-rw-r-----  1 oracle oinstall 476M Mar 15 08:46 undotbs01.dbf

-rw-r--r--  1 oracle oinstall 270M Mar 15 08:45 ygzhou.dmp

-rw-r--r--  1 oracle oinstall  43K Mar 15 08:45 ygzhou.log

-rw-r-----  1 oracle oinstall 501M Mar 15 08:43 system01.dbf

-rw-r-----  1 oracle oinstall 101M Mar 15 08:43 tbs_stream01.dbf

-rw-r-----  1 oracle oinstall 291M Mar 15 08:43 sysaux01.dbf

-rw-r-----  1 oracle oinstall 179M Mar 15 08:39 users01.dbf

-rw-r-----  1 oracle oinstall  51M Mar 15 08:34 redo01.log

-rw-r-----  1 oracle oinstall  51M Mar 15 08:34 redo03.log

-rw-r-----  1 oracle oinstall  31M Jan 31 22:00 temp01.dbf

[oracle@ygzhou01 ygzhou01]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Thu Mar 15 08:47:10 2012

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved. 

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options 

SQL> conn ygzhou/ygzhou

SQL> insert into ygzhou01 select * from ygzhou01;

insert into ygzhou01 select * from ygzhou01

*

ERROR at line 1:

ORA-01122: database file 5 failed verification check

ORA-01110: data file 5: '/u01/app/oracle/oradata/ygzhou01/ygzhou01.dbf'

ORA-01208: data file is an old version - not accessing current version

SQL> alter database datafile 5 offline;

Database altered. 

SQL> recover datafile 5;

ORA-00279: change 2983705 generated at 03/15/2012 08:34:57 needed for thread 1

ORA-00289: suggestion : /home/oracle/archivelog/1_29_777913609.dbf

ORA-00280: change 2983705 for thread 1 is in sequence #29

 

Specify log: {=suggested | filename | AUTO | CANCEL}

auto

Log applied.

Media recovery complete.

SQL> alter database datafile 5 online;

Database altered.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24867586/viewspace-718726/,如需轉載,請註明出處,否則將追究法律責任。

相關文章