eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« 生命的律动 | Blog首页 | 光纤存储、SUN遭遇莫名故障 »

DBA警世录:有多少错误可以再犯
modb.pro

前几天写过一篇短文,有些习惯DBA需要养成,其中提到几点建议以帮助DBA减少错误。

今天,一个同事又犯下一个低级的错误,导致了数据库故障。
所以确切的说,是SA的错误而不应该是DBA的责任,然而影响的毕竟还是数据库业务。

错误是这样犯下的,一台数据库服务器出了点故障,SA去检查重起信息,他试图键入如下一条命令:

last |grep reboot

然而不幸得是grep被他漏掉了,然后主机就被成功的reboot了。

晕倒,这样的错误也不容易出现的吧。

然后该我来启动数据库:

$ sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 27 10:33:12 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+DATADG/boss/spfileboss.ora'
ORA-17503: ksfdopn:2 Failed to open file +DATADG/boss/spfileboss.ora
ORA-15077: could not locate ASM instance serving a required diskgroup
SQL> exit
Disconnected

报错,原来是ASM的数据库,先来启动ASM实例:

$ export ORACLE_SID=+ASM
$ sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 27 10:35:51 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup
ASM instance started

Total System Global Area 130023424 bytes
Fixed Size 1976920 bytes
Variable Size 102880680 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining Scoring Engine options

再来启动数据库实例:

$ export ORACLE_SID=boss
$ sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Mar 27 10:36:18 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1115684864 bytes
Fixed Size 1984440 bytes
Variable Size 520099912 bytes
Database Buffers 587202560 bytes
Redo Buffers 6397952 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining Scoring Engine options

最后启动监听器:

$ lsnrctl start

LSNRCTL for Solaris: Version 10.2.0.1.0 - Production on 27-MAR-2007 10:37:03

Copyright (c) 1991, 2005, Oracle. All rights reserved.

Starting /opt/oracle/product/10.2.0/bin/tnslsnr: please wait...

TNSLSNR for Solaris: Version 10.2.0.1.0 - Production
System parameter file is /opt/oracle/product/10.2.0/network/admin/listener.ora
Log messages written to /opt/oracle/product/10.2.0/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db480.hurray.com.cn)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Solaris: Version 10.2.0.1.0 - Production
Start Date 27-MAR-2007 10:37:03
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/10.2.0/network/admin/listener.ora
Listener Log File /opt/oracle/product/10.2.0/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=db480.hurray.com.cn)(PORT=1521)))
The listener supports no services
The command completed successfully

搞定。
记录一下,存此警世。

-The End-


历史上的今天...
    >> 2017-03-27文章:
    >> 2013-03-27文章:
    >> 2011-03-27文章:
    >> 2008-03-27文章:
           奶粉钱 与 奶粉荒
    >> 2006-03-27文章:
           tkprof的含义
           Eygle.com 的一个里程碑

By eygle on 2007-03-27 11:03 | Comments (7) | Beginner | 1391 |

7 Comments

unix的命令都是很危险的^_^

是很危险,所以责任重大啊:)

我们这地,sa和dba是同一个人,所以所以这个对我们就非常有用了.

你老婆的blog怎么看不了呢??

嘿嘿,就是犯了错误,暂时关闭躲躲风头。

呵呵,有了这次的教训,以后键入命令在按下enter前,估计SA要sleep 2秒了.^|^

哈哈

估计也是。

还在是不是6月份的??


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com