« PREVIOUS « |
MAIN INDEX 19C HOL | » AWR Diff Reports » |
In this part of the Lab you will upgrade the UPGR
database from Oracle 11.2.0.4 to Oracle 19c. You can find detailed steps including the output for a Multitenant upgrade here for your information only in case you can’t complete the lab here.
In earlier version of the lab we did ask you to do a manual command line upgrade. This time you will use the AutoUpgrade and upgrade your UPGR database unattended.
Just make sure to copy the newest autoupgrade.jar from MOS Note: 2485457.1 as otherwise some of the examples will give a different output or may require additional parameters. The autoupgrade.jar used here is the one from April 2021.
With the older version of autoupgrade.jar being in the 19.9.0 lab, you must run olspreupgrade.sql by yourself as otherwise the upgrade will fail. This is fixed in the April 2021 version of AutoUpgrade.
Index
1. Preparation
The only task you’ll have to do when using the AutoUpgrade: You need to prepare a config file for the database(s).
The environment variable $OH19
is created only for your convenience. It points always to the Oracle 19c Home.
. upgr
java -jar $OH19/rdbms/admin/autoupgrade.jar -create_sample_file config
This tells you that the sample file has been created at:
Created sample configuration file /home/oracle/scripts/sample_config.cfg
You will need to edit it – and then pass it to the AutoUpgrade utility.
Created sample configuration file /home/oracle/sample_config.cfg
Open the file /home/oracle/sample_config.cfg
in your preferred editor (text or graph mode)
- Text mode:
vi /home/oracle/scripts/sample_config.cfg
- Graphical mode:
kwrite /home/oracle/scripts/sample_config.cfg &
Adjust the following parameters – since newer versions of AutoUpgrade, parameters such as dbname, start_time, upgrade_node and target_version are no longer needed. Hence, you can remove them:
Generated standard config.cfg | Make the following adjustments and remove the other lines: |
#Global configurations #Autoupgrade's global directory, ... #temp files created and other ... #send here global.autoupg_log_dir=/default/... # # Database number 1 # upg1.dbname=employee upg1.start_time=NOW upg1.source_home=/u01/... upg1.target_home=/u01/... upg1.sid=emp upg1.log_dir=/scratch/auto upg1.upgrade_node=hol1.localdomain upg1.target_version=19 #upg1.run_utlrp=yes #upg1.timezone_upg=yes |
|
Then save the file and name it as UPGR.cfg
in /home/oracle/scripts
.
If you saved it under its original name, sample_config.cfg
, rename it as shown below:
mv /home/oracle/scripts/sample_config.cfg /home/oracle/scripts/UPGR.cfg
2. ANALYZE Phase
It is best practice to run AutoUpgrade in analyze
mode at first. Once the analyze
phase is passed without issues, the database can be upgraded automatically (the below command is a one-line command!).
. upgr
java -jar $OH19/rdbms/admin/autoupgrade.jar -config /home/oracle/scripts/UPGR.cfg -mode analyze
You will see this output:
Autoupgrade tool launched with default options +--------------------------------+ | Starting AutoUpgrade execution | +--------------------------------+ 1 databases will be analyzed Type 'help' to list console commands upg>
You can monitor the analyze phase in the upg>
job console with:
lsj
status -job 100
Shortly after, the console will reply:
upg> status Job 100 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
Please check also the HTML output:
firefox /home/oracle/logs/cfgtoollogs/upgrade/auto/status/status.html &
You may see an ERROR at first. But as AutoUpgrade has a FixUp Available for it, it will take care of it.
Close Firefox once you are done.
The database can be upgraded automatically.
3. Upgrade
When you initiate the upgrade with -mode deploy
, the tool will repeat the analyze
phase, but add the fixups
, upgrade
and postupgrade
steps.
java -jar $OH19/rdbms/admin/autoupgrade.jar -config /home/oracle/scripts/UPGR.cfg -mode deploy
You will see this output:
Autoupgrade tool launched with default options +--------------------------------+ | Starting AutoUpgrade execution | +--------------------------------+ 1 databases will be processed Type 'help' to list console commands upg>
At this point you can monitor the upgrade now – enlarge the xterm‘s width a bit to see no line wraps.
Type help
on the upg>
job console to see an overview of available commands.
help
upg> help exit // To close and exit help // Displays help lsj [(-r|-f|-p|-e) | -n ] // 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 Display up to n jobs. lsr // Displays the restoration queue lsa // Displays the abort queue tasks // Displays the tasks running clear // Clears the terminal resume -job // Restarts a previous job that was running status [-job [-long]] // Lists all the jobs or a specific job restore -job // 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 // Aborts the specified job h[ist] // Displays the command line history /[] // Executes the command specified from the history. The default is the last command
The most important commands are:
-
lsj
– this lists the job number and overview information about each active job.
Please note that the job number has now changed for the-mode deploy
run.
-
lsj
upg> lsj +----+-------+---------+---------+--------+--------------+--------+--------+-------------+ |Job#|DB_NAME| STAGE|OPERATION| STATUS| START_TIME|END_TIME| UPDATED| MESSAGE| +----+-------+---------+---------+--------+--------------+--------+--------+-------------+ | 101| UPGR|PREFIXUPS|EXECUTING| RUNNING|19/10/17 23:15| N/A|23:15:28|Remaining 3/3| +----+-------+---------+---------+--------+--------------+--------+--------+-------------+ Total jobs 2
status -job <number>
– this gives you more information about a specific job.
It displays you also where the log files are located.-
status -job 101
upg> status -job 101 Progress ----------------------------------- Start time: 19/10/17 23:16 Elapsed (min): 1 End time: N/A Last update: 2019-10-17T23:16:58.468 Stage: PREFIXUPS Operation: EXECUTING Status: RUNNING Pending stages: 6 Stage summary: SETUP <1 min PREUPGRADE <1 min PRECHECKS <1 min GRP <1 min PREFIXUPS <1 min (IN PROGRESS) Job Logs Locations ----------------------------------- Logs Base: /home/oracle/upg_logs/UPGR Job logs: /home/oracle/upg_logs/UPGR/101 Stage logs: /home/oracle/upg_logs/UPGR/101/prefixups TimeZone: /home/oracle/upg_logs/UPGR/temp Additional information ----------------------------------- Details: +--------+----------------+-------+ |DATABASE| FIXUP| STATUS| +--------+----------------+-------+ | UPGR|DICTIONARY_STATS|STARTED| +--------+----------------+-------+ Error Details: None
-
logs
– displays the logs folder-
logs
Autoupgrade logs folder [/home/oracle/upg_logs/cfgtoollogs/upgrade/auto/config_files] logs folder [UPGR][/home/oracle/upg_logs/UPGR] Please open a second xterm tab and go to the logs folder.
cd /home/oracle/logs/UPGR/101
Explore the subdirectories, especially
/home/oracle/logs/UPGR/101
and below. - Change the directory and see whether the
dbupgrade
directory has been created. This usually takes up to 4 minutes until the prechecks and fixups have been completed. You will find the 4 upgrade worker’s logs in cd/home/oracle/logs/UPGR/101/dbupgrade
.These 4 subdirectories get created beforedbupgrade
:prechecks prefixups preupgrade drain
- You can
tail -f
especially the main worker’s (ending with 0) log to display the upgrade progress.cd ../dbupgrade
tail -f catupgrd*0.log
Interrupt the
tail
command with CTRL+C.
-
But even better, you can open Firefox again and have the entire upgrade monitored automatically. The page will refresh by itself.
firefox /home/oracle/logs/cfgtoollogs/upgrade/auto/state.html &
Depending on the hardware, the upgrade will take about 20-35 minutes. You don’t have to wait but instead we will do some exercises now with the AutoUpgrade tool.
The upgrade will take between 20-40 minutes to complete.
upg> Job 101 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
Congratulations – you upgraded the UPGR database successfully from Oracle 11.2.0.4 to Oracle 19c.
« PREVIOUS « |
MAIN INDEX 19C HOL | » AWR Diff Reports » |