暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

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

原创 eygle 2007-03-27
535
前几天写过一篇短文,有些习惯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-
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论