ORACLE 11.2.0.4 升级至19C

ORACLE 19C安装部署忽略

参考:
https://blog.csdn.net/weixin_42955647/article/details/108139740

ORACLE 11.2.0.4 升级至19C
1.运行预升级脚本,根据提示完成升级前设置

输出11g的环境变量,运行预升级脚本
export ORACLE_HOME=/u01/app/oracle/product/11.2/db_1
/u01/app/oracle/product/19.3/db_1/jdk/bin/java -jar /u01/app/oracle/product/19.3/db_1/rdbms/admin/preupgrade.jar TERMINAL TEXT

脚本输出内容如下:

[oracle@upgrade-test ~]$ /u01/app/oracle/product/19.3/db_1/jdk/bin/java -jar /u01/app/oracle/product/19.3/db_1/rdbms/admin/preupgrade.jar TERMINAL TEXT
Report generated by Oracle Database Pre-Upgrade Information Tool Version
19.0.0.0.0 Build: 1 on 2020-08-25T14:22:15

Upgrade-To version: 19.0.0.0.0

=======================================
Status of the database prior to upgrade
=======================================
      Database Name:  CIM
     Container Name:  Not Applicable in Pre-12.1 database
       Container ID:  Not Applicable in Pre-12.1 database
            Version:  11.2.0.4.0
     DB Patch Level:  PSU 11.2.0.4.181016
         Compatible:  11.2.0.0.0
          Blocksize:  8192
           Platform:  Linux x86 64-bit
      Timezone File:  4
  Database log mode:  ARCHIVELOG
           Readonly:  FALSE
            Edition:  EE

  Oracle Component                       Upgrade Action    Current Status
  ----------------                       --------------    --------------
  Oracle Server                          [to be upgraded]  VALID         
  JServer JAVA Virtual Machine           [to be upgraded]  VALID         
  Oracle XDK for Java                    [to be upgraded]  VALID         
  Oracle Workspace Manager               [to be upgraded]  VALID         
  OLAP Analytic Workspace                [to be upgraded]  VALID         
  Oracle Enterprise Manager Repository   [to be upgraded]  VALID         
  Oracle Text                            [to be upgraded]  VALID         
  Oracle XML Database                    [to be upgraded]  VALID         
  Oracle Java Packages                   [to be upgraded]  VALID         
  Oracle Multimedia                      [to be upgraded]  VALID         
  Oracle Spatial                         [to be upgraded]  VALID         
  Data Mining                            [to be upgraded]  VALID         
  Expression Filter                      [to be upgraded]  VALID         
  Rule Manager                           [to be upgraded]  VALID         
  Oracle OLAP API                        [to be upgraded]  VALID         

