解决spfile错误的基本步骤
这是我在oracle深入浅出看到的一个关于spfile启动不了的例子,在这重新试验了一次,我觉得 这个例子讲出了一个解决这种启动错误的一般解决方法,记下,以备以后查用.
1)启动数据库,出现如下错误
SYS@ orcl>startup
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE 例程已经启动。
Total System Global Area 289406976 bytes
Fixed Size 1248576 bytes
Variable Size 83886784 bytes
Database Buffers 197132288 bytes
Redo Buffers 7139328 bytes
数据库装载完毕。
ORA-01092: ORACLE 实例终止。强制断开连接
2)打开alter.log文件,首先查看alterXXX.log(background_dump_dest目录下),由于alert.log的重要作用,当数据库出现帮障时,我们最先的处理步骤就是检查该文件,以便发现相关错误信息或线索,这是dba必须明确的一个知识点.
Errors in file e:\oracle\product\10.2.0\admin\orcl\udump\orcl_ora_1404.trc:
ORA-30012: 还原表空间 'UNDOTBS3' 不存在或类型不正确
Sat Aug 01 11:29:03 2009
Error 30012 happened during db open, shutting down database
USER: terminating instance due to error 30012
Sat Aug 01 11:29:03 2009
Errors in file e:\oracle\product\10.2.0\admin\orcl\bdump\orcl_pmon_3256.trc:
ORA-30012: undo tablespace '' does not exist or of wrong type
查看ora-30012的定义
Error Code: ORA-30012
Error Cause:the specified undo tablespace either does not exist or is of the wrong type.
Action:Correct the tablespace name and reissue the statement.
3)启动数据库到mount状态,查看是否是spfile启动及undo_tablespace的值
SYS@ orcl>show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string E:\ORACLE\PRODUCT\10.2.0\DB_1\
DATABASE\SPFILEORCL.ORA
SYS@ orcl>show parameter undo_tablespace
NAME TYPE VALUE
------------------------------------ ----------- -------------------------
undo_tablespace string UNDOTBS3
查看所有表空间中没有叫undotbs3的表空间
SYS@ orcl>select name from v$tablespace;--由于是在mount状态下所以可以查看v$视图
NAME
------------------------------
SYSTEM
SYSAUX
USERS
TEMP
EXAMPLE
JENNYTEST
TBSJENNY
TESTUSER1
DXY_DT
EYGLE
UNDOTBS02
可以看到是没有叫undotbs3的表空间,只有一个undotbs02的undo表空间
4)再去查看alter.log看是否有改过undo_tablespace的参数值,发现如下一行
Fri Jul 31 10:55:54 2009
ALTER SYSTEM SET undo_tablespace='UNDOTBS02' SCOPE=MEMORY;
再查看关于undotbs03的操作
Sat Aug 01 11:26:15 2009
drop tablespace undotbs3 including contents and datafiles cascade constraints
通过以上就清楚了把undo_tablespace改为了UNDOTBS02却没有写到spfile中,而且又删除了undotbs3导致启动数据库时找不到undospace(注意一下,原来including contents and datafiles cascade constraints可以这样直接删除表空间),
5)在这个mount状态下修改如下
SYS@ orcl>alter system set undo_tablespace='undotbs02' scope=both;
alter system set undo_tablespace='undotbs02' scope=both(系统没有启动所以both会错误改用spfile就ok了)
*第 1 行出现错误:
ORA-02097: 无法修改参数, 因为指定的值无效
ORA-30012: 还原表空间 'undotbs02' 不存在或类型不正确
SYS@ orcl>alter system set undo_tablespace='undotbs02' scope=spfile;
系统已更改。
6)重新启动数据库,打开成功
SYS@ orcl>shutdown immediate;
ORA-01109: 数据库未打开
已经卸载数据库。
ORACLE 例程已经关闭。
SYS@ orcl>startup
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE 例程已经启动。
Total System Global Area 289406976 bytes
Fixed Size 1248576 bytes
Variable Size 83886784 bytes
Database Buffers 197132288 bytes
Redo Buffers 7139328 bytes
数据库装载完毕。
数据库已经打开。
SYS@ orcl>
7.总结一下.首先出现问题应该去看alter.log,第二查看问题的起因即ora-XXX,第三根据问题的起因做相关分析一步一步解决感悟alter.log是很重要的
第一次把试验笔记写的这么完整,哈哈,表扬一下我自已.貌似挺长的.
这是我在oracle深入浅出看到的一个关于spfile启动不了的例子,在这重新试验了一次,我觉得 这个例子讲出了一个解决这种启动错误的一般解决方法,记下,以备以后查用.
1)启动数据库,出现如下错误
SYS@ orcl>startup
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE 例程已经启动。
Total System Global Area 289406976 bytes
Fixed Size 1248576 bytes
Variable Size 83886784 bytes
Database Buffers 197132288 bytes
Redo Buffers 7139328 bytes
数据库装载完毕。
ORA-01092: ORACLE 实例终止。强制断开连接
2)打开alter.log文件,首先查看alterXXX.log(background_dump_dest目录下),由于alert.log的重要作用,当数据库出现帮障时,我们最先的处理步骤就是检查该文件,以便发现相关错误信息或线索,这是dba必须明确的一个知识点.
Errors in file e:\oracle\product\10.2.0\admin\orcl\udump\orcl_ora_1404.trc:
ORA-30012: 还原表空间 'UNDOTBS3' 不存在或类型不正确
Sat Aug 01 11:29:03 2009
Error 30012 happened during db open, shutting down database
USER: terminating instance due to error 30012
Sat Aug 01 11:29:03 2009
Errors in file e:\oracle\product\10.2.0\admin\orcl\bdump\orcl_pmon_3256.trc:
ORA-30012: undo tablespace '' does not exist or of wrong type
查看ora-30012的定义
Error Code: ORA-30012
Error Cause:the specified undo tablespace either does not exist or is of the wrong type.
Action:Correct the tablespace name and reissue the statement.
3)启动数据库到mount状态,查看是否是spfile启动及undo_tablespace的值
SYS@ orcl>show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string E:\ORACLE\PRODUCT\10.2.0\DB_1\
DATABASE\SPFILEORCL.ORA
SYS@ orcl>show parameter undo_tablespace
NAME TYPE VALUE
------------------------------------ ----------- -------------------------
undo_tablespace string UNDOTBS3
查看所有表空间中没有叫undotbs3的表空间
SYS@ orcl>select name from v$tablespace;--由于是在mount状态下所以可以查看v$视图
NAME
------------------------------
SYSTEM
SYSAUX
USERS
TEMP
EXAMPLE
JENNYTEST
TBSJENNY
TESTUSER1
DXY_DT
EYGLE
UNDOTBS02
可以看到是没有叫undotbs3的表空间,只有一个undotbs02的undo表空间
4)再去查看alter.log看是否有改过undo_tablespace的参数值,发现如下一行
Fri Jul 31 10:55:54 2009
ALTER SYSTEM SET undo_tablespace='UNDOTBS02' SCOPE=MEMORY;
再查看关于undotbs03的操作
Sat Aug 01 11:26:15 2009
drop tablespace undotbs3 including contents and datafiles cascade constraints
通过以上就清楚了把undo_tablespace改为了UNDOTBS02却没有写到spfile中,而且又删除了undotbs3导致启动数据库时找不到undospace(注意一下,原来including contents and datafiles cascade constraints可以这样直接删除表空间),
5)在这个mount状态下修改如下
SYS@ orcl>alter system set undo_tablespace='undotbs02' scope=both;
alter system set undo_tablespace='undotbs02' scope=both(系统没有启动所以both会错误改用spfile就ok了)
*第 1 行出现错误:
ORA-02097: 无法修改参数, 因为指定的值无效
ORA-30012: 还原表空间 'undotbs02' 不存在或类型不正确
SYS@ orcl>alter system set undo_tablespace='undotbs02' scope=spfile;
系统已更改。
6)重新启动数据库,打开成功
SYS@ orcl>shutdown immediate;
ORA-01109: 数据库未打开
已经卸载数据库。
ORACLE 例程已经关闭。
SYS@ orcl>startup
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORACLE 例程已经启动。
Total System Global Area 289406976 bytes
Fixed Size 1248576 bytes
Variable Size 83886784 bytes
Database Buffers 197132288 bytes
Redo Buffers 7139328 bytes
数据库装载完毕。
数据库已经打开。
SYS@ orcl>
7.总结一下.首先出现问题应该去看alter.log,第二查看问题的起因即ora-XXX,第三根据问题的起因做相关分析一步一步解决感悟alter.log是很重要的
第一次把试验笔记写的这么完整,哈哈,表扬一下我自已.貌似挺长的.