Oracle 11201 升级到 11203 示例.docx
《Oracle 11201 升级到 11203 示例.docx》由会员分享,可在线阅读,更多相关《Oracle 11201 升级到 11203 示例.docx(35页珍藏版)》请在冰豆网上搜索。
Oracle11201升级到11203示例
Oracle11.2.0.1升级到11.2.0.3示例
分类:
OracleAdvancedKnowledge
2014/01/1800:
2234views1条回复
Oracle11.2.0.1单实例升级到11.2.0.3。
Oracle升级的步骤都差不多。
先升级Oraclesoftware,然后升级Oracleinstance。
一.查看DB相关的信息
我们安装的是64位的DB。
[oracle@dave~]$sqlplus/assysdba;
SQL*Plus:
Release11.2.0.1.0ProductiononWedSep2810:
23:
512011
Copyright(c)1982,2009,Oracle.Allrightsreserved.
Connectedto:
OracleDatabase11gEnterpriseEditionRelease11.2.0.1.0-64bitProduction
WiththePartitioning,OLAP,DataMiningandRealApplicationTestingoptions
SQL>selectnamefromv$database;
NAME
———
ANQING
查看Oracle是32位还是64位的方法
二.升级的相关说明
2.1Patchset的说明
这部分内容copy自patchset的readme文档。
OracleDatabasepatchset,release11.2.0.3(11.2.0.2)isafullinstallationoftheOracleDatabasesoftware.ThismeansthatyoudonotneedtoinstallOracleDatabase11gRelease2(11.2.0.1)beforeinstallingOracleDatabase11gRelease2(11.2.0.3/11.2.0.2).
Oracle11.2.0.2和11.2.0.3的patchset都是完整的安装包。
所以可以直接用来安装。
Notethefollowingchangeswiththenewpatchsetpackaging:
(1)Newinstallationsconsistofinstallingthemostrecentpatchset,ratherthaninstallingabasereleaseandthenupgradingtoapatchrelease.
(2)Directupgradesfrompreviousreleasestothemostrecentpatchsetaresupported.
(3)Out-of-placepatchsetupgradesrecommended,inwhichyouinstallthepatchsetintoanew,separateOraclehome.In-placeupgradesaresupported,butnotrecommended.
2.1.1In-PlaceUpgrade
ThisfeatureenablesyoutoupgradeanexistinginstallationofOracledatabasetoOracleDatabase11gRelease2(11.2.0.3)intothesameOraclehomedirectorybyreplacingtheexistingdatabasefiles.Thepatchsetapplicationrequiresmoredowntimeandisnotrecommended.Thisupgradetyperequireslessdiskspace.
将升级文件安装到原来的Oraclehome目录,这样可以节省磁盘空间,但是需要更多的downtime。
这种并不推荐。
2.1.2Out-of-PlaceUpgrade
ThisfeatureenablesyoutoinstallOracleDatabase11gRelease2(11.2.0.3)inanew,separateOraclehomedirectory.Aftertheinstallationiscomplete,thedatafromthedatabaseintheoldOraclehomedirectoryismigratedtothedatabaseinthenewOraclehomedirectory.
可以将OracleDatabase安装的新的OracleHomedirectory,当安装结束后,旧的database会迁移到新的Oraclehomedirectory。
Out-of-placeupgradeprocessissimilartoOracledatabaseupgradefromoneversiontoanotherandistherecommendedtype.Thebenefitsofthisupgradetypeisthatthepatchsetapplicationrequiresmuchlessdowntime,andissaferwhenthepatchsetapplicationmustbeaborted.ThisupgradetyperequiresmorediskspacetoaccommodatetwoOraclehomedirectoriessimultaneously.
这种方法是oracle推荐的方式,它可以降低downtime时间,也相对更安全。
但是这种方法需要2倍的地盘空间,不过对与现在白菜价硬盘来说,这点空间也不算什么了。
2.2升级步骤
Oracle10g的Readme上有详细的升级步骤,但是11g的Readme上并没有详细的升级说明,需要参考官方文档。
Oracle10gupgradefrom10.2.0.1to10.2.0.4
(1)备份数据库
(2)运行patchset,升级oracle软件
(3)准备新的ORACLE_HOME
(4)运行dbua或者脚本升级实例
(5)检查升级后的版本信息和无效对象
官网地址:
UpgradingtotheNewRelease
我这里也是一个单实例的升级,相对较简单,如果是RAC的升级,估计还要费劲一点,11gR2RAC升级后面会继续进行测试。
三.具体升级操作
3.1备份DB
我这里是测试环境,就不进行备份,如果是生产环境,切记要先备份,后操作。
如果是In-PlaceUpgrade,同时备份一下整个ORACLE_HOME目录。
如果升级有问题,还可以还原回来。
重点是如下目录:
ORACLE_HOME/dbs
ORACLE_HOME/network/admin
ORACLE_HOME/hostname_dbname
ORACLE_HOME/oc4j/j2ee/OC4J_DBConsole_hostname_dbname
3.2升级Oracledatabase软件
运行Patchset的runInstaller。
注意这里,我们选择第三个选项,skipsoftwareupdate,因为我们的patchset已经下载过了,如果选择第二个选项,会遇到如下错误,
INS-20704Thelocationprovidedisnotintheexpecteddirectorystructure
Oracle给的解决方式是用如下命令来执行:
./runInstaller–downloadUpdates
但是这个命令需要收费的Metalink帐号。
MOS的相关文档:
HowToDownloadTheLatestUpdatesAndPatchesUsing11.2.0.2OUI[ID1295074.1]
Error:
INS-20704WhileInstalling11.2.0.2with"Usepre-downloadedsoftwareupdates"Option[ID1265270.1]
这里要注意,我们之前讲过11gR2的Patchset可以直接用来安装。
在这个界面就可以选择操作类型,这个功能比较方便,从而也导致patchset越来越大,我们这里选择upgradeanexistingdatabase。
注意这里的安装位置,我之前的安装目录是11.2.0.这里我改成了11.2.0.3.即将oracle安装到其他位置,这样可以减少宕机时间,也是oracle推荐的方法。
注意这里的Inventorydirectory,这里用来存放安装文件的,我们之前安装过DB,所以这个目录已经存在,2种解决方法,删除之前的目录,二放到其他目录,我这里将安装文件存放到其他目录。
[root@daveoraInventory]#/u01/app/oraInventory2/orainstRoot.sh
Changingpermissionsof/u01/app/oraInventory2.
Addingread,writepermissionsforgroup.
Removingread,write,executepermissionsforworld.
Changinggroupnameof/u01/app/oraInventory2tooinstall.
Theexecutionofthescriptiscomplete.
[root@daveoraInventory]#/u01/app/oracle/product/11.2.0.3/db_1/root.sh
PerformingrootuseroperationforOracle11g
Thefollowingenvironmentvariablesaresetas:
ORACLE_OWNER=oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/db_1
Enterthefullpathnameofthelocalbindirectory:
[/usr/local/bin]:
Copyingdbhometo/usr/local/bin…
Copyingoraenvto/usr/local/bin…
Copyingcoraenvto/usr/local/bin…
Entrieswillbeaddedtothe/etc/oratabfileasneededby
DatabaseConfigurationAssistantwhenadatabaseiscreated
Finishedrunninggenericpartofrootscript.
Nowproduct-specificrootactionswillbeperformed.
Finishedproduct-specificrootactions.
这里会提示我们配置监听,因为监听之前已经存在,所以这里取消监听配置。
我们点击下一步时,会提示一些配置失败,是否继续,我们点是。
结束Oracledatabase软件的安装。
从上面来看,如果没有错误,在监听配置完毕会,会自动调用DBUA来升级我们的实例。
这里我们配置失败,正好验证下手工升级实例。
3.3配置新的ORACLE_HOME
这部分工作,主要是准备新的ORACLE_HOME,因为我们的Oracledatabase安装到了新的位置,所以我们需要配置一下相关的信息。
这部分即使在上面自动调用了DBUA,我们也还是需要进行操作的。
Afterbackingupthedatabasetobeupgraded,preparethenewOraclehomeinanewlocation.DothisforanyreleaseofOracleDatabaseforwhichyouareupgrading,whetherthedatabaseisrelease11.2orearlier.StartingwithOracleDatabase11gRelease2(11.2.0.2),youinstalltheOracleGridInfrastructureandOracleDatabasesoftwareintoanewOraclehomeinsteadofapplyingapatchsettotheexistingOraclehome.
TopreparethenewOraclehome:
1.CopyconfigurationfilesfromtheOraclehomeofthedatabasebeingupgradedtothenewOracleDatabase11gRelease2(11.2)Oraclehome:
(1)Ifyourparameterfileresideswithintheoldenvironment'sOraclehome,thencopyittothenewOraclehome.Bydefault,OraclelooksfortheparameterfileintheORACLE_HOME/dbsdirectoryonLinuxorUNIXplatformsandintheORACLE_HOME\databasedirectoryonWindowsoperatingsystems.Theparameterfilecanresideanywhereyouwish,butitshouldnotresideintheoldenvironment'sOraclehomeafteryouupgradetoOracleDatabase11gRelease2(11.2).
(2)IfyourparameterfileresideswithinanOracleASMinstance,thenbackuptheparameterfileusingthefollowingcommand:
CREATEpfileFROMspfile;
IfyoumustdowngradethedatabaseandyourSPFILEresidedwithinOracleASM,thentheparameterfilemustberestoredbeforethedowngrade.
(3)Ifyourparameterfileisatext-basedinitializationparameterfilewitheitheranIFILE(includefile)oraSPFILE(serverparameterfile)entry,andthefilespecifiedintheIFILEorSPFILEentryresideswithintheoldenvironment'sOraclehome,thencopythefilespecifiedbytheIFILEorSPFILEentrytothenewOraclehome.ThefilespecifiedintheIFILEorSPFILEentrycontainsadditionalinitializationparameters.
(4)Ifyouhaveapasswordfilethatresideswithintheoldenvironment'sOraclehome,thenmoveorcopythepasswordfiletotheOracleDatabase11gRelease2(11.2)Oraclehome.
Thenameandlocationofthepasswordfileareoperatingsystem-specific.OnLinuxorUNIXplatforms,thedefaultpasswordfileisorapwsid,locatedintheORACLE_HOME/dbsdirectory.OnWindowsoperatingsystems,thedefaultpasswordfileispwdsid.ora,locatedintheORACLE_HOME\databasedirectory.Inbothcases,sidisyourOracleinstanceID.
(5)Ifyouareupgradingaclusterdatabaseandyourinitdb_name.orafileresideswithintheoldenvironment'sOraclehome,thenmoveorcopytheinitdb_name.orafiletothenewOraclehome.
Note:
Ifyouareupgradingaclusterdatabase,thenperformthissteponallnodesinwhichthisclusterdatabasehasinstancesconfigured.
2.AdjustyourparameterfileinOracleDatabase11gRelease2(11.2)bycompletingthefollowingsteps:
(1)Removeobsoleteinitializationparametersandadjustdeprecatedinitializationparameters.CertainparametersareobsoleteinOracleDatabase11gRelease2(11.2),whileotherparametershavebecomedeprecated.RemoveallobsoleteparametersfromanyparameterfilethatstartsanOracleDatabase11gRelease2(11.2)instance.ObsoleteparametersmightcauseerrorsinOracleDatabase11gRelease2(11.2).Also,alteranyparameterwhosesyntaxhaschangedinthenewrelease.
ThePre-UpgradeInformationTooldisplaysanydeprecatedparametersandobsoleteparametersitfindsintheDeprecatedParametersandObsoleteParameterssections,respectively.
(2)MakesuretheCOMPATIBLEinitializationparameterisproperlysetforOracleDatabase11gRelease2(11.2).ThePre-UpgradeInformationTooldisplaysawarningintheDatabasesectionifCOMPATIBLEisnotproperlyset.
(3)AdjustthevaluesoftheinitializationparameterstoatleasttheminimumvaluesindicatedbythePre-UpgradeInformationTool.
(4)Makesureallpathnamesintheparameterfilearefullyspecified.Youshouldnothaverelativepathnamesintheparameterfile.
(5)IftheparameterfilecontainsanIFILEentry,thenchangetheIFILEentryintheparameterfiletopointtothenewlocationoftheincludefilethatyouspecifiedinStep1.c.Then,editthefilespecifiedintheIFILEentryinthesamewaythatyoueditedtheparameterfileinStepathroughStepd.
(6)Ifyouareupgradingaclusterdatabase,thenmodifytheinitdb_name.orafileinthesamewaythatyoumodifiedtheparameterfile.
Makesureyousaveallofthefilesyoumodifiedaftermakingtheseadjustments.
3.Ifyo