Upgrade database using dbua.docx
《Upgrade database using dbua.docx》由会员分享,可在线阅读,更多相关《Upgrade database using dbua.docx(20页珍藏版)》请在冰豆网上搜索。
Upgradedatabaseusingdbua
Patchdatabasefrom11.2.0.1to11.2.0.2usingDBUA
Recommenddbuatoupgradethedatabaseasittakescareofcopyingtheinit.orafiles,passwordfileandalsomodifiedtheOCRtopointtoneworaclehomeandupgradedsrvctlversion.OracleUpgradechecklistdoesnotlistanymethoddocumentingstepstobetakenforsrvctl.
TARGETS:
DB_NAME
VERSION
RACORNOT
NODE
NOTE
GENRAC
11.2.0.1.0
yes
xlsnd100/xlsnd101
GENERAL
11.2.0.1.0
no
xlsnd100
QCKTST
11.2.0.1.0
no
xlsnd100
VTEST
11.2.0.1.0
no
xlsnd100
RAT
11.2.0.1.0
no
xlsnd101
Requirementsandrecommendationsfortargetdatabase
•BACKUPbinaries(option)
--tarcvfTarget.tar$OH
•Downloadandinstallthe11gR2binariestoanew$OH,makesuretherearenorelinkerrors(fullrelease,out-of-placeupgrade,softwareonlyinstall)
•InstallthelatestavailablePatchsetfromMetalink.(Ifavailable).
•Installthelatestopatchavailableforyourplatformanddatabaseversion(Ifavailable)
•InstallthelatestavailableCriticalPatchUpdate.(Ifavailable).
•EithertakeaColdorHotbackupofyoursourcedatabase(advisabletohavecoldbackup).
DatabaseUpgradeProcessUsingDBUA
Pre-UpgradeSteps
Step1
Checkthatalldatabasecomponentsonthe10gdatabasearevalidandcheckdatabaseobjectsusingbelowSQL:
set pagesize500
set linesize 100
select substr(comp_name,1,40) comp_name, status, substr(version,1,10) version from
dba_registry order by comp_name;
select substr(object_name,1,40) object_name,substr(owner,1,15) owner,object_type from
dba_objects where status='INVALID' order by owner,object_type;
select owner,object_type,count(*) from dba_objects where status='INVALID' group by
owner,object_type order by owner,object_type;
Iftherearesomeinvalidobjects,execute@?
/rdbms/admin/utlrp.sqltovalidthem.
Step2
EnsurethatyoudonothavetheduplicateobjectsintheSYSandSYSTEMschemabyrunningbelowSQL:
select object_name, object_type
from dba_objects
where object_name||object_type in
(select object_name||object_type
from dba_objects
where owner = 'SYS')
and owner = 'SYSTEM';
Exceptiontothisrulethefollowingobjectsarepermissibleduplicatesobjects
OBJECT_NAMEOBJECT_TYPE
-------------------------------------------------
AQ$_SCHEDULESTABLE
AQ$_SCHEDULES_PRIMARYINDEX
DBMS_REPCAT_AUTHPACKAGE
DBMS_REPCAT_AUTHPACKAGEBODY
Pleasereferthefollowingarticleforcompleteinstructionstoremoveanyotherduplicates.
NOTE.1030426.6HOWTOCLEANUPDUPLICATEOBJECTSOWNEDBYSYSANDSYSTEM
Step3
RunthePre-UpgradeInformationToolforCollectingPre-UpgradeInformation
TodownloadthelatestPre-UpgradeInformationToolcheckscript:
SeeNote884522.1
ORafterinstall11.2.0.2:
$11202_HOME/rdbms/admin/utlu112i.sql
$ sqlplus '/ as sysdba'
SQL> spool upgrade_info.log
SQL> @utlu112i.sql
SQL> spool off
Checkthespoolfileandexaminetheoutputoftheupgradeinformationtool.Pleaselookupmetalinkdocument[ID837570.1]tolearnthemeaningofthespoolfile.
Note:
Ifsysauxwascreatedin9ithenitmustbedroppedandre-createdafterstartinginthenewrelease.Ifcreatedin10Gorlaterthenitcanbeleftthereandused.
Step4
Checkfortheintegrityofthesourcedatabasepriortostartingtheupgradebydownloadingandrunningdbupgdiag.sqlscriptfrombelowMyOracleSupportarticle
Note556610.1 ScripttoCollectDBUpgrade/MigrateDiagnosticInformation(dbupgdiag.sql)
SQL>Sqlplus/assysdba
SQL>@dbupgdiag.sql
PROMPTEnterlocationforSpooledoutput:
Whenitcompleted,pleasecheckthespoolfile.
Ifthedbupgdiag.sqlscriptreportsanyinvalidobjects,run$ORACLE_HOME/rdbms/admin/utlrp.sql(multipletimes)tovalidatetheinvalidobjectsinthedatabase,untilthereisnochangeinthenumberofinvalidobjects.
Aftervalidatingtheinvalidobjects,re-rundbupgdiag.sqlinthedatabaseonceagainandmakesurethateverythingisfine.
Step5
ChecksforTIMESTAMPWITHTIMEZONEDatatype
--Applying11.2.0.2on11.2.0.1,usingOut-of-placeupgrade-installthe11.2.0.2patchsetintoanew,separateOraclehomelocation.
Note:
TheTIMESTAMPWITHTIMEZONEdatastoredinthedatabasecanbecomecorruptedduringtheupgradeifthereisatimezonefileversionmismatch.
Checkthecurrentversionofthe11.2.0.1OracleRDBMStimezonedefinitions-thisneedstobedoneforALLdatabasesinthe11.2.0.1home:
SQL>conn/assysdba
Connected.
SQL>SELECTversionFROMv$timezone_file;
VERSION
----------
14
DB_NAME
TZ_VERSION
ACTION
NOTE
GENRAC
11
5a)
GENERAL
11
5a)
QCKTST
11
5a)
VTEST
11
5a)
RAT
11
5a)
5a)theresultis14orlower
Note:
Everydatabasein11.2.0.1homeneedstobechecked,ifoneormorehasaresulthigherthan14youneedtofollowstep5b)
IfyourcurrentRDBMStimetimezoneversionisDSTv14orlower, install11.2.0.2inanewhomeandupdatethe11.2.0.1databaseto11.2.0.2.
YoucanskipanyDSTrelatedsectionsinthepatchsetdocumentation,thereisnoneedtoapplyDSTpatchesorcheckforDSTissuesfortheupdateto11.2.0.2
The11.2.0.2RDBMSDSTversionaftertheupdateto11.2.0.2willbethesameasyou11.2.0.1system.
Aftertheupgradeto11.2.0.2youcan
*(recommended)updatetoDSTv14byfollowingNote977512.1UpdatingtheRDBMSDSTversionin11gR2(11.2.0.1andup)usingDBMS_DST
*(optional)updatetoahigherDSTthanDSTv14versionifthisisneeded.
ThelatestavailableDSTpatchisfoundinNote412160.1UpdatedDSTtransitionsandnewTimeZonesinOracleTimeZoneFilepatches
5b)theresultishigherthan14
IfyourcurrentRDBMStimetimezoneversionishigherthen14,youneedtore-applythesameRDBMSDSTversionasfoundinqueryafterinstallingthe11.2.0.2softwareinthenewOracle_home.Orinotherwords,youneedtoapplythe11.2.0.2RDBMSDSTpatchforthesameDSTversionbeforeopeningthedatabaseinthenew11.2.0.2softwarehome.
Wesuggesttoapplythe11.2.0.2RDBMSDSTpatchafterinstallingthe11.2.0.2softwarewiththeOracleUniversalinstaller.
IfyoualsoneedtopatchtheOJVMthenwesuggesttoapplythelatestDSTOJVMfixfor11.2.0.2,evenifyourcurrentRDBMSDSTpatchislower.ThisisbestdonerightafterinstallingtheRDBMSDSTpatch,noneedtofollowtheOJVMDSTpatchreadmeinstructionsasthereisnodatabaseyet.
FortheactualOJVMandRDBMSDSTpatchesforyour11.2.0.2releasepleaseseeNote412160.1UpdatedTimeZonesinOracleTimeZoneFilepatches
AfterinstallingthesameRDBMS(andtheOJVM-whichmaybethelastest/higherthantheRDBMSDSTversion)DSTpatchinthe11.2.0.2ORACLE_HOMEupgradeto11.2.0.2withoutanyactiononTSLTZorTSTZdata.Followtheupgradeorpatchsetapplyinstructions,youcanskipanyDSTrelatedsections.
The11.2.0.2RDBMSDSTversionaftertheupgradeto11.2.0.2willbethesameDSTversionasusedinthe11.2.0.1OracleRDBMS.
Aftertheupgradeto11.2.0.2youcancheckifthereisanewerDSTversionoutand,ifneeded,updatetothisDSTversion.
ThelatestavailableDSTversionisfoundinNote412160.1UpdatedDSTtransitionsandnewTimeZonesinOracleTimeZoneFilepatches
Step6
CheckthatNationalCharacterset(NLS_NCHAR_CHARACTERSET)isUTF8andAL16UTF16:
selectvaluefromNLS_DATABASE_PARAMETERSwhereparameter='NLS_NCHAR_CHARACTERSET';
IfthisisUTF8orAL16UTF16thennoactionisneeded.
IfisnotUTF8orAL16UTF16thenreferthefollowingarticle
Note276914.1TheNationalCharacterSetinOracle9iand10g.
Step7
OptimizerStatistics
WhenupgradingtoOracleDatabase11gRelease2(11.2),optimizerstatisticsarecollectedfordictionarytablesthatlackstatistics.Thisstatisticscollectioncanbetimeconsumingfordatabaseswithalargenumberofdictionarytables,butstatisticsgatheringonlyoccursforthosetablesthatlackstatisticsoraresignificantlychangedduringtheupgrade.
Todeterminetheschemaswhichlackstatistics-reviewtheoutputoftheutlu112i.sqlscript.
Todecreasetheamountofdowntimeincurredwhencollectingstatistics,youcancollectstatisticspriortoperformingtheactualdatabaseupgrade.AsofOracleDatabase10gRelease1(10.1),OraclerecommendsthatyouusetheDBMS_STATS.GATHER_DICTIONARY_STATSproceduretogatherthesestatistics.Forexample,youcanenterthefollowing:
$ sqlplus "/as sysdba"
SQL> EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;
Step8
DisableOracleDatabaseVault
DB_NAME
OracleDatabaseVault
NOTE:
GENRAC
Nofoundinstalled.
Noactionrequired
GENERAL
Nofoundinstalled.
Noactionrequired
QCKTST
Nofoundinstalled.
Noactionrequired
VTEST
Nofoundinstalled.
Noactionrequired
RAT
Nofoundinstalled.
Noactionrequired
Step9
BackingupEnterpriseManagerDatabaseControlData
AfterupgradingtoOracleDatabase11grelease2(11.2),ifyouwanttodowngradeOracleEnterpriseManagerDatabaseControlyoumustsaveyourDatabaseControlfilesanddatabeforeupgradingyourdatabase.Theemdwgrdutilitycanbeusedtokeepacopyofyourdatabasecontrolfilesanddatabeforeupgradingyourdatabase.TheemdwgrdutilityresidesintheORACLE_HOME/bindirectoryintheOracleDatabase11grelease2(11.2)home.
DB_NAME
EnterpriseManagerDatabaseControlorNot
Note
GENRAC
YES-OracleEnterpriseManager
Step5b,6
GENERAL
YES-OracleEnterpriseManager
QCKTST
NO
VTEST
NO
RAT
YES-OracleEnterpriseManager
1.SetORACLE_HOMEtoyouroldOraclehome
2.SetORACLE_SIDtotheSIDofthedatabasebeingupgraded.
3.SetPATH,LD_LIBRARY_PATHandSHLIB_PATHtopointtotheSource/oldOraclehome.
4.GotothetargetOracleDatabaseReleasehome