==============
BEFORE UPGRADE
==============

  REQUIRED ACTIONS
  ================
  1.  (AUTOFIXUP) You must upgrade Oracle-Maintained tables using prior
      versions of evolved types. Use ALTER TABLE ... UPGRADE INCLUDING DATA.
      
      There is object type data in Oracle-Maintained tables that has not been
      upgraded to the latest version of an evolved object type.
      
      To prevent data loss during database upgrade, all object type columns in
      tables owned by Oracle-Supplied users must be current prior to the
      upgrade or plugin.

  2.  (AUTOFIXUP) Empty the RECYCLEBIN immediately before database upgrade.
      
      The database contains 295 objects in the recycle bin.
      
      The recycle bin must be completely empty before database upgrade.

  RECOMMENDED ACTIONS
  ===================
  3.  Remove the EM repository.
      
      - Copy the $ORACLE_HOME/rdbms/admin/emremove.sql script from the target
      19 ORACLE_HOME into the source 11.2.0.4.0 ORACLE_HOME.
      
      Step 1: If database control is configured, stop EM Database Control,
      using the following command
      
        $> emctl stop dbconsole
      
      Step 2: Connect to the database using the SYS account AS SYSDBA
      
        SET ECHO ON;
        SET SERVEROUTPUT ON;
        @emremove.sql
      
      Without the set echo and serveroutput commands, you will not be able to
      follow the progress of the script.
      
      The database has an Enterprise Manager Database Control repository.
      
      Starting with Oracle Database 12c, the local Enterprise Manager Database
      Control does not exist anymore. The repository will be removed from your
      database during the upgrade.  This step can be manually performed before
      the upgrade to reduce downtime.

  4.  Run 11.2.0.4.0 $ORACLE_HOME/rdbms/admin/utlrp.sql to recompile invalid
      objects.  You can view the individual invalid objects with
      
        SET SERVEROUTPUT ON;
        EXECUTE DBMS_PREUP.INVALID_OBJECTS;
      
      79 objects are INVALID.
      
      There should be no INVALID objects in SYS/SYSTEM or user schemas before
      database upgrade.

  5.  Remove OLAP Catalog by running the 11.2.0.4.0 SQL script
      $ORACLE_HOME/olap/admin/catnoamd.sql script.
      
      The OLAP Catalog component, AMD, exists in the database.
      
      Starting with Oracle Database 12c, the OLAP Catalog (OLAP AMD) is
      desupported and will be automatically marked as OPTION OFF during the
      database upgrade if present. Oracle recommends removing OLAP Catalog
      (OLAP AMD) before database upgrade.  This step can be manually performed
      before the upgrade to reduce downtime.

  6.  Explicitly set RESOURCE_LIMIT to FALSE in the pfile/spfile to retain the
      previous behavior.
      
      the RESOURCE_LIMIT initialization parameter is not explicitly set in the
      pfile/spfile.
      
      The RESOURCE_LIMIT initialization parameter default value changed from
      FALSE to TRUE in 12.1.0.2 onwards.  Without an explicit setting, the
      upgrade may introduce unintented RESOURCE_LIMIT enforcement.

  7.  Backup the existing ACLs and their assignments for reference. Use the new
      DBMS_NETWORK_ACL_ADMIN interfaces and dictionary views to administer
      network privileges after upgrade.
      
      The database contains network ACLs with privileges that will be migrated
      to a new format in 12c.
      
      Network access control list (ACL) privileges in 11g will be migrated to a
      new format in 12c. As part of the migration, new DBMS_NETWORK_ACL_ADMIN
      interfaces and dictionary views are provided, and privileges in the
      existing ACLs will be converted to the new format with new ACL names. The
      old ACL names, DBMS_NETWORK_ACL_ADMIN interfaces and dictionary views may
      continue to be used but are deprecated and their use is discouraged. For
      further information, refer to My Oracle Support note number 2078710.1.

  8.  Perform one of the following:
       1) Expire user accounts that use only the old 10G password version and
      follow the procedure recommended in Oracle Database Upgrade Guide under
      the section entitled, "Checking for Accounts Using Case-Insensitive
      Password Version".
       2) Explicitly set SQLNET.ALLOWED_LOGON_VERSION_SERVER in the 19
      SQLNET.ORA to a non-Exclusive Mode value, such as "11". (This is a short
      term approach and is not recommended because it will retain known
      security risks associated with the 10G password version.)
      
      Your database system has at least one account with only the 10G password
      version (see the PASSWORD_VERSIONS column of DBA_USERS).
      
      Starting with Oracle Database release 12.2.0.1, Exclusive Mode is the new
      default password-based authentication mode. All Exclusive Mode
      login/authentication attempts will fail for preexisting user accounts
      which only have the 10G password version and neither the 11G or 12C
      password version (see DBA_USERS.PASSWORD_VERSIONS.) For more information,
      refer to "Understanding Password Case Sensitivity and Upgrades" in the
      Oracle Database Upgrade Guide.

  9.  (AUTOFIXUP) If you plan on continuing to use the Oracle mitigation patch
      instead of installing the Oracle recommended Oracle JavaVM (OJVM) Patch
      Set Update (PSU), then you should enable Java development just before
      upgrade using the command:
      
       EXECUTE SYS.DBMS_JAVA_DEV.ENABLE;
      
      Taking this action will make your database subject to a known security
      vulnerability, but without the PSU patch, Java development must still be
      enabled to allow some upgrade actions to complete. The execution of the
      fixup provided by this check in the preupgrade_fixups.sql script will
      enable Java development. Extreme caution is advised.
      
      The temporary OJVM Mitigation patch is currently installed and active in
      the database, securing it against the known threat but disabling Java
      development until you can install the latest OJVM PSU.
      
      The upgrade may fail if Java development is disabled.  When active, the
      OJVM Mitigation patch disables Java development in the database.  Oracle
      strongly recommends installing the latest OJVM PSU in both the 11.2.0.4.0
      and 19 ORACLE_HOMEs which will eliminate the need for the mitigation
      patch.  Doing that in 19 will not incur any database downtime and will
      eliminate the same vulnerability during the next upgrade.  If you cannot
      apply the OJVM PSU, you may opt to retain the mitigation patch in
      11.2.0.4.0, but Java development still must be enabled during the
      upgrade.  Please refer to MOS note 1929745.1 for more details.

  10. Remove the SEC_CASE_SENSITIVE_LOGON instance initialization parameter
      setting, to configure your system to use case sensitive password
      authentication by default.
      
      Your database system is configured to enforce case insensitive password
      authentication (the SEC_CASE_SENSITIVE_LOGON instance initialization
      parameter setting is FALSE).
      
      Starting with Oracle Database release 12.2, Exclusive Mode is the default
      password-based authentication mode. Case insensitive password
      authentication is not supported in Exclusive Mode. If your system needs
      to use case insensitive password authentication, Exclusive Mode must be
      switched off prior to the upgrade. See the Network Reference Manual
      chapter about the SQLNET.ORA parameter
      SQLNET.ALLOWED_LOGON_VERSION_SERVER for more details on Exclusive Mode.

  11. Remove Streams setup. For detailed steps, refer to the section "Removing
      an Oracle Streams Configuration" in the Oracle Streams Concepts and
      Administration Guide specific for the Oracle release from which you are
      removing. For versions pre-12.1.0.2, the procedure
      dbms_streams_adm.remove_streams_configuration must not be used as may
      lead to unwanted results. Instead, use the other procedures
      (dbms_capture_adm.drop_capture, dbms_apply_adm.drop_apply,
      dbms_streams_adm.remove_queue, etc). For 12.1.0.2 and higher, procedure
      dbms_streams_adm.remove_streams_configuration can be safely used.
      
      Oracle Streams feature is configured in the database.
      
      Starting with Oracle Database 19, Oracle Streams is desupported. It is
      strongly advised to remove any streams configuration manually.

  12. Fix the metadata for the DBMS_JOB jobs listed below before upgrading the
      database to ensure these jobs can be properly re-created, or drop them if
      no longer needed. For reference, check the section "Summary of DBMS_JOB
      Subprograms" in the Oracle Database PL/SQL Packages and Types Reference
      documentation.
      
      183 has an invalid powner field: IMTRFID 
      
      
      There are jobs created using DBMS_JOB package with invalid metadata.
      These jobs cannot be re-created successfully during database upgrade
      process.
      
      Starting with Oracle Database 19c, jobs created and managed through
      DBMS_JOB package in previous database versions will be re-created using
      Oracle Scheduler architecture. Jobs not successfully re-created may not
      function properly after upgrade.

  13. (AUTOFIXUP) Gather stale data dictionary statistics prior to database
      upgrade in off-peak time using:
      
        EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;
      
      Dictionary statistics do not exist or are stale (not up-to-date).
      
      Dictionary statistics help the Oracle optimizer find efficient SQL
      execution plans and are essential for proper upgrade timing. Oracle
      recommends gathering dictionary statistics in the last 24 hours before
      database upgrade.
      
      For information on managing optimizer statistics, refer to the 11.2.0.4
      Oracle Database Performance Tuning Guide.

  14. (AUTOFIXUP) Directly grant ADMINISTER DATABASE TRIGGER privilege to the
      owner of the trigger or drop and re-create the trigger with a user that
      was granted directly with such. You can list those triggers using: SELECT
      OWNER, TRIGGER_NAME FROM DBA_TRIGGERS WHERE
      TRIM(BASE_OBJECT_TYPE)='DATABASE' AND OWNER NOT IN (SELECT GRANTEE FROM
      DBA_SYS_PRIVS WHERE PRIVILEGE='ADMINISTER DATABASE TRIGGER').
      
      There is one or more database triggers whose owner does not have the
      right privilege on the database.
      
      The creation of database triggers must be done by users granted with
      ADMINISTER DATABASE TRIGGER privilege. Privilege must have been granted
      directly.

  15. (AUTOFIXUP) Gather statistics on fixed objects prior the upgrade.
      
      None of the fixed object tables have had stats collected.
      
      Gathering statistics on fixed objects, if none have been gathered yet, is
      recommended prior to upgrading.
      
      For information on managing optimizer statistics, refer to the 11.2.0.4
      Oracle Database Performance Tuning Guide.

  INFORMATION ONLY
  ================
  16. To help you keep track of your tablespace allocations, the following
      AUTOEXTEND tablespaces are expected to successfully EXTEND during the
      upgrade process.
      
                                                 Min Size
      Tablespace                        Size     For Upgrade
      ----------                     ----------  -----------
      TEMP                                46 MB       150 MB
      
      Minimum tablespace sizes for upgrade are estimates.

  17. Consider removing the following deprecated initialization parameters.
      
      Parameter
      ---------
      sec_case_sensitive_logon                                    
      
      These deprecated parameters probably will be obsolete in a future release.

  18. Run $ORACLE_HOME/rdbms/admin/catnoexf.sql located in the new Oracle
      Database Oracle home to remove both EXF and RUL.
      
      Expression Filter (EXF) or Rules Manager (RUL) exist in the database.
      
      Starting with Oracle Database release 12.1, the Expression Filter (EXF)
      and Database Rules Manager (RUL) features are desupported, and are
      removed during the upgrade process.  This step can be manually performed
      before the upgrade to reduce downtime.

  19. Ensure there is additional disk space in LOG_ARCHIVE_DEST_1 for at least
      4950 MB of archived logs.  Check alert log during the upgrade that there
      is no write error to the destination due to lack of disk space.
      
      Archiving cannot proceed if the archive log destination is full during
      upgrade.
      
      Archive Log Destination: 
       Parameter    :  LOG_ARCHIVE_DEST_1 
       Destination  :  /u01/app/oracle/product/11.2/db_1/dbs/arch
      
      The database has archiving enabled.  The upgrade process will need free
      disk space in the archive log destination(s) to generate archived logs to.

  20. Check the Oracle Backup and Recovery User's Guide for information on how
      to manage an RMAN recovery catalog schema.
      
      If you are using a version of the recovery catalog schema that is older
      than that required by the RMAN client version, then you must upgrade the
      catalog schema.
      
      It is good practice to have the catalog schema the same or higher version
      than the RMAN client version you are using.

  ORACLE GENERATED FIXUP SCRIPT
  =============================
  All of the issues in database CIM
  which are identified above as BEFORE UPGRADE "(AUTOFIXUP)" can be resolved by
  executing the following

    SQL>@/u01/app/oracle/cfgtoollogs/cimm/preupgrade/preupgrade_fixups.sql

