hs ws1 oracle,Oracle诊断案例-Spfile案例一则

2. 尝试重新启动数据库

bash-2.03$ sqlplus "/ as sysdba"SQL*Plus: Release 9.2.0.3.0 - Production on 星期四 4月 1 11:43:52 2004

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

已连接到空闲例程。

SQL> startup

ORACLE 例程已经启动。

Total System Global Area 4364148184 bytes

Fixed Size 736728 bytes

Variable Size 1845493760 bytes

Database Buffers 2516582400 bytes

Redo Buffers 1335296 bytes

数据库装载完毕。

ORA-01092: ORACLE 例程终止。强行断开连接

.............

工程人员报告的问题重现.

3. 检查数据文件

bash-2.03$ cd /u01/ oradata/gzhs

bash-2.03$ ls -l

total 55702458

-rw-r----- 1 oracle dba 1073750016 Apr 1 11:44 UNDOTBS2.dbf

-rw-r----- 1 oracle dba 1073750016 Apr 1 11:44 WAP12_BILLINGDETAIL.dbf

-rw-r----- 1 oracle dba 1073750016 Apr 1 11:44 WAP12_MAIN.dbf

-rw-r----- 1 oracle dba 2097160192 Apr 1 11:44 WAP12_MAIN10.dbf

-rw-r----- 1 oracle dba 2097160192 Apr 1 11:44 WAP12_MAIN11.dbf

-rw-r----- 1 oracle dba 2097160192 Apr 1 11:44 WAP12_MAIN2.dbf

-rw-r----- 1 oracle dba 2097160192 Apr 1 11:44 WAP12_MAIN3.dbf

-rw-r----- 1 oracle dba 2097160192 Apr 1 11:44 WAP12_MAIN4.dbf

-rw-r----- 1 oracle dba 2097160192 Apr 1 11:44 WAP12_MAIN5.dbf

-rw-r----- 1 oracle dba 2097160192 Apr 1 11:44 WAP12_MAIN6.dbf

-rw-r----- 1 oracle dba 2097160192 Apr 1 11:44 WAP12_MAIN7.dbf

-rw-r----- 1 oracle dba 2097160192 Apr 1 11:44 WAP12_MAIN8.dbf

-rw-r----- 1 oracle dba 2097160192 Apr 1 11:44 WAP12_MAIN9.dbf

-rw-r----- 1 oracle dba 1073750016 Apr 1 11:44 WAP12_MVIEW.dbf

-rw-r----- 1 oracle dba 1073750016 Mar 24 17:15 WAP12_TEMP1.dbf

.........................

发现存在文件UNDOTBS2.dbf

4. mount数据库,检查系统参数

bash-2.03$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.3.0 - Production on 星期四 4月 1 11:46:20 2004

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

已连接到空闲例程。

SQL>

SQL>

SQL> startup mount;

ORACLE 例程已经启动。

Total System Global Area 4364148184 bytes

Fixed Size 736728 bytes

Variable Size 1845493760 bytes

Database Buffers 2516582400 bytes

Redo Buffers 1335296 bytes

数据库装载完毕。

SQL> select name from v$datafile;

NAME

------------------------------------------

/u01/oradata/gzhs/system01.dbf

/u01/oradata/gzhs/cwmlite01.dbf

/u01/oradata/gzhs/drsys01.dbf

/u01/oradata/gzhs/example01.dbf

/u01/oradata/gzhs/indx01.dbf

/u01/oradata/gzhs/odm01.dbf

/u01/oradata/gzhs/tools01.dbf

/u01/oradata/gzhs/users01.dbf

/u01/oradata/gzhs/xdb01.dbf

.........................

/u01/oradata/gzhs/UNDOTBS2.dbf

已选择23行。

SQL>

SQL> show parameter undo

NAME    TYPE   VALUE

------------------------------------ -----------

undo_management  string   AUTO

undo_retention integer 10800

undo_suppress_errors boolean FALSE

undo_tablespace string UNDOTBS1

SQL> show parameter spfile

NAME   TYPE   VALUE

------------------------------------

spfile  string

发现系统没有使用spfile,而初始化参数设置的undo表空间为UNDOTBS1

5. 检查参数文件

发现设置的UNDO表空间正是UNDOTBS1

undo_management=AUTO

undo_retention=10800

undo_tablespace=UNDOTBS1

这个设置是极其可疑的.

怀疑参数文件和实际数据库设置不符.

6. 再次检查alert文件查找对于UNDO表空间的操作

第一部分,创建数据库时的信息:

Sat Feb 7 20:30:12 2004

CREATE DATABASE gzhs

MAXINSTANCES 1

MAXLOGHISTORY 1

MAXLOGFILES 5

MAXLOGMEMBERS 3

MAXDATAFILES 100

DATAFILE '/u01/oradata/gzhs/system01.dbf' SIZE 500M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED

EXTENT MANAGEMENT LOCAL

DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/u01/oradata/gzhs/temp01.dbf' SIZE 1000M REUSE AUTOEXTEND

