Deinstall 12cR1 Oracle Database Software

[oracle@racnode1 ~]$ cd $ORACLE_HOME/deinstall
[oracle@racnode1 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/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/18.0.0/grid
The following nodes are part of this cluster: racnode1
Checking for sufficient temp space availability on node(s) : 'racnode1'

## [END] Install check configuration ##


Network Configuration check config START

Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_check2020-03-12_05-38-36-PM.log

Network Configuration check config END

Database Check Configuration START

Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_check2020-03-12_05-38-37-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 [RACTEST1,RACTEST]:

###### For Database 'RACTEST1' ######

Specify the type of this database (1.Single Instance Database|2.Oracle Restart Enabled Database|3.RAC Database|4.RAC One Node Database) [1]: 3
Specify the list of nodes on which this database has instances [racnode1]:
Specify the list of instance names [RACTEST1]:
Specify the local instance name on node [RACTEST1]:
Specify the diagnostic destination location of the database [/u01/app/oracle/diag/rdbms/ractest1]:
Specify the storage type used by the Database ASM|FS []: ASM

###### For Database 'RACTEST' ######

Specify the type of this database (1.Single Instance Database|2.Oracle Restart Enabled Database|3.RAC Database|4.RAC One Node Database) [1]: 3
Specify the list of nodes on which this database has instances [racnode1]:
Specify the list of instance names [RACTEST]:
Specify the local instance name on node [RACTEST]:
Specify the diagnostic destination location of the database [/u01/app/oracle/diag/rdbms/ractest]:
Specify the storage type used by the Database ASM|FS []: ASM


Database Check Configuration END
Oracle Configuration Manager check START
OCM check log file location : /u01/app/oraInventory/logs//ocm_check7431.log
Oracle Configuration Manager check END

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


####################### DECONFIG CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /u01/app/18.0.0/grid
The following nodes are part of this cluster: racnode1

WARNING !
Deinstall utility has detected that Oracle Clusterware processes are not running on the local node, 
hence entries of Real Application Cluster Databases that are being deinstalled will not be removed from Oracle Cluster Registry (OCR). 
For complete deinstallation of Real Application Cluster Databases, it is recommended to run the deinstall utility with Oracle Clusterware running.

The cluster node(s) on which the Oracle home deinstallation will be performed are:racnode1
Oracle Home selected for deinstall is: /u01/app/oracle/product/12.1.0/dbhome_1
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
The following databases were selected for de-configuration : RACTEST1,RACTEST
Database unique name : RACTEST1
Storage used : ASM
Database unique name : RACTEST
Storage used : ASM
Checking the config status for CCR
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_deconfig2020-03-12_05-38-34-PM.out'
Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2020-03-12_05-38-34-PM.err'

######################## DECONFIG CLEAN OPERATION START ########################
Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_clean2020-03-12_05-41-05-PM.log
Database Clean Configuration START RACTEST1
This operation may take few minutes.
Database Clean Configuration END RACTEST1
Database Clean Configuration START RACTEST
This operation may take few minutes.
Database Clean Configuration END RACTEST

Network Configuration clean config START

Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_clean2020-03-12_05-41-46-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_clean7431.log
Oracle Configuration Manager clean END

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


####################### DECONFIG CLEAN OPERATION SUMMARY #######################
Successfully de-configured the following database instances : RACTEST1,RACTEST
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/deinstall2020-03-12_05-38-26PM/response/deinstall_2020-03-12_05-38-34-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_deconfig2020-03-12_05-38-34-PM.out'
Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2020-03-12_05-38-34-PM.err'

######################## DEINSTALL CLEAN OPERATION START ########################
## [START] Preparing for Deinstall ##
Setting LOCAL_NODE to racnode1
Setting CLUSTER_NODES to racnode1
Setting CRS_HOME to false
Setting oracle.installer.invPtrLoc to /tmp/deinstall2020-03-12_05-38-26PM/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/dbhome_1' from the central inventory on the local node : Done

Delete directory '/u01/app/oracle/product/12.1.0/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/dbhome_1'.

Oracle Universal Installer cleanup was successful.

Oracle Universal Installer clean END


## [START] Oracle install clean ##

Clean install operation removing temporary directory '/tmp/deinstall2020-03-12_05-38-26PM' on node 'racnode1'

## [END] Oracle install clean ##


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


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

Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################


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

Check and Confirm Inventory Updated.
[oracle@racnode1 app]$ ls -ltr /u01/app/oracle/product/12.1.0
total 0
[oracle@racnode1 app]$
[oracle@racnode1 ContentsXML]$ cat inventory.xml
<?xml version="1.0" standalone="yes" ?>
<!-- Copyright (c) 1999, 2014, Oracle and/or its affiliates.
All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<INVENTORY>
<VERSION_INFO>
<SAVED_WITH>12.1.0.2.0</SAVED_WITH>
<MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME="OraDB12Home2" LOC="/u01/app/oracle/product/12.2.0/dbhome_1" TYPE="O" IDX="4"/>
<HOME NAME="OraGI18Home1" LOC="/u01/app/18.0.0/grid" TYPE="O" IDX="5" CRS="true"/>
<HOME NAME="OraGI12Home1" LOC="/u01/app/12.1.0/grid" TYPE="O" IDX="1" REMOVED="T"/>
<HOME NAME="OraGI12Home2" LOC="/u01/app/12.2.0.1/grid" TYPE="O" IDX="3" REMOVED="T"/>
<HOME NAME="OraDB12Home1" LOC="/u01/app/oracle/product/12.1.0/dbhome_1" TYPE="O" IDX="2" REMOVED="T"/>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>
[oracle@racnode1 ContentsXML]$

How to Set SQL or Oracle Database to Single-User Mode and How to Check Single User or Multi User Mode

In Oracle database, place the instance in restricted mode.  The users already connected to the database will not get disconnected. You need to manually kill these sessions.

SQL> alter system enable restricted session;

OR

Startup in restricted mode.

SQL> startup restrict;

Check the instance mode

SQL> select logins from v$instance;

LOGINS
----------
RESTRICTED

In SQL database,  Below are the two most popular ways to set up database to single-user mode in SQL Server:

Using SQL Server Management Studio

Right-click the database to change, and then click Properties -> click the Options page->From the Restrict Access option, select Single.
If other users are connected to the database, an Open Connections message will appear. To change the property and close all other connections, click Yes.

Using Transact-SQL

USE master;
GO
ALTER DATABASE MyDatabase SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
GO

Check SQL Database Single User or Multi User Mode

a)  Select ServerProperty(‘IsSingleUser’)

