CN104850470A - Method for fast recovering mis-deleted data under linux system - Google Patents

Method for fast recovering mis-deleted data under linux system Download PDF

Info

Publication number
CN104850470A
CN104850470A CN 201510238369 CN201510238369A CN104850470A CN 104850470 A CN104850470 A CN 104850470A CN 201510238369 CN201510238369 CN 201510238369 CN 201510238369 A CN201510238369 A CN 201510238369A CN 104850470 A CN104850470 A CN 104850470A
Authority
CN
Grant status
Application
Patent type
Prior art keywords
database
file
method
data
linux system
Prior art date
Application number
CN 201510238369
Other languages
Chinese (zh)
Inventor
李征
Original Assignee
浪潮电子信息产业股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date

Links

Abstract

The invention discloses a method for fast recovering mis-deleted data under a Linux system, under the Linux system, after a database is damaged by rm-rf misoperation and data is lost, the handle of a lost file is found by searching for a process number of the database, and the database is timely remedied. The method aims to realize the timely remedy on the data after the rm-rf misoperation is executed, and has the characteristic of fast and accurately searching for and effectively recovering the lost file.

Description

—种快速恢复Linux系统下误删除数据的方法 - speedy and accidentally deleted data recovery method Linux system

技术领域 FIELD

[0001] 本发明涉及Linux环境中数据库恢复技术领域,具体涉及一种快速恢复Linux系统下误删除数据的方法,通过及时保护、查找、恢复、校验几步快速恢复误操作导致的数据丢失。 [0001] The present invention relates to a Linux environment database recovery techniques, and in particular relates to a method for fast recovery data deletion Linux systems, by timely protection, search, restoration, calibration steps fast recovery loss caused by misuse.

背景技术 Background technique

[0002] Linux是一套免费使用和自由传播的类Unix (尤尼斯)操作系统,是一个多用户、多任务、支持多线程和多CPU的操作系统。 [0002] Linux is a free Unix-use and free dissemination of (Younis) operating system, is a multi-user, multi-tasking, multi-threading and multi-CPU support for the operating system. 它支持32位和64位硬件。 It supports 32-bit and 64-bit hardware. Linux继承了Unix以网络为核心的设计思想,是一个性能稳定的多用户网络操作系统。 Linux has inherited the Unix design idea to the network as the core, is a stable performance multi-user network operating system.

[0003] Linux的基本思想有两点:第一,一切都是文件;第二,每个软件都有确定的用途。 [0003] Linux basic idea of ​​two things: first, everything is a file; second, every software has identified uses. 其中第一条详细来讲就是系统中的所有都归结为一个文件,包括命令、硬件和软件设备、操作系统、进程等等对于操作系统内核而言,都被视为拥有各自特性或类型的文件。 The first of these is detailed in terms of all the system comes down to a file, including commands, hardware and software equipment, operating systems, processes, etc. for the operating system kernel, the file is considered to have their own characteristics or types of .

[0004] Linux 文件系统有Ext 2、Ext 3、Ext 4 三种。 [0004] Linux file system Ext 2, Ext 3, Ext 4 three. 其中,Ext4(The fourth extendedfile system,第四扩展文件系统)是一种针对Ext 3系统的扩展日志式文件系统,是专门为Linux开发的原始的扩展文件系统(ext或extfs)的第四版。 Which, Ext4 (The fourth extendedfile system, the fourth extended file system) is an extended log file system for Ext 3 system, developed specifically for the original Linux extended file system (ext or extfs) fourth edition.

[0005] Linux文件系统中,文件由inode ( —种数据结构,包含有文件的所有信息)进行唯一标识。 [0005] Linux file system, the file inode (- kind of data structure that contains all of the information has a file) uniquely identified. 每个文件有inode和block(块)组成,inode是文件系统组成的最基本单元,它保存着文件的基本属性(大小、权限、属主组等)和存放的位置信息。 Each file has inode and Block (Block) composition, inode file is the basic unit of the system components, which holds the basic attributes (size, permissions, owner, group, etc.), and file location information stored. 而block用来存储数据。 The block used to store data. 类似key-value (线索-值)存储系统,inode就是key,block对应value,通过key查找key对应的value。 Similar key-value (cue - value) storage system, inode is the key, block corresponding to the value, find the key value through the corresponding key. 类似python ( —种解释型、面向对象、动态数据类型的高级程序设计语言)的字典。 Similar python (- explanations, object-oriented, dynamic data type of high-level programming language) dictionary.