=============
AFTER UPGRADE
=============

  REQUIRED ACTIONS
  ================
  None

  RECOMMENDED ACTIONS
  ===================
  21. Upgrade the database time zone file using the DBMS_DST package.
      
      The database is using time zone file version 4 and the target 19 release
      ships with time zone file version 32.
      
      Oracle recommends upgrading to the desired (latest) version of the time
      zone file.  For more information, refer to "Upgrading the Time Zone File
      and Timestamp with Time Zone Data" in the 19 Oracle Database
      Globalization Support Guide.

  22. To identify directory objects with symbolic links in the path name, run
      $ORACLE_HOME/rdbms/admin/utldirsymlink.sql AS SYSDBA after upgrade.
      Recreate any directory objects listed, using path names that contain no
      symbolic links.
      
      Some directory object path names may currently contain symbolic links.
      
      Starting in Release 18c, symbolic links are not allowed in directory
      object path names used with BFILE data types, the UTL_FILE package, or
      external tables.

  23. (AUTOFIXUP) Gather dictionary statistics after the upgrade using the
      command:
      
        EXECUTE DBMS_STATS.GATHER_DICTIONARY_STATS;
      
      Oracle recommends gathering dictionary statistics after upgrade.
      
      Dictionary statistics provide essential information to the Oracle
      optimizer to help it find efficient SQL execution plans. After a database
      upgrade, statistics need to be re-gathered as there can now be tables
      that have significantly changed during the upgrade or new tables that do
      not have statistics gathered yet.

  24. Gather statistics on fixed objects after the upgrade and when there is a
      representative workload on the system using the command:
      
        EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;
      
      This recommendation is given for all preupgrade runs.
      
      Fixed object statistics provide essential information to the Oracle
      optimizer to help it find efficient SQL execution plans.  Those
      statistics are specific to the Oracle Database release that generates
      them, and can be stale upon database upgrade.
      
      For information on managing optimizer statistics, refer to the 11.2.0.4
      Oracle Database Performance Tuning Guide.

  INFORMATION ONLY
  ================
  25. Check the Oracle documentation for the identified components for their
      specific upgrade procedure.
      
      The database upgrade script will not upgrade the following Oracle
      components:  OLAP Catalog
      
      The Oracle database upgrade script upgrades most, but not all Oracle
      Database components that may be installed.  Some components that are not
      upgraded may have their own upgrade scripts, or they may be deprecated or
      obsolete.

  26. (AUTOFIXUP) Apply latest Oracle JavaVM (OJVM) Bundle Patch (BP) or Patch
      Set Update (PSU) if it was not applied before database upgrade on 19
      ORACLE_HOME. Please refer to MOS note 1929745.1 for more details. The
      execution of the fixup provided by this check in the
      postupgrade_fixups.sql script will disable Java development. 
      
      The temporary OJVM Mitigation patch is currently installed and active in
      the database, securing it against the known threat but disabling Java
      development until you can install the latest OJVM BP or PSU.
      
      Oracle JavaVM Component Database PSU is released as part of the Critical
      Patch Update program from October 2014 onwards. Oracle recommends
      applying the latest OJVM PSU patch to ALL databases that have Oracle
      JavaVM present in the database, regardless of whether you are explicitly
      using it or not. Even if Oracle JavaVM is not present in the database it
      is best practice to install the OJVM PSU in case a new database is
      created in the ORACLE_HOME.

  ORACLE GENERATED FIXUP SCRIPT
  =============================
  All of the issues in database CIM
  which are identified above as AFTER UPGRADE "(AUTOFIXUP)" can be resolved by
  executing the following

    SQL>@/u01/app/oracle/cfgtoollogs/cimm/preupgrade/postupgrade_fixups.sql


