User Rating: 0 / 5

Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

Quick article to show how to remove Oracle databases and Oracle Grid Infrastructure 12cR2.

PLEASE, READ THIS FIRST
This is a critical manipulation which will be quite hard to revert without a backup. So make sure you are on the right database and you have a working backup.
I decline all responsibility for loss or damage on your database.

Before starting, you'll need
- Oracle Grid Infrastructure 12cR2 already installed
  (if not, check how to install Oracle Grid Infrastructure 12cR2 for RAC)
  (Or how to Install Oracle Grid Infrastructure 12cR2 Standalone)
- A Oracle Database Instance already installed
  (if not, check how to Silent database 12c creation with dbca)
- root access

In this scenario, UXOCDB database will be removed then Oracle GI 12cR2 will be deinstalled.

Remove a Database Instance

It is recommanded to remove all database instances which use Oracle GI 12cR2 first.

On oralab01 server as oracle user :

# List database instances
[[email protected]]$ srvctl status database -thishome

# Set oracle env
[oracle]$ . oraenv
    ORACLE_SID = [UXOCDB] ?
    The Oracle base has been set to /u01/app/oracle

# Remove instance UXOCDB
[oracle]$ dbca -silent -deleteDatabase -sourceDB UXOCDB
    Enter SYS user password:

    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/app/oracle/cfgtoollogs/dbca/UXOCDB.log" for further details.

Deinstall Grid Infrastructure

On oralab01 server as grid user:

# Set grid environement
[grid]$ . oraenv
    ORACLE_SID = [root] ? +ASM
    The Oracle base has been set to /u01/app/grid

# Deinstall Grid Infrastructure
[grid]$ $ORACLE_HOME/deinstall/deinstall
    Checking for required files and bootstrapping ...
    Please wait ...
    Location of logs /u01/app/oraInventory/logs/

    ############ ORACLE DECONFIG TOOL START ############


    ######################### DECONFIG CHECK OPERATION START #########################
    ## [START] Install check configuration ##


    Checking for existence of the Oracle home location /u01/app/12.2.0/grid
    Oracle Home type selected for deinstall is: Oracle Grid Infrastructure for a Standalone Server
    Oracle Base selected for deinstall is: /u01/app/grid
    Checking for existence of central inventory location /u01/app/oraInventory
    Checking for existence of the Oracle Grid Infrastructure home /u01/app/12.2.0/grid

    ## [END] Install check configuration ##

    Traces log file: /u01/app/oraInventory/logs//crsdc_2017-09-28_10-29-01-AM.log

    Network Configuration check config START

    Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_check2017-09-28_10-29-01-AM.log

    Specify all Oracle Restart enabled listeners that are to be de-configured. Enter .(dot) to deselect all. [LISTENER]:

    Network Configuration check config END

    Asm Check Configuration START

    ASM de-configuration trace file location: /u01/app/oraInventory/logs/asmcadc_check2017-09-28_10-29-04-AM.log

    Automatic Storage Management (ASM) instance is detected in this Oracle home /u01/app/12.2.0/grid.
    ASM Diagnostic Destination : /u01/app/grid
    ASM Diskgroups : +DATA,+FRA
    ASM diskstring : /dev/sd*
    Diskgroups will be dropped
    De-configuring ASM will drop all the diskgroups and their contents at cleanup time. This will affect all of the databases and ACFS that use this ASM instance(s).
     If you want to retain the existing diskgroups or if any of the information detected is incorrect, you can modify by entering 'y'. Do you  want to modify above information (y|n) [n]:
    Database Check Configuration START

    Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_check2017-09-28_10-29-12-AM.log

    Database Check Configuration END

    ######################### DECONFIG CHECK OPERATION END #########################


    ####################### DECONFIG CHECK OPERATION SUMMARY #######################
    Oracle Grid Infrastructure Home is: /u01/app/12.2.0/grid
    Oracle Home selected for deinstall is: /u01/app/12.2.0/grid
    Inventory Location where the Oracle home registered is: /u01/app/oraInventory
    Following Oracle Restart enabled listener(s) will be de-configured: LISTENER
    ASM instance will be de-configured from this Oracle home
    Do you want to continue (y - yes, n - no)? [n]: y
    A log of this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2017-09-28_10-28-59-AM.out'
    Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2017-09-28_10-28-59-AM.err'

    ######################## DECONFIG CLEAN OPERATION START ########################
    Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_clean2017-09-28_10-29-14-AM.log
    ASM de-configuration trace file location: /u01/app/oraInventory/logs/asmcadc_clean2017-09-28_10-29-14-AM.log
    ASM Clean Configuration START
    ASM Clean Configuration END

    Network Configuration clean config START

    Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_clean2017-09-28_10-39-57-AM.log

    De-configuring Oracle Restart enabled listener(s): LISTENER

    De-configuring listener: LISTENER
        Stopping listener: LISTENER
        Listener stopped successfully.
        Unregistering listener: LISTENER
        Listener unregistered successfully.
        Deleting listener: LISTENER
        Listener deleted successfully.
    Listener de-configured successfully.

    De-configuring Naming Methods configuration file...
    Naming Methods configuration file de-configured successfully.

    De-configuring backup files...
    Backup files de-configured successfully.

    The network configuration has been cleaned up successfully.

    Network Configuration clean config END


    ---------------------------------------->

    Run the following command as the root user or the administrator on node "oralab01".

    /u01/app/12.2.0/grid/crs/install/roothas.sh -force  -deconfig -paramfile "/tmp/deinstall2017-09-28_10-28-50AM/response/deinstall_OraGI12Home1.rsp"

    Press Enter after you finish running the above commands

    <----------------------------------------