[0006] Linux系统被用在越来越多的关键行业,学习和使用Iinux的人也越来越多,虽然Iinux系统完全免费,但是存在该系统下的数据却可能是无价的,所以,在DBA管理Iinux系统时,一定要小心仔细,特别是慎用“rm - rf ”这样的命令。 [0006] Linux systems are used in a growing number of key industries, to learn and use Iinux people more and more, although Iinux system is free, but there is data in the system but can be invaluable, therefore, when Iinux DBA management system, must be careful carefully, particularly with caution "rm - rf" such an order.

[0007] 随着Linux的发展,因为它的嵌入式特点和源代码开放,越来越多的用户和行业开始使用Linux技术,从最早的只有政府机构使用Iinux系统到现在金融,电信,邮政等等越来越多的关键行业使用,Linux扮演的角色也越来越重要。 [0007] With the development of Linux, because it's embedded features and open source, more and more users start using Linux technology and industry, using Iinux system from the earliest to the present, only government agencies in finance, telecommunications, postal services, etc. and other key industries to use more and more, Linux plays an increasingly important role. 虽然现在不乏各种高端技术来保障Linux的数据安全,可是仍然避免不了一些人为的失误,造成各种损失和困扰。 Although no lack of high-end technology to protect the Linux data security, but still can not avoid some human errors caused various losses and distress.

[0008] 万一真的发生了这样的不幸,由于错误操作删除了数据,特别是在没有可用的rman备份,或者数据库冷备份等情况下,也就是说,没有任何备份,怎么才能恢复误删除的数据。 [0008] In case it happens this unfortunate, because the erroneous operation deletes the data, especially in the absence of available rman backup, or cold database backup, that is, without any backup, how to restore accidentally deleted The data.

发明内容 SUMMARY

[0009] 本发明要解决的技术问题是:在系统数据没有备份的情况下,本发明提供一种快速恢复Linux系统下误删除数据的方法。 [0009] The present invention is to solve the technical problem: when the system data is not backed up, the present invention provides a method for fast recovery of data deletion Linux system.

[0010] Linux下删除文件并不是真实的删除磁盘分区中的文件,而是将文件的inode节点中的扇区指针清除,同时释放这些数据对应的数据块,当释放的数据块被系统重新分配时,那些被删除的数据就会被覆盖。 [0010] delete the file delete partitions are not real files under Linux, instead of the inode file pointer sector clear, while the release of the data corresponding to the data block, the data block is released when the system reallocated when those deleted data will be overwritten.

[0011] 本发明所采用的技术方案为: [0011] The technical proposal of the present invention are:

一种快速恢复Linux系统下误删除数据的方法,在Linux系统下,数据库被rm - rf误操作破坏丢失收据后,通过查找数据库进程号,寻找丢失文件的句柄,对数据库进行及时补救。 A quick accidentally deleted data recovery method under Linux system, Linux system, the database is rm - rf misuse damage after the loss of receipts, by process ID to find the database to find the missing file handles, database timely remedy.

[0012] 模拟rm _rf删除oradata目录下所有文件,所述方法具体恢复步骤如下: [0012] Model rm _rf delete all files, the method in specific directories oradata recovery steps:

a.分别查看dbw、Igwr进程,查看进程号; . A view separate dbw, Igwr process, view the process ID;

b.进入相应的进程目录“/proc/进程号/fd/”下; . B enter the appropriate process directory "/ proc / process ID / fd /" under;

c.使用“Is -1tr”命令查看该目录下文件句柄,被删除的句柄文件末尾会被标记; . C Use "Is -1tr" command to see the directory file handle, the handle end of the file to be deleted are marked;

d.手动创建实例名目录,用oracle用户将这些被标记的文件句柄cp到原路径; . D instance name of the directory created manually, using the user oracle those marked cp file handle to the original path;

e.手动执行实例恢复; . E instance manually perform recovery;

f.重启数据库。 f. Restart the database.

[0013] 发生误操作删除数据后,立刻卸载掉文件所在分区,或者以只读模式挂载,避免进一步破坏,这时候千万不要关闭或重启数据库。 After the [0013] misuse delete the data immediately uninstall the partition file, or mounted read-only, to avoid further damage, this time do not shut down or restart the database.

[0014] 本发明的有益效果为: [0014] Advantageous effects of the present invention are:

本发明旨在解决执行“rm -rf”误操作后对数据的及时补救,具有快速、准确查找丢失文件,并进行有效恢复的特点。 The present invention addresses the implementation of "rm -rf" misuse timely remedy of the data, with fast, accurate locate the missing file, and the characteristics of effective recovery.

[0015] 说明书附图 [0015] The accompanying drawings

图1为本发明方法恢复流程图。 Figure 1 is a flowchart of the recovery method of the invention.

