Skip to content

Commit 927cb53

Browse files
authored
orestart changes (#3030)
1 parent b324bd6 commit 927cb53

File tree

3 files changed

+123
-110
lines changed

3 files changed

+123
-110
lines changed

OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oracommon.py

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def add_key(self,key,value,env_dict):
291291
env_dict[key] = value
292292
self.oenv.update_env_vars(env_dict)
293293
else:
294-
msg='''Variable {0} value is not defined to add in the env variables. Exiting!'''.format(value)
294+
msg='''Variable {0} value is not defined to add in the env variables. Exiting!'''.format(key)
295295
self.log_error_message(msg,self.file_name)
296296
self.prog_exit(self)
297297

@@ -1423,49 +1423,45 @@ def get_sw_cmd(self, key, rspfile, node, netmasklist):
14231423
"""
14241424
This function returns the installation command.
14251425
"""
1426+
cmd=""
14261427
giuser, gihome, gbase, oinv = self.get_gi_params()
14271428
pwdparam = f'''oracle.install.asm.SYSASMPassword={"HIDDEN_STRING"} oracle.install.asm.monitorPassword={"HIDDEN_STRING"}'''
14281429
copyflag = " -noCopy " if self.check_key("COPY_GRID_SOFTWARE", self.ora_env_dict) else ""
14291430
prereq = " -ignorePreReq " if self.check_key("IGNORE_CRS_PREREQS", self.ora_env_dict) else " "
1430-
prereqfailure = " -ignorePrereqFailure " if self.check_key("IGNORE_CRS_PREREQS", self.ora_env_dict) else " "
1431+
prereqfailure = " -ignorePrereqFailure " if self.check_key("IGNORE_CRS_PREREQS_FAILURE", self.ora_env_dict) else " "
14311432
snic = "-J-Doracle.install.crs.allowSingleNIC=true" if self.check_key("SINGLENIC", self.ora_env_dict) else ""
14321433

14331434
if key == "INSTALL":
14341435
runCmd = "gridSetup.sh"
1435-
# Running only in Oracle Restart in RU Patch scenario, else setup fails
1436-
# if self.check_key("APPLY_RU_LOCATION", self.ora_env_dict) and self.check_key("CRS_GPC", self.ora_env_dict):
1437-
# runCmd += f''' -applyRU "{self.ora_env_dict["APPLY_RU_LOCATION"]}"'''
14381436
if self.check_key("DEBUG_MODE", self.ora_env_dict):
14391437
runCmd += " -debug"
14401438

14411439
self.log_info_message(f"runCmd set to : {runCmd}", self.file_name)
14421440

14431441
if self.detect_k8s_env():
1444-
cmd_parts = []
14451442
oraversion = self.get_rsp_version("INSTALL", None)
14461443
version = oraversion.split(".", 1)[0].strip()
14471444
distid_env = ""
14481445
if int(version) == 19:
14491446
distid_env = "export CV_ASSUME_DISTID=OL8; "
14501447
if self.check_key("CRS_GPC", self.ora_env_dict):
1451-
gridCmd = f'''su - {giuser} -c "{distid_env}{gihome}/{runCmd} -waitforcompletion {copyflag} -silent -responseFile {rspfile} {prereqfailure}"'''
1452-
cmd_parts.append(gridCmd)
1453-
1454-
if cmd_parts:
1455-
cmd = " && ".join(cmd_parts)
1448+
if int(version) <= 21:
1449+
cmd = f'''su - {giuser} -c "{distid_env}{gihome}/{runCmd} -waitforcompletion {copyflag} -silent -responseFile {rspfile} {prereq} {prereqfailure}"'''
1450+
else:
1451+
cmd = f'''su - {giuser} -c "{distid_env}{gihome}/{runCmd} -waitforcompletion {copyflag} -silent -responseFile {rspfile} {pwdparam} {prereq} {prereqfailure}"'''
14561452
else:
14571453
param1 = f'''oracle.install.crs.config.netmaskList={netmasklist}''' if netmasklist else \
14581454
'''oracle.install.crs.config.netmaskList=eth0:255.255.0.0,eth1:255.255.255.0,eth2:255.255.255.0'''
1459-
cmd = f'''su - {giuser} -c "{distid_env}{gihome}/{runCmd} -waitforcompletion {copyflag} -silent {snic} -responseFile {rspfile} {param1} {pwdparam} {prereqfailure}"'''
1455+
cmd = f'''su - {giuser} -c "{distid_env}{gihome}/{runCmd} -waitforcompletion {copyflag} -silent {snic} -responseFile {rspfile} {param1} {pwdparam} {prereq} {prereqfailure}"'''
14601456
else:
1461-
cmd = f'''su - {giuser} -c "{gihome}/{runCmd} -waitforcompletion {copyflag} -silent {snic} -responseFile {rspfile} {prereq} {pwdparam}"'''
1457+
cmd = f'''su - {giuser} -c "{gihome}/{runCmd} -waitforcompletion {copyflag} -silent {snic} -responseFile {rspfile} {prereq} {prereqfailure} {pwdparam}"'''
14621458
elif key == 'ADDNODE':
14631459
status = self.check_home_inv(None, gihome, giuser)
14641460
if status:
14651461
copyflag = " -noCopy "
14661462
else:
14671463
copyflag = " "
1468-
cmd = f'''su - {giuser} -c "ssh {node} '{gihome}/gridSetup.sh -silent -waitForCompletion {copyflag} {prereq} -responseFile {rspfile}'"'''
1464+
cmd = f'''su - {giuser} -c "ssh {node} '{gihome}/gridSetup.sh -silent -waitForCompletion {copyflag} {prereq} {prereqfailure} -responseFile {rspfile}'"'''
14691465
else:
14701466
cmd = ""
14711467
return cmd
@@ -1491,11 +1487,6 @@ def crs_sw_install_on_node(self, giuser, copyflag, crs_nodes, oinv, gihome, giba
14911487
self.log_info_message("disk" + version, self.file_name)
14921488
self.opatch_apply(node)
14931489

1494-
# Returning only in Oracle Restart in RU Patch scenario, else below command fails in Oracle Restart
1495-
# if int(version) == 19 and self.check_key("APPLY_RU_LOCATION", self.ora_env_dict):
1496-
# if self.check_key("CRS_GPC", self.ora_env_dict):
1497-
# self.log_info_message("Oracle Restart RU patch scenario detected. Skipping crs_sw_install_on_node", self.file_name)
1498-
# return
14991490

15001491
# Handle Oracle 19c (special case)
15011492
if int(version) == 19:
@@ -1505,12 +1496,18 @@ def crs_sw_install_on_node(self, giuser, copyflag, crs_nodes, oinv, gihome, giba
15051496
self.log_info_message("Oracle RU Patch deployment detected.", self.file_name)
15061497
apply_ru = ''' -applyRU "{0}" '''.format(self.ora_env_dict["APPLY_RU_LOCATION"])
15071498

1508-
if self.check_key("ONEOFF_FOLDER_NAME", self.ora_env_dict) and self.check_key("ONEOFF_IDS", self.ora_env_dict):
1509-
one_off_ids=self.ora_env_dict["ONEOFF_IDS"]
1510-
one_off_ids_with_location=""
1511-
for id in one_off_ids:
1512-
one_off_ids_with_location=one_off_ids_with_location+","+self.ora_env_dict["APPLY_RU_LOCATION"]+"/"+id
1513-
apply_oneoff = ''' --applyOneOffs "{0}" '''.format(one_off_ids_with_location)
1499+
if self.check_key("ONEOFF_FOLDER_NAME", self.ora_env_dict) and self.check_key("GRID_ONEOFF_IDS", self.ora_env_dict):
1500+
grid_oneoff_ids = self.ora_env_dict["GRID_ONEOFF_IDS"]
1501+
oneoff_ids_with_location = ""
1502+
1503+
# Split by comma to get individual oneoff IDs
1504+
for oneoff_id in grid_oneoff_ids.split(","):
1505+
if oneoff_ids_with_location:
1506+
oneoff_ids_with_location += ","
1507+
oneoff_ids_with_location += self.ora_env_dict["ONEOFF_FOLDER_NAME"] + "/" + oneoff_id.strip()
1508+
1509+
apply_oneoff = ''' -applyOneOffs "{0}" '''.format(oneoff_ids_with_location)
1510+
15141511

15151512
if int(version) < 23:
15161513
rspdata = '''su - {0} -c "ssh {10} '{11}{1}/gridSetup.sh {12} {13} {14} -waitforcompletion {2} -silent
@@ -3235,6 +3232,15 @@ def getdbrdestdgname(self,dgname):
32353232
"""
32363233
return self.ora_env_dict["DB_RECOVERY_FILE_DEST"] if self.check_key("DB_RECOVERY_FILE_DEST",self.ora_env_dict) else dgname
32373234

3235+
3236+
###### function to return DG Name for REDO LOG DESTINATION
3237+
def getredodestdgname(self,dgname):
3238+
"""
3239+
return REDO DG NAME
3240+
"""
3241+
return self.ora_env_dict["LOG_FILE_DEST"] if self.check_key("LOG_FILE_DEST",self.ora_env_dict) else dgname
3242+
3243+
32383244
##### Function to catalog the backup
32393245
def catalog_bkp(self):
32403246
"""

OracleDatabase/RAC/OracleRealApplicationClusters/containerfiles/scripts/oramiscops.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def checkdbrole(self):
350350
osid=self.ora_env_dict["DB_NAME"] if self.ocommon.check_key("DB_NAME",self.ora_env_dict) else "ORCLCDB"
351351
scanname = self.get_scan_name()
352352
scanport=self.ora_env_dict["SCAN_PORT"] if self.ocommon.check_key("SCAN_PORT",self.ora_env_dict) else "1521"
353-
connect_str=self.ocommon.get_sqlplus_str(dbhome,osid,osuser,"sys",'HIDDEN_STRING',scanname,scanport,osid,None,None,None)
353+
connect_str=self.ocommon.get_sqlplus_str(dbhome,osid,osuser,"sys",None,scanname,scanport,osid,None,None,None)
354354
status=self.ocommon.get_db_role(osuser,dbhome,osid,connect_str)
355355
else:
356356
status="NOTAVAILABLE"
@@ -403,7 +403,7 @@ def checkracsvc(self):
403403
osid=self.ora_env_dict["DB_NAME"] if self.ocommon.check_key("DB_NAME",self.ora_env_dict) else "ORCLCDB"
404404
scanname = self.get_scan_name()
405405
scanport=self.ora_env_dict["SCAN_PORT"] if self.ocommon.check_key("SCAN_PORT",self.ora_env_dict) else "1521"
406-
connect_str=self.ocommon.get_sqlplus_str(dbhome,osid,osuser,"sys",'HIDDEN_STRING',scanname,scanport,osid,None,None,None)
406+
connect_str=self.ocommon.get_sqlplus_str(dbhome,osid,osuser,"sys",None,scanname,scanport,osid,None,None,None)
407407
status=self.ocommon.get_dbinst_status(osuser,dbhome,osid,connect_str)
408408
if self.ocommon.check_substr_match(status,"OPEN"):
409409
mode="OPEN"
@@ -915,7 +915,7 @@ def get_scan_name(self):
915915
if self.ocommon.check_key("CRS_GPC", self.ora_env_dict):
916916
return self.ocommon.get_public_hostname()
917917
else:
918-
scanname=self.ora_env_dict["SCAN_NAME"]
918+
scan_name=self.ora_env_dict["SCAN_NAME"]
919919
return scan_name
920920

921921
def update_ons(self):

0 commit comments

Comments
 (0)