top of page
Oracle DBA Training & Support

Oracle Database Upgrades with AutoUpgrade Feature - Oracle 19c Database Upgrade

Updated: Aug 20, 2023

Are you tired of the complex and time-consuming process of upgrading your Oracle databases? Look no further! Oracle's AutoUpgrade feature is here to simplify the upgrade process, making it faster, more reliable, and hassle-free. In this blog post, we'll walk you through the steps to perform multiple database upgrades using the AutoUpgrade feature. Let's dive in!


Introducing AutoUpgrade


Oracle's AutoUpgrade is a powerful tool designed to automate and streamline the database upgrade process. Whether you're upgrading from Oracle 11g, 12c, or any other version to Oracle 19c or higher version, AutoUpgrade ensures a smooth transition to the latest Oracle Database release.


Step-by-Step Guide to Using AutoUpgrade


1. Inventory and Patch Analysis


Before beginning the upgrade process, it's important to assess the current state of your databases. Use the following commands to check applied patches and inventory:


$ORACLE_HOME/OPatch/opatch lsinv | grep -i applied

$ORACLE_HOME/OPatch/opatch lspatches | sort -nr


2. Set Up AutoUpgrade Workspace


Create a dedicated directory for AutoUpgrade and navigate to it:


mkdir /u02/AutoUpgrade_19c

cd /u02/AutoUpgrade_19c


3. Generate Sample Configuration File


Run the following command from your Oracle Database 19c home to create a sample configuration file:


/u02/app/oracle/product/19c/db_1/jdk/bin/java -jar /u02/app/oracle/product/19c/db_1/rdbms/admin/autoupgrade.jar -create_sample_file config


4. Configure Database Parameters

Adjust necessary database parameters by executing the provided SQL commands. These commands set the recovery file destination and size, ensuring a smooth upgrade process.


alter system set db_recovery_file_dest_size=15G;

alter system set db_recovery_file_dest='/u01/app/oracle/FRA';


5. Customize the Configuration File


Duplicate the sample configuration file and customize it according to your environment. For instance, copy the sample to test_db_config.cfg and modify its contents.


cp sample_config.cfg test_db_config.cfg


Edit the test_db_config.cfg file to specify the details for each database you want to upgrade.


# Sample output from config file "test_db_config.cfg"

# Please customize these settings according to your environment


# AutoUpgrade global configuration

global.autoupg_log_dir=/u02/AutoUpgrade_19c/upg_logs


# Configuration for the first database upgrade

# Database: test

upg1.dbname=test

upg1.start_time=NOW

upg1.source_home=/u01/app/oracle/product/12c/db_1

upg1.target_home=/u02/app/oracle/product/19c/db_1

upg1.sid=test

upg1.log_dir=/u01/AutoUpgrade_19c/upg_logs/test

upg1.upgrade_node=test.localdomain

upg1.target_version=19.12

upg1.run_utlrp=yes

upg1.timezone_upg=yes


# Configuration for the second database upgrade

# Database: orcl

upg2.dbname=orcl

upg2.start_time=NOW

upg2.source_home=/u01/app/oracle/product/11.2.0.4/db_1

upg2.target_home=/u02/app/oracle/product/19c/db_1

upg2.sid=orcl

upg2.log_dir=/u01/AutoUpgrade_19c/upg_logs/orcl

upg2.upgrade_node=test.localdomain

upg2.target_version=19.12

upg2.run_utlrp=yes

upg2.timezone_upg=yes




6. Analyze the Databases


Initiate the analysis of the databases using AutoUpgrade:


export ORACLE_HOME=/u01/app/oracle/product/19c/db_1

export PATH=$PATH:$ORACLE_HOME/jdk/bin


$ORACLE_HOME/jdk/bin/java -jar $ORACLE_HOME/rdbms/admin/autoupgrade.jar -config /u02/AutoUpgrade_19c/test_db_config.cfg -mode ANALYZE



7. Monitor Analysis Progress


Check the progress of the analysis job using the following command:


Here you will see the upg prompt, withing which you can run


lsj


status -job 100 <<< change job id based on above output



8. Deploy Upgrades


Once the analysis is complete, deploy the upgrades using the following command:


$ORACLE_HOME/jdk/bin/java -jar $ORACLE_HOME/rdbms/admin/autoupgrade.jar -config /u02/AutoUpgrade_19c/test_db_config.cfg -mode DEPLOY


9. Verify Upgrade Success


Execute various SQL queries to verify the success of the upgrade:


select name, open_mode, version, status from v$database, v$instance;


show parameter cluster


set lines 200 pages 500

col owner for a15

col OBJECT_NAME for a35

select owner,object_name,object_type,status from dba_objects where status='INVALID';


col COMP_NAME for a40

select COMP_ID,COMP_NAME,VERSION,STATUS from dba_registry;


col ACTION_TIME for a30

col action for a30

col version for a10

col BUNDLE_SERIES for a30

col COMMENTS for a47

select ACTION_TIME,ACTION,VERSION,BUNDLE_SERIES,COMMENTS from dba_registry_history;



SELECT VERSION FROM V$TIMEZONE_FILE;


select name from v$restore_point;

-- Additional verification steps can be added here


10. Perform Post-Upgrade Actions


Execute any necessary post-upgrade actions, such as altering system parameters and checking the compatibility:


show parameter compatible;

alter system set compatible='19.0.0' scope=spfile;

shutdown immediate;

startup;

show parameter compatible;

-- Additional post-upgrade actions can be added here



Conclusion


Oracle's AutoUpgrade feature takes the complexity out of database upgrades, allowing you to seamlessly transition to the latest Oracle Database release. By following this step-by-step guide, you can efficiently upgrade multiple databases and enjoy the benefits of enhanced performance, security, and features. Upgrade with confidence using AutoUpgrade!

So, why wait? Upgrade your databases with ease today! If you have any questions or need assistance, feel free to reach out to Oracle support or consult their documentation for further guidance. Happy upgrading!






Comentários


bottom of page