具体实施方式 detailed description

[0016] 下面根据说明书附图,结合具体实施方式对本发明进一步说明: [0016] According to the following accompanying drawings, in conjunction with specific embodiments further explanation of the invention:

操作系统:Redhat Iinux或者K-UNIX,搭载oracle数据库; OS: Redhat Iinux or K-UNIX, mounted oracle database;

文件系统:ext2、ext3、ext4 等; File systems: ext2, ext3, ext4 and so on;

一种快速恢复Linux系统下误删除数据的方法,在Linux系统下,数据库被rm - rf误操作破坏丢失收据后,通过查找数据库进程号,寻找丢失文件的句柄,对数据库进行及时补救。 A quick accidentally deleted data recovery method under Linux system, Linux system, the database is rm - rf misuse damage after the loss of receipts, by process ID to find the database to find the missing file handles, database timely remedy.

[0017] 如图1所示,模拟rm -rf删除oradata目录下所有文件,所述方法具体恢复步骤如下: [0017] As shown in FIG. 1, the analog rm -rf oradata delete all files in the directory, the method follows the specific recovery steps:

a.分别查看dbw、Igwr等进程,查看进程号; . A view separate dbw, Igwr and other processes, view the process ID;

b.进入相应的进程目录“/proc/进程号/fd/”下; . B enter the appropriate process directory "/ proc / process ID / fd /" under;

c.使用“Is -ltr”命令查看该目录下文件句柄,被删除的句柄文件末尾会被标记(deleted); . C Use "Is -ltr" command to see the directory file handle, the handle end of the file to be deleted are marked (deleted);

d.手动创建实例名目录,用oracle用户将这些被标记的文件句柄cp到原路径; . D instance name of the directory created manually, using the user oracle those marked cp file handle to the original path;

e.手动执行实例恢复; . E instance manually perform recovery;

f.重启数据库。 f. Restart the database.

[0018] 发生误操作删除数据后,立刻卸载掉文件所在分区,或者以只读模式挂载,避免进一步破坏,这时候千万不要关闭或重启数据库。 After the [0018] misuse delete the data immediately uninstall the partition file, or mounted read-only, to avoid further damage, this time do not shut down or restart the database.

[0019] 以上实施方式仅用于说明本发明,而并非对本发明的限制,有关技术领域的普通技术人员,在不脱离本发明的精神和范围的情况下,还可以做出各种变化和变型,因此所有等同的技术方案也属于本发明的范畴,本发明的专利保护范围应由权利要求限定。 [0019] The above embodiments are merely illustrative of the present invention, and are not restrictive of the invention, relating to ordinary skill in the art, without departing from the spirit and scope of the present invention, can make various changes and modifications , all equivalent technical solutions also within the scope of the present invention, the scope of the present invention patent is defined by the appended claims.

Claims (3)

  1. 1.一种快速恢复Linux系统下误删除数据的方法,其特征在于:在Linux系统下,数据库被rm - rf误操作破坏丢失收据后,通过查找数据库进程号,寻找丢失文件的句柄,对数据库进行及时补救。 1. A method for fast recovery of accidentally deleted data under the Linux system, wherein: the Linux system, the database is rm - rf handle the destruction of misuse lost receipt, by process ID to find the database, finding lost files, database timely remedy.
  2. 2.根据权利要求1所述的一种快速恢复Linux系统下误删除数据的方法,其特征在于:模拟rm -rf删除oradata目录下所有文件,所述方法具体恢复步骤如下: a.分别查看dbw、Igwr进程,查看进程号; b.进入相应的进程目录“/proc/进程号/fd/”下; c.使用“Is -1tr”命令查看该目录下文件句柄,被删除的句柄文件末尾会被标记; d.手动创建实例名目录,用oracle用户将这些被标记的文件句柄cp到原路径; e.手动执行实例恢复; f.重启数据库。 The one of the fast recovery method of a Linux system data deletion, as claimed in claim wherein: the analog rm -rf oradata delete all files in the directory, the method follows the specific recovery steps:. A view respectively dbw , Igwr process, view the process ID; b enter the appropriate process under the directory "/ proc / process ID / fd /";.. c use "is -1tr" command to see the directory file handle, the handle end of the file will be deleted labeled;. D manually created instance name of the directory, the user of oracle those marked cp file handle to the original path;. E performed manually restore instance;. F restart the database.
  3. 3.根据权利要求1或2所述的一种快速恢复Linux系统下误删除数据的方法,其特征在于:发生误操作删除数据后,立刻卸载掉文件所在分区,或者以只读模式挂载。 The one or more rapid recovery of the 12 data deletion method of the Linux system, as claimed in claim wherein: the erroneous deletion of data occurs immediately uninstall the partition file, or mounted read-only mode.
