国产99久久精品_欧美日本韩国一区二区_激情小说综合网_欧美一级二级视频_午夜av电影_日本久久精品视频

最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當前位置: 首頁 - 科技 - 知識百科 - 正文

Oracle學習.數據文件、控制文件、重做日志文件的理解

來源:懂視網 責編:小采 時間:2020-11-09 15:41:37
文檔

Oracle學習.數據文件、控制文件、重做日志文件的理解

Oracle學習.數據文件、控制文件、重做日志文件的理解:什么是數據文件、控制文件、重做日志文件? 首先從Oracle的官方文檔里摘錄下面內容: The following divs explain the physical database structures of an Oracle database, including datafiles, redo log files
推薦度:
導讀Oracle學習.數據文件、控制文件、重做日志文件的理解:什么是數據文件、控制文件、重做日志文件? 首先從Oracle的官方文檔里摘錄下面內容: The following divs explain the physical database structures of an Oracle database, including datafiles, redo log files

什么是數據文件、控制文件、重做日志文件? 首先從Oracle的官方文檔里摘錄下面內容: The following divs explain the physical database structures of an Oracle database, including datafiles, redo log files, and control files 下面幾段內容將解釋一

什么是數據文件、控制文件、重做日志文件?


首先從Oracle的官方文檔里摘錄下面內容:

The following divs explain the physical database structures of an Oracle database, including datafiles, redo log files, and control files

下面幾段內容將解釋一下,Oracle數據庫的物理結構是什么?包括數據文件、控制文件和重做日志文件。

Datafiles


Every Oracle database has one or more physical datafiles. The datafiles contain all the database data. The data of logical database structures, such as tables and indexes, is physically stored in the datafiles allocated for a database.

