Advertisement

Thursday, December 10, 2015

Oracle ODA (Database Appliance) - Database upgrade using OAK

In this blog, I am going to discuss how to upgrade database on an ODA using 'oak' from 11.2.0.3 to 11.2.0.4. 
I will be mentioning what if - in case the DB has a standby, but the focus of this blog is just upgrade. 

Steps which are going to be followed - 

1. Ensure backups have completed successfully. 
2. Put OEM blackout in place.
3. Check dbhomes and databases using 'oakcli'. (Refer to End of Blog how to create a new Home)
4. Upgrade
5.  Post Steps

Assuming Step 1 & 2 are complete, jumping to step 3 - 

Verify DB Homes

[root@testoda1 ]# /opt/oracle/oak/bin/oakcli show dbhomes
Oracle Home Name      Oracle Home version                  Home Location
----------------      -------------------                  ------------
OraDb11203_home1      11.2.0.3.15(20760997,17592127)      /u01/app/oracle/product/11.2.0.3/dbhome_1
OraDb11204_home1      11.2.0.4.8(21352635,21352649)       /u01/app/oracle/product/11.2.0.4/dbhome_1

List out your databases

[root@testoda1 ]# /opt/oracle/oak/bin/oakcli show databases
Name     Type       Storage   HomeName             HomeLocation                                       Version
-----    ------     --------  --------------       ----------------                                   ----------
MYTEST   SINGLE     ASM       OraDb11203_home1     /u01/app/oracle/product/11.2.0.3/dbhome_1          11.2.0.3.15(20760997,17592127)
NEWTST   SINGLE     ASM       OraDb11203_home1     /u01/app/oracle/product/11.2.0.3/dbhome_1          11.2.0.3.15(20760997,17592127)

Upgrade the database using OAKCLI.

(Note - We need to upgrade database from first node of ODA only)

You will be prompted for sys password, so make a note of it before hand.

[root@testoda1 ~]# oakcli upgrade database -db MYTEST -to OraDb11204_home1
INFO: 2015-12-10 00:05:51: Look at the log file '/opt/oracle/oak/log/testoda1/tools/12.1.2.5.0/dbupgrade.log' for more details

Please enter the 'SYS'  password :
Please re-enter the 'SYS' password:
INFO: 2015-12-10 00:07:37: Upgrading the database MYTEST. It will take few minutes. Please wait...
...
SUCCESS: 2015-12-10 00:16:12: Successfully upgraded the database MYTEST

When the upgrade is running it is a good practice to have another session open and do a tail of the log file (highlighted above). From the log file you can figure out couple of things - one that this is oda and the name of the oda is testoda and the oak version is 12.1.2.5.0

Another point to note here is that oakcli calls dbua in silent mode and actually takes care of any pre steps such as dict stats gather.
When it is running you can verify by grepping for child processes (or ps -ef | grep -i dbua)

Check databases using OAKCLI.

[root@testoda1 ~]#oakcli show databases
Name     Type       Storage   HomeName             HomeLocation                                       Version
-----    ------     --------  --------------       ----------------                                   ----------
MYTEST   SINGLE     ASM       OraDb11204_home1     /u01/app/oracle/product/11.2.0.4/dbhome_1          11.2.0.4.8(21352635,21352649)
NEWTST   SINGLE     ASM       OraDb11203_home1     /u01/app/oracle/product/11.2.0.3/dbhome_1          11.2.0.3.15(20760997,17592127)

Assuming all went fine, the DB at this point has been upgraded and can is verified above (note the home location highlighted)

Post Steps
i. If you have any scripts pointed to old home, make sure you change them 
ii. Change the home location in Enterprise Manager and remove the blackout
iii. Verify the config using srvctl. Note - oak will automatically change the OCR entry, but it is a good practice to verify the config (srvctl config database -d <db_unique_name>

Standby Database Steps
In the following section let's discuss what are the changes if there is standby database
1. Stop The standby before Upgrade
2. Change the spfile/pfile location and oratab entries -  update to the new home
3.  change the OCR entry using srvctl to the new home
4. Once upgrade is complete start the standby and the recovery

So, this completes the upgrade of a database on ODA using oakcli.

*******
In case your DB home is not previously installed and you want to create a new DB Home and register with OAK - Below steps are to be followed first - 

cd /opt/oracle/oak/bin
./oakcli unpack -package <absolute_path_to_patch_file  p14777276_210000_Linux-x86-64.zip>

cd /opt/oracle/oak/bin
./oakcli create dbhome -version 12.1.0.2.0