系统之家 - 系统光盘下载网站!

当前位置:系统之家 > 系统教程 > Linux使用rm删除数据库文件

Linux使用rm删除了数据库文件如何恢复?(3)

时间:2015-01-19 17:56:43 作者:qipeng 来源:系统之家 1. 扫描二维码随时看资讯 2. 请使用手机浏览器访问: https://m.xitongzhijia.net/xtjc/20150119/35276.html 手机查看 评论

  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、要重启计算机。

  只要机器没有运行过磁盘整理。系统完好。任何时候的文件都可以找回来。

  上面就是Linux rm命令删除数据库文件的恢复方法的介绍了,如果你不小心使用rm命令删除了数据库文件,先测试你删除的文件,再进行恢复。

发表评论

0

没有更多评论了

评论就这些咯,让大家也知道你的独特见解

立即评论

以上留言仅代表用户个人观点,不代表系统之家立场

其他版本软件

热门教程

人气教程排行

Linux系统推荐

扫码关注
扫码关注

扫码关注 官方交流群 软件收录