签到成功

知道了

CNDBA社区CNDBA社区

Oracle 11g 升级到19c 操作示例 -- AutoUpgrade 工具(NON-CDB)

2025-06-26 08:45 92 2 原创 Oracle 19c
作者: dave

1 升级说明

关于Oracle的生命周期,我在之前的博客里有过说明,如下:

从生命周期的角度来谈谈Oracle 软件的版本(12c/18c/19c/20c/21c)问题
https://www.cndba.cn/dave/article/107944http://www.cndba.cn/dave/article/131640

实际上到了11g的生命周期早就结束了,就连19c的生命周期也知道2030年,只剩下5年的时间,主要还是因为升级风险比较高,而11g又比较稳定,所以现在11g 还占了很大的比例。

11g 升级 19c 大体有如下三种方法:

  1. 导出导入,在有时间窗口的情况下,这个也是一个不错的选择。
  2. XTTS 传输表空间,这种对数据库体量比较大或者跨平台的情况下,比较友好。
  3. AutoUpgrade 直接升级,这种虽然简单,但是相对风险也比较大。
    AutoUpgrade Tool (Doc ID 2485457.1)

从19.3 以后默认自带AutoUpgrade 工具,但升级之前,建议替换成最新版:

Oracle Database 19c (19.3) and later target Oracle homes, the autoupgrade.jar file exists by default. However, before you use AutoUpgrade, Oracle recommends that you download the latest version and replace the one already existing under $ORACLE_HOME/rdbms/admin.

注意:

从 Oracle Database 23ai 开始,在除 Windows 之外的其他 OS 平台上,AutoUpgrade 成为 Oracle 唯一支持的数据库升级工具,DBUA 与手工升级方法不再被支持。

只有如下的版本可以直接19c的版本,如果是其他版本,比如11.2.0.3,则需要先升级到11.2.0.4,在用AutoUpgrade 来升级:

官网对autoupgrade的说明如下:

https://docs.oracle.com/en/database/oracle/oracle-database/19/upgrd/about-oracle-database-autoupgrade.htmlhttp://www.cndba.cn/dave/article/131640

当在同一台服务器上升级时执行如下命令:

java -jar autoupgrade.jar -config config.txt -mode analyze
java -jar autoupgrade.jar -config config.txt -mode deploy

如果源端和目标端在不同的服务器,则执行如下命令:

java -jar autoupgrade.jar -config config.txt -mode analyze

Run fixups on the source server:
java -jar autoupgrade.jar -config config.txt -mode fixups

Complete the tasks to move the source Oracle Database from the source server to the target server.

On the target server, start up the database in upgrade mode, and then run AutoUpgrade in upgrade mode:
java -jar autoupgrade.jar -config config.txt -mode upgrade

本文我们将介绍使用AutoUpgrade 将同服务器上11g的单实例直接升级到19c版本。

2 升级过程

2.1 兼容性检查

因为只有特定的版本才能升级到19c,所以在升级之前,需要先检查下当前兼容性参数。如果源端版本是 11.2.0.4,但 compatible 参数是设置为10.0.0,就会导致失败,需要先将compatible参数设置为至少支持升级的最小值(11.2.0),然后再升级。

SQL> set lines 160
SQL> show parameter compatible;

NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
compatible                           string                 11.2.0.4.0
SQL>

如果不满足,需要先修改参数,更改参数后,重启动数据库生效:

SQL> alter system set compatible=’11.2.0’ scope=spfile;

2.2 备份数据库

升级是高危动作,需要先使用RMAN 备份,具体步骤这里忽略。http://www.cndba.cn/dave/article/131640

2.3 安装19c 软件

Oracle有2种升级方法:In-Place和Out-of-Place。这种大版本升级,一般推荐使用out-of-place,所以需要先安装一套19c的软件,不创建实例。 http://www.cndba.cn/dave/article/131640

图形化部署可以参考如下博客:

Linux 7.4 平台下 Oracle 19.3 单实例安装手册
https://www.cndba.cn/dave/article/3427

我们这里用静默方式快速部署一套,前期准备工作我这里忽略,具体可以参考上面的链接。http://www.cndba.cn/dave/article/131640

2.3.1 创建目录并授权

我们这里创建新目录:http://www.cndba.cn/dave/article/131640

