系统环境:
Linux standby 2.6.32-573.el6.x86_64 #1 SMP Wed Jul 1 18:23:37 EDT 2015 x86_64 x86_64x86_64 GNU/Linux
1. 讲补丁包上传到 oracle server ,解压、安装
[root@standby database]#unzip p13390677_112040_Linux-x86-64_1of7.zip -d /tmp&& unzip p13390677_112040_Linux-x86-64_2of7.zip -d /tmp
2. 检查当前版本
SQL> select * from v$version;
BANNER
-------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production PL/SQL Release 11.2.0.1.0 - Production CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production NLSRTL Version 11.2.0.1.0 – Production
SQL> set linesize 150 SQL> set pagesize 9999
SQL> col comp_name format a40
SQL> SELECT COMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY;
COMP_NAME VERSION STATUS
---------------------------------------- ------------------------------ -------- OWB 11.2.0.1.0 VALID
Oracle Application Express 3.2.1.00.10 VALID Oracle Enterprise Manager 11.2.0.1.0 VALID OLAP Catalog 11.2.0.1.0 VALID Spatial 11.2.0.1.0 VALID
Oracle Multimedia 11.2.0.1.0 VALID Oracle XML Database 11.2.0.1.0 VALID Oracle Text 11.2.0.1.0 VALID
Oracle Expression Filter 11.2.0.1.0 VALID Oracle Rules Manager 11.2.0.1.0 VALID Oracle Workspace Manager 11.2.0.1.0 VALID
Oracle Database Catalog Views 11.2.0.1.0 VALID
Oracle Database Packages and Types 11.2.0.1.0 VALID
JServer JAVA Virtual Machine 11.2.0.1.0 VALID Oracle XDK 11.2.0.1.0 VALID
Oracle Database Java Packages 11.2.0.1.0 VALID OLAP Analytic Workspace 11.2.0.1.0 VALID Oracle OLAP API 11.2.0.1.0 VALID 18 rows selected.
3. 检查磁盘空间(system 必须要最少 10m)(新home最少4.7GB)
SQL> select a.tablespace_name, round(a.total_size) \round(a.total_size) - round(b.free_size,3) \round(b.free_size,3) \
round(b.free_size/total_size *100,2) ||'%' free_rate from
(select tablespace_name,sum(bytes) /1024/1024 total_size from dba_data_files
group by tablespace_name) a,
(select tablespace_name,sum(bytes)/1024/1024 free_size from dba_free_space
group by tablespace_name) b
where a.tablespace_name=b.tablespace_name(+); 4.为数据库做冷备份
RMAN>run {
shutdown immediate; startup mount;
allocate channel c1 type disk; allocate channel c2 type disk;
backup full tag=’full_bak' database format '/home/oracle/full_cold_%d_%s.bak'; alter database open; }
RMAN> list backup;
数据库正常关闭后,还需要备份Oracle主目录,目的还是为了升级失败时,能够还原出数据库软件到升级前的版本。 重点是如下目录: ORACLE_HOME/dbs
ORACLE_HOME/network/admin ORACLE_HOME/hostname_dbname
ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole_hostname_dbname
[oracle@11g ~]$ env|grep ORA ORACLE_SID=orcl
ORACLE_BASE=/home/oracle/app
ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1 [oracle@11g ~]$
tar–cvf bk.tar $ORACLE_HOME
5. 关闭数据库实例及相关进程 (静态监听、动态监听、EOM、相关服务)
--停止数据库外部进程
[root@11g ~]#ps -ef|grep -v grep |grep LOCAL=NO|awk '{print $2}'|xargs kill -9 SQL> shutdown immediate; [oracle@11g rmanbak]$ cat
/home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora [oracle@11g rmanbak]$ lsnrctl stop
[oracle@11g rmanbak]$ lsnrctl status
[oracle@11g rmanbak]$ ps -ef |grepora_|grep -v grep [oracle@11g rmanbak]$ netstat -an |grep 1521 [oracle@11g rmanbak]$ netstat -an |grep 1158 6. 开始升级操作
[oracle@11g ~]$ cd /tmp/database
[oracle@11g database]$ ./runInstaller
6.1 不勾选 , 点击 next
6.2 选择 skip software updates
6.3 选择 upgrade an existing database
可能报错数据库实例未检测
6.4 选择语言