Forum Stats

  • 3,722,124 Users
  • 2,244,226 Discussions
  • 7,849,646 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

mdbutil throw some errors when I check status or move MGMTDB to other diskgroup ?

Mario Goren
Mario Goren Member Posts: 11 Blue Ribbon

Hello,

Looks like a Warning but but I don't know why this message are thrown (mdbutil.pl version : 1.99 )

/tmp/mdbutil.pl --mvmgmtdb --target=+MGMT --debug

mdbutil.pl version : 1.99

2020-08-25 11:05:26: D Executing: /u01/12.2.0.1/grid/bin/srvctl status diskgroup -g MGMT

2020-08-25 11:05:28: D Exit code: 0

2020-08-25 11:05:28: D Output of last command execution:

Disk Group MGMT is running on mp-pre-db-2,mp-pre-db-1

2020-08-25 11:05:28: D Executing: /u01/12.2.0.1/grid/bin/srvctl status mgmtdb

2020-08-25 11:05:30: D Exit code: 0

2020-08-25 11:05:30: D Output of last command execution:

Database is enabled

2020-08-25 11:05:30: D Executing: /u01/12.2.0.1/grid/bin/srvctl status mgmtdb

2020-08-25 11:05:32: D Exit code: 0

2020-08-25 11:05:32: D Output of last command execution:

Database is enabled

Moving MGMTDB, it will be stopped, are you sure (Y/N)? Y

2020-08-25 11:05:55: D Executing: /u01/12.2.0.1/grid/bin/oclumon manage -get reppath

2020-08-25 11:05:56: D Exit code: 0

2020-08-25 11:05:56: D Output of last command execution:

2020-08-25 11:05:56: D Executing: ps -eo args | grep -v grep | grep asm_pmon

2020-08-25 11:05:56: D Exit code: 0

2020-08-25 11:05:56: D Output of last command execution:

asm_pmon_+ASM1

2020-08-25 11:05:56: I Checking for the required paths under +MGMT

2020-08-25 11:05:56: D Executing: export ORACLE_SID=+ASM1;export ORACLE_HOME=/u01/12.2.0.1/grid;/u01/12.2.0.1/grid/bin/asmcmd --nocp ls '+MGMT/_MGMTDB/PARAMETERFILE/'

sh: ORACLE_SID=+ASM1: is not an identifier

2020-08-25 11:05:56: D Exit code: 1

2020-08-25 11:05:56: D Output of last command execution:

2020-08-25 11:05:56: I Creating new path +MGMT/_MGMTDB/PARAMETERFILE

2020-08-25 11:05:56: D Executing: export ORACLE_SID=+ASM1;export ORACLE_HOME=/u01/12.2.0.1/grid;/u01/12.2.0.1/grid/bin/asmcmd --nocp mkdir '+MGMT/_MGMTDB/'

sh: ORACLE_SID=+ASM1: is not an identifier

2020-08-25 11:05:56: D Exit code: 1

2020-08-25 11:05:56: D Output of last command execution:

2020-08-25 11:05:56: D Executing: export ORACLE_SID=+ASM1;export ORACLE_HOME=/u01/12.2.0.1/grid;/u01/12.2.0.1/grid/bin/asmcmd --nocp mkdir '+MGMT/_MGMTDB/PARAMETERFILE/'

sh: ORACLE_SID=+ASM1: is not an identifier

2020-08-25 11:05:56: D Exit code: 1

2020-08-25 11:05:56: D Output of last command execution:

2020-08-25 11:05:56: E Cannot create required path +MGMT/_MGMTDB/PARAMETERFILE, exiting...

Checking status

2020-08-24 17:05:32: I Checking CHM status...

2020-08-24 17:05:35: I Listener MGMTLSNR is configured and running on mp-pre-db-1

2020-08-24 17:05:40: I Database MGMTDB is configured and running on mp-pre-db-1

2020-08-24 17:05:41: I Cluster Health Monitor (CHM) is configured and running

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

CHM Repository Path = +VOTOCR/_MGMTDB/516B058221CF097BE054002128F9FA7C/DATAFILE/sysmgmtdata.281.946076371

sh: ORACLE_SID=+ASM1: is not an identifier

