重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 21|回复: 0

[升级] oracle10.2.0.5直升12.1.0.2

[复制链接]
发表于 6 天前 | 显示全部楼层 |阅读模式
本帖最后由 刘泽宇 于 2020-9-13 19:03 编辑

1.环境准备
         1.1 创建新的ORACLE_HOME:
629765f5dfa4275e11.png
         1.2 修改参数:
         /etc/sysctl.conf下参数修改为
54765f5dfa52edc75.png
    通过/sbin/sysctl-p使改动生效
         1.3 传输12.1.0.2的安装文件:
768095f5dfa7d01780.png
         1.4 解压文件:
627365f5dfa83d9232.png
2.安装oracle12.1.0.2
595175f5dfaa3991d5.png
598885f5dfaa818fed.png
275445f5dfaaeba625.png
159315f5dfab3bbd85.png
521695f5dfab8b9a7e.png
816335f5dfabd20f26.png
644575f5dfac1970d7.png
93945f5dfac6f00ca.png
841095f5dfacbd4d3d.png
566965f5dfad0e567b.png
951635f5dfaddd5fe8.png
408525f5dfae2c4e4e.png

3.源库创建测试数据
    450745f5dfafc981c2.png
4.检查无效对象
203855f5dfb037b971.png
5.校验环境
5.1执行检查脚本:
594375f5dfb0d0b994.png
    197145f5dfb13aad1a.png
    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处理脚本中出现的问题:
997745f5dfb28208c2.png
469265f5dfb2bc7c19.png
512145f5dfb32eee0a.png
    5.4清空aud$表和回收站:
303695f5dfb43b157e.png
6.运行dbua升级
    [oracle@oracle ~]$ cd/u01/app/oracle/product/12.1.0/db_1/bin/
    6.1升级数据库
307095f5dfb4c704ba.png
    6.2选择要升级的数据库
740595f5dfb5310fd3.png
    6.3检查环境
545395f5dfb599c9de.png
    6.4选项配置
101545f5dfb5ee981f.png
    6.5取消勾选EM
778465f5dfb6580134.png
    6.6默认配置
850195f5dfb6c1e266.png
    6.7确认监听
916955f5dfb71583aa.png
    6.8选择已有备份策略
49395f5dfb767ebe0.png
    6.9确认信息,开始升级
158845f5dfb7bd2181.png
501615f5dfb816a2e4.png
    6.10完成
548045f5dfb86dbdb1.png
957485f5dfb8e5a2ba.png
7.检查验证
    7.1更新ORACLE_HOME,查看/etc/oratab下的ORACLE_HOME:
904515f5dfb961b7c5.png
    cat /etc/oratab
723245f5dfb9d36e26.png
    7.2确认数据库版本:
23755f5dfba2cc5d6.png
    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:
826055f5dfbad7e77a.png
    7.5检查sys和system用户无效对象:
293835f5dfbb2051fc.png
    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确认组件:
488445f5dfbbc64a3b.png
    7.4检查之前创建的数据:
981265f5dfbc1a364a.png
至此,数据库已经成功升级到12.1.0.2。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2020-9-19 07:45 , Processed in 0.151705 second(s), 24 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表