修复因归档日志满而无法启动Oracle的解决方案

6 月 24th, 2009 | Posted by | Filed under 未分类

本文内容遵从CC版权协议, 可以随意转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明
网址: http://www.penglixun.com/database/repair_archive_logs_over_cause_cannot_start_oracle.html

在Linux上,安装完成之后,在测试RMAN时可能会遇到如下错误:

[oracle@smsdbrac1 oracle]$ rman target /
rman: can’t open target


这是由于调用的是非Oracle的RMAN的缘故:

[oracle@smsdbrac1 oracle]$ which rman
/usr/X11R6/bin/rman

在X11R6下存在一个名为rman的命令:

[oracle@smsdbrac1 bin]$ ./rman -help
rman
    [-f <ASCII|roff|TkMan|Tk|Sections|HTML|XML|MIME|LaTeX|LaTeX2e|RTF|pod>]
    [-S(ource of man page passed in)] [-F(ormatted man page passed in)]
    [-r <man reference printf string>] [-l <title printf string>]
    [-V(olume) <colon-separated list>] [-U(RLs as hyperlinks)]
    [-b (show subsections)] [-k(eep head/foot)]
    [-n(ame of man page) <string>] [-s(ection) <string>]
    [-p(aragraph mode toggle)] [-t(abstops spacing) <number>]
    [-N(ormalize spacing, changebars)] [-y (zap hyphens toggle)]
    [-K (declare that page has no breaks)]
    [-d(iff) <file> (diff of old page source to incorporate)]
    [-M(essage) <text> (included verbatim at end of Name section)]
    [-R(ebus words for TkMan)] [-C (enable Tcl/Tk formatting)]
    [-o (no op)] [-O <arg> (no op with arg)]
    [-q(uiet–don’t report warnings)] [-h(elp)] [-v(ersion)]
    [<filename>]

修正这个问题,我们只需要在Oracle用户的环境变量下,将$ORACLE_HOME/bin放在PATH变量前就可以了:

export PATH=$ORACLE_HOME/bin:${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin

重新登录使环境变量生效,现在Oracle能找到正确的rman了:

[oracle@smsdbrac1 oracle]$ su – oracle
Password:
[oracle@smsdbrac1 oracle]$ which rman
~/product/10.2.0/db/bin/rman
Oracle自动归档模式下硬盘空间满了报:oracle initialization or shutdown in progress

Oracle无法启动.清理硬盘空间,腾出部分空间,Oracle正常启动.

1、登陆RMAN,清理硬盘空间,删除归档的文件

C:\>rman target  用户名/密码

恢复管理器: 版本9.2.0.8.0 – Production

 Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
 
连接到目标数据库: FLT (DBID=3951449863)
 
RMAN> delete archivelog all;
是否确定要删除以上对象 (输入 YES 或 NO)? yes
 
RMAN> exit
2、更改自动归档模式为非自动归档模式
 
SQL> connect sys/密码 as sysdba
已连接。
SQL> shutdown immediate;
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup mount;
ORACLE 例程已经启动。
 
Total System Global Area 621879712 bytes
Fixed Size                   455072 bytes
Variable Size             201326592 bytes
Database Buffers          419430400 bytes
Redo Buffers                 667648 bytes
数据库装载完毕。
SQL> alter database noarchivelog;
 
数据库已更改。
 
SQL> alter database open;
 
数据库已更改。
 
SQL> archive log list
数据库日志模式             非存档模式
自动存档             启用
存档终点            D:\oracle\oradata\FLT\archive
最早的概要日志序列     350
当前日志序列           352
SQL> archive log list
数据库日志模式             非存档模式
自动存档             启用
存档终点            D:\oracle\oradata\FLT\archive
最早的概要日志序列     350
当前日志序列           352
SQL>

目前还没有任何评论.