Open another terminal as root, and execute the asked command:

# Execute root script
[root]$ /u01/app/12.2.0/grid/crs/install/roothas.sh -force  -deconfig -paramfile "/tmp/deinstall2017-09-28_10-28-50AM/response/deinstall_OraGI12Home1.rsp"
    Using configuration parameter file: /tmp/deinstall2017-09-28_10-28-50AM/response/deinstall_OraGI12Home1.rsp
    The log of current session can be found at:
      /u01/app/oraInventory/logs/hadeconfig.log
    CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'oralab01'
    CRS-2673: Attempting to stop 'ora.evmd' on 'oralab01'
    CRS-2677: Stop of 'ora.evmd' on 'oralab01' succeeded
    CRS-2673: Attempting to stop 'ora.cssd' on 'oralab01'
    CRS-2677: Stop of 'ora.cssd' on 'oralab01' succeeded
    CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'oralab01' has completed
    CRS-4133: Oracle High Availability Services has been stopped.
    2017/09/28 10:51:49 CLSRSC-337: Successfully deconfigured Oracle Restart stack

Then return to the other terminal as grid, and press enter:

...
    ---------------------------------------->

    Run the following command as the root user or the administrator on node "oralab01".

    /u01/app/12.2.0/grid/crs/install/roothas.sh -force  -deconfig -paramfile "/tmp/deinstall2017-09-28_10-28-50AM/response/deinstall_OraGI12Home1.rsp"

    Press Enter after you finish running the above commands

    <----------------------------------------

    ######################### DECONFIG CLEAN OPERATION END #########################


    ####################### DECONFIG CLEAN OPERATION SUMMARY #######################
    ASM instance was de-configured successfully from the Oracle home
    Following Oracle Restart enabled listener(s) were de-configured successfully: LISTENER
    Oracle Restart was already stopped and de-configured on node "oralab01"
    Oracle Restart is stopped and de-configured successfully.
    #######################################################################


    ############# ORACLE DECONFIG TOOL END #############

    Using properties file /tmp/deinstall2017-09-28_10-28-50AM/response/deinstall_2017-09-28_10-28-59-AM.rsp
    Location of logs /u01/app/oraInventory/logs/

    ############ ORACLE DEINSTALL TOOL START ############





    ####################### DEINSTALL CHECK OPERATION SUMMARY #######################
    A log of this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2017-09-28_10-28-59-AM.out'
    Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2017-09-28_10-28-59-AM.err'

    ######################## DEINSTALL CLEAN OPERATION START ########################
    ## [START] Preparing for Deinstall ##
    Setting LOCAL_NODE to oralab01
    Setting CRS_HOME to true
    Setting oracle.installer.invPtrLoc to /tmp/deinstall2017-09-28_10-28-50AM/oraInst.loc
    Setting oracle.installer.local to false

    ## [END] Preparing for Deinstall ##

    Setting the force flag to false
    Setting the force flag to cleanup the Oracle Base
    Oracle Universal Installer clean START

    Detach Oracle home '/u01/app/12.2.0/grid' from the central inventory on the local node : Done

    Delete directory '/u01/app/12.2.0/grid' on the local node : Done

    The Oracle Base directory '/u01/app/grid' will not be removed on local node. The directory is not empty.

    Oracle Universal Installer cleanup was successful.

    Oracle Universal Installer clean END


    ## [START] Oracle install clean ##


    ## [END] Oracle install clean ##


    ######################### DEINSTALL CLEAN OPERATION END #########################


    ####################### DEINSTALL CLEAN OPERATION SUMMARY #######################
    Successfully detached Oracle home '/u01/app/12.2.0/grid' from the central inventory on the local node.
    Successfully deleted directory '/u01/app/12.2.0/grid' on the local node.
    Oracle Universal Installer cleanup was successful.

    Review the permissions and contents of '/u01/app/grid' on nodes(s) 'oralab01'.
    If there are no Oracle home(s) associated with '/u01/app/grid', manually delete '/u01/app/grid' and its contents.
    Oracle deinstall tool successfully cleaned up temporary directories.
    #######################################################################


    ############# ORACLE DEINSTALL TOOL END #############

# Delete files as root (WARNING! Check you are on the right server)
[[email protected]]$ su - -c "rm -rf /etc/oraInst.loc /opt/ORCLfmap /etc/oratab /u01/app/grid"
    Password:

Deinstall is finished, you can delete grid directory contents if not nedded anymore:
[root]$ rm -fr /u01/app/grid/* /etc/oraInst.loc /opt/ORCLfmap /etc/oratab

HTH,
Michel.

Enjoyed this article? Please like it or share it.

Add comment

Please connect with one of social login below (or fill up name and email)

     


Security code
Refresh