mkdir -p /u02/app/oracle
mkdir -p /u02/app/oraInventory
mkdir -p /u02/app/oracle/product/19.0.0/dbhome_1
chown -R oracle:oinstall /u02
chmod -R 775 /u02

2.3.2 修改环境变量

因为我们这里还是同一个用户,所以直接修改当前Oracle的变量:

http://www.cndba.cn/dave/article/131640

[oracle@cndba.cn oraInventory]$ cat ~/.bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

TMP=/tmp; export TMP  
TMPDIR=$TMP; export TMPDIR  
#ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE  
ORACLE_BASE=/u02/app/oracle; export ORACLE_BASE  
#ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME  
ORACLE_HOME=$ORACLE_BASE/product/19.0.0/dbhome_1; export ORACLE_HOME  
ORACLE_SID=orcl; export ORACLE_SID  
ORACLE_TERM=xterm; export ORACLE_TERM  
PATH=/usr/sbin:$PATH; export PATH  
PATH=$ORACLE_HOME/bin:$PATH; export PATH  
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH  
CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

2.3.3 上传19.3 介质并解压缩

19c 部署都是直接解压缩的,将19.3 复制到ORACLE HOME 并解压缩:

[oracle@cndba.cn software]$ cd $ORACLE_HOME
[oracle@cndba.cn dbhome_1]$ pwd
/u02/app/oracle/product/19.0.0/dbhome_1
[oracle@cndba.cn dbhome_1]$ cp /u01/software/LINUX.X64_193000_db_home.zip .
[oracle@cndba.cn dbhome_1]$ ls
LINUX.X64_193000_db_home.zip
[oracle@cndba.cn dbhome_1]$ unzip LINUX.X64_193000_db_home.zip

2.3.4 编辑db_install.rsp响应文件

静默安装需要响应文件,默认在$ORACLE_HOME/install/response目录下:

[oracle@cndba.cn dbhome_1]$ cd $ORACLE_HOME/install/response
[oracle@cndba.cn response]$ ls
db_install.rsp
[oracle@cndba.cn response]$

这个是模板文件,里面内容比较多,我们这里创建一个简单点的:

[oracle@cndba.cn response]$ mv db_install.rsp db_install.rsp.bak
[oracle@cndba.cn response]$ touch db_install.rsp
[oracle@cndba.cn response]$ cat db_install.rsp
#软件版本信息
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0
#安装选项-仅安装数据库软件
oracle.install.option=INSTALL_DB_SWONLY
#oracle用户用于安装软件的组名
UNIX_GROUP_NAME=oinstall
#oracle产品清单目录
INVENTORY_LOCATION=/u02/app/oraInventory
#oracle安装目录
ORACLE_HOME=/u02/app/oracle/product/19.0.0/dbhome_1
#oracle基础目录
ORACLE_BASE=/u02/app/oracle
#安装版本类型:企业版
oracle.install.db.InstallEdition=EE
#指定组信息
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
[oracle@cndba.cn response]$

2.3.5 安装DB 软件

[oracle@cndba.cn response]$ cd $ORACLE_HOME
[oracle@cndba.cn dbhome_1]$ ./runInstaller -silent -noconfig -responseFile /u02/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp

[oracle@cndba.cn dbhome_1]$ ./runInstaller -silent -noconfig -responseFile /u02/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp
Launching Oracle Database Setup Wizard...

The response file for this session can be found at:
 /u02/app/oracle/product/19.0.0/dbhome_1/install/response/db_2025-06-25_05-27-55PM.rsp

You can find the log of this install session at:
 /u01/app/oraInventory/logs/InstallActions2025-06-25_05-27-55PM/installActions2025-06-25_05-27-55PM.log


As a root user, execute the following script(s):
        1. /u02/app/oracle/product/19.0.0/dbhome_1/root.sh

Execute /u02/app/oracle/product/19.0.0/dbhome_1/root.sh on the following nodes: 
[ora11g]


Successfully Setup Software with warning(s).

执行root.sh 脚本:
[root@cndba.cn software]# sh /u02/app/oracle/product/19.0.0/dbhome_1/root.sh
Check /u02/app/oracle/product/19.0.0/dbhome_1/install/root_ora11g_2025-06-25_17-44-02-488683896.log for the output of root script
[root@cndba.cn software]#