ON NEXT 250M MAXSIZE UNLIMITED

UNDO TABLESPACE "UNDOTBS1" DATAFILE '/u01/oradata/gzhs/undotbs01.dbf' SIZE 1000M REUSE AUTOEXTEND ON

NEXT 100M MAXSIZE UNLIMITED  CHARACTER SET ZHS16GBK  NATIONAL CHARACTER SET AL16UTF16  LOGFILE GROUP 1

('/u01/oradata/gzhs/redo01.log') SIZE 256M,  GROUP 2 ('/u01/oradata/gzhs/redo02.log') SIZE 256M,

GROUP 3 ('/u01/oradata/gzhs/redo03.log') SIZE 256M

注意,这也是OCP教材上提到的两种创建UNDO表空间的方式之一

第二部分,发现创建UNDOTBS2的记录信息:

Wed Mar 24 20:20:58 2004

/* OracleOEM */ CREATE UNDO TABLESPACE "UNDOTBS2"

DATAFILE '/u01/oradata/gzhs/UNDOTBS2.dbf' SIZE 1024M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED

Wed Mar 24 20:22:37 2004

Created Undo Segment _SYSSMU11$

Created Undo Segment _SYSSMU12$

Created Undo Segment _SYSSMU13$

Created Undo Segment _SYSSMU14$

Created Undo Segment _SYSSMU15$

Created Undo Segment _SYSSMU16$

Created Undo Segment _SYSSMU17$

Created Undo Segment _SYSSMU18$

Created Undo Segment _SYSSMU19$

Created Undo Segment _SYSSMU20$

Completed: /* OracleOEM */ CREATE UNDO TABLESPACE "UNDOTBS2"

Wed Mar 24 20:24:25 2004

Undo Segment 11 Onlined

Undo Segment 12 Onlined

Undo Segment 13 Onlined

Undo Segment 14 Onlined

Undo Segment 15 Onlined

Undo Segment 16 Onlined

Undo Segment 17 Onlined

Undo Segment 18 Onlined

Undo Segment 19 Onlined

Undo Segment 20 Onlined

Successfully onlined Undo Tablespace 15.

Undo Segment 1 Offlined

Undo Segment 2 Offlined

Undo Segment 3 Offlined

Undo Segment 4 Offlined

Undo Segment 5 Offlined

Undo Segment 6 Offlined

Undo Segment 7 Offlined

Undo Segment 8 Offlined

Undo Segment 9 Offlined

Undo Segment 10 Offlined

Undo Tablespace 1 successfully switched out.

第三部分,新的UNDO表空间被应用

Wed Mar 24 20:24:25 2004

ALTER SYSTEM SET undo_tablespace='UNDOTBS2' SCOPE=MEMORY;

我们发现问题就在这里,创建了新的UNDO表空间以后,因为使用的是pfile文件,修改的只对当前实例生效,操作人员忘记了修改pfile文件.

如果使用spfile,缺省的修改范围是both,会同时修改spfile文件,就可以避免以上问题的出现.

第四部分,删除了UNDOTBS1的信息

Wed Mar 24 20:25:01 2004

/* OracleOEM */ DROP TABLESPACE "UNDOTBS1" INCLUDING CONTENTS AND DATAFILES CASCADE CONSTRAINTS

Wed Mar 24 20:25:03 2004

Deleted file /u01/oradata/gzhs/undotbs01.dbf

Completed: /* OracleOEM */ DROP TABLESPACE "UNDOTBS1" INCLUDI.............

这样再次重新启动数据库的时候,问题出现了,pfile中定义的UNDOTBS1找不到了,而且操作实在很久以前,没人能回忆起来,甚至无法得知是什么人的操作。

7. 更改pfile,启动数据库

修改undo表空间

###########################################

# System Managed Undo and Rollback Segments

###########################################

undo_management=AUTO

undo_retention=10800

undo_tablespace=UNDOTBS2

....

bash-2.03$ sqlplus "/ as sysdba"

SQL*Plus: Release 9.2.0.3.0 - Production on 星期四 4月 1 11:55:11 2004

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

连接到:

Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.3.0 - Production

SQL> select * from v$version;

BANNER

----------------------------------------------------------------

Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production

PL/SQL Release 9.2.0.3.0 - Production

CORE 9.2.0.3.0 Production

TNS for Solaris: Version 9.2.0.3.0 - Production

NLSRTL Version 9.2.0.3.0 - Production

SQL> exit

从Oracle9i Enterprise Edition Release 9.2.0.3.0 - 64bit Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.3.0 - Production中断开

bash-2.03$

在这里我们可以看到,使用spfile可以免去手工修改pfile文件的麻烦,减少了犯错的可能。

既然Oracle9i给我们提供了这个新特性,就值得我们学习使用它.

历史上的今天...

>>

2013-06-26文章:

2011-06-26文章:

2009-06-26文章:

2008-06-26文章:

2007-06-26文章:

2006-06-26文章:

2005-06-26文章:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值