Infrastructure at your Service

Marc Wagner

How to synchronize the appliance registry metadata on an ODA?

Databases administration on a Bare Metal ODA will be done as root user by running odacli commands :

  • odacli create-database to create a database
  • odacli upgrade-database to upgrade a database between major releases
  • odacli move-database to move databases from one Oracle home to another of the same database version
  • odacli update-dbhome to update a specific RDBMS home to the latest patch bundle version
  • etc…

The odacli commands will do the needful and at the end update the Apache derby DB (ODA registry metadata). odacli commands like odacli list-dbhomes or odacli list-databases will use the derby DB information to display the requested information.

But what will happen if the odacli commands to upgrade or update your database are failing in error? How to synchronize the appliance registry metadata on an ODA?

I have been running several customer projects where the odacli commands to upgrade or update databases have been failing in error before completion. This had as consequence to complete the upgrade manually and to unfortunately update the derby DB manually in order to have coherent metadata information.

I have been already sharing a few blogs on that subject :
https://blog.dbi-services.com/connecting-to-oda-derby-database/
https://blog.dbi-services.com/moving-oracle-database-to-new-home-on-oda/

Updating manually the derby DB is a sensitive operation and you might want to do it only with oracle support guidance and instructions.

But, GOOD NEWS! If you are running an ODA version newer than 18.7, there is a new command available : odacli update-registry. I could use it successfully recently and through this blog, I would like to share it with you.

odacli update-registry command

This command will update the registry of the components when you manually apply patches or run a manual database upgrade. The option -n will define the component you would like to get updated in the derby DB.
See ODA 19.8 documentation for more details.

Real customer case example

I had to upgrade DB1 from 11.2.0.4 to 12.1.0.2. The odacli upgrade-database command has been failing in error and I had to manually complete the upgrade. At the end I had to synchronize the registry metadata DB.

List dbhomes

The dbhomes from the ODA was the following one :
[[email protected] log]# odacli list-dbhomes
 
ID Name DB Version Home Location Status
---------------------------------------- -------------------- ---------------------------------------- --------------------------------------------- ----------
d6df9457-e4cd-4c39-b3cb-8d03be3c4598 OraDB11204_home1 11.2.0.4.190115 /u01/app/oracle/product/11.2.0.4/dbhome_1 Configured
9d2d92d0-3b98-42ac-9f39-9bd6deeb2e16 OraDB19000_home1 19.7.0.0.200414 /u01/app/oracle/product/19.0.0.0/dbhome_1 Configured
73847823-ae83-4bf0-a630-f8884cf4387a OraDB12102_home1 12.1.0.2.200414 /u01/app/oracle/product/12.1.0.2/dbhome_1 Configured

Registry metadata after manual upgrade

The registry metadata after manual upgrade was the following one :
[[email protected] log]# odacli list-databases
 
ID DB Name DB Type DB Version CDB Class Shape Storage Status DbHomeID
---------------------------------------- ---------- -------- -------------------- ---------- -------- -------- ---------- ------------ ----------------------------------------
d897e7d6-9e2d-45e4-a0d7-a1e232d47f16 DB1 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
67abbd2e-f8e1-42da-bf8d-2f0a8eb403dd DB2 Si 19.7.0.0.200414 false Oltp Odb1 Acfs Configured 9d2d92d0-3b98-42ac-9f39-9bd6deeb2e16
c51f7361-ee99-42ed-9126-86b7fc281981 DB3 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
472c04fe-533d-46af-aeab-ab5271979d98 DB4 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
8dd9b1ea-37fd-408f-99ab-eb32e2c2ed91 DB5 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
2f5856df-e717-404a-b7b0-ca8c82b2f45e DB6 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
5797b6b2-e3fc-4182-8db3-671132dd43a7 DB7 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
3c67a04d-4e6b-4b43-8b56-94284994b25d DB8 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
a1b2500d-728e-4cbe-8425-f8a85826c422 DB9 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
7dfadc59-0c67-4b42-86e1-0140f39cf4d3 DB10 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598

