图形化升级单机oracle 11.2.0.4 到 12.2.0.1
1. 讲补丁包上传到 Oracle server ,解压、安装
[oracle@11g tmp]$ unzip linuxx64_12201_database.zip
2. 检查当前版本
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
SQL> set linesize 150;
set pagesize 9999;
col comp_name format a40;
SELECT COMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY;SQL> SQL> SQL>
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.4.0 VALID
OLAP Catalog 11.2.0.4.0 VALID
Spatial 11.2.0.4.0 VALID
Oracle Multimedia 11.2.0.4.0 VALID
Oracle XML Database 11.2.0.4.0 VALID
Oracle Text 11.2.0.4.0 VALID
Oracle Expression Filter 11.2.0.4.0 VALID
Oracle Rules Manager 11.2.0.4.0 VALID
Oracle Workspace Manager 11.2.0.4.0 VALID
Oracle Database Catalog Views 11.2.0.4.0 VALID
Oracle Database Packages and Types 11.2.0.4.0 VALID
JServer JAVA Virtual Machine 11.2.0.4.0 VALID
Oracle XDK 11.2.0.4.0 VALID
Oracle Database Java Packages 11.2.0.4.0 VALID
OLAP Analytic Workspace 11.2.0.4.0 VALID
Oracle OLAP API 11.2.0.4.0 VALID
18 rows selected.
3. 检查磁盘空间
select a.tablespace_name, round(a.total_size) "total_size(mb)",
round(a.total_size) - round(b.free_size,3) "unsed_size(mb)",
round(b.free_size,3) "free_size(mb)",
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='db_full_bak' database format '/home/oracle/rmanbak/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.4/dbhome_1
[oracle@11g ~]$ tar cvf oracle.ora /home/oracle
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 |grep ora_|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
注意这里的安装位置,我之前的安装目录是11.2.0.4,我新目录是12.2.0.1.0 即将oracle 安装到其他位置,这样可以减少宕机时间,也是oracle 推荐的方法。
有pdksh或者ksh其中一个就行
[root@11g ~]# rpm -qa|grep ksh
pdksh-5.2.14-1.i386
执行到78%的时候弹出如下窗口: 用 root 用户跑这个脚本
进度到了83%的时候,自动弹出dbua窗口
停在37%执行了很久,耐心等待
选abort强制,进行如下操作
选yes
最后点击close。
7. 修改环境变量
然后,再修改oracle用户的.bash_profile
ORACLE_HOME=$ORACLE_BASE/product/12.2.0.1.0/db_1
然后source ~/.bash_profile
查看 cat /etc/oratab 【内容应该是新目录】
8. 登录查看,升级后版本
[oracle@11g ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu Apr 2 16:43:38 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL> set linesize 150;
set pagesize 9999;
col comp_name format a40;
SELECT COMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY;
COMP_NAME VERSION STATUS
---------------------------------------- ------------------------------ ----------------------
Oracle Database Catalog Views 12.2.0.1.0 UPGRADED
Oracle Database Packages and Types 12.2.0.1.0 UPGRADED
JServer JAVA Virtual Machine 12.2.0.1.0 UPGRADED
Oracle XDK 12.2.0.1.0 UPGRADED
Oracle Database Java Packages 12.2.0.1.0 UPGRADED
OLAP Analytic Workspace 12.2.0.1.0 UPGRADED
Oracle Workspace Manager 12.2.0.1.0 UPGRADED
Oracle Text 12.2.0.1.0 UPGRADED
Oracle XML Database 12.2.0.1.0 UPGRADED
Oracle Multimedia 12.2.0.1.0 UPGRADED
Spatial 12.2.0.1.0 UPGRADED
Oracle OLAP API 12.2.0.1.0 UPGRADED
OLAP Catalog 11.2.0.4.0 OPTION OFF
Oracle Application Express 5.0.4.00.12 UPGRADED
14 rows selected.
SQL> select count(*) from dba_objects where status<>'VALID';
COUNT(*)
----------
8357
SQL> select * from utl_recomp_errors;
no rows selected
编译失效对象
SQL>@$ORACLE_HOME/rdbms/admin/catuppst.sql
Session altered.
--多次执行utlrp.sql,失效对象数量不再变化
SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql
PL/SQL procedure successfully completed.
SQL> select count(*) from dba_objects where status<>'VALID';
COUNT(*)
----------
44
统计失效的对象:
SQL> set lin 300;
set pagesize 300;
col owner for a30;
select owner, object_type, status, count(*)
from dba_objects
where status='INVALID'
group by owner, object_type, status
order by owner, object_type;
OWNER OBJECT_TYPE STATUS COUNT(*)
------------------------------ ----------------------- ------- ----------
SYS FUNCTION INVALID 2
SYS PROCEDURE INVALID 5
SYS TRIGGER INVALID 2
SYS VIEW INVALID 1
TBTB FUNCTION INVALID 13
TBTB PROCEDURE INVALID 3
TBTB VIEW INVALID 18
查看具体失效对象
col owner for a20;
col object_name for a32;
col object_type for a16;
col status for a8;
select owner, object_name, object_type, status
from dba_objects
where status='INVALID'
order by 1,2,3;
OWNER OBJECT_NAME OBJECT_TYPE STATUS
-------------------- -------------------------------- ---------------- --------
SYS DEPEND_RELATIONSHIP PROCEDURE INVALID
SYS EVENT_TABLE PROCEDURE INVALID
SYS FN_GETSQLBYSQLID FUNCTION INVALID
SYS GET_SQLTEXT FUNCTION INVALID
SYS OLAPISHUTDOWNTRIGGER TRIGGER INVALID
SYS OLAPISTARTUPTRIGGER TRIGGER INVALID
SYS P_COLL_DML_INSERT PROCEDURE INVALID
SYS P_MONI_INVALID_INDEX PROCEDURE INVALID
SYS P_MONI_SQL PROCEDURE INVALID
SYS V$SQLAREA_TOTAL VIEW INVALID
TBTB CONTRACT_CALV FUNCTION INVALID
TBTB CONTRACT_CONTTYPE FUNCTION INVALID
TBTB CONTRACT_GDQX FUNCTION INVALID
TBTB EMPLEVEL_LT FUNCTION INVALID
TBTB EMPLEVEL_LZ FUNCTION INVALID
TBTB EMPLEVEL_QC FUNCTION INVALID
TBTB EMPLEVEL_XJRS FUNCTION INVALID
TBTB GETTRMOBJ_BYOID FUNCTION INVALID
TBTB GETUNITFULLNAME FUNCTION INVALID
TBTB GET_CONTRACTOIDBYEMPOID FUNCTION INVALID
TBTB GET_EMPDATA FUNCTION INVALID
TBTB JLSXTG PROCEDURE INVALID
TBTB LUOC FUNCTION INVALID
TBTB PROC_COPYTEMPLATE PROCEDURE INVALID
TBTB REP_1 FUNCTION INVALID
TBTB SET_EMPDATA PROCEDURE INVALID
TBTB TB_CNB_PAYRECORDINFO VIEW INVALID
TBTB TB_V_CRPT_SELCOUNT VIEW INVALID
TBTB TB_V_EMPASSIGNEDJOB VIEW INVALID
TBTB TB_V_EMPPOSITION VIEW INVALID
TBTB TB_V_LEADERLEVEL VIEW INVALID
TBTB TB_V_LEADER_SET VIEW INVALID
TBTB TB_V_ORGUNIT VIEW INVALID
TBTB TB_V_PMG_EVALUESCORE VIEW INVALID
TBTB TB_V_PMG_REWARDANDPUNISH VIEW INVALID
TBTB TB_V_REC_CANDIDATE VIEW INVALID
TBTB TB_V_TABLE VIEW INVALID
TBTB TB_V_TMG_MONTHREPORT VIEW INVALID
TBTB TB_V_TRM_CLASSINFO VIEW INVALID
TBTB TB_V_TRM_CLASSMONEY VIEW INVALID
TBTB TB_V_TRM_COURSE VIEW INVALID
TBTB VIEW_BIZPROCINST VIEW INVALID
TBTB VIEW_BIZWORKITEM VIEW INVALID
TBTB VIEW_ORG_PERSON_ROLE_UNIT VIEW INVALID
44 rows selected.
手动单个单个编译失效对象,结果每个报 Warning: Procedure altered with compilation errors.
ALTER PROCEDURE SYS.DEPEND_RELATIONSHIP COMPILE;
ALTER PROCEDURE SYS.P_MONI_INVALID_INDEX COMPILE;
ALTER PROCEDURE SYS.P_MONI_SQL COMPILE;
ALTER PROCEDURE SYS.P_COLL_DML_INSERT COMPILE;
ALTER FUNCTION SYS.GET_SQLTEXT COMPILE;
ALTER TRIGGER SYS.OLAPISTARTUPTRIGGER COMPILE;
ALTER TRIGGER SYS.OLAPISHUTDOWNTRIGGER COMPILE;
ALTER FUNCTION TBTB.GET_EMPDATA COMPILE;
ALTER FUNCTION TBTB.GETUNITFULLNAME COMPILE;
ALTER PROCEDURE TBTB.SET_EMPDATA COMPILE;
ALTER PROCEDURE TBTB.JLSXTG COMPILE;
ALTER PROCEDURE TBTB.PROC_COPYTEMPLATE COMPILE;
ALTER FUNCTION TBTB.GETTRMOBJ_BYOID COMPILE;
ALTER FUNCTION TBTB.LUOC COMPILE;
ALTER FUNCTION TBTB.REP_1 COMPILE;
ALTER FUNCTION TBTB.GET_CONTRACTOIDBYEMPOID COMPILE;
ALTER FUNCTION TBTB.EMPLEVEL_LT COMPILE;
ALTER FUNCTION TBTB.EMPLEVEL_LZ COMPILE;
ALTER FUNCTION TBTB.EMPLEVEL_QC COMPILE;
ALTER FUNCTION TBTB.CONTRACT_CALV COMPILE;
ALTER FUNCTION TBTB.CONTRACT_CONTTYPE COMPILE;
ALTER FUNCTION TBTB.CONTRACT_GDQX COMPILE;
ALTER FUNCTION TBTB.EMPLEVEL_XJRS COMPILE;
ALTER FUNCTION SYS.FN_GETSQLBYSQLID COMPILE;
ALTER PROCEDURE SYS.EVENT_TABLE COMPILE;
至此失效对象无法valid,推测是版本升级废弃对象,这里先不讨论。
9. 修改compatible参数,若修改完成,此次升级操作就无法回退,一定要在应用经过测试之后修改。
SQL> show parameter compatible
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
compatible string 11.2.0.4
noncdb_compatible boolean FALSE
QL> create spfile from pfile;
File created.
SQL> shutdown immediate;
SQL> startup;
SQL> alter system set compatible='12.2.0.1.0' scope=spfile;
System altered.
SQL> shutdown immediate;
SQL> startup;
SQL> show parameter compatible
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
compatible string 12.2.0.1.0
noncdb_compatible boolean FALSE
SQL> set linesize 150;
set pagesize 9999;
col comp_name format a40;
SELECT COMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY;
COMP_NAME VERSION STATUS
---------------------------------------- ------------------------------ ----------------------
Oracle Database Catalog Views 12.2.0.1.0 VALID
Oracle Database Packages and Types 12.2.0.1.0 VALID
JServer JAVA Virtual Machine 12.2.0.1.0 VALID
Oracle XDK 12.2.0.1.0 VALID
Oracle Database Java Packages 12.2.0.1.0 VALID
OLAP Analytic Workspace 12.2.0.1.0 VALID
Oracle Workspace Manager 12.2.0.1.0 VALID
Oracle Text 12.2.0.1.0 VALID
Oracle XML Database 12.2.0.1.0 VALID
Oracle Multimedia 12.2.0.1.0 VALID
Spatial 12.2.0.1.0 VALID
Oracle OLAP API 12.2.0.1.0 VALID
OLAP Catalog 11.2.0.4.0 OPTION OFF
Oracle Application Express 5.0.4.00.12 VALID
14 rows selected.
升级过程有忽略,abort,很简单粗暴,只用来初次尝试,用来学习与参考,失效对象还要进一步确认,升级过程中有不合理之处请指正,转载请标明出处
图形化升级单机oracle 11.2.0.4 到 12.2.0.1的更多相关文章
- 图形化升级单机oracle 11.2.0.1 到 11.2.0.4
1. 讲补丁包上传到 oracle server ,解压.安装 [root@11g ~]#unzip p13390677_112040_Linux-x86-64_1of7.zip -d /tmp &a ...
- Failed RMAN Catalog Upgrade from 11.2.0.2 to 12.1.0.2 ( ORA-02296 RMAN-06004 )
Failed RMAN Catalog Upgrade from 11.2.0.2 to 12.1.0.2 ( ORA-02296 RMAN-06004 ) 由于后期使用12c的数据库,需要对现有 ...
- 升级_开阔视野之Oracle图形化升级(dbca建库后升级)—10.2.0.1.0升为10.2.0.5.0
***********************************************声明*************************************************** ...
- CentOS7 图形化方式安装 Oracle 18c 单实例
下载 Oracle 数据库,zip 包 https://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.h ...
- CentOS7 图形化方式安装Oracle 18c 安装配置
下载 Oracle 数据库,zip 包 https://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.h ...
- ORACLE 12.1.0.1 至12.1.0.2升级文档(单机版 DBUA方式)
12C DBUA新特性 1. 新的pre-upgrade 检查工具. 2. 并行升级. 3. DBUA升级时,默认并行度为CPU个数或2. 并行度可调整. 4. 在升级过程中,DBUA工具可再次调用( ...
- 图形化界面安装oracle报错Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set.
问题描述: 在Linux + oracle 安装时,采有root 帐号登录x-windows 界面,然后 $su oracle 登录录安装Oracle 报以下错误: >>> Coul ...
- 【转】:Oracle Linux6.9下安装Oracle 11.2.0.4.0及psu补丁升级
为方便截图,本文操作都在vmware虚拟机上完成. 目录: 1.操作系统安装 2.数据库安装 3.PSU补丁升级卸载 part1 操作系统安装 Oracle (Enterprise) Linux ...
- 探索Oracle数据库升级6 11.2.0.4.3 Upgrade12c(12.1.0.1)
探索Oracle数据库升级6 11.2.0.4.3 Upgrade12c(12.1.0.1) 一.前言: Oracle 12c公布距今已经一年有余了,其最大亮点是一个能够插拔的数据库(PD ...
随机推荐
- Hadoop初体验(续)--YARN
1.Hadoop已经安装完成并启动成功 复制mapred-site.xml.template重命名为mapred-site.xml /etc/hadoop/mapred-site.xml.templa ...
- OpenCV编程->RGB直方图统计
我们在处理彩色图像时.特别是在做局部图像的阈值切割时,须要一个直观的RGB统计图. 接下来開始实现. 代码: void CalcHistRGB() { IplImage* img_sou ...
- tool class
在Java中,工具类定义了一组公共方法,这篇文章将介绍Java中使用最频繁及最通用的Java工具类.以下工具类.方法按使用流行度排名,参考数据来源于Github上随机选取的5万个开源项目源码. 一. ...
- LeetCode:有效三角形的个数【611】
LeetCode:有效三角形的个数[611] 题目描述 给定一个包含非负整数的数组,你的任务是统计其中可以组成三角形三条边的三元组个数. 示例 1: 输入: [2,2,3,4] 输出: 3 解释: 有 ...
- iOS 当前应用或者浏览器中 唤起 手机其他应用
这种方法 是 产品很常见的需求,关键 是在info.plist URL types 设置对应属性 比如 里面 子属性 URL identifier 设置成 bundle id //设置应用指向 ...
- 自顶向下归并排序(Merge Sort)
一.自顶向下的归并排序思路: 1.先把数组分为两个部分. 2.分别对这两个部分进行排序. 3.排序完之后,将这两个数组归并为一个有序的数组. 重复1-3步骤,直到数组的大小为1,则直接返回. 这个思路 ...
- CSS控制表格嵌套
网页设计应用中,当我们不能完全放弃表格的使用时,为了达到预期的效果,不免要用到表格嵌套(特别是多层嵌套)方式来进行布局.可能很多同仁都遇到过这样的问题,为了达到显示效果要为每一个(每一层)的表格写不同 ...
- 异步刷新页面的前进与后退的实现--pushState replaceState
实现目标 页面的跳转(前进后退,点击等)不重新请求页面 页面URL与页面展现内容一致(符合人们对传统网页的认识) 在不支持的浏览器下降级成传统网页的方式 使用到的API history.state 当 ...
- 一款实现滑动切换效果的插件---swiper
Swiper是纯javascript打造的滑动特效插件,面向手机.平板电脑等移动终端. Swiper能实现触屏焦点图.触屏Tab切换.触屏多图切换等常用效果. Swiper开源.免费.稳定.使用简单. ...
- django使用bootstrap前端框架
一.下载bootstrap相关文件,放在项目目录中.在blog 应用中新建static目录,bootstrap文件放在此目录下. bootstrap下载网址:http://v3.bootcss.com ...