The characteristics of datafiles are:

  • A datafile can be associated with only one database.

  • Datafiles can have certain characteristics set to let them automatically extend when the database runs out of space.

  • One or more datafiles form a logical unit of database storage called a tablespace.

  • Data in a datafile is read, as needed, during normal database operation and stored in the memory cache of Oracle. For example, assume that a user wants to access some data in a table of a database. If the requested information is not already in the memory cache for the database, then it is read from the appropriate datafiles and stored in memory.

    Modified or new data is not necessarily written to a datafile immediately. To reduce the amount of disk access and to increase performance, data is pooled in memory and written to the appropriate datafiles all at once, as determined by the database writer process (DBWn) background process.

    數據文件:

    每一個Oracle數據庫都要有一個或者多個物理的數據文件,這些數據文件里存儲的就是Oracle數據庫里的數據。就好比你有一個文件夾,里面有幾個txt的文本文件,文本文件里記錄的你這個月的每一筆花銷。如果把文件夾看做是數據庫,那么txt文件就是數據文件,而txt文件里面記錄的每一筆花銷就是數據了。

    然而表、索引等等其實都是數據庫的邏輯結構,這些表、索引都被物理的存儲在了數據文件里面。

    數據文件有三個特性:

    1、一個數據文件只能屬于一個數據庫。

    2、數據庫中的數據文件可以被設置成自動的增長。(當數據庫的空間用完的時候,數據庫中的數據文件就會自動增長,比如原來1G的數據文件自動變成了2G的數據文件)

    3、一個或者多個數據文件就組成了數據庫的一個邏輯單元叫做---表空間。

    (就比如記錄流水賬,那這個月的賬目就組成了一個表空間,下個月的就是另外一個表空間。)

    數據文件里的數據,在需要的時候就會被讀取到內容Oracle的緩沖區中,比如當我們想查看一天數據時,而這條數據恰好又不在Oracle的緩沖區中,那么Oracle就會把這條數據從數據文件中讀取到Oracle的緩沖區中來。

    當更改或者新增一天數據時,也不是馬上就寫到數據文件里面,這么做是為了減少對磁盤的訪問,提高效率,數據先存儲在緩沖區,然后在一次都寫入數據文件,這個過程有一個dbwn后臺進程來控制。


    Control Files
     
    Every Oracle database has a control file. A control file contains entries that specify the physical structure of the database. For example, it contains the following information:

    Database name

    Names and locations of datafiles and redo log files

    Time stamp of database creation

    Oracle can multiplex the control file, that is, simultaneously maintain a number of identical control file copies, to protect against a failure involving the control file.

    Every time an instance of an Oracle database is started, its control file identifies the database and redo log files that must be opened for database operation to proceed. If the physical makeup of the database is altered (for example, if a new datafile or redo log file is created), then the control file is automatically modified by Oracle to reflect the change. A control file is also used in database recovery.

    控制文件:

    每一個數據庫都擁有控制文件(它和數據文件一樣重要),控制文件里記錄的是對數據庫物理結構的詳細信息,例如它包括如下三個信息:
    1、數據庫的名稱
    2、數據文件的名字和存在位置,重做日志文件的名字和存儲位置
    3、數據庫創建的時間標識

    Oracle可以使用多重的控制文件,也就是說它可以同時維護多個完全一樣的控制文件,這么做就是為了防止數據文件損壞而造成的數據庫故障。比如Oracle同時維護3個控制文件,當其中有1個控制文件出問題了,就比較好解決,把出問題的刪了,在復制一份沒有問題的就可以了。

    每當Oracle數據庫的實例啟動的時候,它就會通過控制文件來識別,要想執行數據庫的一些操作,必須需要哪些數據文件和重做日志文件,以及這些數據文件和重做日志文件都存在在什么位置。當數據庫的物理構成發生改變的時候,比如新增加了一個數據文件或者重做日志文件,那么控制文件就會自動的更新來記錄這些變化。另外在數據庫恢復的時候也會用到控制文件。


    Redo Log Files
     
    Every Oracle database has a set of two or more redo log files. The set of redo log files is collectively known as the redo log for the database. A redo log is made up of redo entries (also called redo records).

    The primary function of the redo log is to record all changes made to data. If a failure prevents modified data from being permanently written to the datafiles, then the changes can be obtained from the redo log, so work is never lost.
     
    To protect against a failure involving the redo log itself, Oracle allows a multiplexed redo log so that two or more copies of the redo log can be maintained on different disks.

    The information in a redo log file is used only to recover the database from a system or media failure that prevents database data from being written to the datafiles. For example, if an unexpected power outage terminates database operation, then data in memory cannot be written to the datafiles, and the data is lost. However, lost data can be recovered when the database is opened, after power is restored. By applying the information in the most recent redo log files to the database datafiles, Oracle restores the database to the time at which the power failure occurred.

    The process of applying the redo log during a recovery operation is called rolling forward.

    重做日志文件:
    每個Oracle數據庫都擁有一組文件,其中包括2個或者多個重做日志文件(其實也可以擁有多組,用途跟多個控制文件一樣)。這組文件整體被稱為數據庫的重做日志,而重做日志又是由一條一條的重做記錄組成的,所有也被稱為重做記錄。
    重做日志的主要作用就是記錄所有的數據變化,當一個故障導致被修改過的數據沒有從內存中永久的寫到數據文件里,那么數據的變化是可以從重做日志中獲得的,從而保證了對數據修改的不丟失。
    為了防止重做日志自身的問題導致故障,所以Oracle擁有多重重做日志功能,也就是可以同時保存多組完全相同的重做日志在不同的磁盤上。
    重做日志里的信息只是用于恢復由于系統或者介質故障所引起的數據沒法寫入數據文件的數據。比如突然斷電導致數據庫的關閉,那么內存中的數據就不能寫入到數據文件中,內存中的數據就會丟失。但當數據庫重新啟動時丟失的數據是可以被恢復的,可以從最近的重做日志中讀取丟失信息然后應用到數據文件中,這樣就把數據庫恢復到斷電前的狀態。
    在恢復操作中恢復重做日志信息的過程叫做回滾。

    聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

    文檔

    Oracle學習.數據文件、控制文件、重做日志文件的理解

    Oracle學習.數據文件、控制文件、重做日志文件的理解:什么是數據文件、控制文件、重做日志文件? 首先從Oracle的官方文檔里摘錄下面內容: The following divs explain the physical database structures of an Oracle database, including datafiles, redo log files
    推薦度:
    標簽: 控制 文件 數據
    • 熱門焦點

    最新推薦

    猜你喜歡

    熱門推薦

    專題
    Top
    主站蜘蛛池模板: 成人无码一区二区片 | 不卡一区二区三区四区 | 亚洲视频在线观看视频 | 国产欧美日韩视频在线观看 | 日韩综合图区 | 一级成人毛片免费观看 | 九九精品视频一区二区三区 | 国产精品日韩欧美一区二区三区 | 一区二区国产精品 | 免费一区二区三区免费视频 | 国产精品伦理久久久久 | 国产亚洲欧美一区 | 亚洲午夜视频 | 九一毛片 | 亚洲一区日韩二区欧美三区 | 亚洲精品91 | 激情综合亚洲欧美日韩 | 国产在线精彩视频 | 亚洲欧美日韩在线2020 | 欧美曰韩 | 亚洲欧美国产精品第1页 | 在线亚洲精品国产成人二区 | 麻豆精品一区 | 国产在线高清不卡免费播放 | 日韩欧美亚洲国产高清在线 | 欧美在线视频免费观看 | 欧美另类精品一区二区三区 | 欧美日韩中字 | 中文字幕久久亚洲一区 | 日韩经典欧美一区二区三区 | 国产亚洲免费观看 | er久99久热只有精品国产 | 国产精品免费观看视频 | 久久精品免费看 | 91精品成人免费国产片 | julia一区| 亚洲精品免费观看 | 国内精品视频在线观看 | 亚洲精品99久久久久中文字幕 | 国产一页 | 国产精品不卡在线观看 |