Monday, November 13, 2017

How to deinstall Oracle Database software

Today i need to clean one Exadata from 12.1 software.
It is the rare operation, so i decided to record it.

The documentation says about runInstaller and deinstall .
And i decided to try runInstaller at first.

But no matter how i tried the runInstaller it always want response file or X Server:

[oracle@edbadm01 dbhome_1]$ ./oui/bin/runInstaller -deinstall -home /u01/app/oracle/product/12.1.0.2/dbhome_1
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 24575 MB    Passed
Checking monitor: must be configured to display at least 256 colors
    >>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set.    Failed <<<<

Some requirement checks failed. You must fulfill these requirements before

continuing with the installation,

Continue? (y/n) [n] y


>>> Ignoring required pre-requisite failures. Continuing...
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-11-13_02-53-04PM. Please wait ...
DISPLAY not set. Please set the DISPLAY and try again.
Depending on the Unix Shell, you can use one of the following commands as examples to set the DISPLAY environment variable:
- For csh:              % setenv DISPLAY 192.168.1.128:0.0
- For sh, ksh and bash:     $ DISPLAY=192.168.1.128:0.0; export DISPLAY
Use the following command to see what shell is being used:
    echo $SHELL
Use the following command to view the current DISPLAY environment variable setting:
    echo $DISPLAY
- Make sure that client users are authorized to connect to the X Server.
To enable client users to access the X Server, open an xterm, dtterm or xconsole as the user that started the session and type the following command:
% xhost +
To test that the DISPLAY environment variable is set correctly, run a X11 based program that comes with the native operating system such as 'xclock':
    % <full path to xclock.. see below>
If you are not able to run xclock successfully, please refer to your PC-X Server or OS vendor for further assistance.
Typical path for xclock: /usr/X11R6/bin/xclock
[oracle@edbadm01 dbhome_1]$


[oracle@edbadm01 dbhome_1]$ ./oui/bin/runInstaller -deinstall -home /u01/app/oracle/product/12.1.0.2/dbhome_1 -silent -ignoreSysPrereqs 
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 24575 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-11-13_02-53-44PM. Please wait ...[oracle@edbadm01 dbhome_1]$ Oracle Universal Installer, Version 12.1.0.2.0 Production
Copyright (C) 1999, 2014, Oracle. All rights reserved.

OUI-10202:No response file is specified for this session. A silent session requires inputs from a response file or from the command line. Specify the response file and re-run the installer.



This way i realized the runInstaller is not my way.

The another tool is deinstall.
Look, how it works:

[oracle@edbadm01 oracle]$ cd $OH/deinstall

[oracle@edbadm01 deinstall]$ ./deinstall -h
Checking for required files and bootstrapping ...
Please wait ...
Unknown option: -h

deinstall
               [ -silent <-checkonly | -paramfile <complete path of input parameter properties file>> ]
               [ -checkonly ]
               [ -local ]
               [ -paramfile <complete path of input parameter properties file> ]
               [ -params <name1=value[ name2=value name3=value ...]> ]
               [ -o <complete path of directory for saving files> ]
               [ -tmpdir <complete path of temporary directory to use> ]
               [ -logdir <complete path of log directory to use> ]
               [ -help : Display this help message. ]


