Manually remove OLD DB HOMES if odacli-delete dbhome fails
Please follow the instructions below:
1. Check if any running jobs currently:
# odacli list-jobs.
2. If none, then stop the DCSAgents (initdcsagent) by running:
# systemctl stop initdcsagent
3. Manually remove the respective Oracle_Home folders using ‘rm -rf <DB_Home_Path>.
For example:
– As root:
rm -f /u01/app/odaorahome/oracle/product/12.2.0.1/dbhome_3
4. Then connect to the MySQL database repository and delete the corresponding DatabaseHome table in the repository.
(a) Navigate to the following directory
# cd /opt/oracle/dcs/mysql/bin
(b) Connect to the MySql database and use “dcsagentdb”
# /opt/oracle/dcs/mysql/bin/mysql –defaults-file=/opt/oracle/dcs/mysql/etc/mysqldb.cnf
mysql> use dcsagentdb;
(c) Find the DB id using the dbHomeLocation using the following command:
mysql> select id, name, dbHomeLocation from DatabaseHome where dbHomeLocation='<DB_Home>’ ;
(d) Locate the id then delete the DatabaseHome using the ID found from the above command
mysql> delete from DatabaseHome where id='<id_from_above_query>’;(Fill in the value of id located)
For example, (For the OraDB12201_home3 DBHome with the id value, ‘683daf6e-0a1e-45f0-9fce-75f059885bb6’):
mysql> delete from DatabaseHome where id=’683daf6e-0a1e-45f0-9fce-75f059885bb6′;
(e) Make sure the corresponding entry is deleted
mysql> select id, name, dbHomeLocation from DatabaseHome;
(f) Then commit the change and exit
mysql> commit;
mysql> exit;
Note: From 1 to 4 steps perform on both nodes
5. Start the DCSAgents (initdcsagent)
# systemctl start initdcsagent
6. Lastly, verify the dbhome is successfully deleted by running the following commands:
# odacli list-dbhomes