Use of uninitialized value in scalar chomp at ./mdbutil_2.pl line 2022.

Use of uninitialized value in substitution (s///) at ./mdbutil_2.pl line 2023.

Use of uninitialized value in substitution (s///) at ./mdbutil_2.pl line 2023.

Use of uninitialized value in concatenation (.) or string at ./mdbutil_2.pl line 466.

MGMTDB space used on DG +VOTOCR =  Mb

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

2020-08-24 17:05:42: W Not able to get the MGMTDB size

With Debug I get this

-bash-3.2$ ./mdbutil_2.pl --status --debug

mdbutil.pl version : 1.99

2020-08-24 17:10:39: I Checking CHM status...

2020-08-24 17:10:39: D Executing: /u01/12.2.0.1/grid/bin/srvctl status mgmtlsnr

2020-08-24 17:10:41: D Exit code: 0

2020-08-24 17:10:41: D Output of last command execution:

Listener MGMTLSNR is enabled

2020-08-24 17:10:41: D Executing: /u01/12.2.0.1/grid/bin/srvctl status mgmtlsnr

2020-08-24 17:10:43: D Exit code: 0

2020-08-24 17:10:43: D Output of last command execution:

Listener MGMTLSNR is enabled

2020-08-24 17:10:43: I Listener MGMTLSNR is configured and running on mp-pre-db-1

2020-08-24 17:10:43: D Executing: /u01/12.2.0.1/grid/bin/srvctl status mgmtdb

2020-08-24 17:10:45: D Exit code: 0

2020-08-24 17:10:45: D Output of last command execution:

Database is enabled

2020-08-24 17:10:45: D Executing: /u01/12.2.0.1/grid/bin/srvctl status mgmtdb

2020-08-24 17:10:47: D Exit code: 0

2020-08-24 17:10:47: D Output of last command execution:

Database is enabled

2020-08-24 17:10:47: I Database MGMTDB is configured and running on mp-pre-db-1

2020-08-24 17:10:47: D Executing: /u01/12.2.0.1/grid/bin/crsctl stat res ora.crf -init

2020-08-24 17:10:48: D Exit code: 0

2020-08-24 17:10:48: D Output of last command execution:

NAME=ora.crf

2020-08-24 17:10:48: D Executing: /u01/12.2.0.1/grid/bin/crsctl stat res ora.crf -init

2020-08-24 17:10:48: D Exit code: 0

2020-08-24 17:10:48: D Output of last command execution:

NAME=ora.crf

2020-08-24 17:10:48: D Executing: /u01/12.2.0.1/grid/bin/crsctl stat type ora.crf.type -init

2020-08-24 17:10:49: D Exit code: 0

2020-08-24 17:10:49: D Output of last command execution:

TYPE_NAME=ora.crf.type

2020-08-24 17:10:49: I Cluster Health Monitor (CHM) is configured and running

2020-08-24 17:10:49: D Executing: /u01/12.2.0.1/grid/bin/oclumon manage -get reppath

2020-08-24 17:10:49: D Exit code: 0

2020-08-24 17:10:49: D Output of last command execution:

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

CHM Repository Path = +VOTOCR/_MGMTDB/516B058221CF097BE054002128F9FA7C/DATAFILE/sysmgmtdata.281.946076371

2020-08-24 17:10:49: D Executing: ps -eo args | grep -v grep | grep asm_pmon

2020-08-24 17:10:49: D Exit code: 0

2020-08-24 17:10:49: D Output of last command execution:

asm_pmon_+ASM1

2020-08-24 17:10:49: D Executing: export ORACLE_SID=+ASM1;export ORACLE_HOME=/u01/12.2.0.1/grid;/u01/12.2.0.1/grid/bin/asmcmd --nocp du --suppressheader '+VOTOCR/_MGMTDB/'

sh: ORACLE_SID=+ASM1: is not an identifier

2020-08-24 17:10:49: D Exit code: 1

2020-08-24 17:10:49: D Output of last command execution:

Use of uninitialized value in scalar chomp at ./mdbutil_2.pl line 2022.

Use of uninitialized value in substitution (s///) at ./mdbutil_2.pl line 2023.

Use of uninitialized value in substitution (s///) at ./mdbutil_2.pl line 2023.

Use of uninitialized value in concatenation (.) or string at ./mdbutil_2.pl line 466.

MGMTDB space used on DG +VOTOCR =  Mb

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

2020-08-24 17:10:49: W Not able to get the MGMTDB size

Best Answer

  • Mario Goren
    Mario Goren Member Posts: 11 Blue Ribbon
    edited August 2020 Accepted Answer

    Look like perl look for sh shell, and the assignment of the variables depending on the shell have different syntaxes. The two form in this scrip don't work, maybe you have to link /bin/sh with other shell or change inside the script the syntaxis.

    return "setenv ORACLE_SID $sid;setenv ORACLE_HOME $orahome"; don't work

    return "setenv ORACLE_SID $sid;setenv ORACLE_HOME $orahome"; don't work

    "ORACLE_SID=$sid;export ORACLE_SID;ORACLE_HOME=$orahome; export ORACLE_HOME" work

    Use the --status to verify that ORACLE_SID is correctly assigned

Answers

  • Mario Goren
    Mario Goren Member Posts: 11 Blue Ribbon
    edited August 2020

    Hello

    Now look like it work (* are print of variable I added)

    -bash-3.2$ ./mdbutil.pl --status

    mdbutil.pl version : 1.99

    2020-08-25 16:17:11: I Checking CHM status...

    2020-08-25 16:17:14: I Listener MGMTLSNR is configured and running on mp-pre-db-1

    2020-08-25 16:17:18: I Database MGMTDB is configured and running on mp-pre-db-1

    2020-08-25 16:17:20: I Cluster Health Monitor (CHM) is configured and running

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

    CHM Repository Path = +VOTOCR/_MGMTDB/516B058221CF097BE054002128F9FA7C/DATAFILE/sysmgmtdata.281.946076371

    *   SID +ASM1

    *   CRS /u01/12.2.0.1/grid

    *  SHELL otro shell

    *  RC 0

    *  OUT Executing cmd: ORACLE_SID=+ASM1;export ORACLE_SID;ORACLE_HOME=/u01/12.2.0.1/grid; export ORACLE_HOME;/u01/12.2.0.1/grid/bin/asmcmd --nocp du --suppressheader '+VOTOCR/_MGMTDB/'

    *   ENVIRONMENT  ORACLE_SID=+ASM1;export ORACLE_SID;ORACLE_HOME=/u01/12.2.0.1/grid; export ORACLE_HOME

    MGMTDB space used on DG +VOTOCR = 43361 Mb

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

    Look like the issue is that the only commands that accept to set de environment are    

    "ORACLE_SID=$sid;export ORACLE_SID;ORACLE_HOME=$orahome; export ORACLE_HOME"

    no set env and no export VARIABLE=xxx

    So I changed the both returns and have no issues on any shell.

    sub racsetenv {

      my $orahome = $_[0];

      my $sid = defined $_[1]?$_[1]:"";

      if ($ENV{"SHELL"} eq "csh") {

        return "setenv ORACLE_SID $sid;setenv ORACLE_HOME $orahome";

      } else {

        return "export ORACLE_SID=$sid;export ORACLE_HOME=$orahome";

      }

    }

    Any idea why if I set csh the setenv is not found, and if I set bash the export ORACLE_SID=+ASM1..... not work?

    thank you

    Mario Goren
  • Mario Goren
    Mario Goren Member Posts: 11 Blue Ribbon
    edited August 2020 Accepted Answer

    Look like perl look for sh shell, and the assignment of the variables depending on the shell have different syntaxes. The two form in this scrip don't work, maybe you have to link /bin/sh with other shell or change inside the script the syntaxis.

    return "setenv ORACLE_SID $sid;setenv ORACLE_HOME $orahome"; don't work

    return "setenv ORACLE_SID $sid;setenv ORACLE_HOME $orahome"; don't work

    "ORACLE_SID=$sid;export ORACLE_SID;ORACLE_HOME=$orahome; export ORACLE_HOME" work

    Use the --status to verify that ORACLE_SID is correctly assigned

Sign In or Register to comment.