1、首先安装11.2.0.4数据库,安装步骤略过
2、开始升级
我已经下载了更新软件,所以选择第Skip software update
选择upgrade 按existing database继续下一步
语言默认english,next
选择企业版Next
注意这里的路径,开始我是11.2.0.1这里升级后是11.2.0.4需要建立新的目录
然后点击完成,开始安装
这里会让你选择创建监听,我们已经有监听,不创建cancel,出现以下窗口点击OK
点击YES,继续安装
完成安装后close
3、开始配置新的ORACLE_HOME
修改oracle的.bash_profile
把重新制定的路径更新到.bash_profile
下面是我的修改
修改/etc/oratab,如下
4、将参数文件copy到新的目录下
[[email protected] dbs]$ pwd
/u01/app/oracle/11.2.0.1/db_1/dbs
[[email protected] dbs]$ ls
hc_dave.dat init.ora lkDAVE orapwdave spfiledave.ora
[[email protected] dbs]$ cp * /u01/app/oracle/11.2.0.4/db_1/dbs/
5、copy 监听和TNS
[[email protected] admin]$ pwd
/u01/app/oracle/11.2.0.1/db_1/network/admin
[[email protected] admin]$ ls
listener.ora samples shrept.lst sqlnet.ora tnsnames.ora
[[email protected] admin]$
[[email protected] admin]$ cp -R * /u01/app/oracle/11.2.0.4/db_1/network/admin
6、查看并修改.bash_profile加入红色部分,如果没有
[[email protected] admin]$ cat /home/oracle/.bash_profile | grep ORACLE_HOME
export ORACLE_HOME=$ORACLE_BASE/11.2.0.4/db_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export TNS_ADMIN=/u01/app/oracle/11.2.0.4/db_1/network/admin
export PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;export CLASSPATH
7、连接数据库执行手动升级
[[email protected] ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Tue Dec 9 04:41:31 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected to an idle instance.
执行:
alter system set cluster_DATABASE=false scope=spfile;
SQL> startup upgrade
ORACLE instance started.
Total System Global Area 617975808 bytes
Fixed Size 2255752 bytes
Variable Size 423625848 bytes
Database Buffers 188743680 bytes
Redo Buffers 3350528 bytes
Database mounted.
Database opened.
然后执行升级
SQL>@/u01/app/oracle/11.2.0.4/db_1/rdbms/admin/catupgrd.sql; ----记住是11.2.0.4的新路径下
编译失效对象
SQL>shutdown immediate
SQL>startup
SQL>@/u01/app/oracle/11.2.0.4/db_1/rdbms/admin/utlrp.sql;
测试是否成功:
SQL> select * from v$version;或者select * from dba_registry;
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
升级成功!
恢复数据库为集群数据库:
alter system set cluster_DATABASE=true scope=spfile;
如果不是集群数据库不需要执行蓝色部分语句