Home » Other » General » Problem with Oracle supplied perl script (GI 18c, Windows)
Problem with Oracle supplied perl script [message #678262] Thu, 21 November 2019 06:05 Go to next message
John Watson
Messages: 8962
Registered: January 2010
Location: Global Village
Senior Member
I have a big problem with an upgrade of a RAC from 12.1 to 18c (can't go to 19c, becaused this is SE2) on Windows. We've had a P1 TAR open for two months. I am convinced that the problem is with the perl script crsupgrade.pm, which does not seem to have been correctly ported from Unix. My perl skills are zero, which doesn't help. This is the problem block:
#-------------------------------------------------------------------------------
# Function: checks if the user running the upgrade matches with the owner
# of the old crs home.
# Args    : none
# Returns : TRUE or FALSE
#-------------------------------------------------------------------------------
sub checkOldCrsOwner
{
  my $ch = $CFG->OLD_CRS_HOME;
  my $cssd_bin = "$ch/bin/ocssd.bin";
  my $old_ch_owner = getBinaryOwner($cssd_bin);

  my $ch_owner = $CFG->params('ORACLE_OWNER');

  trace("new CH owner = $ch_owner");
  trace("old CH owner = $old_ch_owner");
  if ($old_ch_owner != $ch_owner)
  {
    print_error(360, $old_ch_owner, $ch_owner);
    return FALSE;
  }

  return TRUE;
}
The first problem is obvious: the fourth line of the function is looking for ocssd.bin which does not exist on Windows. I told them this, and they agreed that I must edit the line to
my $cssd_bin = "$ch\bin\ocssd.exe";
but now it fails with this error:
C:\app\18.0.0\grid18\crs\config\gridconfig.bat, -upgrade, ] error = [Missing braces on \o{} at C:\app\18.0.0\grid18\crs\install/crsupgrade.pm line 4016, near "$ch", Compilation failed in require at C:\app\18.0.0\grid18\crs\install\rootcrs.pl line 185., BEGIN failed--compilation aborted at C:\app\18.0.0\grid18\crs\install\rootcrs.pl line 185.]
(that line is indeed line 4016). I've been trying to understand what the problem is. Could it be that perl does not realize where the variable $ch ends and the string to which it pre-pended begins? Would this be something that would work on Unix with forward slash directory delimiters and fail on Windows with back slash delimiters? If so, where should I add the {} braces?
I've asked Support about this, but all they have done is set it to "Review Defect". My perl sjkills are not up to this, can anyone advise?
I'll attach the complete, unedited, perl script.
Thank you for any insight.
Re: Problem with Oracle supplied perl script [message #678263 is a reply to message #678262] Thu, 21 November 2019 06:53 Go to previous messageGo to next message
Frank Naude
Messages: 4587
Registered: April 1998
Senior Member
Quick guess, use double backslashes:
my $cssd_bin = "$ch\\bin\\ocssd.exe";

\o{} === Octal escape sequence.
Re: Problem with Oracle supplied perl script [message #678265 is a reply to message #678263] Thu, 21 November 2019 07:12 Go to previous messageGo to next message
John Watson
Messages: 8962
Registered: January 2010
Location: Global Village
Senior Member
I'll try that first thing tomorrow.

ps - nice to hear from you, Frank.
Re: Problem with Oracle supplied perl script [message #678266 is a reply to message #678262] Thu, 21 November 2019 07:48 Go to previous message
John Watson
Messages: 8962
Registered: January 2010
Location: Global Village
Senior Member
Amazing! Support has come back with something:
	
Hi,

Please modify the crsupgrade.pm as follows:

- current file:

4013 sub checkOldCrsOwner
4014 {
4015 my $ch = $CFG->OLD_CRS_HOME;
4016 my $cssd_bin = "$ch\bin\ocssd.exe";
4017 my $old_ch_owner = getBinaryOwner($cssd_bin);
4018

- new change needed:

4013 sub checkOldCrsOwner
4014 {
4015 my $ch = $CFG->OLD_CRS_HOME;
4016 my $cssd_bin;
4017 $cssd_bin = catfile($ch, "bin", "ocssd.exe");
4018 my $old_ch_owner = getBinaryOwner($cssd_bin);
Previous Topic: Oracle licensing
Next Topic: Trigger execution shows up in DBA_Objects with execution time as Last_DDL_Time
Goto Forum:
  


Current Time: Fri Dec 27 22:15:58 CST 2024