[oracle@edbadm01 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/oracle/product/12.1.0.2/dbhome_1
Oracle Home type selected for deinstall is: Oracle Real Application Cluster Database
Oracle Base selected for deinstall is: /u01/app/oracle
Checking for existence of central inventory location /u01/app/oraInventory
Checking for existence of the Oracle Grid Infrastructure home /u01/app/12.2.0.1/grid
The following nodes are part of this cluster: edbadm01,edbadm02
Active Remote Nodes are edbadm02
Checking for sufficient temp space availability on node(s) : 'edbadm01,edbadm02'

## [END] Install check configuration ##


Network Configuration check config START

Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_check2017-11-13_03-57-25-PM.log

Network Configuration check config END

Database Check Configuration START

Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_check2017-11-13_03-57-26-PM.log

Use comma as separator when specifying list of values as input

Specify the list of database names that are configured in this Oracle home []:
Database Check Configuration END
Oracle Configuration Manager check START
OCM check log file location : /u01/app/oraInventory/logs//ocm_check6085.log
Oracle Configuration Manager check END

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


####################### DECONFIG CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /u01/app/12.2.0.1/grid
The following nodes are part of this cluster: edbadm01,edbadm02
Active Remote Nodes are edbadm02
The cluster node(s) on which the Oracle home deinstallation will be performed are:edbadm01,edbadm02
Oracle Home selected for deinstall is: /u01/app/oracle/product/12.1.0.2/dbhome_1
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
Checking the config status for CCR
edbadm01 : Oracle Home exists with CCR directory, but CCR is not configured
edbadm02 : Oracle Home exists with CCR directory, but CCR is not configured
CCR check is finished
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-11-13_02-57-19-PM.out'
Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2017-11-13_02-57-19-PM.err'

######################## DECONFIG CLEAN OPERATION START ########################
Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_clean2017-11-13_03-58-34-PM.log

Network Configuration clean config START

Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_clean2017-11-13_03-58-34-PM.log

De-configuring Listener configuration file on all nodes...
Listener configuration file de-configured successfully.

De-configuring Naming Methods configuration file on all nodes...
Naming Methods configuration file de-configured successfully.

De-configuring Local Net Service Names configuration file on all nodes...
Local Net Service Names configuration file de-configured successfully.

De-configuring Directory Usage configuration file on all nodes...
Directory Usage configuration file de-configured successfully.

De-configuring backup files on all nodes...
Backup files de-configured successfully.

The network configuration has been cleaned up successfully.

Network Configuration clean config END

Oracle Configuration Manager clean START
OCM clean log file location : /u01/app/oraInventory/logs//ocm_clean6085.log
Oracle Configuration Manager clean END

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


####################### DECONFIG CLEAN OPERATION SUMMARY #######################
Cleaning the config for CCR
As CCR is not configured, so skipping the cleaning of CCR configuration
CCR clean is finished
#######################################################################


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

Using properties file /tmp/deinstall2017-11-13_02-57-10PM/response/deinstall_2017-11-13_02-57-19-PM.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-11-13_02-57-19-PM.out'
Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2017-11-13_02-57-19-PM.err'

######################## DEINSTALL CLEAN OPERATION START ########################
## [START] Preparing for Deinstall ##
Setting LOCAL_NODE to edbadm01
Setting REMOTE_NODES to edbadm02
Setting CLUSTER_NODES to edbadm01,edbadm02
Setting CRS_HOME to false
Setting oracle.installer.invPtrLoc to /tmp/deinstall2017-11-13_02-57-10PM/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/oracle/product/12.1.0.2/dbhome_1' from the central inventory on the local node : Done

Delete directory '/u01/app/oracle/product/12.1.0.2/dbhome_1' on the local node : Done

The Oracle Base directory '/u01/app/oracle' will not be removed on local node. The directory is in use by Oracle Home '/u01/app/oracle/product/12.2.0.1/dbhome_1'.

SEVERE:Remote 'DetachHome' failed on nodes: 'edbadm02'. Refer to '/u01/app/oraInventory/logs/Cleanup2017-11-13_03-58-36-PM.log' for details.
It is recommended that the following command needs to be manually run on the failed nodes:
 /u01/app/oracle/product/12.1.0.2/dbhome_1/oui/bin/platform/linux64/runInstaller -detachHome -noClusterEnabled ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/dbhome_1 "INVENTORY_LOCATION=/u01/app/oraInventory" -invPtrLoc "/tmp/deinstall2017-11-13_02-57-10PM/oraInst.loc" LOCAL_NODE=<node on which command is to be run>.
Please refer 'DetachHome' logs under central inventory of remote nodes where failure occurred for more details.
Detach Oracle home '/u01/app/oracle/product/12.1.0.2/dbhome_1' from the central inventory on the remote nodes 'edbadm02' : Done

Delete directory '/u01/app/oracle/product/12.1.0.2/dbhome_1' on the remote nodes 'edbadm02' : Done

Delete directory '/u01/app/oracle' on the remote nodes 'edbadm02' : Failed <<<<

The directory '/u01/app/oracle' could not be deleted on the nodes 'edbadm02'.
Oracle Universal Installer cleanup completed with errors.

Oracle Universal Installer clean END


## [START] Oracle install clean ##

Clean install operation removing temporary directory '/tmp/deinstall2017-11-13_02-57-10PM' on node 'edbadm01'
Clean install operation removing temporary directory '/tmp/deinstall2017-11-13_02-57-10PM' on node 'edbadm02'

## [END] Oracle install clean ##


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


####################### DEINSTALL CLEAN OPERATION SUMMARY #######################
Successfully detached Oracle home '/u01/app/oracle/product/12.1.0.2/dbhome_1' from the central inventory on the local node.
Successfully deleted directory '/u01/app/oracle/product/12.1.0.2/dbhome_1' on the local node.
Successfully detached Oracle home '/u01/app/oracle/product/12.1.0.2/dbhome_1' from the central inventory on the remote nodes 'edbadm02'.
Successfully deleted directory '/u01/app/oracle/product/12.1.0.2/dbhome_1' on the remote nodes 'edbadm02'.
Failed to delete directory '/u01/app/oracle' on the remote nodes 'edbadm02'.
Oracle Universal Installer cleanup completed with errors.

Run 'rm -r /opt/ORCLfmap' as root on node(s) 'edbadm02' at the end of the session.
Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################


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

[oracle@edbadm01 deinstall]$


Overall:
- it works in text terminal and don't use X Server
- it don't require parameter file
- it is simple: you should go to $OH/deinstall and run ./deinstall command 
- in the RAC environment it remove software from all RAC nodes !

I think it great tool !

Saturday, November 11, 2017

[INS-35354] The system on which you are attempting to install Oracle RAC is not part of valid cluster

As docummentation says

Oracle Clusterware 12c supports Oracle Database 12c and Oracle Database 11g release 2 (11.2.0.3 and later)

But if you will try to install relatively old DB software (11.2.0.3 my case) on the 12.2 Grid then you will get "[INS-35354] The system on which you are attempting to install Oracle RAC is not part of valid cluster":








The reason is simple: new 12.2 oracle inventory hasn't NODE_NAME lines !
For example new 12.2 central inventory:



And central inventory with NODE_NAME limes:



What you should to do ?
SOLUTION:  Add NODE_NAME to the inventory manually 



$ /u01/app/12.2.0.1/grid/oui/bin/runInstaller -silent -ignoresysprereqs -updatenodelist ORACLE_HOME=/u01/app/12.2.0.1/grid "CLUSTER_NODES={ed03dbadm01,ed03dbadm02}" CRS=true
 




Note Doc ID 2003905.1
 






Does DEALLOCATE UNUSED or SHRINK SPACE will free space occupied by LOB segment?

Lets check how it works. My env is DB 19.20@Linux-x64 1) I created the table with 4 LOB columns of 4 different LOB types: BASICFILE BLOB, BA...