Oracle 控制文件认知
3. 控制文件在打开状态下能够写入。如果不能写入控制文件,则数据库不能被挂载和不能恢复。4. 控制文件会在创建数据库时同时创建
1. 控制文件: 一个记录数据库物理结构的二进制文件。
2. 控制文件主要包含:
数据库名(DB_NAME)
数据文件名,与位置, REDOLOG文件名与位置
数据库创建时间
当前日志SCN
CHECKPOINT号
3. 控制文件在打开状态下能够写入。如果不能写入控制文件,,则数据库不能被挂载和不能恢复。
4. 控制文件会在创建数据库时同时创建。 Oracle建议COPY两份或者多份,在不同的磁盘上。 以防丢失。
5. 可以在参数文件中设置CONTROL_FILES的位置。如果没有设置:
如果没有启用OMF, 数据库创建的控制文件将使用系统指定的名字命名。
如果启用OMF, 在参数文件中开启这个特性,由OMF来定义控制文件名字和位置。
如果使用ASM,由初始化参数DB_CREATE_FILE_DEST和DB_RECOVERY_FILE_DEST参数设定。
6.在以下情况时需要备份控制文件:
创建,删除,或重命名数据文件时。
创建,删除表空间,或更改表空间为READ/WRITE 状态。
创建,删除REDO LOG或者日志组。
7. creating additional copies, renaming, and relocating controlfiles
shutdown the database.
使用操作系统命令复制已存在的控制文件到新的位置。
修改CONTROLE_FILES 参数,增加新控制文件名,或者改变已存大的控制文件名。
重新启动数据库。
8. 创建控制文件
(1)查询数据文件和REDO文件。
select member from v$logfile;
select name from v$datafile;
(2) 关闭数据库。
(3) 备份所有数据件各REDO LOGFILES。
(4) 启动数据库到NOMOUNT状态。
(5) CREATE NEW CONTROLFILE.
CREATE CONTROLFILE
SET DATABASE prod
LOGFILE GROUP 1 ('/u01/oracle/prod/redo01_01.log',
'/u01/oracle/prod/redo01_02.log'),
GROUP 2 ('/u01/oracle/prod/redo02_01.log',
'/u01/oracle/prod/redo02_02.log'),
GROUP 3 ('/u01/oracle/prod/redo03_01.log',
'/u01/oracle/prod/redo03_02.log')
RESETLOGS
DATAFILE '/u01/oracle/prod/system01.dbf' SIZE 3M,
'/u01/oracle/prod/rbs01.dbs' SIZE 5M,
'/u01/oracle/prod/users01.dbs' SIZE 5M,
'/u01/oracle/prod/temp01.dbs' SIZE 5M
MAXLOGFILES 50
MAXLOGMEMBERS 3
MAXLOGHISTORY 400
MAXDATAFILES 200
MAXINSTANCES 6
ARCHIVELOG;
(6) 打开数据库。
alter database open resetlogs;
9. 当查询数据文件为MISSINGnnnn时, 此数据文件为只读或者以OFFLINE关闭掉了, 不能以重命名的方式来解决问题, 而应使用介技恢复, 最后以RESETLOGS方式打开数据库。
10. 控制文件备份方法。
(1) alter database backup controlfile to '/home/oracle/control.bkp';
(2) alter database backup controlfile to trace; 此文件可以以普通文本打开。
11. 利用COPY方式还原控制文件, 当单个控制文件损坏时可以利用以下方法解决。
cp control01.tl control02.tl;
startup;
12. 移动控制文件。
cp olde_location new_loction;
修改初始化参数: CONTROL_FILES
启动数据库。
13. 删除控制文件。
关闭数据库。
修改参数文件,去掉所要删除的控制文件。
启动数据库。
14. 数据库相关视图。
v$database 显示数据库信息。
v$controlfile 可查询控制文件名字。
v$controlfile_reord_section 可查询控制文件所记录信息。
v$parameter 可显示控制文件位置从参数文件里(CONTROL_FILES)参数

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

MySQL is an open source relational database management system. 1) Create database and tables: Use the CREATEDATABASE and CREATETABLE commands. 2) Basic operations: INSERT, UPDATE, DELETE and SELECT. 3) Advanced operations: JOIN, subquery and transaction processing. 4) Debugging skills: Check syntax, data type and permissions. 5) Optimization suggestions: Use indexes, avoid SELECT* and use transactions.

This article recommends the top ten digital currency trading apps in the world, including Binance, OKX, Huobi Global, Coinbase, Kraken, Gate.io, KuCoin, Bitfinex, Gemini and Bitstamp. These platforms have their own characteristics in terms of transaction pair quantity, transaction speed, security, compliance, user experience, etc. For example, Binance is known for its high transaction speed and extensive services, while Coinbase is more suitable for novices. Choosing a platform that suits you requires comprehensive consideration of your own needs and risk tolerance. Learn about the world's mainstream digital currency trading platforms to help you conduct digital asset trading safely and efficiently.

This article will provide a detailed introduction to how to install and register a Bitcoin trading application. The Bitcoin trading app allows users to manage and trade cryptocurrencies such as Bitcoin. The article guides users through the installation and registration process step by step, including downloading applications, creating accounts, performing identity verification, and first deposit. The goal of the article is to provide beginners with clear and easy-to-understand guidelines to help them easily enter the world of Bitcoin trading.

MySQL is an open source relational database management system, mainly used to store and retrieve data quickly and reliably. Its working principle includes client requests, query resolution, execution of queries and return results. Examples of usage include creating tables, inserting and querying data, and advanced features such as JOIN operations. Common errors involve SQL syntax, data types, and permissions, and optimization suggestions include the use of indexes, optimized queries, and partitioning of tables.

MySQL is chosen for its performance, reliability, ease of use, and community support. 1.MySQL provides efficient data storage and retrieval functions, supporting multiple data types and advanced query operations. 2. Adopt client-server architecture and multiple storage engines to support transaction and query optimization. 3. Easy to use, supports a variety of operating systems and programming languages. 4. Have strong community support and provide rich resources and solutions.

Ouyi, also known as OKX, is a world-leading cryptocurrency trading platform. The article provides a download portal for Ouyi's official installation package, which facilitates users to install Ouyi client on different devices. This installation package supports Windows, Mac, Android and iOS systems. Users can choose the corresponding version to download according to their device type. After the installation is completed, users can register or log in to the Ouyi account, start trading cryptocurrencies and enjoy other services provided by the platform.

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.
