Oraclecorruptblock(坏块)详解

电脑杂谈  发布时间:2019-08-02 14:08:57  来源:网络整理

logical dump_logical函数_matlab的logical

Oracle 控制文件

Whenany of the mirrors (Oracle’s multiplexing) of the control file is corrupted,critical information about the database cannot be accessed which will result ina database crash. The following tablesexplain the potential causes, detection, prevention and repair of a corruptionin the current control file.

虽然控制文件有冗余,但是任何一个控制文件出现损坏都会导致db crash。

4.1.1 Causes and Prevention

4.1.2 Detectionand Repair

控制文件通常有三个,任何一个出现corrupt都会使db crash。 这种情况下,可以修改初始话参数,使用其他的几个控制来启动db,如果能启动,就ok。不能启动,就需要重建控制文件来解决。 关于控制文件的重建,我上面贴的链接里有。

4.2 Redo log file corruption

Redolog files are critical in protecting a database from failures. The changes made to data in a database arerecorded in the redo log files.

redo 是在db failures来进行恢复的,所有的事务操作都会记录到redolog里。

When there is a failure which prevents data from being written to the data files ondisk from memory, the changes can be obtained from the redo log files. When a data file is corrupted, a backup froman earlier day can be restored and the changes from that day onwards can beapplied to the data file from the redo log files.

The redo log files are used only when a database is recovered from a failure. There are two kinds of redo log files: Onlineredo log files and Archived redo log files. Archived redo log files are the spooled copies of the online redo logfiles.

Corruption could occur in an online redo log file or an archived redo log file. If a corruption occurs on an online redo logfile, the instance crashes if there are no mirrors of the redo log file or ifthe mirrors are corrupted as well. Ifthe corruption occurs in an archived redo log file, the database is notaffected unless a backup is restored and recovery is being done for which it isneeded.

上述操作在归档模式下进行,如果是非归档模式,在执行restore命令前,首先需要恢复之前备份的控制文件,并且在执行restore和recover命令后,必须以open restlogs方式打开。恢复已丢失的分区,即时查看相文件、分区镜像备份与还原。这种状况的发生很明显就是我们系统的文件出现了问题,这个时候我觉得你最好是进行过电脑文件的备份,若是备份之后只需要进行恢复即可,若是不行的话在,最坏的方法就是直接对电脑系统进行重装了,解决win7系统提示dwm.exe损坏的图像问题。

4.2.1 Causes and Prevention

4.2.2 Detectionand Repair

the following example shows how to create a full database backup by using with format to overwrite any existing backups and create a new media set. then, the example backs up the transaction log. in a real-life situation, you would have to perform a series of regular log backups. for this example, the adventureworks2012 sample database is set to use the full recovery model.。when a database is on a different server from the web server. sometimes the problem is using a unc path to reference a database. one nastyproblem with unc paths is that even if the database is on the same computer as the web server, the web server assumes that the database resides on a different computer.。now you need to save this shim database file (a small database including the shim information is created), and install it. you can either install it by right-clicking on the shim and pressing the install button, or by using a command-line option, sdbinst.exe .。

This parameter is undocumented and unsupported.

The_allow_resetlogs_corruptionshould only be done as a last resort. Usually when a database is opened witheither the RESETLOGS or NORESETLOGS option, the status and checkpointstructures in all the file headers of all data files are checked to make surethat they are consistent. Once this ischecked, the redo logs are zeroed out in case of RESETLOGS. When the _ALLOW_RESETLOGS_CORRUPTIONparameter is set, the file header checks are bypassed. This means that we do not make sure that thefiles are consistent and open the database. It will potentially cause some lost data and lost data integrity. The database should be rebuilt since data andthe data dictionary could be corrupt in ways that are not immediatelydetectable. This could lead to futureoutages or put the database in a state where it cannot be salvaged at all. There is no guarantee that this will work.

Advantages

nsome circumstances, database can be brought up even when no valid backups areavailable

Disadvantages

(1)The database will not be in aconsistent state once the undocumented parameter is used and so it has to berebuilt by doing a full database export, recreate the database and a fulldatabase import.

(2)Not guaranteed to work

关于online redocorrupt,曾经整理过,参考:

Current online Redo 和 Undo 损坏的处理方法

Oracle 不同故障的恢复方案

4.3 Data file corruption

The data files are the physical storage unit of data stored in a database. Each data file ismade up of data blocks which can be divided into 5 different types (in thecontext of media corruption):

(1)File header blocks : File header block is the first Oracle block inevery data file in an Oracle database. This block keeps track of a lot of information about the data file thatit belongs to.

(2)Data Dictionary blocks : SYSTEM tablespace consists of datadictionary objects. Data dictionaryobjects are objects that keep track of information stored in the database suchas the information about the tablespaces, information about the data files,information of amount of free space in each tablespace.


本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-117663-1.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...