==================
PREUPGRADE SUMMARY
==================
  /u01/app/oracle/cfgtoollogs/cimm/preupgrade/preupgrade.log
  /u01/app/oracle/cfgtoollogs/cimm/preupgrade/preupgrade_fixups.sql
  /u01/app/oracle/cfgtoollogs/cimm/preupgrade/postupgrade_fixups.sql

Execute fixup scripts as indicated below:

Before upgrade:

Log into the database and execute the preupgrade fixups
@/u01/app/oracle/cfgtoollogs/cimm/preupgrade/preupgrade_fixups.sql

After the upgrade:

Log into the database and execute the postupgrade fixups
@/u01/app/oracle/cfgtoollogs/cimm/preupgrade/postupgrade_fixups.sql

Preupgrade complete: 2020-08-25T14:22:16
2.根据输出内容做相应的配置变更。

BEFORE UPGRADE


**1) (AUTOFIXUP)
**2) (AUTOFIXUP)
**3) Remove the EM repository.

  $ emctl stop dbconsole
  SQL> SET ECHO ON;
  SQL> SET SERVEROUTPUT ON;
  SQL> @/u01/app/oracle/product/19.3/db_1/rdbms/admin/emremove.sql

**4) recompile invalid objects.
Run the 11.2.0.4.0 $ORACLE_HOME/rdbms/admin/utlrp.sql

