生产环境oracle10g升级至11g准备工作
发表于:2025-12-02 作者:千家信息网编辑
千家信息网最后更新 2025年12月02日,最近需要生产系统从10.2.0.5.升级到11.2.0.2.0 做了不少的准备工作,硬是在周末自己搭了测试环境,照着自己准备的升级步骤练习了一番。 除过基本的检查,从Metalink上下载了最新的ps
千家信息网最后更新 2025年12月02日生产环境oracle10g升级至11g准备工作最近需要生产系统从10.2.0.5.升级到11.2.0.2.0 做了不少的准备工作,硬是在周末自己搭了测试环境,照着自己准备的升级步骤练习了一番。 除过基本的检查,从Metalink上下载了最新的psu,和公司的资深dba确认后,提供了给了客户。这样数据库就算是升级到11.2.0.2.10
主要有以下的步骤 : 1.new ORACLE_HOME(11g), old ORACLE_HOME (10g) --这些需要提前提供给客户,作为基本的约定 2.install oracle software 11.2.0.2.0 on production --总共有7个DB,时间很紧,所以准备要充分 3.apply DB patch additional if needed --patch详细信息参见 Note:16056267.8 11.2.0.2.10 (Apr 2013) Database Patch Set Update (PSU) Patch:16056267 4.init parameter tuning --这个也是必需的,主要有三个方面 11g里面可能过期的参数,如user_dump...... 11g里面新增加的参数,如diag....,有些需要考虑是否调优。 10g里面调优的隐含参数是否需要保留... 5.OS kernel tuning --系统级的调优也是必须的。需要找专门的team来提供意见。 6.PET and Production compare --准生产环境的准备,需要做足前期的测试工作。 7.confirm details with App team if have any concern. --对于升级过程中的部分问题,如果不能确认,需要找开发或者其他的team来协调。
8.full backup or cold backup --这个取决于具体的环境实施方案,保证充足的备份很重要,生产系统做cold backup应该很悬了。
9.check if there are crontab running or scheduled. --这个需要提前考虑,一般的项目都会有系统监控,要保证在升级过程中排除不必要的影响。如果有goldengate同步之类的,也需要提前协调好,保证不会影响。 10.check if all database components are valid --可以使用如下的sql来 select substr(comp_name,1,40) comp_name, status, substr(version,1,10) version from dba_registry order by comp_name; --组建都应该是valid状态。 11.check if all objects are valid --检查object状态也应该是valid. if there are component or objects invalid, need to use utlrp.sql to recompile 12.check if duplicate objects owned by SYS and SYSTEM Schema --从dba_objects里查询,保证sys,system下的没有重复的object,,以下是期望的结果,如果有其他的,需要查看metalink文档来处理。Note,1030426.6
OBJECT_NAME OBJECT_TYPE
------------------------------ ------------------- AQ$_SCHEDULES TABLE AQ$_SCHEDULES_PRIMARY INDEX DBMS_REPCAT_AUTH PACKAGE DBMS_REPCAT_AUTH PACKAGE BODY
13.disable custom triggers --为了排除trigger的导致的ddl影响,建议还是disable custom trigger. 14.Copy Pre-upgrade Information script. to a local folder --建一个临时的文件夹,把升级所需的脚本拷贝过去。如脚本rdbms/admin/utlu112i.sql 需要从11ghome下rdbms/admin提前拷贝过去。 15.Run Pre-upgrade Information Tool on target database (10g) --spool一下,做升级前的检查工作。 sqlplus / as sysdba spool pre_upgrade_info.log @utlu112i.sql spool off 16.Check the output of the Pre-Upgrade Information Tool --这里需要注意warning信息,清空recyclebin,保证timezone file必须是v4,要不升级100%失败。还有要注意部分参数,根据提示进行修改。 17.backup /etc/oratab,tnsnames.ora,listener.ora sqlnet.ora,password file, pfile,spfile,profile --备份必要的文件,作为rollback的备份。 18.Copy Network files to 11g Home and modify the home in listener --拷贝tnsnames.ora,listener.ora到11g home的对应目录下。 19.Copy password file to 11g Home --拷贝密码文件 20.Prepare a separate .bash_profile to set 11g environment variables --profile文件也需要做相应修改。
21.Collect dictionary stats --使用如下的包来 EXEC DBMS_STATS.GATHER_DICTIONARY_STATS; 22.Stop Listener services of the target database. --停掉监听,开始升级 23.Shutdown the target database (10g) --down掉数据库,清空缓存,这样起来以后跑脚本会排出很多干扰,速度也快一些。 24.Set working environment to 11g ORACLE_HOME. Make sure multiple ORACLE HOMEs are not in the PATH variable. 25.Copy spfile to 11g home. 26.stop source(10g) DB,Start the db in nomount,mount mode, and make necessary changes/adjustments in spfile with scope=spfile. --这一步,需要修改compatible参数,调节一些参数。(之前的步骤进行参数调优的时候准备好的) 最后create spfile from pfile; 27.Shutdown and startup the db in upgrade mode. --启动数据库,使用spfile, --startup upgrade 28.Run upgrade script. Exit the session after upgrade. --这个是最关键的脚本,运行时间也会长一些。,脚本运行完成后,会自动shutfdown immediate spool upgrade11g2.log @?/rdbms/admin/catupgrd.sql Spool off Exit 29.Verify the log for errors. Ignore "table or view not found" errors --如果有部分错误,需要检查,如果有些错误如memory issue 不能忽略,需要重新运行脚本 30.Startup the db in normal mode and run post upgrade information tool. Verify the status of each db component and address the failures. --启动数据库,运行如下的脚本。 spool post_upgrade_info.txt @?/rdbms/admin/utlu112s.sql Spool 31.Continue upgrade (new in 11g) --继续执行脚本,属于post upgrade脚本。 Spool upgrade11g2.log @?/rdbms/admin/catuppst.sql Spool off 32.Recompile invalid objects 33.enable custom triggers --enable之前disable的trigger 34.update /etc/oratab with 11g home --更改该配置,在某些应用中会用到。 35.rename spfile/pfile from 10g home --保证10g的参数不被使用,保证不会有错误的操作导致不必要的麻烦。 36.Start Listener services of the target database with 11g HOME. --确定后启动监听。 37.DBA sanity check(check if mv is able to refresh,db components are valid,check if there are ORA erros from logs) --DBA先做一些简单的sanity test.保证环境交给客户之前不会有基本的错误。 38.Check the connectivity from client --然后从客户端进行测试,连接是否正常。 39.Backup of DB after upgrade --进行必要的备份。 40.upgrade rman catalog if necessary --如果使用rman做备份恢复,需要升级catalog 41.change crontab --可以修改crontab,使其生效。
--大体的步骤就以上这么多,也希望大家拍砖,提供修正意见。:)
------------------------------------------------------------------------------- 2013-0714:补充:升级完之后 升级timezone file. SQL> select *from v$timezone_file;
FILENAME VERSION -------------------- ---------- timezlrg_4.dat 4 需要升级到14,要不可能会有一些问题。 参照文档Note:977512.1:
主要有以下的步骤 : 1.new ORACLE_HOME(11g), old ORACLE_HOME (10g) --这些需要提前提供给客户,作为基本的约定 2.install oracle software 11.2.0.2.0 on production --总共有7个DB,时间很紧,所以准备要充分 3.apply DB patch additional if needed --patch详细信息参见 Note:16056267.8 11.2.0.2.10 (Apr 2013) Database Patch Set Update (PSU) Patch:16056267 4.init parameter tuning --这个也是必需的,主要有三个方面 11g里面可能过期的参数,如user_dump...... 11g里面新增加的参数,如diag....,有些需要考虑是否调优。 10g里面调优的隐含参数是否需要保留... 5.OS kernel tuning --系统级的调优也是必须的。需要找专门的team来提供意见。 6.PET and Production compare --准生产环境的准备,需要做足前期的测试工作。 7.confirm details with App team if have any concern. --对于升级过程中的部分问题,如果不能确认,需要找开发或者其他的team来协调。
8.full backup or cold backup --这个取决于具体的环境实施方案,保证充足的备份很重要,生产系统做cold backup应该很悬了。
9.check if there are crontab running or scheduled. --这个需要提前考虑,一般的项目都会有系统监控,要保证在升级过程中排除不必要的影响。如果有goldengate同步之类的,也需要提前协调好,保证不会影响。 10.check if all database components are valid --可以使用如下的sql来 select substr(comp_name,1,40) comp_name, status, substr(version,1,10) version from dba_registry order by comp_name; --组建都应该是valid状态。 11.check if all objects are valid --检查object状态也应该是valid. if there are component or objects invalid, need to use utlrp.sql to recompile 12.check if duplicate objects owned by SYS and SYSTEM Schema --从dba_objects里查询,保证sys,system下的没有重复的object,,以下是期望的结果,如果有其他的,需要查看metalink文档来处理。Note,1030426.6
OBJECT_NAME OBJECT_TYPE
------------------------------ ------------------- AQ$_SCHEDULES TABLE AQ$_SCHEDULES_PRIMARY INDEX DBMS_REPCAT_AUTH PACKAGE DBMS_REPCAT_AUTH PACKAGE BODY
13.disable custom triggers --为了排除trigger的导致的ddl影响,建议还是disable custom trigger. 14.Copy Pre-upgrade Information script. to a local folder --建一个临时的文件夹,把升级所需的脚本拷贝过去。如脚本rdbms/admin/utlu112i.sql 需要从11ghome下rdbms/admin提前拷贝过去。 15.Run Pre-upgrade Information Tool on target database (10g) --spool一下,做升级前的检查工作。 sqlplus / as sysdba spool pre_upgrade_info.log @utlu112i.sql spool off 16.Check the output of the Pre-Upgrade Information Tool --这里需要注意warning信息,清空recyclebin,保证timezone file必须是v4,要不升级100%失败。还有要注意部分参数,根据提示进行修改。 17.backup /etc/oratab,tnsnames.ora,listener.ora sqlnet.ora,password file, pfile,spfile,profile --备份必要的文件,作为rollback的备份。 18.Copy Network files to 11g Home and modify the home in listener --拷贝tnsnames.ora,listener.ora到11g home的对应目录下。 19.Copy password file to 11g Home --拷贝密码文件 20.Prepare a separate .bash_profile to set 11g environment variables --profile文件也需要做相应修改。
21.Collect dictionary stats --使用如下的包来 EXEC DBMS_STATS.GATHER_DICTIONARY_STATS; 22.Stop Listener services of the target database. --停掉监听,开始升级 23.Shutdown the target database (10g) --down掉数据库,清空缓存,这样起来以后跑脚本会排出很多干扰,速度也快一些。 24.Set working environment to 11g ORACLE_HOME. Make sure multiple ORACLE HOMEs are not in the PATH variable. 25.Copy spfile to 11g home. 26.stop source(10g) DB,Start the db in nomount,mount mode, and make necessary changes/adjustments in spfile with scope=spfile. --这一步,需要修改compatible参数,调节一些参数。(之前的步骤进行参数调优的时候准备好的) 最后create spfile from pfile; 27.Shutdown and startup the db in upgrade mode. --启动数据库,使用spfile, --startup upgrade 28.Run upgrade script. Exit the session after upgrade. --这个是最关键的脚本,运行时间也会长一些。,脚本运行完成后,会自动shutfdown immediate spool upgrade11g2.log @?/rdbms/admin/catupgrd.sql Spool off Exit 29.Verify the log for errors. Ignore "table or view not found" errors --如果有部分错误,需要检查,如果有些错误如memory issue 不能忽略,需要重新运行脚本 30.Startup the db in normal mode and run post upgrade information tool. Verify the status of each db component and address the failures. --启动数据库,运行如下的脚本。 spool post_upgrade_info.txt @?/rdbms/admin/utlu112s.sql Spool 31.Continue upgrade (new in 11g) --继续执行脚本,属于post upgrade脚本。 Spool upgrade11g2.log @?/rdbms/admin/catuppst.sql Spool off 32.Recompile invalid objects 33.enable custom triggers --enable之前disable的trigger 34.update /etc/oratab with 11g home --更改该配置,在某些应用中会用到。 35.rename spfile/pfile from 10g home --保证10g的参数不被使用,保证不会有错误的操作导致不必要的麻烦。 36.Start Listener services of the target database with 11g HOME. --确定后启动监听。 37.DBA sanity check(check if mv is able to refresh,db components are valid,check if there are ORA erros from logs) --DBA先做一些简单的sanity test.保证环境交给客户之前不会有基本的错误。 38.Check the connectivity from client --然后从客户端进行测试,连接是否正常。 39.Backup of DB after upgrade --进行必要的备份。 40.upgrade rman catalog if necessary --如果使用rman做备份恢复,需要升级catalog 41.change crontab --可以修改crontab,使其生效。
--大体的步骤就以上这么多,也希望大家拍砖,提供修正意见。:)
------------------------------------------------------------------------------- 2013-0714:补充:升级完之后 升级timezone file. SQL> select *from v$timezone_file;
FILENAME VERSION -------------------- ---------- timezlrg_4.dat 4 需要升级到14,要不可能会有一些问题。 参照文档Note:977512.1:
升级
脚本
参数
保证
准备
备份
环境
客户
拷贝
数据
数据库
文件
步骤
系统
错误
检查
运行
工作
生产
部分
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
呈贡区智能化软件开发厂家价格
人类意图数据库
全球新一代数据库产品
php数据库设计入门教程交流
冬奥期间网络安全总结
软件开发与实施控制程序
如何构建企业数据库
网络安全与隐私保护游戏
服务器搭建个人图床
程序软件开发费用
迷你世界服务器卡爆了
百奥网络技术有限公司
嘉定区提供软件开发代理品牌
各级政府是网络安全
遗愿清单软件开发
剑网三 服务器ip
为网络技术学院
文鳐互联网科技公司
数据库泄漏事件
手机怎么会提示验证短信服务器
对未来软件开发方法的展望
泰山 服务器
hcna网络技术学习指南答案
东营服务器运维管理系统设备
合肥安卓智能产品软件开发
数据库综合设计
如何架构缓存数据库
小米商城实训数据库的设计
工信部企业网络安全威胁
文鳐互联网科技公司