Home Database Mysql Tutorial ora-01190 ora-01110的解决方法

ora-01190 ora-01110的解决方法

Jun 07, 2016 pm 05:16 PM

ORA-01190: 控制文件或数据文件2来自于最后一个 RESETLOGS 之前ORA-01110: 数据文件 2: lsquo;E:\ORACLE9I\ORA9I\UNDOTBS01.DBF

SQLPLUS>ALTER DATABASE DATAFILE 2 ONLINE;
ALTER DATABASE DATAFILE 2 ONLINE
*
ERROR 位于第 1 行:
ORA-01190: 控制文件或数据文件2来自于最后一个 RESETLOGS 之前
ORA-01110: 数据文件 2: ‘E:\Oracle9I\ORA9I\UNDOTBS01.DBF’
接下来由于V$DATAFILE中的CHECKPOINT_CHANGE#仍然大于V$RECOVER_FILE中的CHANGE#,决定用ADJUST_SCN来调整SCN.
首先需要设置_allow_resetlogs_corruption参数,否则不能成功(实验了)
SQLPLUS>ALTER SYSTEM SET “_allow_resetlogs_corruption”=TRUE SCOPE=SPFILE;
系统已更改。
SQLPLUS>SHUTDOWN IMMEDIATE
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQLPLUS>STARTUP MOUNT;
ORACLE 例程已经启动。
Total System Global Area 135339940
bytes
Fixed Size 454564
bytes
Variable Size 109051904
bytes
Database Buffers 25165824
bytes
Redo Buffers 667648
bytes
数据库装载完毕。
SQLPLUS>ALTER DATABASE OPEN;
数据库已更改。
SQLPLUS>ALTER SESSION SET EVENTS ‘IMMEDIATE TRACE NAME ADJUST_SCN LEVEL 1′;
会话已更改。
SQLPLUS>SHUTDOWN IMMEDIATE
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQLPLUS>STARTUP MOUNT;
ORACLE 例程已经启动。
Total System Global Area 135339940
bytes
Fixed Size 454564
bytes
Variable Size 109051904
bytes
Database Buffers 25165824
bytes
Redo Buffers 667648
bytes
数据库装载完毕。
SQLPLUS>SELECT TS#,FILE#,NAME,STATUS,CHECKPOINT_CHANGE# FROM V$DATAFILE;
TS# FILE# NAME STATUS CHECKPOINT_CHANGE#
—- —– —————————————- ——- ——————
0 1 E:\ORACLE9I\ORA9I\SYSTEM01.DBF SYSTEM 1041478416
1 2 E:\ORACLE9I\ORA9I\UNDOTBS01.DBF OFFLINE 0
3 3 E:\ORACLE9I\ORA9I\DRSYS01.DBF OFFLINE 0
4 4 E:\ORACLE9I\ORA9I\INDX01.DBF OFFLINE 0
5 5 E:\ORACLE9I\ORA9I\TOOLS01.DBF OFFLINE 0
6 6 E:\ORACLE9I\ORA9I\USERS01.DBF OFFLINE 0
7 7 E:\ORACLE9I\ORA9I\XDB01.DBF OFFLINE 0
8 8 E:\ORACLE9I\ORA9I\OEM_REPOSITORY.DBF OFFLINE 0
13 9 E:\ORACLE9I\ORADATA\GAXZTEMP.DB OFFLINE 0
14 10 E:\ORACLE9I\ORADATA\GAXZUSR.DB OFFLINE 0
15 11 E:\ORACLE9I\ORADATA\GAXZRBS.DB OFFLINE 0
TS# FILE# NAME STATUS CHECKPOINT_CHANGE#
—- —– —————————————- ——- ——————
16 12 E:\ORACLE9I\ORADATA\GAXZWEB.DB OFFLINE 0
已选择12行。
SQLPLUS>SELECT * FROM V$RECOVER_FILE;
FILE# ONLINE ONLINE_ ERROR CHANGE# TIME
—– ——- ——- ——————– ————— ———-
2 OFFLINE OFFLINE WRONG FILE CREATE 37667 18-12月-04
3 OFFLINE OFFLINE WRONG FILE CREATE 37667 18-12月-04
4 OFFLINE OFFLINE WRONG FILE CREATE 37667 18-12月-04
5 OFFLINE OFFLINE WRONG FILE CREATE 37667 18-12月-04
6 OFFLINE OFFLINE WRONG FILE CREATE 37667 18-12月-04
7 OFFLINE OFFLINE WRONG FILE CREATE 37667 18-12月-04
8 OFFLINE OFFLINE WRONG FILE CREATE 37667 18-12月-04
9 OFFLINE OFFLINE WRONG FILE CREATE 37667 18-12月-04
10 OFFLINE OFFLINE WRONG FILE CREATE 37667 18-12月-04
11 OFFLINE OFFLINE WRONG FILE CREATE 37667 18-12月-04
12 OFFLINE OFFLINE WRONG FILE CREATE 37667 18-12月-04
已选择11行。
SQLPLUS>RECOVER UNTIL CANCEL;
完成介质恢复。
上面这一步很重要,虽然不做这个操作也能打开数据库,但是我们是要用RESETLOGS来打开数据库,否则仍然将其它数据文件联机的时候
仍然会报ORA-01189.
然后将数据文件状态联机。
SQLPLUS>ALTER DATABASE DATAFILE 2,3,4,5,6,7,8,9,10,11,12 ONLINE;
数据库已更改。
打开数据库。
SQLPLUS>ALTER DATABASE OPEN RESETLOGS;
数据库已更改。
查看V$DATAFILE,文件状态已经是ONLINE了。
TS# FILE# NAME STATUS CHECKPOINT_CHANGE#
— —– —————————————- ——- ——————
0 1 E:\ORACLE9I\ORA9I\SYSTEM01.DBF SYSTEM 1041478418
1 2 E:\ORACLE9I\ORA9I\UNDOTBS01.DBF ONLINE 1041478418
3 3 E:\ORACLE9I\ORA9I\DRSYS01.DBF ONLINE 1041478418
4 4 E:\ORACLE9I\ORA9I\INDX01.DBF ONLINE 1041478418
5 5 E:\ORACLE9I\ORA9I\TOOLS01.DBF ONLINE 1041478418
6 6 E:\ORACLE9I\ORA9I\USERS01.DBF ONLINE 1041478418
7 7 E:\ORACLE9I\ORA9I\XDB01.DBF ONLINE 1041478418
8 8 E:\ORACLE9I\ORA9I\OEM_REPOSITORY.DBF ONLINE 1041478418
13 9 E:\ORACLE9I\ORADATA\GAXZTEMP.DB ONLINE 1041478418
14 10 E:\ORACLE9I\ORADATA\GAXZUSR.DB ONLINE 1041478418
15 11 E:\ORACLE9I\ORADATA\GAXZRBS.DB ONLINE 1041478418
TS# FILE# NAME STATUS CHECKPOINT_CHANGE#
— —– —————————————- ——- ——————
16 12 E:\ORACLE9I\ORADATA\GAXZWEB.DB ONLINE 1041478418
至此,,数据库已经恢复了,接下来的工作就简单了:
将临时表空间文件找回:
SQLPLUS>ALTER TABLESPACE TEMP ADD TEMPFILE ‘E:\ORACLE9i\ORA9I\TEMP01.DBF’ REUSE;
表空间已更改。
将UNDO管理方式改成自动
SQLPLUS>ALTER SYSTEM SET UNDO_MANAGEMENT=AUTO SCOPE=SPFILE;
系统已更改。
SQLPLUS>ALTER SYSTEM SET UNDO_TABLESPACE=UNDOTBS SCOPE=SPFILE;
系统已更改。
用EXP导出数据,重建数据库。
总结:刚解决完的时候,有点不敢相信竟然解决了。因为这种由SYSTEM表空间造成的ORA-01189这个错误,我一直以为只能通过DUL来解决了。
在网上也同样找不到真正解决的资料,一般都是解决ORA-01190的。这两个问题的区别在于,创建控制文件的时候如果不产生01189(用resetlogs选项)那么创建时不用将其它的数据文件去掉,而且打开数据库的时候只要设置_allow_resetlogs_corruption就可以了,另外也不用adjust_scn来修改change#。于是在自己的机器上又做了几次实验:
1关掉数据库;
2备份SYSTEM表空间;
3打开数据库;
4切换日志;
5关数据库;
6替换旧的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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months 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)

How do you alter a table in MySQL using the ALTER TABLE statement? How do you alter a table in MySQL using the ALTER TABLE statement? Mar 19, 2025 pm 03:51 PM

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

How do I configure SSL/TLS encryption for MySQL connections? How do I configure SSL/TLS encryption for MySQL connections? Mar 18, 2025 pm 12:01 PM

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

How do you handle large datasets in MySQL? How do you handle large datasets in MySQL? Mar 21, 2025 pm 12:15 PM

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? What are some popular MySQL GUI tools (e.g., MySQL Workbench, phpMyAdmin)? Mar 21, 2025 pm 06:28 PM

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

How do you drop a table in MySQL using the DROP TABLE statement? How do you drop a table in MySQL using the DROP TABLE statement? Mar 19, 2025 pm 03:52 PM

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

How do you create indexes on JSON columns? How do you create indexes on JSON columns? Mar 21, 2025 pm 12:13 PM

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

How do you represent relationships using foreign keys? How do you represent relationships using foreign keys? Mar 19, 2025 pm 03:48 PM

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)? How do I secure MySQL against common vulnerabilities (SQL injection, brute-force attacks)? Mar 18, 2025 pm 12:00 PM

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)

See all articles