--编译失效对象
SQL> @?/rdbms/admin/utlrp.sql
--查看失效对象(保证sys和system下无失效对象)
SQL> SET SERVEROUTPUT ON;
SQL> EXECUTE DBMS_PREUP.INVALID_OBJECTS;

**5) Remove OLAP Catalog.
Run the 11.2.0.4.0 SQL script $ORACLE_HOME/olap/admin/catnoamd.sql

SQL> @?/olap/admin/catnoamd.sql

**6) 在pfile/spfile中显式地将RESOURCE_LIMIT设置为FALSE
在pfile/spfile中显式地将RESOURCE_LIMIT设置为FALSE,以保留前面的行为。
在pfile/spfile中没有显式地设置RESOURCE_LIMIT初始化参数。RESOURCE_LIMIT初始化参数的默认值在12.1.0.2中从FALSE变为TRUE。如果没有显式设置,升级可能会引入意想不到的RESOURCE_LIMIT强制。
**7) Backup the existing ACLs
备份现有的acl及其分配,以供参考。使用新的DBMS_NETWORK_ACL_ADMIN接口和字典视图来管理升级后的网络权限。该数据库包含具有将被迁移到12c新格式的特权的网络acl。
11g中的网络访问控制列表(ACL)权限将迁移到12c中的新格式。作为迁移的一部分,将提供新的DBMS_NETWORK_ACL_ADMIN接口和字典视图,并将现有ACL中的特权转换为具有新ACL名称的新格式。旧的ACL名称、DBMS_NETWORK_ACL_ADMIN接口和字典视图可以继续使用,但不建议使用,并且不建议使用它们。要了解更多信息,请参阅我的Oracle支持说明编号2078710.1。
**8) cat >> /u01/app/oracle/product/19.3/db_1/network/admin/sqlnet.ora <<EOF
#This should be temporary while you deal with old passwords.
SQLNET.ALLOWED_LOGON_VERSION_SERVER=11
EOF

