您的位置:首页 > 数据库 > Oracle

oracle断电重启之ORA-01033和ORA-01172数据库掉电后磁盘坏块解决方法

2015-05-21 17:29 381 查看
--尝试连接数据库prjdb
C:\Documents and Settings\Administrator>sqlplus test/test@prjdb
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 9 17:23:08 2014
Copyright (c) 1982, 2010, Oracle.  All rights reserved.

--报错ORA01033
ERROR:
ORA-01033: ORACLE ????????
Process ID: 0
Session ID: 0 Serial number: 0

--查找ORA-01033的根源是什么,使用管理员身份登陆
C:\Documents and Settings\Administrator>SQLPLUS SYS/SYS AS SYSDBA
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 9 17:25:31 2014
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

--关闭数据库实例
SQL> SHUTDOWN
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.

--尝试启动数据库,如果启动失败会报错,这样就能够找到问题根源。
SQL> STARTUP
ORACLE instance started.

Total System Global Area  778387456 bytes
Fixed Size                  1374808 bytes
Variable Size             469763496 bytes
Database Buffers          301989888 bytes
Redo Buffers                5259264 bytes
Database mounted.
--问题根源是ORA-01172和ORA-01151
ORA-01172: recovery of thread 1 stuck at block 651 of file 90
ORA-01151: use media recovery to recover block, restore backup if needed

--查看file 90到底是哪一个文件,此步骤非必需
SQL> select file#,name from v$datafile where file#=90;
FILE#     NAME
D:\ORACLE\ORADATA\PRJDB\TS_HIS18.DBF

--恢复file 90
SQL> recover datafile 90;
Media recovery complete.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Pr
oduction
With the Partitioning, OLAP, Data Mining and Real Application Testing options

--再次尝试连接prjdb
C:\Documents and Settings\Administrator>sqlplus test/test@prjdb
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 9 17:46:33 2014
Copyright (c) 1982, 2010, Oracle.  All rights reserved.

--依然失败
ERROR:
ORA-01033: ORACLE ????????
Process ID: 0
Session ID: 0 Serial number: 0

--重复前面的操作
C:\Documents and Settings\Administrator>SQLPLUS SYS/SYS AS SYSDBA
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 9 17:46:46 2014
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select open_mode from v$database;
OPEN_MODE
--------------------
MOUNTED

SQL> alter database open;
alter database open
*
ERROR at line 1:
--发现还有一个file 7也是有问题的
ORA-01172: recovery of thread 1 stuck at block 89361 of file 7
ORA-01151: use media recovery to recover block, restore backup if needed

--恢复file 7
SQL> recover datafile 7;
Media recovery complete.

--再次启动数据库
SQL> alter database open;

--数据库启动成功
Database altered.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Pr
oduction
With the Partitioning, OLAP, Data Mining and Real Application Testing options

--再次尝试连接
C:\Documents and Settings\Administrator>sqlplus test/test@prjdb
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 9 17:48:33 2014
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
--连接成功。









内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: