Leonardo Santos Lopes
How to manually drop/recreate MGMTDB Database – Oracle Rac One Node 12.2
Category: Database Author: Leonardo Santos Lopes Date: 4 years ago Comments: 0

How to manually drop/recreate MGMTDB Database - Oracle Rac One Node 12.2

Hi everyone,
Today in this article I would like to share my experience regarding drop/recreate the MGMTDB in order to purge the repository and free some space from ASM Disk Group.
I was going to perform a migration from Oracle Database 12.2 Single Instance to an Oracle Database 12.2 Rac One Node, when I found something bizarre. The “+DATA” diskgroup was 59GB of used space and it was a fresh installation (Only few weeks waiting for the “GO” to migrate without any database).
After performing the actions below, I was able free / to get back about 20GB.
Documents used in this procedure:
  • How to Move/Recreate GI Management Repository (GIMR / MGMTDB) to Different Shared Storage (Diskgroup, CFS or NFS etc) (Doc ID 1589394.1)
  • 12.2: How to Create GI Management Repository (Doc ID 2246123.1)
  • MDBUtil: GI Management Repository configuration tool (Doc ID 2065175.1)
Steps:
[oracle@lab-dev-datad1 ~]$ . oraenv

 ORACLE_SID = [+ASM1] ? +ASM1

 The Oracle base remains unchanged with value /u01/base




[oracle@lab-dev-datad1 ~]$ ps -ef | grep pmon
 oracle   19280     1  0 08:21 ?        00:00:00 asm_pmon_+ASM1
 oracle   21769     1  0 08:21 ?        00:00:00 mdb_pmon_-MGMTDB
 oracle   22655 29118  0 11:05 pts/1    00:00:00 grep --color=auto pmon

[oracle@lab-dev-datad1 ~]$ asmcmd lsdg
[oracle@lab-dev-datad1 ~]$ asmcmd -p




ASMCMD [+] > ls -l



State    Type    Rebal  Name



MOUNTED  EXTERN  N      DATA/



MOUNTED  EXTERN  N      FRA/



ASMCMD [+] >

ASMCMD [+] > du FRA




Used_MB      Mirror_used_MB




   2268                2268

ASMCMD [+] > du DATA



Used_MB      Mirror_used_MB



  59292               59292

ASMCMD [+] > cd DATA

ASMCMD [+DATA] > ls -l




Type      Redund  Striped  Time             Sys  Name




                                            Y    ASM/




                                            N    _mgmtdb/




                                            Y    dev-data-clu/




PASSWORD  UNPROT  COARSE   JUL 09 16:00:00  N    orapwasm => +DATA/ASM/PASSWORD/pwdasm.256.1013185265




PASSWORD  UNPROT  COARSE   JUL 09 16:00:00  N    orapwasm_backup => +DATA/ASM/PASSWORD/pwdasm.257.1013185629

ASMCMD [+DATA] > du ASM



Used_MB      Mirror_used_MB



      0                   0

ASMCMD [+DATA] > du _mgmtdb/



Used_MB      Mirror_used_MB



  57776               57776
 
Stopping required resources in both nodes:
As root user, from Grid Home:

 

[root@lab-dev-datad1 ~]# /u01/oracle/base/product/12.2.0/grid/bin/crsctl stop res ora.crf -init

 CRS-2673: Attempting to stop 'ora.crf' on 'lab-dev-datad1'

 CRS-2677: Stop of 'ora.crf' on 'lab-dev-datad1' succeeded




[root@lab-dev-datad2 ~]# /u01/oracle/base/product/12.2.0/grid/bin/crsctl stop res ora.crf -init

 CRS-2673: Attempting to stop 'ora.crf' on 'lab-dev-datad2'

 CRS-2677: Stop of 'ora.crf' on 'lab-dev-datad2' succeeded




[root@lab-dev-datad1 ~]# /u01/oracle/base/product/12.2.0/grid/bin/crsctl modify res ora.crf -attr ENABLED=0 -init

[root@lab-dev-datad2 ~]# /u01/oracle/base/product/12.2.0/grid/bin/crsctl modify res ora.crf -attr ENABLED=0 -init
 
Validate MGMTDB database status:

 

[root@lab-dev-datad1 ~]# /u01/oracle/base/product/12.2.0/grid/bin/srvctl status mgmtdb
 Database is enabled
 Instance -MGMTDB is running on node lab-dev-datad1
 
Deleting MGMTDB using DBCA in silent mode:
As oracle user:

 

[oracle@lab-dev-datad1 ~]$ /u01/oracle/base/product/12.2.0/grid/bin/dbca -silent -deleteDatabase -sourceDB -MGMTDB
 Connecting to database
 4% complete
 9% complete
 14% complete
 19% complete
 23% complete
 28% complete
 47% complete
 Updating network configuration files
 52% complete
 Deleting instance and datafiles
 76% complete
 100% complete
 Look at the log file "/u01/base/cfgtoollogs/dbca/_mgmtdb.log" for further details.
 
Validate the current space from “+DATA” diskgroup:

 

[oracle@lab-dev-datad1 ~]$ asmcmd lsdg
In order to recreate the MGMTDB in Oracle Database 12/R2 (12.2), is required to use a perl script (mdbutil.pl), that you can download from here:
  • MDBUtil: GI Management Repository configuration tool (Doc ID 2065175.1)
Recreating MGMTDB:
Listing options:

 

[oracle@lab-dev-datad1 ~]$ ./mdbutil.pl -h
 Usage:
      Create/Enable MGMTDB & CHM
        mdbutil.pl --addmdb --target=
      Move MGMTDB to another location
        mdbutil.pl --mvmgmtdb --target=
      Check MGMTDB status
        mdbutil.pl --status
mdbutil.pl OPTIONS
    --addmdb            Create MGMTDB/CHM and reconfigure related functions
    --mvmgmtdb          Migrate MGMTDB to another location
    --target='+DATA'    MGMTDB Disk Group location
    --status            Check the CHM & MGMTDB status
    --help              Display this help and exit
    --debug             Verbose commands output/trace
Example:
    Create/Enable MGMTDB:
      mdbutil.pl --addmdb --target=+DATA
    Move MGMTDB to another location:
      mdbutil.pl --mvmgmtdb --target=+REDO
    Check CHM:
      mdbutil.pl --status
 
Launch MGMTDB creation:

 

[oracle@lab-dev-datad1 ~]$ ./mdbutil.pl --addmdb --target=+DATA

mdbutil.pl version : 1.98

 2019-10-04 11:32:18: I Starting To Configure MGMTDB at +DATA…

 2019-10-04 11:32:21: I Container database creation in progress… for GI 12.2.0.1.0

 2019-10-04 11:42:13: I Plugable database creation in progress…

 2019-10-04 11:47:20: I Executing "/tmp/mdbutil.pl --addchm" on lab-dev-datad1 as root to configure CHM.

 root@lab-dev-datad1's password:

 2019-10-04 11:49:50: I MGMTDB & CHM configuration done!

 root@lab-dev-datad2's password:

 2019-10-04 11:49:50: I MGMTDB & CHM configuration done!

 

Modifying back the resource ora.crf in both nodes:
As root user, from Grid Home:

 

[root@lab-dev-datad1 ~]# /u01/oracle/base/product/12.2.0/grid/bin/crsctl modify res ora.crf -attr ENABLED=1 -init

[root@lab-dev-datad1 ~]# /u01/oracle/base/product/12.2.0/grid/bin/crsctl start res ora.crf -init
 CRS-2672: Attempting to start 'ora.crf' on 'lab-dev-datad1'
 CRS-2676: Start of 'ora.crf' on 'lab-dev-datad1' succeeded

[root@lab-dev-datad2 ~]# /u01/oracle/base/product/12.2.0/grid/bin/crsctl modify res ora.crf -attr ENABLED=1 -init

[root@lab-dev-datad2 ~]# /u01/oracle/base/product/12.2.0/grid/bin/crsctl start res ora.crf -init
 CRS-2672: Attempting to start 'ora.crf' on 'lab-dev-datad2'
 CRS-2676: Start of 'ora.crf' on 'lab-dev-datad2' succeeded

[oracle@lab-dev-datad1 ~]$ /u01/oracle/base/product/12.2.0/grid/bin/srvctl status mgmtdb

 Database is enabled

 Instance -MGMTDB is running on node lab-dev-datad1

 

Validate the current size after MGMTDB database creation:

 

[oracle@lab-dev-datad1 ~]$ asmcmd lsdg

 

 

[oracle@lab-dev-datad1 ~]$ asmcmd -p

ASMCMD [+] > ls -l



State    Type    Rebal  Name



MOUNTED  EXTERN  N      DATA/



MOUNTED  EXTERN  N      FRA/

ASMCMD [+] > du DATA Used_MB      Mirror_used_MB   34256               34256

 

From Oracle 12.2 Standalone Cluster is required at least 37.6GB only for MGMTDB

 

Oracle Clusterware Storage Space Requirements (12.2)

 

 

 

See you in the next post!

 

Leonardo Lopes

How to apply patch (PSU) in Oracle Enterprise Manager 13c
Category: Database Author: Leonardo Santos Lopes Date: 5 years ago Comments: 0

How to apply patch (PSU) in Oracle Enterprise Manager 13c

Today in this article I will show you how to apply patch (PSU) in Oracle Enterprise Manager 13c (OEM13c).

 

Before start:
export ORACLE_HOME=/u01/software/em/middleware

export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$ORACLE_HOME/OMSPatcher
 
1 – Download the latest PSU in the MOS (My Oracle Support) and upload the .zip file to the OMS server:

 

– Enterprise Manager 13.2 Master Bundle Patch List (Includes Plugins: 13.2.1, 13.2.2, 13.2.3) (Doc ID 2219797.1)
 
2 – Download the required OPatch and OMSPatcher version as describe in the README of the PSU: (13.9.0.0.0)
 
OPatch:
https://updates.oracle.com/download/6880880.html

 

OMSPatcher:
– Patch 19999993: OMSPatcher patch of version 13.8.0.0.2 for Enterprise Manager Cloud Control 13.2.0.0.0
 
3 – Unzip the patch for the OPatch and apply:
unzip p6880880_139000_Generic.zip -d /home/oracle/6880880
 
cd /home/oracle/6880880
 
$ORACLE_HOME/oracle_common/jdk/bin/java -jar /home/oracle/6880880/opatch_generic.jar -silent oracle_home=$ORACLE_HOME

 

4 – Unzip the new OMSPatcher version:
unzip p19999993_132000_Generic.zip -d /home/oracle/OMSPatcher/
 
mv /home/oracle/OMSPatcher/ /u01/software/em/middleware/
 
mv /u01/software/em/middleware/OMSPatcher/
 
/u01/software/em/middleware/OMSPatcher_old20180427

 

5 – Validate the OPatch and OMSPatcher version:
  $ORACLE_HOME/OPatch/opatch version



e.g.:
OPatch Version: 13.9.3.2.0

OPatch succeeded.
 
$ORACLE_HOME/OMSPatcher/omspatcher version



e.g.:
OMSPatcher Version: 13.8.0.0.2

 OPlan Version: 12.2.0.1.6

 OsysModel build: Wed Mar 21 18:20:48 PDT 2018

 OMSPatcher succeeded.

 

6 – Apply patch in the OPatch agent:
export ORACLE_HOME=/u01/software/em/agent/agent_13.2.0.0.0
 
$ORACLE_HOME/jdk/bin/java -jar /home/oracle/6880880/opatch_generic.jar -silent oracle_home=$ORACLE_HOME
 
$ORACLE_HOME/OPatch/opatch version



e.g.:
OPatch Version: 13.9.3.2.0

OPatch succeeded.
7 – Generating the property file:
export ORACLE_HOME=/u01/software/em/middleware
 
cd $ORACLE_HOME/OMSPatcher/wlskeys
 
$ORACLE_HOME/OMSPatcher/wlskeys/createkeys.sh -oh $ORACLE_HOME -location
 
$ORACLE_HOME/OMSPatcher/wlskeys

 

PS: You will be prompted to enter the credentials for the user: weblogic (Admin Server)

 

8 – Unzip the file and check prerequisites, as oracle:
unzip p27612395_132000_Generic.zip -d /home/oracle/27612395
 
cd /home/oracle/27612395
 
omspatcher apply -analyze -property_file /u01/software/em/middleware/OMSPatcher/wlskeys/properties OMSPatcher.OMS_DISABLE_HOST_CHECK=true

 

PS: DO NOT copy and paste the “omspatcher” command, it does not support. You must type each command manually.

 

9 – Stopping and Applying the patch in the OMS Server:
$ORACLE_HOME/bin/emctl stop oms
 
omspatcher apply -property_file /u01/software/em/middleware/OMSPatcher/wlskeys/properties OMSPatcher.OMS_DISABLE_HOST_CHECK=true

 

10 – Start OMS Server after apply patch:
$ORACLE_HOME/bin/emctl start oms

 

 

 

 

See you in the next post!
 

 

Leonardo Santos Lopes – https://leonardosantoslopes.wordpress.com/
 

 

   

 Disclaimer: “The postings on this site are my own and don’t necessarily represent may actual employer positions, strategies or opinions. The information here was edited to be useful for general purpose, specific data and identifications was removed to allow reach generic audience and to be useful.”


Oracle Certification Matrix
Category: Database Author: Leonardo Santos Lopes Date: 5 years ago Comments: 0

Oracle Certification Matrix

Hi, everyone.
Today in this article I will show you, how to find the certification matrix for one specific Oracle Database Release.

 

PS: Also applied to any other Oracle Product.

Please find the steps below:
1 – Is mandatory to have an account in the My Oracle Support (MOS) website.
2 – After log in into the My Oracle Support, you will find a menu with a few options. Please click on “Certifications” tab:
 
 
3 – You will find in the right side menu, two mandatory fields (Product and Release) to be filled up.
e.g.:
Product:
Release:
After choose the “Product” and “Release” you can click on the button “Search“.

Ps: The “Platform” field is not mandatory to be filled up.
4 – The search results will bring you a list of a few products (Operating Systems, Application Servers, Middleware and etc.) that is certified to be used with the requested release:
See you in the next post!
 

 

Leonardo Santos Lopes – https://leonardosantoslopes.wordpress.com/
 

 

   

 Disclaimer: “The postings on this site are my own and don’t necessarily represent may actual employer positions, strategies or opinions. The information here was edited to be useful for general purpose, specific data and identifications was removed to allow reach generic audience and to be useful.”


How to Upgrade Oracle Restart from 12.1 to 12.2 – (Bug 26554987)
Category: Database Author: Leonardo Santos Lopes Date: 5 years ago Comments: 0

How to Upgrade Oracle Restart from 12.1 to 12.2 – (Bug 26554987)

Hi, everyone.
Today in this article I will show you, how to upgrade Oracle Grid Infrastructure for Standalone without ASM instance (Oracle Restart).
Please find below the required steps to accomplish this task:
Prerequisites:
  1.  Download Oracle Grid Infrastructure 12.2.
  2.  Download latest or desired RU (Release Update).
  3.  Download latest OPatch version compatible with your current release.
Bug:
I came across a bug during the gridSetup.sh related to the upgrade option:
“Oracle Restart: Grid Infrastructure Upgrade from 12.1 to 12.2 Failed with ORA-01078 ORA-29701 CLSRSC-164 message while ASM was not in use (Doc ID 2369909.1)”
 
It happens if you are upgrading the Grid Infrastructure (Oracle Restart only) from 11.2 or 12.1 to 12.2 or beyond.
 
There is a bug fix for it: “Bug 26554987 fixed in 18.1. Apply patch 26554987 on 12.2 home and re-execute rootupgrade.sh”
 
In my case, I did not had the chance to find the bug fix to the platform I am working for: “Oracle Solaris Sparc x64.”
To solve it, we are going to apply the Release Update “12.2.0.1.190416” before run the gridSetup.sh.

Oracle Restart 12.2 installations steps:
 
  1.  unzip the Oracle Grid Infrastructure to the new ORACLE_HOME:
  • export ORACLE_HOME=/oracle/app/grid_122
  • cd /oracle/iso/
  • unzip Oracle_Grid_12.2.0.1_V840013-01.zip -d $ORACLE_HOME
  1.  unzip the new OPatch to the new ORACLE_HOME:
  • export ORACLE_HOME=/oracle/app/grid_122
  • cd $ORACLE_HOME
  • mv OPatch OPatch_old
  • unzip /oracle/iso/OPatch_p6880880_122010_SOLARIS64.zip -d $ORACLE_HOME
  1.  unzip the Release Update Patch:
  • cd /oracle/iso/
  • unzip GI_APR_2019_Release_Update_12.2.0.1.190416_p29301687_122010_SOLARIS64.zip
  1.  Apply the Release Update before complete the Grid Infrastructure Upgrade: (As grid user)
  • export ORACLE_HOME=/oracle/app/grid_122
$ORACLE_HOME/gridSetup.sh -applyPSU /oracle/iso/29301687
PS: DO NOT EXECUTE root.sh or rootupgrade.sh before follow up this procedure, only after apply the steps below.
e.g.:
-bash-4.4$ $ORACLE_HOME/gridSetup.sh -applyPSU /oracle/iso/29301687
Preparing the home to patch…
Applying the patch /oracle/iso/29301687…
Successfully applied the patch.
The log can be found at: /oracle/app/oraInventory/logs/GridSetupActions2019-05-28_03-07-45PM/installerPatchActions_2019-05-28_03-07-45PM.log
Launching Oracle Grid Infrastructure Setup Wizard…
 
  1. When the patching process is done, it automatically calls the installation wizard.
Please find below the installation process through installation wizard:
 
 
  1. Done, installation successfully.
 
 
 
 Leonardo Santos Lopes –  https://leonardosantoslopes.wordpress.com/