eygle.com   eygle.com
eygle.com  
 

« March 26, 2007 | Blog首页 | March 29, 2007 »



March 27, 2007

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

作者:eygle

出处:http://blog.eygle.com

前几天写过一篇短文,有些习惯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-

Posted by eygle at 11:03 AM | Comments (7)



CopyRight © 2004-2008 eygle.com, All rights reserved.