2.4 升级前信息检查

2.4.1 替换AutoUpgrade 工具版本

Oracle 19c 自带autoupgrad工具,在$ORACLE_HOME/rdbms/admin目录下,我们用官网的最新版本替代一下。

[oracle@cndba.cn admin]$ ll autoupgrade*
-rw-r--r--. 1 oracle oinstall 6530319 May 26 12:12 autoupgrade_25.3.jar
-rw-r--r--. 1 oracle oinstall 3360892 Feb  9  2019 autoupgrade.jar.bak
[oracle@cndba.cn admin]$ mv autoupgrade_25.3.jar autoupgrade.jar
[oracle@cndba.cn admin]$ ll autoupgrade*
-rw-r--r--. 1 oracle oinstall 6530319 May 26 12:12 autoupgrade.jar
-rw-r--r--. 1 oracle oinstall 3360892 Feb  9  2019 autoupgrade.jar.bak
[oracle@cndba.cn admin]$ pwd
/u02/app/oracle/product/19.0.0/dbhome_1/rdbms/admin

2.4.2 创建autoupgrade配置文件

[oracle@cndba.cn ~]$ cd /u01/software/
[oracle@cndba.cn software]$ java -jar /u02/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/autoupgrade.jar -create_sample_file config
Created sample configuration file /u01/software/sample_config.cfg

sample_config.cfg 文件中会有示例的配置,可以参考。

我们这里直接清空,使用如下配置:

[oracle@cndba.cn software]$ echo '' >  sample_config.cfg 
[oracle@cndba.cn software]$ cat sample_config.cfg 
#日志路径
global.autoupg_log_dir=/tmp/autoupgrade_log
#升级完成之后收集数据字典统计信息
global.dictionary_stats_after=yes
#升级之前收集数据字典统计信息
global.dictionary_stats_before=yes
#升级之前收集固定表统计信息
global.fixed_stats_before=yes
#创建闪回点
global.restoration=yes
#升级完成之后不删除闪回点,人工确认
global.drop_grp_after_upgrade=no
#升级数据库的数据库名
upg1.dbname=orcl
#升级的开始时间
upg1.start_time=NOW
#源端DB ORACLE_HOME
upg1.source_home=/u01/app/oracle/product/11.2.0/db_1
#目标端DB ORACLE_HOME
upg1.target_home=/u02/app/oracle/product/19.0.0/dbhome_1
#升级数据库的ORACLE_SID
upg1.sid=orcl
#日志目录  
upg1.log_dir=/tmp/autoupgrade_log/orcl
#升级节点的hostname  
upg1.upgrade_node=ora11g
#升级之后执行对象编译                  
dbold.run_utlrp=yes
#升级之后,升级时区  
dbold.timezone_upg=yes
#升级的目标版本19c 
upg1.target_version=19
[oracle@cndba.cn software]$

注意:
这里是升级到 non-cdb 的 19c 版本,如果要升级成 CDB 架构,还需要添加 2 个参数:http://www.cndba.cn/dave/article/131640

upg1.target_cdb=cndba
upg1.target_pdb_name=pdborcl

这个另一篇在验证。

2.4.3 analyze 分析

通过分析用来判断条件是否满足升级,如果不满足,也会给出整改建议。

[oracle@cndba.cn software]$ java -jar /u02/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/autoupgrade.jar -config /u01/software/sample_config.cfg -mode analyze
AutoUpgrade 25.3.250509 launched with default internal options
Processing config file ...
+--------------------------------+
| Starting AutoUpgrade execution |
+--------------------------------+
1 Non-CDB(s) will be analyzed
Type 'help' to list console commands
upg> 
注意这里可能会等很久:
upg> -------------------------------------------------
job 101 has not shown progress in last 25 minutes
database [orcl]
Stage    [PRECHECKS]
Operation[EXECUTING]
Status   [RUNNING]
Info     [Loading database information]
[Review log files for further information]
-----------------------------------------------
Logs: /tmp/autoupgrade_log/orcl/orcl/101
-----------------------------------------------Job 101 completed
------------------- Final Summary --------------------
Number of databases            [ 1 ]

Jobs finished                  [1]
Jobs failed                    [0]

