Home Database Mysql Tutorial 探索Oracle之RMAN_07控制文件丢失恢复

探索Oracle之RMAN_07控制文件丢失恢复

Jun 07, 2016 pm 05:15 PM

探索Oracle之RMAN_07控制文件丢失恢复,基于控制文件的复合多路径性,它的丢失分为两种,一种是其中某个控制文件的损坏或丢失,另

1、     控制文件(controlfile)丢失恢复

基于控制文件的复合多路径性,它的丢失分为两种,一种是其中某个控制文件的损坏或丢失,另外一种是所有控制文件均丢失。基于第一种情况,只需把好的控制文件复制一份在损坏或丢失的那个控制文件路径下即可。第二种情况下则需要通过备份信息来对控制文件进行恢复或手工重建控制文件。

丢失单一控制文件的判断及恢复。

SQL>shutdown immediate

ORA-00210:cannot open the specified control file

ORA-00202:control file: '/DBData/oradata/WWL/control02.ctl'

ORA-27041:unable to open file

LinuxError: 2: No such file or directory

Additionalinformation: 3

 

必须强制关闭数据库

SQL>shutdown abort;

Oracleinstance shut down.

 

启动数据库报控制文件验证失败,检查告警日志文件

SQL>startup

ORACLEinstance started.

 

TotalSystem Global Area  285212672 bytes

FixedSize                  1218968 bytes

VariableSize             104859240 bytes

DatabaseBuffers          171966464 bytes

RedoBuffers                7168000 bytes

ORA-00205:error in identifying control file, check alert log for more info

 

查看告警日志,报提示找不到controlfile2

Fri Jun 2211:54:26 2012

Errors infile /DBSoft/admin/WWL/udump/wwl_ora_4816.trc:

ORA-00210:cannot open the specified control file

ORA-00202:control file: '/DBData/oradata/WWL/control02.ctl'

ORA-27041:unable to open file

LinuxError: 2: No such file or directory

 

从上面的信息我们可以得出是由于控制文件丢失导致了数据库无法正常的启动和关闭,下面我们要做的就是对控制文件进行做恢复,因为我们知道控制文件具有重复多路径属性,默认会有三个控制文件。现在日志中看到的是控制文件2丢失,找不到,我们可以通过控制文件13来恢复2

4.1 基于正常控制文件恢复损坏的控制文件

   1、查看控制文件存在路径

SQL>show parameter control_files

 

NAME          TYPE       VALUE

----------------------------------------------- ------------------------------

control_files     string      /DBSoft/oradata/WWL/control01.ctl,/DBData/oradata/WWL/control02.ctl, /DBData/oradata/WWL/control03.ctl

SQL>

    我们可以从如上看到,该套数据库存在三个控制文件其中一个控制文件存放在/DBSoft目中中的oradata/wwl/目录下,另外两个控制文件存在/DBData目录中的/oradata/wwl/的目录下,从上面刚才的信息中我们可以得之是control02.ctl控制文件丢失导致数据库故障。

   2、检查下控制文件是不存在还是损坏了

[oracle@wwldb WWL]$cd /DBData/oradata/WWL/

[oracle@wwldb WWL]$ll

total 0

[oracle@wwldb WWL]$

 

怪了,这个目录怎么一个控制文件都没有了呀,看看控制文件一是否存在。

[oracle@wwldb WWL]$ cd/DBSoft/oradata/WWL/

[oracle@wwldb WWL]$ ls

control01.ctl

 

了。

   3、关闭数据库

SQL> shutdown abort

ORACLE instance shut down.

SQL>

 

4、恢复损坏丢失的控制文件

[oracle@wwldbWWL]$ ls

control01.ctl

[oracle@wwldbWWL]$ pwd

/DBSoft/oradata/WWL

[oracle@wwldbWWL]$ ls

control01.ctl

[oracle@wwldbWWL]$ cp control01.ctl /DBData/oradata/WWL/control02.ctl

[oracle@wwldbWWL]$ cp control01.ctl /DBData/oradata/WWL/control03.ctl

[oracle@wwldbWWL]$ ll /DBData/oradata/WWL/

total13792

-rw-r-----1 oracle oinstall 7061504 Jun 22 12:51 control02.ctl

-rw-r-----1 oracle oinstall 7061504 Jun 22 12:51 control03.ctl

[oracle@wwldb WWL]$

2、启动数据库

SQL>startup

ORACLEinstance started.

 

Total SystemGlobal Area 285212672 bytes

FixedSize                 1218968 bytes

VariableSize            104859240 bytes

DatabaseBuffers         171966464 bytes

RedoBuffers               7168000 bytes

Databasemounted.

Databaseopened.

SQL>

 

 

所有控制文件全部丢失。

      丢失单一控制文件的判断及恢复。

SQL>shutdown immediate

ORA-00210:cannot open the specified control file

ORA-00202:control file: ' /DBSoft/oradata/WWL/control01.ctl'

ORA-27041:unable to open file

LinuxError: 2: No such file or directory

Additionalinformation: 3

 

必须强制关闭数据库

SQL>shutdown abort;

ORACLEinstance shut down.

 

启动数据库报控制文件验证失败,检查告警日志文件

