首页 > 数据库 >利用AutoUpgrade工具升级数据库

利用AutoUpgrade工具升级数据库

时间:2023-02-08 18:47:37浏览次数:62  
标签:status autoupgrade 数据库 AutoUpgrade 升级 WAITING oracle app u01

0. 当升级到12cR2及以上的版本时,可以使用AutoUpgrade工具来完成升级工作。具体可以参考MOS文档AutoUpgrade Tool (Doc ID 2485457.1)。在本示例中,源数据库的版本为:11.2.0.4;目标数据库的版本为:19.3.0。
    
1.生成autoupgrade配置文件模板
/u01/app/oracle/product/19.0.0/dbhome_1/jdk/bin/java -jar /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/autoupgrade.jar -create_sample_file config


2.编辑autoupgrade配置文件
[oracle@oem ~]$ cat sample_config.cfg |grep -v ^# |grep -v ^$
global.autoupg_log_dir=/u01/app/oracle/cfgtoollogs/autoupgrade
upg1.log_dir=/u01/app/oracle/cfgtoollogs/autoupgrade/employee             # Path of the log directory for the upgrade job
upg1.sid=sdswhxcx                                              # ORACLE_SID of the source DB/CDB
upg1.source_home=/u01/app/oracle/product/11.2.0.4/dbhome_1  # Path of the source ORACLE_HOME
upg1.target_home=/u01/app/oracle/product/19.0.0/dbhome_1  # Path of the target ORACLE_HOME
upg1.start_time=NOW                                       # Optional. [NOW | +XhYm (X hours, Y minutes after launch) | dd/mm/yyyy hh:mm:ss]
upg1.upgrade_node=oem                                # Optional. To find out the name of your node, run the hostname utility. Default is ''localhost''
upg1.run_utlrp=yes                                  # Optional. Whether or not to run utlrp after upgrade
upg1.timezone_upg=yes                               # Optional. Whether or not to run the timezone upgrade
upg1.target_version=19                      # Oracle version of the target ORACLE_HOME.  Only required when the target Oracle database version is 12.2
根据实际情况修改以上参数值。

3.利用autoupgrade工具
分析当前数据库
[oracle@oem ~]$ /u01/app/oracle/product/19.0.0/dbhome_1/jdk/bin/java -jar /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/autoupgrade.jar -config sample_config.cfg -mode analyze
AutoUpgrade 22.5.221011 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> Job 101 completed
------------------- Final Summary --------------------
Number of databases            [ 1 ]

Jobs finished                  [1]
Jobs failed                    [0]

Please check the summary report at:
/u01/app/oracle/cfgtoollogs/autoupgrade/cfgtoollogs/upgrade/auto/status/status.html
/u01/app/oracle/cfgtoollogs/autoupgrade/cfgtoollogs/upgrade/auto/status/status.log
[oracle@oem ~]$
查看status.html文件,检查升级前的precheck工作是否成功,也可以根据status.log文件中记录的日志查看更详细的内容。如果当前数据库不满足升级要求,则根据提示进行调整。

4.利用autoupgrade工具正式升级
[oracle@oem ~]$ /u01/app/oracle/product/19.0.0/dbhome_1/jdk/bin/java -jar /u01/app/oracle/product/19.0.0/dbhome_1/rdbms/admin/autoupgrade.jar -config sample_config.cfg -mode deploy
AutoUpgrade 22.5.221011 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> help
exit                             // To close and exit
help                            // Displays help
lsj [<option>] [-a <number>]    // list jobs by status up to n elements.
        -f                Filter by finished jobs.
        -r                Filter by running jobs.
        -e                Filter by jobs with errors.
        -p                Filter by jobs being prepared.
        -n <number>       Display up to n jobs.
        -a <number>       Repeats the command (in <number> seconds).
lsr                             // Displays the restoration queue
lsa                             // Displays the abort queue
tasks                           // Displays the tasks running
clear                           // Clears the terminal
resume -job <number>            // Restarts a previous job that was running
status [<option>] [-a <number>] // Summary of current execution
        -config                     Show Config Information
        -job <number>               Summary of a given job
        -job <number> -c <dbname>   Show details of container
        -a [<number>]               Repeats the command (in <number> seconds).
restore -job <number>           // Restores the database to its state prior to the upgrade
restore all_failed              // Restores all failed jobs to their previous states prior to the upgrade
logs                            // Displays all the log locations
abort -job <number>             // Aborts the specified job
h[ist]                          // Displays the command line history
/[<number>]                     // Executes the command specified from the history. The default is the last command
meta                            // Displays Internal latch count
hwinfo                          // Displays additional information
fxlist -job <number> [<option>]                // FixUps summary
        -c <dbname>                                  Container specific FixUps
        -c <dbname> alter <check> run <yes|no|skip>  Update Run Configuration
