本帖最后由 刘泽宇 于 2020-9-13 19:03 编辑
1.环境准备 1.1 创建新的ORACLE_HOME: 1.2 修改参数: 将/etc/sysctl.conf下参数修改为: 通过/sbin/sysctl-p使改动生效 1.3 传输12.1.0.2的安装文件: 1.4 解压文件: 2.安装oracle12.1.0.2
3.源库创建测试数据4.检查无效对象5.校验环境5.1执行检查脚本: 5.2根据提示运行另一个脚本: SQL>@/u01/app/oracle/cfgtoollogs/test/preupgrade/preupgrade_fixups.sql Pre-Upgrade FixupScript Generated on 2020-07-31 20:31:04 Version: 12.1.0.2 Build: 006 BeginningPre-Upgrade Fixups... Executing incontainer TEST ********************************************************************** Check Tag: DEFAULT_PROCESS_COUNT Check Summary:Verify min process count is not too low Fix Summary: Review and increase if needed, yourPROCESSES value. ********************************************************************** Fixup ReturnedInformation: WARNING:--> Process Count may be too low Database has a maximum process count of150 which is lower than the default value of 300 for this release. You should update your processes valueprior to the upgrade to a value of at least 300. For example: ALTER SYSTEM SET PROCESSES=300SCOPE=SPFILE or update your init.ora file. ********************************************************************** ********************************************************************** Check Tag: COMPATIBLE_PARAMETER Check Summary:Verify compatible parameter value is valid Fix Summary: "compatible" parameter must beincreased manually prior to upgrade. ********************************************************************** Fixup ReturnedInformation: ERROR:--> Compatible set too low "compatible" currently set at10.2.0.1.0 and must be set to at least 11.0.0 prior toupgrading the database. Do not make this change until you areready to upgrade because a downgrade back to 10.2 is notpossible once compatible has been raised. Update your init.ora or spfile to makethis change. ********************************************************************** ********************************************************************** Check Tag: OCM_USER_PRESENT Check Summary:Check for OCM schema Fix Summary: Drop the ORACLE_OCM user. ********************************************************************** Fixup Succeeded ********************************************************************** ********************************************************************** Check Tag: EM_PRESENT Check Summary:Check if Enterprise Manager is present Fix Summary: Execute emremove.sql prior to upgrade. ********************************************************************** Fixup ReturnedInformation: WARNING:--> Enterprise Manager Database Control repository found in the database In Oracle Database 12c, Database Controlis removed during the upgrade. To save time during theUpgrade, this action can be done prior to upgrading using thefollowing steps after copying rdbms/admin/emremove.sql from thenew Oracle home - Stop EM Database Control: $> emctl stop dbconsole - Connect to the Database using the SYSaccount AS SYSDBA: SET ECHO ON; SET SERVEROUTPUT ON; @emremove.sql Without the set echo and serveroutputcommands you will not be able to follow the progress of thescript. ********************************************************************** ********************************************************************** Check Tag: REMOVE_DMSYS Check Summary:Check for existance of DMSYS schema Fix Summary: The DMSYS schema is removed as part of theupgrade. ********************************************************************** Fixup ReturnedInformation: WARNING:--> "DMSYS" schema exists in the database The DMSYS schema (Oracle Data Mining) willbe removed from the database during the databaseupgrade. All data in DMSYS will be preserved underthe SYS schema. Refer to the Oracle Data Mining User'sGuide for details. ********************************************************************** ********************************************************************** Check Tag: AMD_EXISTS Check Summary:Check to see if AMD is present in the database Fix Summary: Manually executeORACLE_HOME/oraolap/admin/catnoamd.sql script to remove OLAP. ********************************************************************** Fixup ReturnedInformation: INFORMATION: -->OLAP Catalog(AMD) exists in database Starting with Oracle Database 12c, OLAPCatalog component is desupported. If you are not using the OLAP Catalogcomponent and want to remove it, then execute the ORACLE_HOME/olap/admin/catnoamd.sql scriptbefore or after the upgrade. ********************************************************************** ********************************************************************** Check Tag: PURGE_RECYCLEBIN Check Summary:Check that recycle bin is empty prior to upgrade Fix Summary: The recycle bin will be purged. ********************************************************************** Fixup Succeeded ********************************************************************** ********************************************************************** Check Tag: NACL_OBJECTS_EXIST Check Summary:Check for Network ACL Objects in use Fix Summary: Objects with network acls are displayed andneed to be reviewed. ********************************************************************** Fixup ReturnedInformation: WARNING: --> Existingschemas with network ACLs exist Database contains schemas with objectsdependent on network packages. Refer to the Upgrade Guide forinstructions to configure Network ACLs. ********************************************************************** ********************************************************************** [Pre-UpgradeRecommendations] ********************************************************************** ***************************************** ********* DictionaryStatistics ********* ***************************************** Please gatherdictionary statistics 24 hours prior to upgrading thedatabase. To gatherdictionary statistics execute the following command while connected asSYSDBA: EXECUTE dbms_stats.gather_dictionary_stats; ^^^ MANUAL ACTIONSUGGESTED ^^^ ************************************************** ************* Fixup Summary************ 2 fixup routines were successful. 5 fixup routines returned INFORMATIONAL textthat should be reviewed. 1 ERROR LEVEL check returned INFORMATION thatmust be acted on prior to upgrade. ************************************************************ ====>> USER ACTIONREQUIRED <<==== ************************************************************ 1) Check Tag: COMPATIBLE_PARAMETER failed. Check Summary: Verify compatible parametervalue is valid Fixup Summary: ""compatible" parametermust be increased manually prior to upgrade." ^^^ MANUAL ACTION REQUIRED ^^^ ************************************************** You MUST resolve the above errorprior to upgrade ************************************************** ****************Pre-Upgrade Fixup Script Complete ********************* 5.3处理脚本中出现的问题: 5.4清空aud$表和回收站: 6.运行dbua升级 [oracle@oracle ~]$ cd/u01/app/oracle/product/12.1.0/db_1/bin/ 6.1升级数据库 6.2选择要升级的数据库 6.3检查环境 6.4选项配置 6.5取消勾选EM 6.6默认配置 6.7确认监听 6.8选择已有备份策略 6.9确认信息,开始升级 6.10完成 7.检查验证 7.1更新ORACLE_HOME,查看/etc/oratab下的ORACLE_HOME: cat /etc/oratab 7.2确认数据库版本: 7.3运行更新后需要执行的脚本: SQL>@/u01/app/oracle/cfgtoollogs/test/preupgrade/postupgrade_fixups.sql Post Upgrade Fixup Script Generated on 2020-07-3121:00:38 Version: 12.1.0.2 Build: 006 Beginning Post-Upgrade Fixups... ********************************************************************** Check Tag: INVALID_OBJECTS_EXIST Check Summary: Check for invalid objects Fix Summary: Invalid objects are displayed and must be reviewed. ********************************************************************** Fixup Returned Information: WARNING: --> Database contains INVALIDobjects prior to upgrade The list ofinvalid SYS/SYSTEM objects was written to registry$sys_inv_objs. The list ofnon-SYS/SYSTEM objects was written to registry$nonsys_inv_objs unless there were over 5000. Useutluiobj.sql after the upgrade to identify any new invalid objects due tothe upgrade. ********************************************************************** ********************************************************************** Check Tag: OLD_TIME_ZONES_EXIST Check Summary: Check for use of older timezone data file Fix Summary: Update the timezone using the DBMS_DST package after upgrade iscomplete. ********************************************************************** Fixup Returned Information: INFORMATION: --> Older Timezone in use Database isusing a time zone file older than version 18. After theupgrade, it is recommended that DBMS_DST package be used toupgrade the 12.1.0.2.0 database time zone version to the latestversion which comes with the new release. Please referto My Oracle Support note number 977512.1 for details. ********************************************************************** ********************************************************************** Check Tag: NOT_UPG_BY_STD_UPGRD Check Summary: Identify existing components that will NOTbe upgraded Fix Summary: Thisfixup does not perform any action. ********************************************************************** Fixup Returned Information: This fixup does not perform any action. If you want to upgrade those other components, you mustdo so manually. ********************************************************************** ********************************************************************** [Post-Upgrade Recommendations] ********************************************************************** ***************************************** ******** Fixed Object Statistics ******** ***************************************** Please create stats on fixed objects two weeks after the upgrade using the command: EXECUTEDBMS_STATS.GATHER_FIXED_OBJECTS_STATS; ^^^ MANUAL ACTION SUGGESTED ^^^ ************************************************** ************* Fixup Summary ************ 3 fixup routinesgenerated INFORMATIONAL messages that should be reviewed. *************** Post Upgrade Fixup Script Complete******************** PL/SQL procedure successfully completed. 7.4查看timezone: 7.5检查sys和system用户无效对象: 7.6编译无效对象: SQL> @/u01/app/oracle/product/12.1.0/db_1/rdbms/admin/utlrp.sql TIMESTAMP ----------------------------------------------------------------------------------------------- COMP_TIMESTAMP UTLRP_BGN 2020-07-31 23:03:40 DOC> Thefollowing PL/SQL block invokes UTL_RECOMP to recompile invalid DOC> objectsin the database. Recompilation time is proportional to the DOC> number ofinvalid objects in the database, so this command may take DOC> a longtime to execute on a database with a large number of invalid DOC> objects. DOC> DOC> Use thefollowing queries to track recompilation progress: DOC> DOC> 1. Queryreturning the number of invalid objects remaining. This DOC> number should decrease with time. DOC> SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6); DOC> DOC> 2. Queryreturning the number of objects compiled so far. This number DOC> shouldincrease with time. DOC> SELECT COUNT(*) FROM UTL_RECOMP_COMPILED; DOC> DOC> Thisscript automatically chooses serial or parallel recompilation DOC> based onthe number of CPUs available (parameter cpu_count) multiplied DOC> by thenumber of threads per CPU (parameter parallel_threads_per_cpu). DOC> On RAC,this number is added across all RAC nodes. DOC> DOC> UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel DOC> recompilation. Jobs are created without instance affinity so that they DOC> canmigrate across RAC nodes. Use the following queries to verify DOC> whetherUTL_RECOMP jobs are being created and run correctly: DOC> DOC> 1. Queryshowing jobs created by UTL_RECOMP DOC> SELECT job_name FROM dba_scheduler_jobs DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%'; DOC> DOC> 2. Queryshowing UTL_RECOMP jobs that are running DOC> SELECT job_name FROM dba_scheduler_running_jobs DOC> WHERE job_name like 'UTL_RECOMP_SLAVE_%'; DOC># PL/SQL procedure successfully completed. TIMESTAMP ----------------------------------------------------------------------- COMP_TIMESTAMP UTLRP_END 2020-07-31 23:03:42 DOC> The following query reports the number of objectsthat have compiled DOC> with errors. DOC> DOC> If the number is higher than expected, pleaseexamine the error DOC> messages reported with each object (using SHOWERRORS) to see if they DOC> point to system misconfiguration or resourceconstraints that must be DOC> fixed before attempting to recompile theseobjects. DOC># OBJECTS WITH ERRORS ------------------- 0 DOC> The following query reports the number of errorscaught during DOC> recompilation. If this number is non-zero, pleasequery the error DOC> messages in the table UTL_RECOMP_ERRORS to see ifany of these errors DOC> are due to misconfiguration or resourceconstraints that must be DOC> fixed before objects can compile successfully. DOC># ERRORS DURING RECOMPILATION --------------------------- 0 Function created. PL/SQL procedure successfully completed. Function dropped. PL/SQL procedure successfully completed. 7.7确认组件: 7.4检查之前创建的数据: 至此,数据库已经成功升级到12.1.0.2。
|