生产环境oracle10g升级至11g准备工作

发布时间:2020-08-07 23:45:04 作者:liuhaimiao
来源:ITPUB博客 阅读:168
最近需要生产系统从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. MySQL5.5升级至5.7
  2. oracle 11.2.0.1升级至11.2.0.4

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

11g oracle10g 准备工作

上一篇:GoldenGate 配置

下一篇:卫士通渠道发布会:同迎产业盛世 共享安全未来

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》