**9) (AUTOFIXUP)
**10) 删除SEC_CASE_SENSITIVE_LOGON初始化参数
删除SEC_CASE_SENSITIVE_LOGON实例初始化参数设置,默认情况下将系统配置为区分用例的密码身份验证。
您的数据库系统被配置为强制不区分大小写的密码身份验证(SEC_CASE_SENSITIVE_LOGON实例初始化参数设置为FALSE)。
从Oracle数据库版本12.2开始,独占模式是默认的基于密码的身份验证模式。在独占模式下不支持不区分大小写的密码身份验证。如果您的系统需要使用不区分大小写的密码身份验证,则必须在升级之前关闭独占模式。请参阅网络参考手册
关于SQLNET的章节。奥拉SQLNET参数。ALLOWED_LOGON_VERSION_SERVER了解有关独占模式的更多细节。
**11)
**12)
**13) (AUTOFIXUP)
**14) (AUTOFIXUP)
**15) (AUTOFIXUP)

INFORMATION ONLY
**16) 调整临时表空间的大小只最小值
**17) 参数文件中删除参数sec_case_sensitive_logon,此参数可能会在将来的版本中过时

Consider removing the following deprecated initialization parameters.
      
      Parameter
      ---------
      sec_case_sensitive_logon                                    
      
      These deprecated parameters probably will be obsolete in a future release

**18) remove both EXF and RUL
12C 以后不再支持Expression Filter (EXF) or Rules Manager (RUL),升级过程中会自动删除,提前手动删除以减少停机时间。

SQL> @?/rdbms/admin/catnoexf.sql

**19) 保证归档目录空间充足。(空间足够,忽略)
**20) 升级相应的catalog库,(没有catalog,忽略)

最后执行脚本修复(AUTOFIXUP)
ORACLE GENERATED FIXUP SCRIPT
All of the issues in database CIM which are identified above as BEFORE UPGRADE “(AUTOFIXUP)” can be resolved by executing the following
SQL> @/u01/app/oracle/cfgtoollogs/cimm/preupgrade/preupgrade_fixups.sql


UPGRADE


  1. Shutdown the source database.
SQL> shutdown immediate;
  1. 传输密码文件,参数文件至目19C目录.
cp $ORACLE_HOME/dbs/orapwcim $ORACLE_BASE/product/19.3/db_1/dbs/
cp $ORACLE_HOME/dbs/spfilecim.ora $ORACLE_BASE/product/19.3/db_1/dbs/

s/
3) Switch to the 19c listener.

cp $ORACLE_HOME/network/admin/listener.ora $ORACLE_BASE/product/19.3/db_1/network/admin/
cp $ORACLE_HOME/network/admin/tnsnames.ora $ORACLE_BASE/product/19.3/db_1/network/admin/
export ORACLE_HOME=$ORACLE_BASE/product/19.3/db_1

lsnrctl start
  1. 升级模式起库
    sqlplus / as sysdba
    SQL> startup upgrade;

  2. 运行升级脚本(后者是前者的简写)
    #Regular upgrade command.
    cd $ORACLE_HOME/rdbms/admin
    $ORACLE_HOME/perl/bin/perl catctl.pl catupgrd.sql
    #Shorthand command.
    $ORACLE_HOME/bin/dbupgrade

  3. 升级完后会关库,重启库
    sqlplus / as sysdba
    SQL> startup


AFTER UPGRADE


**21) Time zone file.

sqlplus / as sysdba <<EOF

-- Check current settings.
SELECT * FROM v$timezone_file;

SHUTDOWN IMMEDIATE;
STARTUP UPGRADE;

