This post covers detailed steps to move a database to an Oracle Home with a different patch level( 19.8 to 19.12) Using dbaascli in Exacs.
High Level Steps:
--> Verify present db version and components list from registry
--> Gather invalid objects details and try to compile
--> Run Prechecks for db home move
--> Move db to different oracle home with different patch level
--> Verify db present version and components list from registry , Invalid objects
Verify Present db Version:
SQL> select INSTANCE_NAME,host_name,status,logins,version,VERSION_FULL,to_char(STARTUP_TIME,'DD/MM/YYYY HH24:MI:SS') "STARTUP_TIME" from gv$instance;
INSTANCE_NAME HOST_NAME STATUS LOGINS VERSION VERSION_FULL STARTUP_TIME
---------------- ------------------- ------------ ---------- ----------------- ----------------- -------------------
stgdb011 ociexacs-node1 OPEN ALLOWED 19.0.0.0.0 19.8.0.0.0 22/08/2022 04:04:03
stgdb012 ociexacs-node2 OPEN ALLOWED 19.0.0.0.0 19.8.0.0.0 22/08/2022 04:04:03
Verify installed components and component version:
SQL> select COMP_ID,COMP_NAME,VERSION,VERSION_FULL,STATUS from dba_registry;
COMP_ID COMP_NAME VERSION VERSION_FULL STATUS
-------------- ------------------------------------ ---------------- ------------------------------ --------
CATALOG Oracle Database Catalog Views 19.0.0.0.0 19.8.0.0.0 VALID
CATPROC Oracle Database Packages and Types 19.0.0.0.0 19.8.0.0.0 VALID
RAC Oracle Real Application Clusters 19.0.0.0.0 19.8.0.0.0 VALID
JAVAVM JServer JAVA Virtual Machine 19.0.0.0.0 19.8.0.0.0 VALID
XML Oracle XDK 19.0.0.0.0 19.8.0.0.0 VALID
CATJAVA Oracle Database Java Packages 19.0.0.0.0 19.8.0.0.0 VALID
APS OLAP Analytic Workspace 19.0.0.0.0 19.8.0.0.0 VALID
XDB Oracle XML Database 19.0.0.0.0 19.8.0.0.0 VALID
OWM Oracle Workspace Manager 19.0.0.0.0 19.8.0.0.0 VALID
CONTEXT Oracle Text 19.0.0.0.0 19.8.0.0.0 VALID
ORDIM Oracle Multimedia 19.0.0.0.0 19.8.0.0.0 VALID
SDO Spatial 19.0.0.0.0 19.8.0.0.0 VALID
XOQ Oracle OLAP API 19.0.0.0.0 19.8.0.0.0 VALID
OLS Oracle Label Security 19.0.0.0.0 19.8.0.0.0 VALID
DV Oracle Database Vault 19.0.0.0.0 19.8.0.0.0 VALID
15 rows selected.
Check Invalid objects:
SQL> select OWNER,OBJECT_NAME,OBJECT_TYPE from dba_objects where STATUS='INVALID';
no rows selected
Check installed DB Home details on Exacs nodes:
[root@ociexacs-node1 ~]# dbaascli system getDBHomes
DBAAS CLI version 22.3.1.1.0
Executing command system getDBHomes
Job id:
{
"OraHome3" : {
"id" : "",
"homePath" : "/u02/app/oracle/product/19.0.0.0/dbhome_1",
"homeName" : "OraHome3",
"version" : "19.12.0.0.0",
"createTime" : 1664597038000,
"updateTime" : 1664597038000,
"ohNodeLevelDetails" : {
"ociexacs-node2" : {
"nodeName" : "ociexacs-node2",
"version" : "19.12.0.0.0"
},
"ociexacs-node1" : {
"nodeName" : "ociexacs-node1",
"version" : "19.12.0.0.0"
}
},
"messages" : [ ]
},
"OraHome100" : {
"id" : "",
"homePath" : "/u02/app/oracle/product/19.0.0.0/dbhome_2",
"homeName" : "OraHome100",
"version" : "19.8.0.0.0",
"createTime" : 1664596819000,
"updateTime" : 1664596819000,
"ohNodeLevelDetails" : {
"ociexacs-node2" : {
"nodeName" : "ociexacs-node2",
"version" : "19.8.0.0.0"
},
"ociexacs-node1" : {
"nodeName" : "ociexacs-node1",
"version" : "19.8.0.0.0"
}
},
"messages" : [ ]
}
}
dbaascli execution completed
19.12 version already installed on Exacs nodes, if target version not installed follow steps in https://www.dbops-tech.com/2021/08/install-oracle-rdbms-on-oracle-cloud.html to installed required db version.
Execute Pre-checks for db move:
[root@ociexacs-node1 ~]# dbaascli database move --dbname stgdb01 --ohome /u02/app/oracle/product/19.0.0.0/dbhome_1 --executePrereqs
DBAAS CLI version 22.3.1.1.0
Executing command database move --ohome /u02/app/oracle/product/19.0.0.0/dbhome_1 --executePrereqs
Job id: cf0a124f-6131-4a11-86af-767175292a27
Loading PILOT...
Session ID of the current execution is: 4
Log file location: /var/opt/oracle/log/stgdb01/database/move/pilot_2022-09-28_09-12-02-PM_90184
-----------------
Running initialization job
Completed initialization job
-----------------
Running validate_user_input job
Completed validate_user_input job
-----------------
Running validate_database job
Completed validate_database job
-----------------
Running validate_creg_file_existence job
Completed validate_creg_file_existence job
-----------------
Running validate_source_home job
Completed validate_source_home job
-----------------
Running validate_major_version job
Completed validate_major_version job
-----------------
Running validate_oracle_home_type job
Completed validate_oracle_home_type job
-----------------
Running check_target_source_home_not_same job
Completed check_target_source_home_not_same job
-----------------
Running validate_home_existence job
Completed validate_home_existence job
-----------------
Running validate_home_consistency job
Completed validate_home_consistency job
-----------------
Running validate_home_options job
Completed validate_home_options job
-----------------
Running validate_disk_space job
Completed validate_disk_space job
dbaascli execution completed
[root@ociexacs-node1 ~]#
Move db to different home using dbaascli:
[root@ociexacs-node1 ~]# dbaascli database move --dbname stgdb01 --ohome /u02/app/oracle/product/19.0.0.0/dbhome_1
DBAAS CLI version 22.3.1.1.0
Executing command database move --ohome /u02/app/oracle/product/19.0.0.0/dbhome_1
Job id: 5bd5403b-0bb4-4db3-8bee-aeca7eebf327
Loading PILOT...
Session ID of the current execution is: 5
Log file location: /var/opt/oracle/log/stgdb01/database/move/pilot_2022-09-28_09-17-09-PM_156886
-----------------
Running initialization job
Completed initialization job
-----------------
Running validate_user_input job
Completed validate_user_input job
-----------------
Running validate_database job
Completed validate_database job
-----------------
Running validate_creg_file_existence job
Completed validate_creg_file_existence job
-----------------
Running validate_source_home job
Completed validate_source_home job
-----------------
Running validate_major_version job
Completed validate_major_version job
-----------------
Running validate_oracle_home_type job
Completed validate_oracle_home_type job
-----------------
Running check_target_source_home_not_same job
Completed check_target_source_home_not_same job
-----------------
Running validate_home_existence job
Completed validate_home_existence job
-----------------
Running validate_home_consistency job
Completed validate_home_consistency job
-----------------
Running validate_home_options job
Completed validate_home_options job
-----------------
Running validate_disk_space job
Completed validate_disk_space job
-----------------
Running acquire_lock job
Completed acquire_lock job
-----------------
Running copy_config_files job
Completed copy_config_files job
-----------------
Running stop_database_instance-ociexacs-node1 job
Completed stop_database_instance-ociexacs-node1 job
-----------------
Running update_database_resource-ociexacs-node1 job
Completed update_database_resource-ociexacs-node1 job
-----------------
Running start_database_instance-ociexacs-node1 job
Completed start_database_instance-ociexacs-node1 job
-----------------
Running stop_database_instance-ociexacs-node2 job
Completed stop_database_instance-ociexacs-node2 job
-----------------
Running update_database_resource-ociexacs-node2 job
Completed update_database_resource-ociexacs-node2 job
-----------------
Running start_database_instance-ociexacs-node2 job
Completed start_database_instance-ociexacs-node2 job
-----------------
Running exacs_post_patch_node_updation job
Completed exacs_post_patch_node_updation job
-----------------
Running update_dba_directories job
Completed update_dba_directories job
-----------------
Running datapatch_and_recompile_invalid_objects job
Datapatch execution on database 'stgdb01' is in progress
Datapatch execution on database 'stgdb01' is complete
Recompilation of invalid objects on database 'stgdb01' is in progress
Recompilation of invalid objects on database 'stgdb01' is complete
Completed datapatch_and_recompile_invalid_objects job
-----------------
Running release_lock job
Completed release_lock job
-----------------
Running invoke_backup_asst job
Completed invoke_backup_asst job
-----------------
Running post_move_validation job
Completed post_move_validation job
-----------------
Running generate_dbsystem_details job
Completed generate_dbsystem_details job
dbaascli execution completed
Post validations:
SQL> select INSTANCE_NAME,host_name,status,logins,version,VERSION_FULL,to_char(STARTUP_TIME,'DD/MM/YYYY HH24:MI:SS') "STARTUP_TIME" from gv$instance;
INSTANCE_NAME HOST_NAME STATUS LOGINS VERSION VERSION_FULL STARTUP_TIME
---------------- ------------------ ------------ ---------- ----------------- ----------------- -------------------
stgdb011 ociexacs-node1 OPEN ALLOWED 19.0.0.0.0 19.12.0.0.0 28/09/2022 21:18:18
stgdb012 ociexacs-node1 OPEN ALLOWED 19.0.0.0.0 19.12.0.0.0 28/09/2022 21:20:22
SQL> select COMP_ID,COMP_NAME,VERSION,VERSION_FULL,STATUS from dba_registry;
COMP_ID COMP_NAME VERSION VERSION_FULL STATUS
-------------- ------------------------------------ ---------------- ------------------------------ --------
CATALOG Oracle Database Catalog Views 19.0.0.0.0 19.12.0.0.0 VALID
CATPROC Oracle Database Packages and Types 19.0.0.0.0 19.12.0.0.0 VALID
RAC Oracle Real Application Clusters 19.0.0.0.0 19.12.0.0.0 VALID
JAVAVM JServer JAVA Virtual Machine 19.0.0.0.0 19.12.0.0.0 VALID
XML Oracle XDK 19.0.0.0.0 19.12.0.0.0 VALID
CATJAVA Oracle Database Java Packages 19.0.0.0.0 19.12.0.0.0 VALID
APS OLAP Analytic Workspace 19.0.0.0.0 19.12.0.0.0 VALID
XDB Oracle XML Database 19.0.0.0.0 19.12.0.0.0 VALID
OWM Oracle Workspace Manager 19.0.0.0.0 19.12.0.0.0 VALID
CONTEXT Oracle Text 19.0.0.0.0 19.12.0.0.0 VALID
ORDIM Oracle Multimedia 19.0.0.0.0 19.12.0.0.0 VALID
SDO Spatial 19.0.0.0.0 19.12.0.0.0 VALID
XOQ Oracle OLAP API 19.0.0.0.0 19.12.0.0.0 VALID
OLS Oracle Label Security 19.0.0.0.0 19.12.0.0.0 VALID
DV Oracle Database Vault 19.0.0.0.0 19.12.0.0.0 VALID
15 rows selected.
SQL> select OWNER,OBJECT_NAME,OBJECT_TYPE from dba_objects where STATUS='INVALID';
no rows selected