oracle数据库有四种状态:shutdown,nomount,mount,open。读取参数文件启动到nomount,启动到mount状态时候会读取控制文件,然后根据controlfile内容加载数据库启动open状态。
如下是当10.2版本的数据库升级到11.2时候(升级过程是先升级软件,后DBUA升级数据库),用10.2版本的sqlplus去实验一下是否能打开数据库,可以很清楚的看到,sqlplus会以10.2的spfile启动到nomount状态,再继续alter database mount时候,就会去读controlfile,此时因为数据库已经升级到了11.2,所以会有如下输出:
[oracle@orcl6 ~]$ source .bash_profile--选择环境变量
What is your choose of Oracle version?
Enter only 1 or 2
1) Oracle 10g
2) Oracle 11g
#? 1
Oracle user Environment is:
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_home_1
ORACLE_SID=orcl
[oracle@orcl6 ~]$ which sqlplus--查看sqlplus版本信息
/u01/app/oracle/product/10.2.0/db_home_1/bin/sqlplus
[oracle@orcl6 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Fri Apr 11 18:34:48 2014
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> startup nomount;
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL> shu immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup nomount;--成功启动到nomount状态
ORACLE instance started.
Total System Global Area 243269632 bytes
Fixed Size 1273032 bytes
Variable Size 92275512 bytes
Database Buffers 146800640 bytes
Redo Buffers 2920448 bytes
SQL> show parameter spfile--查看使用的参数文件
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /u01/app/oracle/product/10.2.0
/db_home_1/dbs/spfileorcl.o
ra
SQL> alter database mount;--明显的报错如下>>
alter database mount
*
ERROR at line 1:
ORA-00201: control file version 11.2.0.3.0 incompatible with ORACLE version
10.2.0.5.0
ORA-00202: control file: '/u01/app/oracle/oradata/orcl/control01.ctl'
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29117696/viewspace-1140394/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29117696/viewspace-1140394/