Rem: This blog is only for information purpose as I believe that sharing increase our knowledge.
Rem: This blog post is only for knowledge purposes, and in production, it can be executed with proper readiness and verification.
Rem: The author is not taking any responsibility that the content will work as it is written in this blog.
Rem: The knowledge is gained from various websites / URLS. Their links are shared at the end.
Rem: For windows OS, use this script with care, it is yet not matured.
An upgrade is very easy now for DBAs. All tasks done by Oracle for us know during the upgrade.
Update from 11.2.0.4, 12cR1, 12cR2 to 19c...
The following steps need to be executed in their order either in a Single Instance or RAC.
For RAC the recommendations that it can be executed from Anyone instance
For progress checking also use the tail command to view updated logs
1)
Install 19c on DB machine
2)
Download update autoupgrade.jar utility from Oracle support using MOC: AutoUpgrade Tool (Doc ID 2485457.1)
3)
Take a backup of your existing
/u01/app/oracle/product/19c/rdbms/admin
[oracle@target admin]$ ls -altr autoupgrade.jar
-rwxrwx--- 1 oracle oinstall 2999632 Jan 25 16:39 autoupgrade.jar
[oracle@target admin]$
4)
Copy downloaded updated autoupgrade.jar TO /u01/app/oracle/product/19c/rdbms/admin
5)
Verify that latest version is there:
/u01/app/oracle/product/19c/rdbms/admin
[oracle@target admin]$ /u01/app/oracle/product/19c/jdk/bin/java -jar autoupgrade.jar -version
build.hash 081e3f7
build.version 21.3.211115 >>>> focsu on it
build.date 2021/11/15 11:57:54
build.max_target_version 21
build.supported_target_versions 12.2,18,19,21
build.type production
6)
Backup of Existing 12cR1 backup using RMAN or Restore point
7)
Ensure that Archive Log is enabled Memory SGA / PGA have proper settings
In a single instance, ensure Share memory at OS level are configured
8)
Create config file using
sample_config.cfg using any text editor and add below lines
#
# Global logging directory pertains to all jobs
#
global.autoupg_log_dir=/u01/app/oracle/autoupgrade # Top level logging directory (Required)
#
# Database 1
#
##current db name
upg1.dbname=orcl
##current db path - in our case it is 12R1
upg1.source_home=/u01/app/oracle/product/12.1.0/db_1
## target db path - in our case 19c
upg1.target_home=/u01/app/oracle/product/19c
upg1.sid=orcl
upg1.start_time=now
## Log location for upgrade files
upg1.log_dir=/u01/app/oracle/autoupgrade/orcl
## host name
upg1.upgrade_node=target.localdomain
upg1.run_utlrp=yes
upg1.timezone_upg=yes
## version information info of source DB
upg1.target_version=12.1.0.2
9)
Open a new shell and set environment variables to a new home (19c binaries)
export ORACLE_HOME=/u01/app/oracle/product/19c
export PATH=$ORACLE_HOME/bin:$PATH
10)
Verify using analyze command
/u01/app/oracle/product/19c/jdk/bin/java -jar /u01/app/oracle/product/19c/rdbms/admin/autoupgrade.jar -config /home/oracle/scripts/UPGR.cfg -mode analyze
11)
If analyze command is good to go then go for an upgrade.
/u01/app/oracle/product/19c/jdk/bin/java -jar /u01/app/oracle/product/19c/rdbms/admin/autoupgrade.jar -config /home/oracle/scripts/UPGR.cfg -mode deploy
[oracle@target ~]$ /u01/app/oracle/product/19c/jdk/bin/java -jar /u01/app/oracle/product/19c/rdbms/admin/autoupgrade.jar -config /home/oracle/scripts/UPGR.cfg -mode deploy
Previous execution found loading latest data
Total jobs recovered: 1
+--------------------------------+
| Starting AutoUpgrade execution |
+--------------------------------+
Type 'help' to list console commands
upg> lsj
+----+-------+---------+---------+-------+--------------+--------+----------------------------+
|Job#|DB_NAME| STAGE|OPERATION| STATUS| START_TIME| UPDATED| MESSAGE|
+----+-------+---------+---------+-------+--------------+--------+----------------------------+
| 103| orcl|PRECHECKS|PREPARING|RUNNING|22/01/25 17:50|09:39:42|Loading database information|
+----+-------+---------+---------+-------+--------------+--------+----------------------------+
Total jobs 1
12)
List jobs are currently running
upg>help -- it will list commands
upg>lsj -job 103
upg> status -job 103
Progress
-----------------------------------
Start time: 22/01/25 17:50
Elapsed (min): 949
End time: N/A
Last update: 2022-01-26T09:39:51.280
Stage: PRECHECKS
Operation: PREPARING
Status: RUNNING
Pending stages: 10
Stage summary:
SETUP <1 min
PREUPGRADE <1 min
PRECHECKS <1 min (IN PROGRESS)
Job Logs Locations
-----------------------------------
Logs Base: /home/oracle/logs/orcl
Job logs: /home/oracle/logs/orcl/103
Stage logs: /home/oracle/logs/orcl/103/prechecks
TimeZone: /home/oracle/logs/orcl/temp
Additional information
-----------------------------------
Details:
+--------+-------------------------+--------+
|DATABASE| CHECK| STATUS|
+--------+-------------------------+--------+
| orcl|PLUGIN_COMP_COMPATIBILITY|FINISHED|
| orcl| AMD_EXISTS|FINISHED|
| orcl| AWR_EXPIRED_SNAPSHOTS|FINISHED|
| orcl| AUDTAB_ENC_TS|FINISHED|
| orcl| COMPATIBLE_NOT_SET|FINISHED|
| orcl| COMPATIBLE_PARAMETER|FINISHED|
| orcl| CASE_INSENSITIVE_AUTH|FINISHED|
| orcl| CYCLE_NUMBER|FINISHED|
| orcl| CREATE_WINDOWS_SERVICE|FINISHED|
| orcl| DV_ENABLED|FINISHED|
| orcl| CONC_RES_MGR|FINISHED|
| orcl|FLASH_RECOVERY_AREA_SETUP|FINISHED|
| orcl| DATA_MINING_OBJECT|FINISHED|
| orcl| DICTIONARY_STATS|FINISHED|
| orcl| DEPEND_USR_TABLES|FINISHED|
| orcl| FILES_NEED_RECOVERY|FINISHED|
| orcl| EXCLUSIVE_MODE_AUTH|FINISHED|
| orcl| HIDDEN_PARAMS|FINISHED|
| orcl| INVALID_OBJECTS_EXIST|FINISHED|
| orcl| INVALID_SYS_TABLEDATA|FINISHED|
| orcl| INVALID_USR_TABLEDATA|FINISHED|
| orcl| JVM_MITIGATION_PATCH|FINISHED|
| orcl| ORACLE_RESERVED_USERS|FINISHED|
| orcl| TRGOWNER_NO_ADMNDBTRG|FINISHED|
| orcl| JAVAVM_STATUS|FINISHED|
| orcl| PENDING_DST_SESSION|FINISHED|
| orcl| MV_REFRESH|FINISHED|
| orcl| POST_DICTIONARY|FINISHED|
| orcl| POST_FIXED_OBJECTS|FINISHED|
| orcl| RAISE_COMPATIBLE|FINISHED|
| orcl| COMPATIBLE_PFILES|FINISHED|
| orcl| POST_JVM_MITIGAT_PATCH|FINISHED|
| orcl| PURGE_RECYCLEBIN|FINISHED|
| orcl| PRE_FIXED_OBJECTS|FINISHED|
| orcl| SYNC_STANDBY_DB| STARTED|
| orcl| RLP_PARAM|FINISHED|
| orcl| SYS_DEFAULT_TABLESPACE| STARTED|
+--------+-------------------------+--------+
Error Details:
None
upg> status
---------------- Config -------------------
User configuration file [/home/oracle/scripts/UPGR.cfg]
General logs location [/home/oracle/logs/cfgtoollogs/upgrade/auto]
Mode [DEPLOY]
DB upg fatal errors ORA-00600,ORA-07445
DB Post upgrade abort time [60] minutes
DB upg abort time [1440] minutes
DB restore abort time [120] minutes
DB GRP abort time [3] minutes
------------------------ Jobs ------------------------
Total databases in configuration file [1]
Total Non-CDB being processed [1]
Total CDB being processed [0]
Jobs finished successfully [0]
Jobs finished/aborted [0]
Jobs in progress [1]
Jobs stage summary
Job ID: 103
DB name: orcl
SETUP <1 min
PREUPGRADE <1 min
PRECHECKS <1 min
PREFIXUPS <1 min
DRAIN <1 min
DBUPGRADE 3 min (IN PROGRESS)
------------ Resources ----------------
Threads in use [19]
JVM used memory [46] MB
CPU in use [13%]
Processes in use [17]
13)
Additionally, all logs are available at:
For job:103
/home/oracle/logs/orcl/103
/home/oracle/logs/cfgtoollogs/upgrade/auto/
state.html
You can also view updates through the HTML page in Firefox:
firefox /home/oracle/logs/cfgtoollogs/upgrade/auto/status.html &
file:///home/oracle/logs/cfgtoollogs/upgrade/auto/state.html
14)
Once upgrade is completed
upg> tasks
+---+-------------------+-------------+
| ID| NAME| Job#|
+---+-------------------+-------------+
| 1| main| WAITING|
| 13| event_loop|TIMED_WAITING|
| 14| console| RUNNABLE|
| 15| queue_reader| WAITING|
| 16| cmd-0| WAITING|
| 17| job_manager-0| WAITING|
| 18| bqueue-103| WAITING|
|309| monitor_orcl|TIMED_WAITING|
|311| catctl_orcl| WAITING|
|312| abort_monitor_orcl|TIMED_WAITING|
|313| async_read| RUNNABLE|
|314| exec_loop| WAITING|
+---+-------------------+-------------+
upg> Job 103 completed
------------------- Final Summary --------------------
Number of databases [ 1 ]
Jobs finished [1]
Jobs failed [0]
Jobs pending [0]
Please check the summary report at:
/home/oracle/logs/cfgtoollogs/upgrade/auto/status/status.html
/home/oracle/logs/cfgtoollogs/upgrade/auto/status/status.log
[oracle@target ~]$ tail -100f /home/oracle/logs/cfgtoollogs/upgrade/auto/status/status.log
==========================================
Autoupgrade Summary Report
==========================================
[Date] Wed Jan 26 10:15:42 PKT 2022
[Number of Jobs] 1
==========================================
[Job ID] 103
==========================================
[DB Name] orcl
[Version Before Upgrade] 12.1.0.2.0
[Version After Upgrade] 19.3.0.0.0
------------------------------------------
[Stage Name] PREUPGRADE
[Status] SUCCESS
[Start Time] 2022-01-26 09:39:42
[Duration] 0:00:00
[Log Directory] /home/oracle/logs/orcl/103/preupgrade
------------------------------------------
[Stage Name] PRECHECKS
[Status] SUCCESS
[Start Time] 2022-01-26 09:39:42
[Duration] 0:00:12
[Log Directory] /home/oracle/logs/orcl/103/prechecks
[Detail] /home/oracle/logs/orcl/103/prechecks/orcl_preupgrade.log
Precheck passed and no manual intervention needed
------------------------------------------
[Stage Name] PREFIXUPS
[Status] FAILURE
[Start Time] 2022-01-26 09:39:54
[Duration] 0:00:08
[Log Directory] /home/oracle/logs/orcl/103/prefixups
------------------------------------------
[Stage Name] DRAIN
[Status] SUCCESS
[Start Time] 2022-01-26 09:40:03
[Duration] 0:00:19
[Log Directory] /home/oracle/logs/orcl/103/drain
------------------------------------------
[Stage Name] DBUPGRADE
[Status] FAILURE
[Start Time] 2022-01-26 09:40:22
[Duration] 0:32:54
[Log Directory] /home/oracle/logs/orcl/103/dbupgrade
------------------------------------------
[Stage Name] POSTCHECKS
[Status] SUCCESS
[Start Time] 2022-01-26 10:13:16
[Duration] 0:00:54
[Log Directory] /home/oracle/logs/orcl/103/postchecks
[Detail] /home/oracle/logs/orcl/103/postchecks/orcl_postupgrade.log
------------------------------------------
[Stage Name] POSTFIXUPS
[Status] SUCCESS
[Start Time] 2022-01-26 10:14:11
[Duration] 0:00:47
[Log Directory] /home/oracle/logs/orcl/103/postfixups
------------------------------------------
[Stage Name] POSTUPGRADE
[Status] SUCCESS
[Start Time] 2022-01-26 10:14:58
[Duration] 0:00:43
[Log Directory] /home/oracle/logs/orcl/103/postupgrade
------------------------------------------
[Stage Name] SYSUPDATES
[Status] SUCCESS
[Start Time] 2022-01-26 10:15:42
[Duration] 0:00:00
[Log Directory] /home/oracle/logs/orcl/103/sysupdates
------------------------------------------
Upgrade Summary: /home/oracle/logs/orcl/103/dbupgrade/upg_summary.log
15)
Upgrade is completed successfully:
SQL> select name, version, open_mode from v$database, v$instance;
NAME VERSION OPEN_MODE
--------- ----------------- --------------------
ORCL 19.0.0.0.0 READ WRITE
SQL>
ORACLE RAC DB configuration modification
srvctl upgrade database -d ORCL -oraclehome /u01/app/oracle/product/19/dbhome1
Start Standby replication on
edit DATABASE orcldr SET STATE = 'apply-on';
Tips:
I have faced most of the issues due to Low RAM on my VM and disk space
Also ensured that OS-level tuning parameters are set. Oracle-Based can help in this regard (https://oracle-base.com/articles/19c/oracle-db-19c-installation-on-oracle-linux-7)
If archival log_archive_dest_state_1 & log_archive_dest_state_2 error is then use use db_recovery_file_dest prameter
If there are errors, first fixed them and perform fresh execution using below command
-- change your job name
/u01/app/oracle/product/19c/jdk/bin/java -jar /u01/app/oracle/product/19c/rdbms/admin/autoupgrade.jar -config /home/oracle/scripts/UPGR.cfg -clear_recovery_data -jobs 103
To check job status below options can be used:
upg>status -job 103
upg>/ -- same as / in sqlplus prompt
upg>/
upg>status
upg>tasks
-------------------------------------------------------------------
Credit goes to below websites for useful information on this subject:
-------------------------------------------------------------------
https://www.oracle.com/downloads/community/vts-hands-on-labs-downloads.html
https://mikedietrichde.com/hol-19c-upgrade/
https://oracle-blog.com/upgrade-to-oracle-19c-using-autoupgrade-utility/
https://doyensys.com/blogs/database-upgrade-using-autoupgrade-tool-from-12c-to-19c/
https://oracle-blog.com/upgrade-to-oracle-19c-using-autoupgrade-utility/
https://www.br8dba.com/upgrade-oracle-database-manually-from-12-2-0-1-to-19c/
--for windows, study below URL in any case
https://eclipsys.ca/the-not-so-autoupgrade-oracle-autoupgrade-in-windows/
For any information feel free to share your remarks/suggestions.
1 comment:
Good work Hayat sb.
Post a Comment