Please check the summary report at:
/tmp/autoupgrade_log/cfgtoollogs/upgrade/auto/status/status.html
/tmp/autoupgrade_log/cfgtoollogs/upgrade/auto/status/status.log
[oracle@cndba.cn software]$

看到这里才是最终的完成。

2.4.4 查看日志并修复

Logs: /tmp/autoupgrade_log/orcl/orcl/101

[root@cndba.cn prechecks]# pwd
/tmp/autoupgrade_log/orcl/orcl/101/prechecks
[root@cndba.cn prechecks]# ll
total 472
-rw-r-----. 1 oracle oinstall   5816 Jun 25 19:10 orcl_checklist.cfg
-rw-r-----. 1 oracle oinstall  21417 Jun 25 19:10 orcl_checklist.json
-rw-r-----. 1 oracle oinstall  20409 Jun 25 19:10 orcl_checklist.xml
-rw-r-----. 1 oracle oinstall  44071 Jun 25 19:10 orcl_preupgrade.html
-rw-r-----. 1 oracle oinstall  21584 Jun 25 19:10 orcl_preupgrade.log
-rw-r-----. 1 oracle oinstall 315728 Jun 25 19:10 prechecks_orcl.log
-rw-r-----. 1 oracle oinstall  39982 Jun 25 19:10 upgrade.xml
[root@cndba.cn prechecks]#

可以查看orcl_preupgrade.log 或者orcl_preupgrade.html。