SQL>startup

ORACLEinstance started.

 

TotalSystem Global Area  285212672 bytes

FixedSize                  1218968 bytes

VariableSize             104859240 bytes

DatabaseBuffers          171966464 bytes

RedoBuffers                7168000 bytes

ORA-00205:error in identifying control file, check alert log for more info

 

查看告警日志,,报提示找不到controlfile1

Fri Jun 22 13:16:07 2012

Errors in file /DBSoft/admin/WWL/udump/wwl_ora_5104.trc:

ORA-00210: cannot open the specified control file

ORA-00202: control file: '/DBSoft/oradata/WWL/control01.ctl'

ORA-27041: unable to open file

Linux Error: 2: No such file or directory

Additional information: 3

 

通过RMAN来进行控制文件的恢复:

SQL> startupforce nomount;

ORACLE instancestarted.

 

Total SystemGlobal Area  285212672 bytes

Fixed Size                  1218968 bytes

VariableSize             109053544 bytes

Database Buffers          167772160 bytes

RedoBuffers                7168000 bytes

SQL> exit

控制文件恢复

RMAN>restore controlfile;

 

3、打开数据库

SQL>alter database mount;

Database altered.

 

SQL>alter database open;

Database altered.

相关阅读:

探索Oracle之RMAN_01概念

探索Oracle之RMAN_02基本使用

探索Oracle之RMAN_03非一致性备份

探索Oracle之RMAN_04非一致性备份

探索Oracle之RMAN_05增量备份

探索Oracle之RMAN_06备份策略

探索Oracle之RMAN_07单个数据文件丢失恢复

探索Oracle之RMAN_07整个业务表空间丢失恢复

探索Oracle之RMAN_07 磁盘损坏数据丢失恢复

探索Oracle之RMAN_07 数据库所有文件全部丢失恢复

探索Oracle之RMAN_07 重做日志redu文件丢失恢复

探索Oracle之RMAN_07 参数文件丢失恢复

探索Oracle之RMAN_07控制文件丢失恢复

探索Oracle之RMAN_07 system表空间丢失恢复

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1668
14
PHP Tutorial
1273
29
C# Tutorial
1256
24
MySQL's Role: Databases in Web Applications MySQL's Role: Databases in Web Applications Apr 17, 2025 am 12:23 AM

The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

Explain the role of InnoDB redo logs and undo logs. Explain the role of InnoDB redo logs and undo logs. Apr 15, 2025 am 12:16 AM

InnoDB uses redologs and undologs to ensure data consistency and reliability. 1.redologs record data page modification to ensure crash recovery and transaction persistence. 2.undologs records the original data value and supports transaction rollback and MVCC.

MySQL's Place: Databases and Programming MySQL's Place: Databases and Programming Apr 13, 2025 am 12:18 AM

MySQL's position in databases and programming is very important. It is an open source relational database management system that is widely used in various application scenarios. 1) MySQL provides efficient data storage, organization and retrieval functions, supporting Web, mobile and enterprise-level systems. 2) It uses a client-server architecture, supports multiple storage engines and index optimization. 3) Basic usages include creating tables and inserting data, and advanced usages involve multi-table JOINs and complex queries. 4) Frequently asked questions such as SQL syntax errors and performance issues can be debugged through the EXPLAIN command and slow query log. 5) Performance optimization methods include rational use of indexes, optimized query and use of caches. Best practices include using transactions and PreparedStatemen

MySQL vs. Other Programming Languages: A Comparison MySQL vs. Other Programming Languages: A Comparison Apr 19, 2025 am 12:22 AM

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages ​​such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages ​​have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

MySQL: From Small Businesses to Large Enterprises MySQL: From Small Businesses to Large Enterprises Apr 13, 2025 am 12:17 AM

MySQL is suitable for small and large enterprises. 1) Small businesses can use MySQL for basic data management, such as storing customer information. 2) Large enterprises can use MySQL to process massive data and complex business logic to optimize query performance and transaction processing.

How does MySQL index cardinality affect query performance? How does MySQL index cardinality affect query performance? Apr 14, 2025 am 12:18 AM

MySQL index cardinality has a significant impact on query performance: 1. High cardinality index can more effectively narrow the data range and improve query efficiency; 2. Low cardinality index may lead to full table scanning and reduce query performance; 3. In joint index, high cardinality sequences should be placed in front to optimize query.

MySQL for Beginners: Getting Started with Database Management MySQL for Beginners: Getting Started with Database Management Apr 18, 2025 am 12:10 AM

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA

MySQL vs. Other Databases: Comparing the Options MySQL vs. Other Databases: Comparing the Options Apr 15, 2025 am 12:08 AM

MySQL is suitable for web applications and content management systems and is popular for its open source, high performance and ease of use. 1) Compared with PostgreSQL, MySQL performs better in simple queries and high concurrent read operations. 2) Compared with Oracle, MySQL is more popular among small and medium-sized enterprises because of its open source and low cost. 3) Compared with Microsoft SQL Server, MySQL is more suitable for cross-platform applications. 4) Unlike MongoDB, MySQL is more suitable for structured data and transaction processing.

See all articles