Showing posts with label opatch opatchauto and autoupgrade.jar In Oracle Database. Show all posts
Showing posts with label opatch opatchauto and autoupgrade.jar In Oracle Database. Show all posts

Saturday, July 29, 2023

OPATCH, OPATCHAUTO AND AUTOUPGRADE.JAR usage In Oracle Database

 Opatch :- 

a java based utility enables the application and rollback patches oracle software.

location:- $ORACLE_HOME/OPatch/

----------------------------------------------------------------------------------------------------------------

opatch prereq CheckSystemPatch -phBaseDir <path_to_patch>
opatch apply <path_to_patch>
opatchauto apply <path_to_patch> -oh <grid_oracle_home> -ocmrf <path_to_ocm_response_file>
opatch lsinventory
opatch lsinventory -patch_id
opatch rollback -id <patch_id>
opatch lsinventory | grep <patch_id>
opatch prereq CheckConflictAmongPatches -phBaseDir <path_to_patch>
------------------------------------------------------------------------------------------------------

Opatchauto :-

orchestration tool generates patching instruction specific to your target configuration then uses opatch to perform patching without user intervention.

location:- $GRID_HOME/OPatch/opatchauto

-----------------------------------------------------------------------------------------
opatchauto apply <path_to_patch> -analyze
opatchauto apply <path_to_patch>
Rolling Patch Apply :-
opatchauto apply <path_to_patch> -oh <grid_oracle_home> -ocmrf <path_to_ocm_response_file>
opatchauto apply <path_to_patch> -verify
opatchauto lspatches
opatchauto rollback -id <patch_id>
opatchauto lspatch <patch_id>
opatchauto prereq CheckConflictAmongPatches <path_to_patch>
--------------------------------------------------------------------------------------------------

autoupgrade.jar :-
automate upgrade of oracle database.
1) first install latest version oracle db software 
2) start 

location:- $ORACLE_HOME/jlib/autoupgrade.jar

cat config.properties
----------------------------------------------------------------------------------
# Source database details
source_home=/path/to/source/oracle_home
source_sid=SOURCE_SID
source_user=SYS
source_password=source_sys_password
source_sysdba_password=source_sysdba_password

# Target database details
target_home=/path/to/target/oracle_home
target_version=19.0.0

# AutoUpgrade behavior
auto_pfile=TRUE
compatible=19.0.0
timezone_upg=yes
datapatch=yes
upgrade_parallelism=4

# Log file locations
log_dir=/path/to/log/directory
log_file=autoupgrade.log

# Optional parameters
parameters=statistics_level=typical
---------------------------------------------------------------------------------------------------
java -jar autoupgrade.jar -config <path_to_config_file> -mode readyness
java -jar autoupgrade.jar -config <path_to_config_file> -mode prechecks
java -jar autoupgrade.jar -config <path_to_config_file> -mode analyze
Apply upgrades:-
java -jar autoupgrade.jar -config <path_to_config_file> -mode deploy
java -jar autoupgrade.jar -config <path_to_config_file> -mode fixups
java -jar autoupgrade.jar -config <path_to_config_file> -mode report
---------------------------------------------------------------------------------------------------

++++++++++++ Always use latest opatch from oracle support websites and Export Oracle environments before doing anything ++++++++++++++++++

always do after autoupgrades/ patching 

$ORACLE_HOME/OPatch/datapatch verbose

Enable OpenSSH on Windows 11

Step 1: Install OpenSSH Server You can do this via PowerShell (run as Administrator ): Check if it's already available: Get-WindowsCapab...