[root@cndba.cn prechecks]# cat orcl_preupgrade.log
Report generated by AutoUpgrade 25.3.250509 (#3110a3d32) on 2025-06-25 19:10:49

Upgrade-To version: 19.0.0.0.0

=======================================
Status of the database prior to upgrade
=======================================
      Database Name:  orcl
     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:  UNKNOWN
         Compatible:  11.2.0.4.0
          Blocksize:  8192
           Platform:  Linux x86 64-bit
      Timezone File:  14
  Database log mode:  NOARCHIVELOG
           Readonly:  false
            Edition:  EE

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

  *
  * ALL Components in This Database Registry:
  *
  Component   Current      Current      Original     Previous     Component   
  CID         Version      Status       Version      Version      Schema      
  ----------  -----------  -----------  -----------  -----------  ------------
  AMD         11.2.0.4.0   VALID                                  OLAPSYS     
  APEX        3.2.1.00.12  VALID                                  APEX_030200 
  APS         11.2.0.4.0   VALID                                  SYS         
  CATALOG     11.2.0.4.0   VALID                                  SYS         
  CATJAVA     11.2.0.4.0   VALID                                  SYS         
  CATPROC     11.2.0.4.0   VALID                                  SYS         
  CONTEXT     11.2.0.4.0   VALID                                  CTXSYS      
  EM          11.2.0.4.0   VALID                                  SYSMAN      
  EXF         11.2.0.4.0   VALID                                  EXFSYS      
  JAVAVM      11.2.0.4.0   VALID                                  SYS         
  ORDIM       11.2.0.4.0   VALID                                  ORDSYS      
  OWB         11.2.0.4.0   VALID                                  OWBSYS      
  OWM         11.2.0.4.0   VALID                                  WMSYS       
  RUL         11.2.0.4.0   VALID                                  EXFSYS      
  SDO         11.2.0.4.0   VALID                                  MDSYS       
  XDB         11.2.0.4.0   VALID                                  XDB         
  XML         11.2.0.4.0   VALID                                  SYS         
  XOQ         11.2.0.4.0   VALID                                  SYS         

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

  REQUIRED ACTIONS
  ================
  1.  Enable the database in ARCHIVE LOG mode and setup FRA or add the entry
      restoration=no in the configuration file to skip taking the guarantee
      restore point.

      By default AutoUpgrade tool takes a guarantee restore point for faster
      restoration in case of error. To accomplish this, the database to be
      upgraded must have the ARCHIVE LOG mode enabled and the fast recovery
      area (FRA) configured.

      The database does not have the ARCHIVE LOG mode enabled.

  RECOMMENDED ACTIONS
  ===================
  2.  (AUTOFIXUP) Remove OLAP Catalog by running the 11.2.0.4.0 SQL script
      $ORACLE_HOME/olap/admin/catnoamd.sql script.

      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.

      The OLAP Catalog component, AMD, exists in the database.

  3.  (AUTOFIXUP) Connect to the database as SYS to drop all Data Pump Advanced
      Queuing (AQ) tables prior to upgrading. Check MOS note 2789059.1 for
      details.

      The database needs to be free of Data Pump Advanced Queuing (AQ) tables
      in order for Data Pump AQ message types to be re-created during the
      database upgrade.

      There exists at least one Data Pump Advanced Queuing (AQ) table in the
      SYS schema which might prevent Data Pump AQ message types from getting
      re-created.
……

这里的建议有2种: REQUIRED ACTIONS 和 RECOMMENDED ACTIONS。 其中RECOMMENDED ACTIONS 基本都是能够AUTOFIXUP的,所以我们这里只需要处理REQUIRED ACTIONS。

我们这里只需要将DB 切换成归档模式并设置FRA 参数即可。

SQL> alter system set log_archive_dest_1='location=/u01/archivelog' scope=both;
System altered.
SQL> alter system set log_archive_format = "arch_%t_%s_%r.arc" scope=spfile;
System altered.
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = 20G SCOPE=BOTH;
System altered.
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = '/u01/archivelog' SCOPE=BOTH;
System altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1770434560 bytes
Fixed Size                  2254064 bytes
Variable Size             486542096 bytes
Database Buffers         1275068416 bytes
Redo Buffers                6569984 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/archivelog
Oldest online log sequence     9
Next log sequence to archive   11
Current log sequence           11
SQL>

2.5 升级数据库

2.5.1 deploy升级数据库

[oracle@cndba.cn ~]$ java -jar /u02/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/autoupgrade.jar -config /u01/software/sample_config.cfg -mode deploy
AutoUpgrade 25.3.250509 launched with default internal options
Processing config file ...
+--------------------------------+
| Starting AutoUpgrade execution |
+--------------------------------+
1 Non-CDB(s) will be processed
Type 'help' to list console commands
upg>

执行后会进入autoupgrade的命令行模式,可以执行相关的监控命令,可以通过help 查看:

upg> status
upg> lsj
upg> status -job 102

upg> status

Config

        User configuration file    [/u01/software/sample_config.cfg]
        General logs location      [/tmp/autoupgrade_log/cfgtoollogs/upgrade/auto]
        Mode                       [DEPLOY]
Jobs Summary

        Total databases in configuration file [1]
        Total Non-CDB being processed         [1]
        Total Containers being processed      [0]

        Jobs finished successfully            [0]
        Jobs finished/stopped                 [0]
        Jobs in progress                      [1]

Progress
        +---+---------------------------------------------------------+
        |Job|                                                 Progress|
        +---+---------------------------------------------------------+
        |102|[|||||                                             ] 8  %|
        +---+---------------------------------------------------------+

upg> lsj
+----+-------+-----+---------+-------+----------+-------+-------+
|Job#|DB_NAME|STAGE|OPERATION| STATUS|START_TIME|UPDATED|MESSAGE|
+----+-------+-----+---------+-------+----------+-------+-------+
| 102|   orcl|  GRP|EXECUTING|RUNNING|  20:48:55|43s ago|       |
+----+-------+-----+---------+-------+----------+-------+-------+
Total jobs 1

upg> status -job 102
Details

        Job No           102
        Oracle SID       orcl
        Start Time       25/06/25 20:48:55
        Elapsed (min):   0
        End time:        N/A

Logfiles

        Logs Base:    /tmp/autoupgrade_log/orcl/orcl
        Job logs:     /tmp/autoupgrade_log/orcl/orcl/102
        Stage logs:   /tmp/autoupgrade_log/orcl/orcl/102
        TimeZone:     /tmp/autoupgrade_log/orcl/orcl/temp
        Remote Dirs:  

Stages
        SETUP            <1 min
        GRP              ~0 min (RUNNING)
        PREUPGRADE      
        PRECHECKS       
        PREFIXUPS       
        DRAIN           
        DBUPGRADE       
        POSTCHECKS      
        POSTFIXUPS      
        POSTUPGRADE     
        SYSUPDATES      

Stage-Progress Per Container

        +--------+-----+
        |Database|  GRP|
        +--------+-----+
        |    orcl|10 % |
        +--------+-----+

upg>

2.5.2 网页监控升级进度

在autoupgrade的命令行中可以查看升级的进度,也可以通过web 页面查看,启动server:http://www.cndba.cn/dave/article/131640

[oracle@cndba.cn ~]$ cd /tmp/autoupgrade_log/cfgtoollogs/upgrade/auto
[oracle@cndba.cn auto]$ python -m SimpleHTTPServer 8000
Serving HTTP on 0.0.0.0 port 8000 ...

然后通过页面访问:
http://192.168.1.150:8000/state.html

当然命令行看的可能更直观一些:http://www.cndba.cn/dave/article/131640

upg> status

Config

        User configuration file    [/u01/software/sample_config.cfg]
        General logs location      [/tmp/autoupgrade_log/cfgtoollogs/upgrade/auto]
        Mode                       [DEPLOY]
Jobs Summary

        Total databases in configuration file [1]
        Total Non-CDB being processed         [1]
        Total Containers being processed      [0]

        Jobs finished successfully            [0]
        Jobs finished/stopped                 [0]
        Jobs in progress                      [1]

Progress
        +---+---------------------------------------------------------+
        |Job|                                                 Progress|
        +---+---------------------------------------------------------+
        |102|[||||||||||||                                      ] 23 %|
        +---+---------------------------------------------------------+

upg>

2.5.3 查看升级日志

autoupgrade会提示日志的保存路径:

Logs: /tmp/autoupgrade_log/orcl/orcl/102

[root@cndba.cn 102]# pwd
/tmp/autoupgrade_log/orcl/orcl/102
[root@cndba.cn 102]# ll
total 324
-rw-r-----. 1 oracle oinstall 266222 Jun 25 21:42 autoupgrade_20250625.log
-rw-r-----. 1 oracle oinstall      0 Jun 25 20:48 autoupgrade_20250625.log.lck
-rw-r-----. 1 oracle oinstall   2012 Jun 25 21:39 autoupgrade_20250625_user.log
-rw-r-----. 1 oracle oinstall      0 Jun 25 20:48 autoupgrade_20250625_user.log.lck
-rw-r-----. 1 oracle oinstall      0 Jun 25 20:48 autoupgrade_err.log
-rw-r-----. 1 oracle oinstall      0 Jun 25 20:48 autoupgrade_err.log.lck
drwxr-x---. 2 oracle oinstall    185 Jun 25 21:29 prechecks
drwxr-x---. 2 oracle oinstall     75 Jun 25 21:39 prefixups
drwxr-x---. 2 oracle oinstall     28 Jun 25 20:50 preupgrade
[root@cndba.cn 102]#

2.6 升级后工作

2.6.1 删除还原点

SQL> select name from v$restore_point;

NAME
--------------------------------------------------------------------------------
AUTOUPGRADE_9212_ORCL112040

SQL> drop restore point AUTOUPGRADE_9212_ORCL112040;

这里必须删除,否则修改兼容性参数会报错:
ORA-38880: Cannot advance compatibility from 11.2.0.4.0 to 19.0.0.0.0 due to guaranteed restore points

2.6.2 设置 COMPATIBLE 初始化参数

SQL> show parameter compatible;

NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
compatible                           string                 11.2.0.4.0
noncdb_compatible                    boolean                FALSE
SQL> alter system set compatible = '19.0.0' scope=spfile;
System altered.
SQL> shutdown immediate
SQL> startup

2.6.3 复制spfile 和 tnsnames.ora 文件

这2个文件默认在旧的ORACLE_HOME 目录下,需要先复制到新的19c ORACLE HOME,然后删除11g的ORACLE_HOME 。

2.6.4 删除源库相关文件

[oracle@cndba.cn db_1]$ pwd
/u01/app/oracle/product/11.2.0/db_1
[oracle@cndba.cn db_1]$ rm -rf /u01/app/oracle/product/11.2.0/db_1

版权声明:本文为博主原创文章,未经博主允许不得转载。

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
dave

dave

关注

人的一生应该是这样度过的:当他回首往事的时候,他不会因为虚度年华而悔恨,也不会因为碌碌无为而羞耻;这样,在临死的时候,他就能够说:“我的整个生命和全部精力,都已经献给世界上最壮丽的事业....."

  • 2273
    原创
  • 3
    翻译
  • 579
    转载
  • 196
    评论
  • 访问:8148056次
  • 积分:4395
  • 等级:核心会员
  • 排名:第1名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