And as we can see, DB1 was still showing to be a 11.2.0.4 database and linked to 11.2.0.4 home although it has been upgraded to 12.1.0.2 version :
[email protected]:/home/oracle/mwagner/upgrade_TZ/ [DB1] DB1
********* dbi services Ltd. *********
STATUS : OPEN
DB_UNIQUE_NAME : DB1_RZA
OPEN_MODE : READ WRITE
LOG_MODE : ARCHIVELOG
DATABASE_ROLE : PRIMARY
FLASHBACK_ON : NO
FORCE_LOGGING : YES
VERSION : 12.1.0.2.0
CDB Enabled : NO
*************************************

Updating registry metadata : odacli update-registry -n db

I tried executing odacli update-registry command to get the registry metadata information updated :

[[email protected] log]# odacli update-registry -n db
 
Job details
----------------------------------------------------------------
ID: a7270d8d-c8d2-48be-a41b-150441559791
Description: Discover Components : db
Status: Created
Created: August 10, 2020 1:55:31 PM CEST
Message:
 
Task Name Start Time End Time Status
---------------------------------------- ----------------------------------- ----------------------------------- ----------
 
[[email protected] log]# odacli describe-job -i a7270d8d-c8d2-48be-a41b-150441559791
 
Job details
----------------------------------------------------------------
ID: a7270d8d-c8d2-48be-a41b-150441559791
Description: Discover Components : db
Status: Success
Created: August 10, 2020 1:55:31 PM CEST
Message:
 
Task Name Start Time End Time Status
---------------------------------------- ----------------------------------- ----------------------------------- ----------
Discover DBHome August 10, 2020 1:55:31 PM CEST August 10, 2020 1:55:31 PM CEST Success
 
[[email protected] log]# odacli list-databases
 
ID DB Name DB Type DB Version CDB Class Shape Storage Status DbHomeID
---------------------------------------- ---------- -------- -------------------- ---------- -------- -------- ---------- ------------ ----------------------------------------
d897e7d6-9e2d-45e4-a0d7-a1e232d47f16 DB1 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
67abbd2e-f8e1-42da-bf8d-2f0a8eb403dd DB2 Si 19.7.0.0.200414 false Oltp Odb1 Acfs Configured 9d2d92d0-3b98-42ac-9f39-9bd6deeb2e16
c51f7361-ee99-42ed-9126-86b7fc281981 DB3 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
472c04fe-533d-46af-aeab-ab5271979d98 DB4 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
8dd9b1ea-37fd-408f-99ab-eb32e2c2ed91 DB5 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
2f5856df-e717-404a-b7b0-ca8c82b2f45e DB6 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
5797b6b2-e3fc-4182-8db3-671132dd43a7 DB7 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
3c67a04d-4e6b-4b43-8b56-94284994b25d DB8 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
a1b2500d-728e-4cbe-8425-f8a85826c422 DB9 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
7dfadc59-0c67-4b42-86e1-0140f39cf4d3 DB10 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
[[email protected] log]#

As we can see nothing really happened…

Use -f force option : odacli update-registry -n db -f

I have been using the force option :

[[email protected] log]# odacli update-registry -n db -f
 
Job details
----------------------------------------------------------------
ID: 2dbada8a-f76d-44bb-bb6e-c507d52e5ae3
Description: Discover Components : db
Status: Created
Created: August 10, 2020 1:58:37 PM CEST
Message:
 
Task Name Start Time End Time Status
---------------------------------------- ----------------------------------- ----------------------------------- ----------
 
[[email protected] log]# odacli describe-job -i 2dbada8a-f76d-44bb-bb6e-c507d52e5ae3
 
Job details
----------------------------------------------------------------
ID: 2dbada8a-f76d-44bb-bb6e-c507d52e5ae3
Description: Discover Components : db
Status: Success
Created: August 10, 2020 1:58:37 PM CEST
Message:
 
