1.首先测试rm 误删除数据库文件
[oracle@primary dbwdn]$ ll
total 2153164
-rw-r----- 1 oracle dba 8536064 Nov 27 21:50 control01.ctl
-rw-r----- 1 oracle dba 8536064 Nov 27 21:50 control02.ctl
-rw-r----- 1 oracle dba 8536064 Nov 27 21:50 control03.ctl
-rw-r----- 1 oracle dba 104865792 Nov 27 21:32 ggs01.dbf
-rw-r----- 1 oracle dba 525344768 Nov 27 21:32 perfstat.dbf
-rw-r----- 1 oracle dba 52429312 Nov 27 21:10 redo01.log
-rw-r----- 1 oracle dba 52429312 Nov 27 21:49 redo02.log
-rw-r----- 1 oracle dba 52429312 Nov 27 21:10 redo03.log
-rw-r----- 1 oracle dba 10493952 Nov 27 21:32 shkz_data_01.dbf
-rw-r----- 1 oracle dba 524296192 Nov 27 21:49 sysaux01.dbf
-rw-r----- 1 oracle dba 524296192 Nov 27 21:49 system01.dbf
-rw-r----- 1 oracle dba 209723392 Nov 18 10:54 temp01.dbf
-rw-r----- 1 oracle dba 52436992 Nov 27 21:32 test01.dbf
-rw-r----- 1 oracle dba 251666432 Nov 27 21:49 undotbs01.dbf
-rw-r----- 1 oracle dba 26222592 Nov 27 21:32 users01.dbf
[oracle@primary dbwdn]$ rm test01.dbf
2.找到数据库后台进程dbw0
oracle 3493 1 0 21:10 ? 00:00:00 ora_dbw0_dbwdn
进程号3493
3.找到被误删除的数据库文件
[oracle@primary dbwdn]$ ll /proc/3493/fd
total 0
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 0 -> /dev/null
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 1 -> /dev/null
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 10 -> /dev/zero
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 11 -> /dev/zero
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 12 -> /u01/app/oracle/product/10.2.0/db_1/rdbms/mesg/oraus.msb
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 13 -> /u01/app/oracle/product/10.2.0/db_1/dbs/hc_dbwdn.dat
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 14 -> /u01/app/oracle/product/10.2.0/db_1/dbs/lkDBWDN
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 15 -> /u01/app/oracle/oradata/dbwdn/control01.ctl
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 16 -> /u01/app/oracle/oradata/dbwdn/control02.ctl
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 17 -> /u01/app/oracle/oradata/dbwdn/control03.ctl
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 18 -> /u01/app/oracle/oradata/dbwdn/system01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 19 -> /u01/app/oracle/oradata/dbwdn/undotbs01.dbf
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 2 -> /dev/null
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 20 -> /u01/app/oracle/oradata/dbwdn/sysaux01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 21 -> /u01/app/oracle/oradata/dbwdn/users01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 22 -> /u01/app/oracle/oradata/dbwdn/test01.dbf (deleted)
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 23 -> /u01/app/oracle/oradata/dbwdn/ggs01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 24 -> /u01/app/oracle/oradata/dbwdn/perfstat.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 25 -> /u01/app/oracle/oradata/dbwdn/shkz_data_01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 26 -> /u01/app/oracle/oradata/dbwdn/temp01.dbf
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 27 -> /u01/app/oracle/product/10.2.0/db_1/rdbms/mesg/oraus.msb
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 3 -> /dev/null
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 4 -> /dev/null
l-wx------ 1 oracle oinstall 64 Nov 27 21:52 5 -> /u01/app/oracle/admin/dbwdn/udump/dbwdn_ora_3485.trc
l-wx------ 1 oracle oinstall 64 Nov 27 21:52 6 -> /u01/app/oracle/admin/dbwdn/bdump/alert_dbwdn.log
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 7 -> /u01/app/oracle/product/10.2.0/db_1/dbs/hc_dbwdn.dat
l-wx------ 1 oracle oinstall 64 Nov 27 21:52 8 -> /u01/app/oracle/admin/dbwdn/bdump/alert_dbwdn.log
误删除之后,数据库没有重启,系统也没用重启
4.拷贝数据库文件
[oracle@primary ~]$ cp /proc/3493/fd/22 /u01/app/oracle/oradata/dbwdn/test01.dbf
[oracle@primary ~]$ cd /u01/app/oracle/oradata/dbwdn
[oracle@primary dbwdn]$ ls
control01.ctl control03.ctl perfstat.dbf redo02.log shkz_data_01.dbf system01.dbf test01.dbf users01.dbf
control02.ctl ggs01.dbf redo01.log redo03.log sysaux01.dbf temp01.dbf undotbs01.dbf
数据库文件找回来了。
5.恢复数据库文件
[oracle@primary dbwdn]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Nov 27 21:55:15 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter database datafile 5 offline;
Database altered.
SQL> recover datafile 5;
Media recovery complete.
SQL> alter database datafile 5 online;
Database altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1273276 bytes
Variable Size 130024004 bytes
Database Buffers 150994944 bytes
Redo Buffers 2920448 bytes
Database mounted.
Database opened.
SQL>
成功恢复数据库
注:如果数据库重启之后,还能恢复吗,测试一下:
[oracle@primary dbwdn]$ rm users01.dbf[oracle@primary dbwdn]$ ps -ef |grep dbw0
oracle 3798 1 0 21:56 ? 00:00:00 ora_dbw0_dbwdn
oracle 4147 3439 0 22:07 pts/1 00:00:00 grep dbw0
[oracle@primary dbwdn]$ ll /proc/3798/fd
total 0
lr-x------ 1 oracle oinstall 64 Nov 27 22:07 0 -> /dev/null
lr-x------ 1 oracle oinstall 64 Nov 27 22:07 1 -> /dev/null
lr-x------ 1 oracle oinstall 64 Nov 27 22:07 10 -> /dev/zero
lr-x------ 1 oracle oinstall 64 Nov 27 22:07 11 -> /dev/zero
lr-x------ 1 oracle oinstall 64 Nov 27 22:07 12 -> /u01/app/oracle/product/10.2.0/db_1/rdbms/mesg/oraus.msb
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 13 -> /u01/app/oracle/product/10.2.0/db_1/dbs/hc_dbwdn.dat
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 14 -> /u01/app/oracle/product/10.2.0/db_1/dbs/lkDBWDN
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 15 -> /u01/app/oracle/oradata/dbwdn/control01.ctl
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 16 -> /u01/app/oracle/oradata/dbwdn/control02.ctl
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 17 -> /u01/app/oracle/oradata/dbwdn/control03.ctl
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 18 -> /u01/app/oracle/oradata/dbwdn/system01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 19 -> /u01/app/oracle/oradata/dbwdn/undotbs01.dbf
lr-x------ 1 oracle oinstall 64 Nov 27 22:07 2 -> /dev/null
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 20 -> /u01/app/oracle/oradata/dbwdn/sysaux01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 21 -> /u01/app/oracle/oradata/dbwdn/users01.dbf (deleted)lrwx------ 1 oracle oinstall 64 Nov 27 22:07 22 -> /u01/app/oracle/oradata/dbwdn/test01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 23 -> /u01/app/oracle/oradata/dbwdn/ggs01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 24 -> /u01/app/oracle/oradata/dbwdn/perfstat.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 25 -> /u01/app/oracle/oradata/dbwdn/shkz_data_01.dbf
数据库没有重启,这个数据文件还能恢复,如果我重启数据库之后,还能看见这个数据文件吗?
[oracle@primary dbwdn]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Nov 27 22:08:01 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> shutdown immediate;
ORA-01116: error in opening database file 4
ORA-01110: data file 4: '/u01/app/oracle/oradata/dbwdn/users01.dbf'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3
SQL> shutdown abort;ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@primary dbwdn]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Nov 27 22:08:19 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1273276 bytes
Variable Size 130024004 bytes
Database Buffers 150994944 bytes
Redo Buffers 2920448 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: '/u01/app/oracle/oradata/dbwdn/users01.dbf'
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@primary dbwdn]$ ll /proc/3798/fd
ls: /proc/3798/fd: No such file or directory
[oracle@primary dbwdn]$ ps -ef |grep dbw0
oracle 4160 1 0 22:08 ? 00:00:00 ora_dbw0_dbwdn
oracle 4193 3439 0 22:09 pts/1 00:00:00 grep dbw0
[oracle@primary dbwdn]$ ll /proc/4160/fd
total 0
lr-x------ 1 oracle oinstall 64 Nov 27 22:09 0 -> /dev/null
lr-x------ 1 oracle oinstall 64 Nov 27 22:09 1 -> /dev/null
lr-x------ 1 oracle oinstall 64 Nov 27 22:09 10 -> /dev/zero
lr-x------ 1 oracle oinstall 64 Nov 27 22:09 11 -> /dev/zero
lr-x------ 1 oracle oinstall 64 Nov 27 22:09 12 -> /u01/app/oracle/product/10.2.0/db_1/rdbms/mesg/oraus.msb
lrwx------ 1 oracle oinstall 64 Nov 27 22:09 13 -> /u01/app/oracle/product/10.2.0/db_1/dbs/hc_dbwdn.dat
lrwx------ 1 oracle oinstall 64 Nov 27 22:09 14 -> /u01/app/oracle/product/10.2.0/db_1/dbs/lkDBWDN
lrwx------ 1 oracle oinstall 64 Nov 27 22:09 15 -> /u01/app/oracle/oradata/dbwdn/control01.ctl
lrwx------ 1 oracle oinstall 64 Nov 27 22:09 16 -> /u01/app/oracle/oradata/dbwdn/control02.ctl
lrwx------ 1 oracle oinstall 64 Nov 27 22:09 17 -> /u01/app/oracle/oradata/dbwdn/control03.ctl
l-wx------ 1 oracle oinstall 64 Nov 27 22:09 2 -> /u01/app/oracle/admin/dbwdn/bdump/dbwdn_dbw0_4160.trc
lr-x------ 1 oracle oinstall 64 Nov 27 22:09 3 -> /dev/null
lr-x------ 1 oracle oinstall 64 Nov 27 22:09 4 -> /dev/null
l-wx------ 1 oracle oinstall 64 Nov 27 22:09 5 -> /u01/app/oracle/admin/dbwdn/udump/dbwdn_ora_4152.trc
l-wx------ 1 oracle oinstall 64 Nov 27 22:09 6 -> /u01/app/oracle/admin/dbwdn/bdump/alert_dbwdn.log
lrwx------ 1 oracle oinstall 64 Nov 27 22:09 7 -> /u01/app/oracle/product/10.2.0/db_1/dbs/hc_dbwdn.dat
l-wx------ 1 oracle oinstall 64 Nov 27 22:09 8 -> /u01/app/oracle/admin/dbwdn/bdump/alert_dbwdn.log
lrwx------ 1 oracle oinstall 64 Nov 27 22:09 9 -> /u01/app/oracle/product/10.2.0/db_1/dbs/lkinstdbwdn (deleted)
[oracle@primary dbwdn]$
已经没法恢复了。
说明需要注意的是,rm误删除文件之后,千万不要慌张,稳住神,不要重启数据库,不要重启动系统。
AIX系统,我没有测试过。
使用备份集恢复上面的数据库文件:
[oracle@primary dbwdn]$ rman target /
Recovery Manager: Release 10.2.0.5.0 - Production on Tue Nov 27 22:13:45 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database (not started)
RMAN> startup nomount;
Oracle instance started
Total System Global Area 285212672 bytes
Fixed Size 1273276 bytes
Variable Size 130024004 bytes
Database Buffers 150994944 bytes
Redo Buffers 2920448 bytes
RMAN> alter database mount;
using target database control file instead of recovery catalog
database mounted
RMAN> run
2> {
3> allocate channel t1 type to disk;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "to": expecting one of: "double-quoted-string, disk, equal, identifier, single-quoted-string"
RMAN-01007: at line 3 column 26 file: standard input
RMAN> run
2> {
3> allocate channel t1 device type disk;
4> restore datafile 4;
5> recover datafile 4;
6> release channel t1;
7> }
allocated channel: t1
channel t1: sid=156 devtype=DISK
Starting restore at 27-NOV-2012 22:16:26
channel t1: starting datafile backupset restore
channel t1: specifying datafile(s) to restore from backup set
restoring datafile 00004 to /u01/app/oracle/oradata/dbwdn/users01.dbf
channel t1: reading from backup piece /u01/bak/03nrctnp_1_1.bak
channel t1: restored backup piece 1
piece handle=/u01/bak/03nrctnp_1_1.bak tag=TAG20121127T213241
channel t1: restore complete, elapsed time: 00:00:04
Finished restore at 27-NOV-2012 22:16:30
Starting recover at 27-NOV-2012 22:16:30
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 27-NOV-2012 22:16:31
released channel: t1
RMAN> alter database open;
database opened
RMAN>
Windows下数据恢复(把回收站清空后的恢复方法):
步骤:
1、单击“开始——运行,然后输入regedit (打开注册表)
2、依次展开:HEKEY——LOCAL——MACHIME/SOFTWARE/microsoft/WINDOWS/ CURRENTVERSION/EXPLORER/DESKTOP/NAMESPACE 在左边空白外点击“新建”
,选择:“主键”,把它命名为“645FFO40——5081——101B——9F08——00AA002F954E”
再把右边的“默认”的主键的键值设为“回收站”,然后退出注册表。就OK啦。
3、要重启计算机。
只要机器没有运行过磁盘整理。系统完好.任何时候的文件都可以找回来。
[oracle@primary dbwdn]$ ll
total 2153164
-rw-r----- 1 oracle dba 8536064 Nov 27 21:50 control01.ctl
-rw-r----- 1 oracle dba 8536064 Nov 27 21:50 control02.ctl
-rw-r----- 1 oracle dba 8536064 Nov 27 21:50 control03.ctl
-rw-r----- 1 oracle dba 104865792 Nov 27 21:32 ggs01.dbf
-rw-r----- 1 oracle dba 525344768 Nov 27 21:32 perfstat.dbf
-rw-r----- 1 oracle dba 52429312 Nov 27 21:10 redo01.log
-rw-r----- 1 oracle dba 52429312 Nov 27 21:49 redo02.log
-rw-r----- 1 oracle dba 52429312 Nov 27 21:10 redo03.log
-rw-r----- 1 oracle dba 10493952 Nov 27 21:32 shkz_data_01.dbf
-rw-r----- 1 oracle dba 524296192 Nov 27 21:49 sysaux01.dbf
-rw-r----- 1 oracle dba 524296192 Nov 27 21:49 system01.dbf
-rw-r----- 1 oracle dba 209723392 Nov 18 10:54 temp01.dbf
-rw-r----- 1 oracle dba 52436992 Nov 27 21:32 test01.dbf
-rw-r----- 1 oracle dba 251666432 Nov 27 21:49 undotbs01.dbf
-rw-r----- 1 oracle dba 26222592 Nov 27 21:32 users01.dbf
[oracle@primary dbwdn]$ rm test01.dbf
2.找到数据库后台进程dbw0
oracle 3493 1 0 21:10 ? 00:00:00 ora_dbw0_dbwdn
进程号3493
3.找到被误删除的数据库文件
[oracle@primary dbwdn]$ ll /proc/3493/fd
total 0
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 0 -> /dev/null
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 1 -> /dev/null
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 10 -> /dev/zero
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 11 -> /dev/zero
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 12 -> /u01/app/oracle/product/10.2.0/db_1/rdbms/mesg/oraus.msb
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 13 -> /u01/app/oracle/product/10.2.0/db_1/dbs/hc_dbwdn.dat
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 14 -> /u01/app/oracle/product/10.2.0/db_1/dbs/lkDBWDN
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 15 -> /u01/app/oracle/oradata/dbwdn/control01.ctl
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 16 -> /u01/app/oracle/oradata/dbwdn/control02.ctl
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 17 -> /u01/app/oracle/oradata/dbwdn/control03.ctl
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 18 -> /u01/app/oracle/oradata/dbwdn/system01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 19 -> /u01/app/oracle/oradata/dbwdn/undotbs01.dbf
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 2 -> /dev/null
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 20 -> /u01/app/oracle/oradata/dbwdn/sysaux01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 21 -> /u01/app/oracle/oradata/dbwdn/users01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 22 -> /u01/app/oracle/oradata/dbwdn/test01.dbf (deleted)
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 23 -> /u01/app/oracle/oradata/dbwdn/ggs01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 24 -> /u01/app/oracle/oradata/dbwdn/perfstat.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 25 -> /u01/app/oracle/oradata/dbwdn/shkz_data_01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 26 -> /u01/app/oracle/oradata/dbwdn/temp01.dbf
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 27 -> /u01/app/oracle/product/10.2.0/db_1/rdbms/mesg/oraus.msb
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 3 -> /dev/null
lr-x------ 1 oracle oinstall 64 Nov 27 21:52 4 -> /dev/null
l-wx------ 1 oracle oinstall 64 Nov 27 21:52 5 -> /u01/app/oracle/admin/dbwdn/udump/dbwdn_ora_3485.trc
l-wx------ 1 oracle oinstall 64 Nov 27 21:52 6 -> /u01/app/oracle/admin/dbwdn/bdump/alert_dbwdn.log
lrwx------ 1 oracle oinstall 64 Nov 27 21:52 7 -> /u01/app/oracle/product/10.2.0/db_1/dbs/hc_dbwdn.dat
l-wx------ 1 oracle oinstall 64 Nov 27 21:52 8 -> /u01/app/oracle/admin/dbwdn/bdump/alert_dbwdn.log
误删除之后,数据库没有重启,系统也没用重启
4.拷贝数据库文件
[oracle@primary ~]$ cp /proc/3493/fd/22 /u01/app/oracle/oradata/dbwdn/test01.dbf
[oracle@primary ~]$ cd /u01/app/oracle/oradata/dbwdn
[oracle@primary dbwdn]$ ls
control01.ctl control03.ctl perfstat.dbf redo02.log shkz_data_01.dbf system01.dbf test01.dbf users01.dbf
control02.ctl ggs01.dbf redo01.log redo03.log sysaux01.dbf temp01.dbf undotbs01.dbf
数据库文件找回来了。
5.恢复数据库文件
[oracle@primary dbwdn]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Nov 27 21:55:15 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter database datafile 5 offline;
Database altered.
SQL> recover datafile 5;
Media recovery complete.
SQL> alter database datafile 5 online;
Database altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1273276 bytes
Variable Size 130024004 bytes
Database Buffers 150994944 bytes
Redo Buffers 2920448 bytes
Database mounted.
Database opened.
SQL>
成功恢复数据库
注:如果数据库重启之后,还能恢复吗,测试一下:
[oracle@primary dbwdn]$ rm users01.dbf[oracle@primary dbwdn]$ ps -ef |grep dbw0
oracle 3798 1 0 21:56 ? 00:00:00 ora_dbw0_dbwdn
oracle 4147 3439 0 22:07 pts/1 00:00:00 grep dbw0
[oracle@primary dbwdn]$ ll /proc/3798/fd
total 0
lr-x------ 1 oracle oinstall 64 Nov 27 22:07 0 -> /dev/null
lr-x------ 1 oracle oinstall 64 Nov 27 22:07 1 -> /dev/null
lr-x------ 1 oracle oinstall 64 Nov 27 22:07 10 -> /dev/zero
lr-x------ 1 oracle oinstall 64 Nov 27 22:07 11 -> /dev/zero
lr-x------ 1 oracle oinstall 64 Nov 27 22:07 12 -> /u01/app/oracle/product/10.2.0/db_1/rdbms/mesg/oraus.msb
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 13 -> /u01/app/oracle/product/10.2.0/db_1/dbs/hc_dbwdn.dat
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 14 -> /u01/app/oracle/product/10.2.0/db_1/dbs/lkDBWDN
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 15 -> /u01/app/oracle/oradata/dbwdn/control01.ctl
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 16 -> /u01/app/oracle/oradata/dbwdn/control02.ctl
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 17 -> /u01/app/oracle/oradata/dbwdn/control03.ctl
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 18 -> /u01/app/oracle/oradata/dbwdn/system01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 19 -> /u01/app/oracle/oradata/dbwdn/undotbs01.dbf
lr-x------ 1 oracle oinstall 64 Nov 27 22:07 2 -> /dev/null
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 20 -> /u01/app/oracle/oradata/dbwdn/sysaux01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 21 -> /u01/app/oracle/oradata/dbwdn/users01.dbf (deleted)lrwx------ 1 oracle oinstall 64 Nov 27 22:07 22 -> /u01/app/oracle/oradata/dbwdn/test01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 23 -> /u01/app/oracle/oradata/dbwdn/ggs01.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 24 -> /u01/app/oracle/oradata/dbwdn/perfstat.dbf
lrwx------ 1 oracle oinstall 64 Nov 27 22:07 25 -> /u01/app/oracle/oradata/dbwdn/shkz_data_01.dbf
数据库没有重启,这个数据文件还能恢复,如果我重启数据库之后,还能看见这个数据文件吗?
[oracle@primary dbwdn]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Nov 27 22:08:01 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> shutdown immediate;
ORA-01116: error in opening database file 4
ORA-01110: data file 4: '/u01/app/oracle/oradata/dbwdn/users01.dbf'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3
SQL> shutdown abort;ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@primary dbwdn]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.5.0 - Production on Tue Nov 27 22:08:19 2012
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1273276 bytes
Variable Size 130024004 bytes
Database Buffers 150994944 bytes
Redo Buffers 2920448 bytes
Database mounted.
ORA-01157: cannot identify/lock data file 4 - see DBWR trace file
ORA-01110: data file 4: '/u01/app/oracle/oradata/dbwdn/users01.dbf'
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@primary dbwdn]$ ll /proc/3798/fd
ls: /proc/3798/fd: No such file or directory
[oracle@primary dbwdn]$ ps -ef |grep dbw0
oracle 4160 1 0 22:08 ? 00:00:00 ora_dbw0_dbwdn
oracle 4193 3439 0 22:09 pts/1 00:00:00 grep dbw0
[oracle@primary dbwdn]$ ll /proc/4160/fd
total 0
lr-x------ 1 oracle oinstall 64 Nov 27 22:09 0 -> /dev/null
lr-x------ 1 oracle oinstall 64 Nov 27 22:09 1 -> /dev/null
lr-x------ 1 oracle oinstall 64 Nov 27 22:09 10 -> /dev/zero
lr-x------ 1 oracle oinstall 64 Nov 27 22:09 11 -> /dev/zero
lr-x------ 1 oracle oinstall 64 Nov 27 22:09 12 -> /u01/app/oracle/product/10.2.0/db_1/rdbms/mesg/oraus.msb
lrwx------ 1 oracle oinstall 64 Nov 27 22:09 13 -> /u01/app/oracle/product/10.2.0/db_1/dbs/hc_dbwdn.dat
lrwx------ 1 oracle oinstall 64 Nov 27 22:09 14 -> /u01/app/oracle/product/10.2.0/db_1/dbs/lkDBWDN
lrwx------ 1 oracle oinstall 64 Nov 27 22:09 15 -> /u01/app/oracle/oradata/dbwdn/control01.ctl
lrwx------ 1 oracle oinstall 64 Nov 27 22:09 16 -> /u01/app/oracle/oradata/dbwdn/control02.ctl
lrwx------ 1 oracle oinstall 64 Nov 27 22:09 17 -> /u01/app/oracle/oradata/dbwdn/control03.ctl
l-wx------ 1 oracle oinstall 64 Nov 27 22:09 2 -> /u01/app/oracle/admin/dbwdn/bdump/dbwdn_dbw0_4160.trc
lr-x------ 1 oracle oinstall 64 Nov 27 22:09 3 -> /dev/null
lr-x------ 1 oracle oinstall 64 Nov 27 22:09 4 -> /dev/null
l-wx------ 1 oracle oinstall 64 Nov 27 22:09 5 -> /u01/app/oracle/admin/dbwdn/udump/dbwdn_ora_4152.trc
l-wx------ 1 oracle oinstall 64 Nov 27 22:09 6 -> /u01/app/oracle/admin/dbwdn/bdump/alert_dbwdn.log
lrwx------ 1 oracle oinstall 64 Nov 27 22:09 7 -> /u01/app/oracle/product/10.2.0/db_1/dbs/hc_dbwdn.dat
l-wx------ 1 oracle oinstall 64 Nov 27 22:09 8 -> /u01/app/oracle/admin/dbwdn/bdump/alert_dbwdn.log
lrwx------ 1 oracle oinstall 64 Nov 27 22:09 9 -> /u01/app/oracle/product/10.2.0/db_1/dbs/lkinstdbwdn (deleted)
[oracle@primary dbwdn]$
已经没法恢复了。
说明需要注意的是,rm误删除文件之后,千万不要慌张,稳住神,不要重启数据库,不要重启动系统。
AIX系统,我没有测试过。
使用备份集恢复上面的数据库文件:
[oracle@primary dbwdn]$ rman target /
Recovery Manager: Release 10.2.0.5.0 - Production on Tue Nov 27 22:13:45 2012
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database (not started)
RMAN> startup nomount;
Oracle instance started
Total System Global Area 285212672 bytes
Fixed Size 1273276 bytes
Variable Size 130024004 bytes
Database Buffers 150994944 bytes
Redo Buffers 2920448 bytes
RMAN> alter database mount;
using target database control file instead of recovery catalog
database mounted
RMAN> run
2> {
3> allocate channel t1 type to disk;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "to": expecting one of: "double-quoted-string, disk, equal, identifier, single-quoted-string"
RMAN-01007: at line 3 column 26 file: standard input
RMAN> run
2> {
3> allocate channel t1 device type disk;
4> restore datafile 4;
5> recover datafile 4;
6> release channel t1;
7> }
allocated channel: t1
channel t1: sid=156 devtype=DISK
Starting restore at 27-NOV-2012 22:16:26
channel t1: starting datafile backupset restore
channel t1: specifying datafile(s) to restore from backup set
restoring datafile 00004 to /u01/app/oracle/oradata/dbwdn/users01.dbf
channel t1: reading from backup piece /u01/bak/03nrctnp_1_1.bak
channel t1: restored backup piece 1
piece handle=/u01/bak/03nrctnp_1_1.bak tag=TAG20121127T213241
channel t1: restore complete, elapsed time: 00:00:04
Finished restore at 27-NOV-2012 22:16:30
Starting recover at 27-NOV-2012 22:16:30
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 27-NOV-2012 22:16:31
released channel: t1
RMAN> alter database open;
database opened
RMAN>
Windows下数据恢复(把回收站清空后的恢复方法):
步骤:
1、单击“开始——运行,然后输入regedit (打开注册表)
2、依次展开:HEKEY——LOCAL——MACHIME/SOFTWARE/microsoft/WINDOWS/ CURRENTVERSION/EXPLORER/DESKTOP/NAMESPACE 在左边空白外点击“新建”
,选择:“主键”,把它命名为“645FFO40——5081——101B——9F08——00AA002F954E”
再把右边的“默认”的主键的键值设为“回收站”,然后退出注册表。就OK啦。
3、要重启计算机。
只要机器没有运行过磁盘整理。系统完好.任何时候的文件都可以找回来。
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
暂无评论...
《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线
暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。
艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。
《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。
更新日志
2024年11月24日
2024年11月24日
- 凤飞飞《我们的主题曲》飞跃制作[正版原抓WAV+CUE]
- 刘嘉亮《亮情歌2》[WAV+CUE][1G]
- 红馆40·谭咏麟《歌者恋歌浓情30年演唱会》3CD[低速原抓WAV+CUE][1.8G]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[320K/MP3][193.25MB]
- 【轻音乐】曼托凡尼乐团《精选辑》2CD.1998[FLAC+CUE整轨]
- 邝美云《心中有爱》1989年香港DMIJP版1MTO东芝首版[WAV+CUE]
- 群星《情叹-发烧女声DSD》天籁女声发烧碟[WAV+CUE]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[FLAC/分轨][748.03MB]
- 理想混蛋《Origin Sessions》[320K/MP3][37.47MB]
- 公馆青少年《我其实一点都不酷》[320K/MP3][78.78MB]
- 群星《情叹-发烧男声DSD》最值得珍藏的完美男声[WAV+CUE]
- 群星《国韵飘香·贵妃醉酒HQCD黑胶王》2CD[WAV]
- 卫兰《DAUGHTER》【低速原抓WAV+CUE】
- 公馆青少年《我其实一点都不酷》[FLAC/分轨][398.22MB]
- ZWEI《迟暮的花 (Explicit)》[320K/MP3][57.16MB]