首页 > 数据库 >Oracle误删除数据文件恢复---惜分飞

Oracle误删除数据文件恢复---惜分飞

时间:2024-02-21 22:13:50浏览次数:30  
标签:误删除 oinstall 20 分飞 dbf --- ------ oradata oracle

联系:手机/微信(+86 17813235971) QQ(107644445)QQ咨询惜分飞

标题:Oracle误删除数据文件恢复

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

有客户通过sftp误删除oracle数据文件,咨询我们是否可以恢复,通过远程上去检查,发现运气不错,数据库还没有crash,通过句柄找到被删除文件

oracle@cwgstestdb[testwctdb]/proc/20611/fd$ls -ltr total 0 lr-x------ 1 oracle oinstall 64 Feb 20 14:03 9 -> /oracle/db19c/rdbms/mesg/oraus.msb lrwx------ 1 oracle oinstall 64 Feb 20 14:03 8 -> /oracle/db19c/dbs/lkTESTWCTDB lrwx------ 1 oracle oinstall 64 Feb 20 14:03 7 -> /oracle/db19c/dbs/hc_testwctdb.dat lr-x------ 1 oracle oinstall 64 Feb 20 14:03 6 -> /var/lib/sss/mc/passwd lr-x------ 1 oracle oinstall 64 Feb 20 14:03 5 -> /proc/20611/fd lr-x------ 1 oracle oinstall 64 Feb 20 14:03 4 -> /oracle/db19c/rdbms/mesg/oraus.msb lrwx------ 1 oracle oinstall 64 Feb 20 14:03 305 -> /oradata/ftms_zx_test01_data8.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 304 -> /oradata/ftms_zx_test01_data7.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 303 -> /oradata/ftms_zx_test01_data6.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 302 -> '/oradata/ftms_zx_test01_data5.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 301 -> '/oradata/ftms_zx_test01_data4.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 300 -> '/oradata/ftms_zx_test01_data3.dbf (deleted)' lr-x------ 1 oracle oinstall 64 Feb 20 14:03 3 -> /dev/null lrwx------ 1 oracle oinstall 64 Feb 20 14:03 299 -> '/oradata/ftms_zx_test01_data2.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 298 -> '/oradata/ftms_zx_test01_data1.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 297 -> '/oradata/ftms_zx_test01_data.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 296 -> /oradata/ftms_zx_test_data.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 295 -> '/oradata/TESTWCTDB/sd.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 294 -> /oradata/TESTWCTDB/ftms_cs3_jiamiceshi lrwx------ 1 oracle oinstall 64 Feb 20 14:03 293 -> /langchao/dumpdata/FTMS_CS_TDE.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 292 -> /oradata/ftms_zx_test01.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 291 -> /langchao/dumpdata/FTMS_CS_DATA4.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 290 -> '/oradata/ftms_zx_data5.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 289 -> /langchao/dumpdata/FTMS_CS_DATA3.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 288 -> /langchao/dumpdata/FTMS_CS_DATA2.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 287 -> /langchao/dumpdata/FTMS_JD_DATA2.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 286 -> '/oradata/LCBIPECDS _TEMP_DAT.DBF' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 285 -> '/oradata/rTB_MBFE_TEMP (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 284 -> '/oradata/TESTWCTDB/temp01.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 283 -> '/oradata/ftms_credit_data5.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 282 -> /oradata/ftmshtdata.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 281 -> '/oradata/dump_data/FTMS_CSBF_DATA.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 280 -> /langchao/dumpdata/FTMS_NEWBL2_DATA.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 279 -> /langchao/dumpdata/FTMS_CS_DATA.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 278 -> /oradata/LCBIPECDS_DAT.DBF lrwx------ 1 oracle oinstall 64 Feb 20 14:03 277 -> /oradata/rTB_MBFE lrwx------ 1 oracle oinstall 64 Feb 20 14:03 276 -> /oradata/udpcount_02.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 275 -> /oradata/udpcount_01.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 274 -> '/oradata/ftms_credit_data_6.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 273 -> /langchao/dumpdata/FTMS_JD_DATA.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 272 -> '/oradata/ftms_old.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 271 -> '/oradata/ftms_credit_data2.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 270 -> /langchao/dumpdata/PJDIP_DATA.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 269 -> '/oradata/ftms_credit_data.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 268 -> /langchao/dumpdata/FTMS_NEWBL_DATA.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 267 -> '/oradata/ftms_zx_data4.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 266 -> /langchao/dumpdata/QIANZHANG_DATA.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 265 -> '/oradata/ftms_zx_data3.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 264 -> '/oradata/ftms_zx_data2.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 263 -> '/oradata/ftms_zx_data.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 262 -> /langchao/dumpdata/FTMSDIP_DATA.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 261 -> /oradata/TESTWCTDB/users01.dbf lrwx------ 1 oracle oinstall 64 Feb 20 14:03 260 -> '/oradata/TESTWCTDB/undotbs01.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 259 -> '/oradata/TESTWCTDB/sysaux01.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 258 -> '/oradata/TESTWCTDB/system01.dbf (deleted)' lrwx------ 1 oracle oinstall 64 Feb 20 14:03 257 -> /oradata/TESTWCTDB/control02.ctl lrwx------ 1 oracle oinstall 64 Feb 20 14:03 256 -> /oradata/TESTWCTDB/control01.ctl l-wx------ 1 oracle oinstall 64 Feb 20 14:03 2 -> /dev/null lrwx------ 1 oracle oinstall 64 Feb 20 14:03 10 -> 'socket:[823411]' l-wx------ 1 oracle oinstall 64 Feb 20 14:03 1 -> /dev/null lr-x------ 1 oracle oinstall 64 Feb 20 14:03 0 -> /dev/null

查询数据文件大小(被删除的文件文件大小通过v$datafile查询为0)

SQL> select name,bytes/1024/1024/1024 from v$datafile;   NAME                                                                             BYTES/1024/1024/1024 -------------------------------------------------------------------------------- -------------------- /oradata/TESTWCTDB/system01.dbf                                                                     0 /oradata/TESTWCTDB/sysaux01.dbf                                                                     0 /oradata/TESTWCTDB/undotbs01.dbf                                                                    0 /oradata/TESTWCTDB/users01.dbf                                                             .004882813 /langchao/dumpdata/FTMSDIP_DATA.dbf                                                                 3 /oradata/ftms_zx_data.dbf                                                                           0 /oradata/ftms_zx_data2.dbf                                                                          0 /oradata/ftms_zx_data3.dbf                                                                          0 /langchao/dumpdata/QIANZHANG_DATA.dbf                                                               5 /oradata/ftms_zx_data4.dbf                                                                          0 /langchao/dumpdata/FTMS_NEWBL_DATA.dbf                                                             30 /oradata/ftms_credit_data.dbf                                                                       0 /langchao/dumpdata/PJDIP_DATA.dbf                                                                  20 /oradata/ftms_credit_data2.dbf                                                                      0 /oradata/ftms_old.dbf                                                                               0 /langchao/dumpdata/FTMS_JD_DATA.dbf                                                                15 /oradata/ftms_credit_data_6.dbf                                                                     0 /oradata/udpcount_01.dbf                                                                            5 /oradata/udpcount_02.dbf                                                                            5 /oradata/rTB_MBFE                                                                              .03125 /oradata/LCBIPECDS_DAT.DBF                                                                         .5 /langchao/dumpdata/FTMS_CS_DATA.dbf                                                                30 /langchao/dumpdata/FTMS_NEWBL2_DATA.dbf                                                            30 /oradata/dump_data/FTMS_CSBF_DATA.dbf                                                               0 /oradata/ftmshtdata.dbf                                                                    .087890625 /oradata/ftms_credit_data5.dbf                                                                      0 /langchao/dumpdata/FTMS_JD_DATA2.dbf                                                                3 /langchao/dumpdata/FTMS_CS_DATA2.dbf                                                       31.9999847 /langchao/dumpdata/FTMS_CS_DATA3.dbf                                                               10 /oradata/ftms_zx_data5.dbf                                                                          0 /langchao/dumpdata/FTMS_CS_DATA4.dbf                                                        12.109375 /oradata/ftms_zx_test01.dbf                                                                19.0527344 /langchao/dumpdata/FTMS_CS_TDE.dbf                                                                  1 /oradata/TESTWCTDB/ftms_cs3_jiamiceshi                                                     .029296875 /oradata/TESTWCTDB/sd.dbf                                                                           0 /oradata/ftms_zx_test_data.dbf                                                             .009765625 /oradata/ftms_zx_test01_data.dbf                                                                    0 /oradata/ftms_zx_test01_data1.dbf                                                                   0 /oradata/ftms_zx_test01_data2.dbf                                                                   0 /oradata/ftms_zx_test01_data3.dbf                                                                   0 /oradata/ftms_zx_test01_data4.dbf                                                                   0 /oradata/ftms_zx_test01_data5.dbf                                                                   0 /oradata/ftms_zx_test01_data6.dbf                                                          12.5976563 /oradata/ftms_zx_test01_data7.dbf                                                          9.08203125 /oradata/ftms_zx_test01_data8.dbf                                                                6.25   45 rows selected.

把数据文件拷贝回来

cp /proc/20611/fd/302   /langchao/orabak/ cp /proc/20611/fd/301   /langchao/orabak/ cp /proc/20611/fd/300   /langchao/orabak/ cp /proc/20611/fd/299   /langchao/orabak/ cp /proc/20611/fd/298   /langchao/orabak/ cp /proc/20611/fd/297   /langchao/orabak/ cp /proc/20611/fd/295   /langchao/orabak/ cp /proc/20611/fd/290   /langchao/orabak/ cp /proc/20611/fd/285   /langchao/orabak/ cp /proc/20611/fd/284   /langchao/orabak/ cp /proc/20611/fd/283   /langchao/orabak/ cp /proc/20611/fd/281   /langchao/orabak/ cp /proc/20611/fd/274   /langchao/orabak/ cp /proc/20611/fd/272   /langchao/orabak/ cp /proc/20611/fd/271   /langchao/orabak/ cp /proc/20611/fd/269   /langchao/orabak/ cp /proc/20611/fd/267   /langchao/orabak/ cp /proc/20611/fd/265   /langchao/orabak/ cp /proc/20611/fd/264   /langchao/orabak/ cp /proc/20611/fd/263   /langchao/orabak/ cp /proc/20611/fd/260   /langchao/orabak/ cp /proc/20611/fd/259   /langchao/orabak/ cp /proc/20611/fd/258   /langchao/orabak/

由于涉及system表空间数据文件被删除,无法在open情况下直接操作,直接关闭数据库,启动到mount状态,重命名数据文件路径,recover数据文件,open库,恢复完成
参考以前类似恢复:
Solaris rm datafile recovery—利用句柄误删除数据文件恢复
如果数据库已经关闭,需要考虑以下类似恢复方式:
dbca删除库和rm删库恢复
记录一次rm -rf 删除数据文件异常恢复

标签:误删除,oinstall,20,分飞,dbf,---,------,oradata,oracle
From: https://www.cnblogs.com/xifenfei/p/18026310

相关文章

  • Day-7 模拟赛题解
    Day-7模拟赛题解S+N---【玄英计划】---2月21日---模拟测#3【补题】-比赛-梦熊联盟T1数据点3-5枚举每一个问号对应的字母Kmp,把s当作模式串匹配T\(O(26^k|T|)\),k是?的个数代码(我也不知道为啥T了,鸽着)正解有种被诈骗了的感觉根据期望的可加性,答案等于......
  • 又一例:ORA-600 kclchkblk_4和2662故障---惜分飞
    又一例:ORA-600kclchkblk_4和2662故障发表于 2024年2月21日 由 惜分飞联系:手机/微信(+8617813235971)QQ(107644445)标题:又一例:ORA-600kclchkblk_4和2662故障作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]有客户恢......
  • 系统架构设计师-第2章-数据库
    第2章-数据库在信息处理领域,由于数据量庞大,如何有效组织、存储数据对实现高效率的信息处理至关重要。数据库技术是目前最有效的数据管理技术。数据库(DataBase,DB)是指长期存储在计算机内、有组织的、统一管理的相关数据的集合。它不仅描述事物的数据本身,而且还包括相关事物之间......
  • Go 100 mistakes - #50: Checking an error type inaccurately
       ......
  • Go - Type assertions and Type switches
    TypeassertionsForanexpression x of interfacetype,butnota typeparameter,andatype T,theprimaryexpressionx.(T)assertsthat x isnot nil andthatthevaluestoredin x isoftype T.Thenotation x.(T) iscalleda typeassertion.M......
  • 4.3 提升题 - A One Way In, Two Ways OutC++
    就是让你判断输入受限的双端队列的输出的正确性。其实就是模拟双端队列出队的过程,要不左边出队,要不右边出队,而入队已经一定了。用一个数组模拟输入受限的双端队列就行了。但是写这题可太难受了,写了我大概2个半小时,各种各种小错误,没考虑周全的地方。#include<iostream>using......
  • 初三年后集训测试---T1排序
    初三年后集训测试$T1$排序$$HZOI$$·题意:给定\(4n\)个整数,求:\[\max\{\sum_{i=1}^{4n}(A_{i,1}\timesA_{i,2}-A_{i,3}\timesA_{i,4})\}\]其中存在\(n\)个这样的集合\(a\),并两两互不相交。·题解:先排序,再将区域划分为两块,从\(2n\)处划分。然后:大的那......
  • Go - wrap an error
        ......
  • python-transformers库
    python-transformers库目录python-transformers库安装测试功能和优势Transformers术语模型与分词器加载预训练模型保存模型分词器编码和解码填充Padpipelinepipeline简介pipeline原理参考资料transformers是一个用于自然语言处理(NLP)任务,如文本分类、命名实体识别,机器翻译等,提供......
  • Go - panic
        ......