It should return 1, 0, or Null.

1 = Single user.
0 = Not single user
NULL = Input is not valid, or an error.

use MyDatabase
go
Select ServerProperty('IsSingleUser')

b) Select from sys.database,  it should retuen:

  • SINGLE_USER
  • MULTI_USER
SELECT user_access_desc 
FROM sys.databases 
WHERE name = 'MyDatabase'

3) From SSMS, Right-click the database , and then click Properties -> click the Options page->From the Restrict Access option.

How to Upgrade Linux OS In RAC Environment

This post introduces how to upgrade Linux OS from RHEL 5 to RHEL 7 with zero downtime for two nodes RAC. 

Subscribe to get access

Read more of this content when you subscribe today.

Deinstall 12.2.0.1 Grid Infrastructure Home After Being Upgraded to 18c GI

Grid Infrastructure 12.2.0.2 has been upgraded to 18c GI successfully. So 12.2.0.1 GI_HOME needs to be de-installed.  There are two ways to uninstall the old GI_HOME ( 12.2.0.1)

1) Detach GI_HOME and Remove the GI_HOME manually:

$ export ORACLE_HOME=/u01/app/grid/12.2.0.1
$ $ORACLE_HOME/OPatch/opatch lsinventory -all
$ cd $ORACLE_HOME/oui/bin
$ ./runInstaller -silent -detachHome ORACLE_HOME="/u01/app/grid/12.2.0.1"
$ unset ORACLE_HOME

-- as root user

# cd /u01/app/grid
# rm -fr 12.2.0.1

For any reason, if the above command fails, then on every node:

$ export ORACLE_HOME=/u01/app/grid/12.2.0.1 
$ $ORACLE_HOME/OPatch/opatch lsinventory -all 
$ cd $ORACLE_HOME/oui/bin 
$ ./runInstaller -silent -local -detachHome ORACLE_HOME="/u01/app/grid/12.2.0.1"
$ unset ORACLE_HOME
-- as root user
# cd /u01/app/grid
# rm -fr 12.2.0.1

2) Deinstall old GI_HOME by using “deinstall” tool :

a) Log in as root, change the permission and ownership of the old GI_HOME ( 12.2.0.1) on both nodes.

# chmod -R 755 /u01/app/12.2.0.1/grid
# chown -R grid /u01/app/12.2.0.1/grid
# chown grid /u01/app/12.2.0.1

b) Run “deinstall” under the to be deleted GI_HOME( /u01/app/12.2.0.1/grid).

$ /u01/app/12.2.0.1/grid/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 ##
...
..
.

c) Refer and check the logs :

The Log of Deinstall 12.2.0.1 GI_HOME

How to Apply Grid Infrastructure RU/RUR Patches Before Upgrading GI from 12.2.0.1 to 18c

While upgrading GI from 12.2.0.1 to 18c, in order to minimize the downtime and reduce the impact on PROD environment,  Release Update(RU) or Release Update Reversion(RUR) patches can be applied onto new 18c GI image before setting up 18c GI.

Please note this way is different from what we normally do to apply RU/RUR patches according to patch README.html instruction.

  • RU/RUR can only be applied before 18c GI is configured (in other word, before root.sh or rootupgrade.sh is executed).
  • In this upgrade case, RU/RUR patches can only be applied onto the new 18c GI home,  patches are not to be applied to the existing (current) 12.2.0.1 GI home.
  • “opatchauto” and “opatch apply” must NOT be used as the new 18c GI home hasn’t been configured yet.

Here is the example of applying both RU/RUR patches sequentially against new 18c GI before starting to upgrade GI 12.2.0.1 to 18c.

Those following two patches will be applied on 18c GI gold imagine:

  • Patch 28828717 – GI Release Update 18.5.0.0.190115
  • Patch 29231062 – GI Release Update Revision 18.5.1.0.190416

Subscribe to get access

Read more of this content when you subscribe today.