CN 201510238369 2015-05-12 2015-05-12 Method for fast recovering mis-deleted data under linux system CN104850470A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201510238369 CN104850470A (en) 2015-05-12 2015-05-12 Method for fast recovering mis-deleted data under linux system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201510238369 CN104850470A (en) 2015-05-12 2015-05-12 Method for fast recovering mis-deleted data under linux system

Publications (1)

Publication Number Publication Date
CN104850470A true true CN104850470A (en) 2015-08-19

Family

ID=53850125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201510238369 CN104850470A (en) 2015-05-12 2015-05-12 Method for fast recovering mis-deleted data under linux system

Country Status (1)

Country Link
CN (1) CN104850470A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095026A (en) * 2015-08-31 2015-11-25 小米科技有限责任公司 Superblock repair method and apparatus for EXT file system and intelligent device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050165863A1 (en) * 2004-01-23 2005-07-28 Atul Mukker File recovery under Linux operating system
CN101826055A (en) * 2010-04-06 2010-09-08 山东高效能服务器和存储研究院 Management method for data cache distribution in Linux system
CN102609644A (en) * 2012-01-11 2012-07-25 杭州东信北邮信息技术有限公司 File protection process
CN103064764A (en) * 2012-12-28 2013-04-24 盘石软件(上海)有限公司 Evidence obtaining method capable of rapidly recovering messages deleted by Android mobile phone
CN104199750A (en) * 2014-08-26 2014-12-10 上海天脉聚源文化传媒有限公司 File recovery method and device of linux system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050165863A1 (en) * 2004-01-23 2005-07-28 Atul Mukker File recovery under Linux operating system
CN101826055A (en) * 2010-04-06 2010-09-08 山东高效能服务器和存储研究院 Management method for data cache distribution in Linux system
CN102609644A (en) * 2012-01-11 2012-07-25 杭州东信北邮信息技术有限公司 File protection process
CN103064764A (en) * 2012-12-28 2013-04-24 盘石软件(上海)有限公司 Evidence obtaining method capable of rapidly recovering messages deleted by Android mobile phone
CN104199750A (en) * 2014-08-26 2014-12-10 上海天脉聚源文化传媒有限公司 File recovery method and device of linux system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
AARON8219: "rm-rf误操作的恢复过程", 《HTTP://WWW.LINUXIDC.COM/LINUX/2014-08/105978P2.HTM》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095026A (en) * 2015-08-31 2015-11-25 小米科技有限责任公司 Superblock repair method and apparatus for EXT file system and intelligent device

Similar Documents

Publication Publication Date Title
US6535998B1 (en) System recovery by restoring hardware state on non-identical systems
US7756833B2 (en) Method and system for synthetic backup and restore
US7565661B2 (en) Method and system for real-time event journaling to provide enterprise data services
US7966293B1 (en) System and method for indexing a backup using persistent consistency point images
US7036043B2 (en) Data management with virtual recovery mapping and backward moves
US6839819B2 (en) Data management appliance
US8108429B2 (en) System for moving real-time data events across a plurality of devices in a network for simultaneous data protection, replication, and access services
US8364648B1 (en) Recovering a database to any point-in-time in the past with guaranteed data consistency
US6898688B2 (en) Data management appliance
US20110016091A1 (en) De-duplication systems and methods for application-specific data
US20100262586A1 (en) Virtual machine data replication
US6820214B1 (en) Automated system recovery via backup and restoration of system state
US20040260726A1 (en) DBMS backup without suspending updates and corresponding recovery using separately stored log and data files
US7831789B1 (en) Method and system for fast incremental backup using comparison of descriptors
US6851073B1 (en) Extensible system recovery architecture
US20070043715A1 (en) Data object search and retrieval
US7277905B2 (en) System and method for a consistency check of a database backup
US7933872B2 (en) Database backup, refresh and cloning system and method
US7885938B1 (en) Techniques for granular recovery of data from local and remote storage
US20150074536A1 (en) File manager integration with virtualization in an information management system, including user control and storage management of virtual machines
US7650341B1 (en) Data backup/recovery
US20060059204A1 (en) System and method for selectively indexing file system content
US7366740B2 (en) Systems and methods for automatic maintenance and repair of enitites in a data model
US20150212893A1 (en) Single snapshot for multiple applications
US7672979B1 (en) Backup and restore techniques using inconsistent state indicators

Legal Events

Date Code Title Description
C06 Publication
EXSB Decision made by sipo to initiate substantive examination