Task Name Start Time End Time Status
---------------------------------------- ----------------------------------- ----------------------------------- ----------
Rediscover DBHome August 10, 2020 1:58:37 PM CEST August 10, 2020 1:58:39 PM CEST Success
Rediscover DBHome August 10, 2020 1:58:39 PM CEST August 10, 2020 1:58:41 PM CEST Success
Rediscover DBHome August 10, 2020 1:58:41 PM CEST August 10, 2020 1:58:48 PM CEST Success
Discover DBHome August 10, 2020 1:58:48 PM CEST August 10, 2020 1:58:48 PM CEST Success
Rediscover DB: DB9_RZA August 10, 2020 1:58:48 PM CEST August 10, 2020 1:58:53 PM CEST Success
Rediscover DB: DB10_RZA August 10, 2020 1:58:53 PM CEST August 10, 2020 1:58:58 PM CEST Success
Rediscover DB: DB8_RZA August 10, 2020 1:58:58 PM CEST August 10, 2020 1:59:03 PM CEST Success
Rediscover DB: DB2_RZA August 10, 2020 1:59:03 PM CEST August 10, 2020 1:59:16 PM CEST Success
Rediscover DB: DB6_RZA August 10, 2020 1:59:16 PM CEST August 10, 2020 1:59:21 PM CEST Success
Rediscover DB: DB7_RZA August 10, 2020 1:59:21 PM CEST August 10, 2020 1:59:26 PM CEST Success
Rediscover DB: DB4_RZA August 10, 2020 1:59:26 PM CEST August 10, 2020 1:59:31 PM CEST Success
Rediscover DB: DB5_RZA August 10, 2020 1:59:31 PM CEST August 10, 2020 1:59:36 PM CEST Success
Rediscover DB: DB3_RZA August 10, 2020 1:59:36 PM CEST August 10, 2020 1:59:41 PM CEST Success
Rediscover DB: DB1_RZA August 10, 2020 1:59:41 PM CEST August 10, 2020 1:59:51 PM CEST Success
 
[[email protected] log]# odacli list-databases
 
ID DB Name DB Type DB Version CDB Class Shape Storage Status DbHomeID
---------------------------------------- ---------- -------- -------------------- ---------- -------- -------- ---------- ------------ ----------------------------------------
d897e7d6-9e2d-45e4-a0d7-a1e232d47f16 DB1 Si 12.1.0.2.200414 false Oltp Odb1 Acfs Configured 73847823-ae83-4bf0-a630-f8884cf4387a
67abbd2e-f8e1-42da-bf8d-2f0a8eb403dd DB2 Si 19.7.0.0.200414 false Oltp Odb1 Acfs Configured 9d2d92d0-3b98-42ac-9f39-9bd6deeb2e16
c51f7361-ee99-42ed-9126-86b7fc281981 DB3 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
472c04fe-533d-46af-aeab-ab5271979d98 DB4 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
8dd9b1ea-37fd-408f-99ab-eb32e2c2ed91 DB5 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
2f5856df-e717-404a-b7b0-ca8c82b2f45e DB6 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
5797b6b2-e3fc-4182-8db3-671132dd43a7 DB7 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
3c67a04d-4e6b-4b43-8b56-94284994b25d DB8 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
a1b2500d-728e-4cbe-8425-f8a85826c422 DB9 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598
7dfadc59-0c67-4b42-86e1-0140f39cf4d3 DB10 Si 11.2.0.4.190115 false Oltp Odb1 Acfs Configured d6df9457-e4cd-4c39-b3cb-8d03be3c4598

As we can see, this time the metadata information has been updated and DB1 is reflecting 12.1.0.2 version and Oracle home. The force option will update all information for existing components as well, and not only new ones.

Force option (-f) is mandatory if the component (here DB1 database) is already existing in the metadata registry.

Conclusion

This odacli update-registry command is really an excellent new feature and very helpful. It will allow to easily keep the ODA metadata registry up to date with all manual operations.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Marc Wagner
Marc Wagner

Consultant