首页 > 数据库技术 > 详细

oracle断电重启之ORA-01033和ORA-01172

时间:2014-06-10 13:23:04      阅读:547      评论:0      收藏:0      [点我收藏+]

参考文献:

ORA-01033:解决方法

数据库掉电后 ORA-01172 磁盘坏块解决方法

 

bubuko.com,布布扣
--尝试连接数据库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
     90        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> 
--连接成功。
bubuko.com,布布扣

 

 

 

 

oracle断电重启之ORA-01033和ORA-01172,布布扣,bubuko.com

oracle断电重启之ORA-01033和ORA-01172

原文:http://www.cnblogs.com/xwdreamer/p/3778419.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!