ORACLE 控制檔案(Control Files)概述
<h2 style="background-color:#FFFFFF;color:#222222;font-family:Tahoma, sans-serif;font-size:19.7600002288818px;">
Control Files概述
</h2>
<p style="color:#222222;font-family:Tahoma, sans-serif;font-size:small;background-color:#FFFFFF;">
The database control file is a small binary file associated with only one database. Each database has one unique control file, although it may maintain identical copies of it.
</p>
<p style="color:#222222;font-family:Tahoma, sans-serif;font-size:small;background-color:#FFFFFF;">
資料庫控制檔案是一個比較小的,並且只與一個資料庫關聯二進位制檔案。每個資料庫都有一個唯一的控制檔案,即使它擁有多個相同的副本。
</p>
<div>
<h3 style="background-color:#FFFFFF;font-size:18.0699996948242px;font-family:Tahoma, sans-serif;color:#222222;">
Use of Control Files
</h3>
<p style="font-size:small;font-family:Tahoma, sans-serif;color:#222222;background-color:#FFFFFF;">
The control file is the root file that Oracle Database uses to find database files and to manage the state of the database generally. A control file contains information such as the following:
</p>
<ul style="margin-top:0px;margin-bottom:0px;">
<li style="background-color:#FFFFFF;font-size:small;font-family:Tahoma, sans-serif;color:#222222;">
<p style="background-color:inherit;">
The database name and database unique identifier (DBID)
</p>
</li>
<li style="background-color:#FFFFFF;font-size:small;font-family:Tahoma, sans-serif;color:#222222;">
<p style="background-color:inherit;">
The time stamp of database creation
</p>
</li>
<li style="background-color:#FFFFFF;font-size:small;font-family:Tahoma, sans-serif;color:#222222;">
<p style="background-color:inherit;">
Information about data files, online redo log files, and archived redo log files
</p>
</li>
</ul>
</div>
<div style="background-color:#FFFFFF;color:#222222;font-family:Tahoma, sans-serif;font-size:small;">
<ul style="margin-top:0px;margin-bottom:0px;background-color:inherit;">
<li style="background-color:inherit;">
Tablespace information
</li>
<li style="background-color:inherit;">
RMAN backups
<p style="background-color:inherit;">
<br />
</p>
</li>
</ul>
<p style="line-height:1.5;">
一般來說,控制檔案是oracle資料庫用來查詢資料庫檔案、管理資料庫狀態的根檔案。一個控制檔案包含一下資訊:
</p>
<p style="line-height:1.5;">
</p>
<div style="color:#000000;font-family:微軟雅黑;font-size:14px;">
<ul style="margin-top:0px;margin-bottom:0px;background-color:inherit;">
<li style="color:#222222;font-family:Tahoma, sans-serif;font-size:small;">
<p style="background-color:inherit;">
資料庫名和資料庫唯一識別符號(DBID)
</p>
</li>
<li style="color:#222222;font-family:Tahoma, sans-serif;font-size:small;">
<p style="background-color:inherit;">
建立資料庫的時間戳
</p>
</li>
<li style="color:#222222;font-family:Tahoma, sans-serif;font-size:small;">
<p style="background-color:inherit;">
包含資料檔案、聯機日誌檔案和歸檔重做日誌檔案的資訊
</p>
</li>
</ul>
</div>
<div>
<ul style="margin-top:0px;margin-bottom:0px;background-color:inherit;">
<li style="background-color:inherit;">
表空間資訊
</li>
<li style="background-color:inherit;">
RMAN備份
</li>
</ul>
</div>
</div>
<div style="background-color:#FFFFFF;color:#222222;font-family:Tahoma, sans-serif;font-size:small;">
<p style="line-height:1.5;">
<br />
</p>
</div>
<div style="background-color:#FFFFFF;color:#222222;font-family:Tahoma, sans-serif;font-size:small;">
<p style="background-color:inherit;">
The control file serves the following purposes:
</p>
<ul style="margin-top:0px;margin-bottom:0px;background-color:inherit;">
<li style="background-color:inherit;">
<p style="background-color:inherit;">
It contains information about data files, online redo log files, and so on that are required to open the database.
</p>
<p style="background-color:inherit;">
The control file tracks structural changes to the database. For example, when an administrator adds, renames, or drops a data file or online redo log file, the database updates the control file to reflect this change.
</p>
</li>
<li style="background-color:inherit;">
<p style="background-color:inherit;">
It contains metadata that must be accessible when the database is not open.
</p>
<p style="background-color:inherit;">
For example, the control file contains information required to recover the database, including checkpoints. A <a href="file://C:/Users/ZhuRui/AppData/Local/Youdao/YNote/editor/web/glossary.htm#CHDDBJEH" style="background-color:inherit;cursor:pointer;color:#72007C;">checkpoint</a> indicates the <a href="file://C:/Users/ZhuRui/AppData/Local/Youdao/YNote/editor/web/glossary.htm#CHDBFAEG" style="background-color:inherit;cursor:pointer;color:#72007C;">SCN</a> in the redo stream where <a href="file://C:/Users/ZhuRui/AppData/Local/Youdao/YNote/editor/web/glossary.htm#CHDIAJFJ" style="background-color:inherit;cursor:pointer;color:#72007C;">instance recovery</a> would be required to begin (see <a href="file://C:/Users/ZhuRui/AppData/Local/Youdao/YNote/editor/web/startup.htm#CEGCHJGF" style="background-color:inherit;cursor:pointer;color:#72007C;">"Overview of Instance Recovery"</a>). Every committed change before a checkpoint SCN is guaranteed to be saved on disk in the data files. At least every three seconds the checkpoint process records information in the control file about the checkpoint position in the online redo log.
</p>
</li>
</ul>
<p style="background-color:inherit;">
Oracle Database reads and writes to the control file continuously during database use and must be available for writing whenever the database is open. For example, recovering a database involves reading from the control file the names of all the data files contained in the database. Other operations, such as adding a data file, update the information stored in the control file.
</p>
<div style="background-color:inherit;">
<p style="font-weight:bold;background-color:inherit;">
<br />
</p>
</div>
</div>
<div style="background-color:#FFFFFF;color:#222222;font-family:Tahoma, sans-serif;font-size:small;">
<h3 style="background-color:inherit;font-size:18.0699996948242px;">
Multiple Control Files
</h3>
<p style="background-color:inherit;">
Oracle Database enables multiple, identical control files to be open concurrently and written for the same database. By multiplexing a control file on different disks, the database can achieve redundancy and thereby avoid a single point of failure.
</p>
<div style="background-color:inherit;">
<p style="font-weight:bold;background-color:inherit;">
Note:
</p>
Oracle recommends that you maintain multiple control file copies, each on a different disk.
</div>
<p style="background-color:inherit;">
If a control file becomes unusable, then the database instance fails when it attempts to access the damaged control file. When other current control file copies exist, the database can be remounted and opened without <a href="file://C:/Users/ZhuRui/AppData/Local/Youdao/YNote/editor/web/glossary.htm#CHDHGHAE" style="background-color:inherit;cursor:pointer;color:#72007C;">media recovery</a>. If all control files of a database are lost, however, then the instance fails and media recovery is required. Media recovery is not straightforward if an older backup of a control file must be used because a current copy is not available.
</p>
<div style="background-color:inherit;">
<p style="font-weight:bold;background-color:inherit;">
<br />
</p>
</div>
</div>
<div style="background-color:#FFFFFF;font-family:Tahoma, sans-serif;font-size:small;">
<h3 style="background-color:inherit;color:#222222;font-size:18.0699996948242px;">
Control File Structure
</h3>
<p style="color:#222222;background-color:inherit;">
Information about the database is stored in different sections of the control file. Each section is a set of records about an aspect of the database. For example, one section in the control file tracks data files and contains a set of records, one for each data file. Each section is stored in multiple logical control file blocks. Records can span blocks within a section.
</p>
<p style="color:#222222;background-color:inherit;">
The control file contains the following types of records:
</p>
<ul style="margin-top:0px;margin-bottom:0px;background-color:inherit;color:#222222;">
<li style="background-color:inherit;">
<p style="background-color:inherit;">
Circular reuse records
</p>
<p style="background-color:inherit;">
These records contain noncritical information that is eligible to be overwritten if needed. When all available record slots are full, the database either expands the control file to make room for a new record or overwrites the oldest record. Examples include records about archived redo log files and RMAN backups.
</p>
</li>
<li style="background-color:inherit;">
<p style="background-color:inherit;">
Noncircular reuse records
</p>
<p style="background-color:inherit;">
These records contain critical information that does not change often and cannot be overwritten. Examples of information include tablespaces, data files, online redo log files, and redo threads. Oracle Database never reuses these records unless the corresponding object is dropped from the tablespace.
</p>
</li>
</ul>
<p style="background-color:inherit;">
<span style="background-color:inherit;color:#222222;">As explained in </span><a href="file://C:/Users/ZhuRui/AppData/Local/Youdao/YNote/editor/web/datadict.htm#i4370" style="background-color:inherit;cursor:pointer;"><span style="background-color:inherit;color:#000000;">"Overview of the Dynamic Performance Views"</span></a><span style="background-color:inherit;color:#222222;">, you can query the dynamic performance views, also known as </span><code style="color:#222222;font-size:12px;background-color:inherit;">V$</code><span style="background-color:inherit;color:#222222;"> views, to view the information stored in the control file. For example, you can query </span><code style="color:#222222;font-size:12px;background-color:inherit;">V$DATABASE</code><span style="background-color:inherit;color:#222222;"> to obtain the database name and DBID. However, only the database can modify the information in the control file.</span>
</p>
<p style="background-color:inherit;">
<span style="background-color:inherit;color:#222222;">Reading and writing the control file blocks is different from reading and writing</span><b style="background-color:inherit;"> </b><a href="file://C:/Users/ZhuRui/AppData/Local/Youdao/YNote/editor/web/glossary.htm#CHDBACIH" style="background-color:inherit;cursor:pointer;"><span style="background-color:inherit;color:#000000;">data blocks</span></a><span style="background-color:inherit;color:#222222;">. For the control file, Oracle Database reads and writes directly from the disk to the </span><a href="file://C:/Users/ZhuRui/AppData/Local/Youdao/YNote/editor/web/glossary.htm#CHDCHGAJ" style="background-color:inherit;cursor:pointer;"><span style="background-color:inherit;color:#000000;">program global area (PGA)</span></a><span style="background-color:inherit;color:#222222;">. Each process allocates a certain amount of its PGA memory for control file blocks.</span>
</p>
<p style="color:#222222;background-color:inherit;">
<br />
</p>
<p style="color:#222222;background-color:inherit;">
還可以透過以下兩個檢視檢視控制檔案的內容:
</p>
<div style="background-color:inherit;color:#222222;">
<ul style="margin-top:0px;margin-bottom:0px;line-height:19px;white-space:normal;widows:auto;">
<li style="background-color:inherit;">
<p style="background-color:inherit;">
<code style="font-size:12px;background-color:inherit;">V$CONTROLFILE_RECORD_SECTION</code> view
</p>
</li>
<li style="background-color:inherit;">
<span style="line-height:1.5;"> </span><code style="font-size:12px;">CONTROL_FILE_RECORD_KEEP_TIME</code><span style="line-height:1.5;"> initialization parameter</span>
<p style="background-color:inherit;">
<br />
</p>
</li>
</ul>
<p style="line-height:1.5;white-space:normal;widows:auto;">
另外,還有其他方法檢視控制檔案的內容,詳見部落格:<a href="http://blog.itpub.net/30208428/viewspace-1811811/" style="cursor:pointer;line-height:1.5;">http://blog.itpub.net/30208428/viewspace-1811811/</a>
</p>
<div>
<br />
</div>
</div>
</div>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31520497/viewspace-2156753/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 控制檔案Oracle
- Oracle 控制檔案損壞解決方案Oracle
- java 檔案的操作(Path、Paths、Files)Java
- Oracle 11g 重新建立控制檔案Oracle
- oracle11g修改控制檔案路徑Oracle
- oracle 控制檔案及引數檔案何時自動備份Oracle
- 轉:Intellij idea Version Control File Status Colors ( 版本控制檔案狀態顏色 )IntelliJIdea
- 4.3.2.2.2 Oracle Managed FilesOracle
- 【RMAN】Oracle中如何備份控制檔案?備份控制檔案的方式有哪幾種?Oracle
- 檔案上傳概述
- [20201104]關於稀疏檔案(sparse files).txt
- oracle快速拿到重建控制檔案語句的方法二Oracle
- 清除Oracle控制檔案中的歸檔資訊v$archived_logOracleHive
- oracle ORA-01189 ORA-01110(控制檔案建立報錯)Oracle
- Files.newDirectoryStream掃描/過濾目錄檔案
- 搭建備庫時報錯“ORA-00203: using the wrong control files”
- Swift-控制流(Control Flow)Swift
- Oracle 12C Database File Mapping for Oracle ASM FilesOracleDatabaseAPPASM
- Oracle 21C管理Voting FilesOracle
- Google 推出 Files Go 中國版,命名“檔案極客”Go
- 2.6.4 指定控制檔案
- Oracle 密碼檔案Oracle密碼
- ORACLE 概要檔案管理Oracle
- Helper for GoPro Files for Mac(移動相機GoPro檔案幫手)GoMac
- Oracle-無備份情況下,如何手動恢復控制檔案Oracle
- oracle控制檔案的損壞或完全丟失的恢復辦法Oracle
- 4.1.1 Oracle Restart概述OracleREST
- 更改oracle 預設db_files 200(ORA-00059: maximum number of DB_FILESOracle
- why do header files even exist?(標頭檔案有什麼用)Header
- Oracle:ASM & 密碼檔案OracleASM密碼
- Oracle 資料檔案回收Oracle
- 咦?Oracle歸檔檔案存哪了?Oracle
- Oracle資料檔案和臨時檔案的管理Oracle
- 控制檔案損壞處理
- ORACLE系統概述(轉)Oracle
- Oracle Stream概述與配置Oracle
- Oracle RAC引數檔案管理Oracle
- Oracle 表空間增加檔案Oracle