oracle数据库异常关闭之后恢复

oracle服务器重启之后无法启动,startup时报
 ORA-03113: 通信通道的文件结尾
shutdown 时报:ORA-27101: shared memory realm does not exist

解决办法参见博文: http://soulful.blog.51cto.com/468033/389570/
登陆服务器,
后切换到oracle用户:
su - oracle

通过sqplus连接到数据库管理员
sqlplus / as sysdba

执行sql如下:
SQL> startup mount;
ORACLE 例程已经启动。
Total System Global Area  835104768 bytes
Fixed Size                  2217952 bytes
Variable Size             637536288 bytes
Database Buffers          188743680 bytes
Redo Buffers                6606848 bytes
数据库装载完毕。
SQL> alter database open;
alter database open
*
第 1 行出现错误:
ORA-03113: 通信通道的文件结尾
进程 ID: 4272
会话 ID: 125 序列号: 5
退出sqlplus : exit
SQL> conn ' / as sysdba'
已连接到空闲例程。
SQL> startup mount
ORACLE 例程已经启动。
Total System Global Area  835104768 bytes
Fixed Size                  2217952 bytes
Variable Size             637536288 bytes
Database Buffers          188743680 bytes
Redo Buffers                6606848 bytes
数据库装载完毕。



SQL> alter database open resetlogs;
alter database open resetlogs
*
第 1 行出现错误:
ORA-01139: RESETLOGS 选项仅在不完全数据库恢复后有效

 SQL> select group#,to_char(next_time,'yyyy-MM-dd hh24:mi:ss') from v$log;

    GROUP# TO_CHAR(NEXT_TIME,'
---------- -------------------
         1 2013-12-13 12:23:50
         3
         2 2013-12-13 12:23:54

SQL> recover database until time '2013-12-13 12:23:50';
完成介质恢复。
SQL> alter database open resetlogs;

数据库已更改。

SQL> shutdown
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup
ORACLE 例程已经启动。

Total System Global Area 6413680640 bytes
Fixed Size                  2213776 bytes
Variable Size            4898949232 bytes
Database Buffers         1476395008 bytes
Redo Buffers               36122624 bytes
数据库装载完毕。
数据库已经打开。
SQL> exit

启动监听程序:
$ lsnrctl start


用plsql连接,成功

猜你喜欢

转载自zhengshuo.iteye.com/blog/1994258