upg> lsj
+----+--------+---------+---------+-------+----------+-------+-------+
|Job#| DB_NAME|    STAGE|OPERATION| STATUS|START_TIME|UPDATED|MESSAGE|
+----+--------+---------+---------+-------+----------+-------+-------+
| 102|sdswhxcx|PREFIXUPS|EXECUTING|RUNNING|  14:45:03|11s ago|       |
+----+--------+---------+---------+-------+----------+-------+-------+
Total jobs 1

upg> tasks
+---+------------------+-------------+
| ID|              NAME|         Job#|
+---+------------------+-------------+
|  1|              main|      WAITING|
| 42|        event_loop|TIMED_WAITING|
| 43|           console|     RUNNABLE|
| 44|      queue_reader|      WAITING|
| 46|             cmd-0|      WAITING|
| 47|     job_manager-0|      WAITING|
|222|sdswhxcx-puifxl0-0|      WAITING|
|223|sdswhxcx-puifxl0-1|      WAITING|
|224|sdswhxcx-puifxl0-2|      WAITING|
|225|sdswhxcx-puifxl0-3|      WAITING|
|234|         exec_loop|      WAITING|
|237|        sql-512443|     RUNNABLE|
+---+------------------+-------------+
upg> Job 102 completed
------------------- Final Summary --------------------
Number of databases            [ 1 ]

Jobs finished                  [1]
Jobs failed                    [0]
Jobs restored                  [0]
Jobs pending                   [0]

---- Drop GRP at your convenience once you consider it is no longer needed ----
Drop GRP from sdswhxcx: drop restore point AUTOUPGRADE_9212_SDSWHXCX112040

Please check the summary report at:
/u01/app/oracle/cfgtoollogs/autoupgrade/cfgtoollogs/upgrade/auto/status/status.html
/u01/app/oracle/cfgtoollogs/autoupgrade/cfgtoollogs/upgrade/auto/status/status.log
[oracle@oem ~]$
查看status.html文件,检查升级工作是否成功。


5.设置compatible参数
在设置该参数之前,先删除之前创建的restore point。

SQL> drop restore point AUTOUPGRADE_9212_SDSWHXCX112040;

Restore point dropped.

SQL> alter database flashback off;

Database altered.

SQL> alter system set compatible='19.3.0' scope=spfile sid='*';

System altered.

6.重启数据库。
SQL> startup force

标签:status,autoupgrade,数据库,AutoUpgrade,升级,WAITING,oracle,app,u01
From: https://www.cnblogs.com/missyou-shiyh/p/17102933.html

相关文章

  • 记录升级 KONG 网关遇到的坑
    记录升级KONG3.1网关遇到的坑原始版本:2.1升级版本:3.1.1动态路由默认使用插件request-transformer假如你有一个真实路由/user/all,现在需要网关做转发,前端请求......
  • 程序员必备的数据库知识 2:Join 算法
    前言连接(Join)是关系数据库重要特性,它和事务常被作为数据库与文件系统的两个重要区别项。程序员江湖一直流传着某某baba的神秘开发宝典,其中数据库部分有重要一条避免过多表......
  • Mysql数据库备份恢复
    一、使用musqldump对数据库、数据库表、一个数据库多个表、所以数据库备份、模拟数据丢失二、配置mysql数据库开启二进制日志功能,配置二进制日志切割,配置跟二进制恢复数据,居......
  • 程序员必备的数据库知识 2:Join 算法
    前言连接(Join)是关系数据库重要特性,它和事务常被作为数据库与文件系统的两个重要区别项。程序员江湖一直流传着某某baba的神秘开发宝典,其中数据库部分有重要一条避免过多......
  • MySQL 升级最佳实践 --- MySQL 5.6升级至MySQL 8.0
    MySQL升级最佳实践---MySQL5.6升级至MySQL8.0背景介绍MySQL8.0新特性数据字典更改MySQLServer8.0合并了一个全局数据字典,其中包含有关事务表中数据库对象的信息。......
  • python获取数据库字段的2种处理思路:文件处理和SQL处理
    问题:接到这样一个需求,定时查数据库表table_a,table_b,table_c中的数据,当有新增的时候,把table中的新增的数据中,所有message字段发出来解决思路一:1.思索后,因为3个table结构一......
  • centos7升级git
    移除旧版本sudoyumremovegitsudoyumremovegit-*添加EndPointPackageRepository在 CentOS7 上安装新版本 Git 最快的方法是通过 EndPoint 库。s......
  • Linux之Centos7内核版本升级
    参考文档https://blog.csdn.net/carefree2005/article/details/1148198851、内核升级步骤1)、查看可升级版本使用命令yumlistkernel可以查看已安装的内核版本和可以升级......
  • .NET Core SshClient + Npgsql 实现ssh隧道访问内网数据库
    privateconststringSSH_USER="root";//ssh账号privateconststringSSH_PASSWORD=".";//ssh密码,若使用密钥且没密码时填......
  • 【转载】一款含金量超高的专利数据库使用简介——德温特创新索引
    原文地址:一款含金量超高的专利数据库使用简介——德温特创新索引(njust.edu.cn)  ========================================  科睿唯安的德温特是全球最知......