-- Begin upgrade to the latest version.
SET SERVEROUTPUT ON
DECLARE
  l_tz_version PLS_INTEGER;
BEGIN
  l_tz_version := DBMS_DST.get_latest_timezone_version;

  DBMS_OUTPUT.put_line('l_tz_version=' || l_tz_version);
  DBMS_DST.begin_upgrade(l_tz_version);
END;
/

SHUTDOWN IMMEDIATE;
STARTUP;

-- Do the upgrade.
SET SERVEROUTPUT ON
DECLARE
  l_failures   PLS_INTEGER;
BEGIN
  DBMS_DST.upgrade_database(l_failures);
  DBMS_OUTPUT.put_line('DBMS_DST.upgrade_database : l_failures=' || l_failures);
  DBMS_DST.end_upgrade(l_failures);
  DBMS_OUTPUT.put_line('DBMS_DST.end_upgrade : l_failures=' || l_failures);
END;
/

-- Check new settings.
SELECT * FROM v$timezone_file;

COLUMN property_name FORMAT A30
COLUMN property_value FORMAT A20

SELECT property_name, property_value
FROM   database_properties
WHERE  property_name LIKE 'DST_%'
ORDER BY property_name;

exit;
EOF

**22) Ignored
**23) (AUTOFIXUP)
**24) 收集升级后fixed对象的统计信息

SQL> EXECUTE DBMS_STATS.GATHER_FIXED_OBJECTS_STATS;

INFORMATION ONLY
**25) Ignored
**26) (AUTOFIXUP)

最后执行脚本修复(AUTOFIXUP)
ORACLE GENERATED FIXUP SCRIPT
All of the issues in database CIM
which are identified above as AFTER UPGRADE “(AUTOFIXUP)” can be resolved by
executing the following
SQL>@/u01/app/oracle/cfgtoollogs/cimm/preupgrade/postupgrade_fixups.sql

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
安装Oracle19c需要一些步骤和准备工作。下面是在Ubuntu 22.04上安装Oracle19c的一般步骤: 1. 首先,在Ubuntu 22.04上安装一些先决条件软件包,如libaio1和bc等。可以使用以下命令进行安装: ``` sudo apt-get install libaio1 bc ``` 2. 接下来,需要创建一个名为oracle的用户和组,并设置相关环境变量。可以使用以下命令进行操作: ``` sudo useradd -m -s /bin/bash oracle sudo passwd oracle sudo usermod -aG sudo oracle echo "oracle soft memlock unlimited" | sudo tee -a /etc/security/limits.conf echo "oracle hard memlock unlimited" | sudo tee -a /etc/security/limits.conf echo "session required pam_limits.so" | sudo tee -a /etc/pam.d/login ``` 然后,切换到oracle用户并设置相关环境变量: ``` su - oracle echo "export ORACLE_BASE=/opt/oracle" >> .bashrc echo "export ORACLE_HOME=$ORACLE_BASE/product/19c/dbhome_1" >> .bashrc echo "export PATH=$PATH:$ORACLE_HOME/bin" >> .bashrc source .bashrc ``` 3. 下载并解压Oracle19c安装文件。可以从Oracle官方网站下载适用于Linux的Oracle Database 19c软件安装包,然后解压缩到适当的目录。例如: ``` mkdir -p /opt/oracle tar -xzvf oracle-database-xxxxxxxxxx.tar.gz -C /opt/oracle ``` 4. 运行Oracle Installer来安装Oracle19c。使用以下命令进入安装目录并运行installer: ``` cd /opt/oracle/database ./runInstaller ``` 在图形界面中,按照向导的提示选择相应的选项,例如安装类型、Oracle数据库软件位置和数据库配置等。然后,等待安装完成。 5. 安装过程结束后,可以使用Database Configuration Assistant(DBCA)来创建和配置Oracle数据库。运行以下命令启动DBCA: ``` dbca ``` 按照向导的提示进行数据库创建和配置,例如选择数据库类型、命名等。 完成上述步骤后,您应该能够在Ubuntu 22.04上成功完成Oracle19c的安装。请注意,在实际安装过程中可能会遇到一些问题和异常情况,根据具体需求和系统环境可能需要进行一些额外的配置和调整。因此,建议在安装前仔细阅读官方文档和参考资料以获得更全面和详细的指导。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值