Modifying Oracle owner user group

During installation, the user must have the oinstall group as its primary group, and it must be a member of the operating system groups appropriate to your installation.

Before you begin

Run the following steps to shut down the Oracle database and the listener process.
  1. On the Oracle database host, log in as oracle user.
  2. Shutdown the database by using the following command:
    $ sqlplus "/ as sysdba"
    SQL*Plus: Release 12.1.0.1.0 Production on Wed Jan 16 14:11:47 2019
    Copyright (c) 1982, 2014, Oracle. All rights reserved.
    Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit
    
    SQL> shutdown immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    
    SQL> exit;
  3. Stop the listener by using the following command:
    $ lsnrctl stop
    LSNRCTL for Linux: Version 12.1.0.2.0
    Copyright (c) 1991, 2014, Oracle. All rights reserved.
    Stopping /opt/oracle/product/12.1.0/bin/tnslsnr: please wait...
    

About this task

Run the following steps to change the Oracle owner group.

Procedure

  1. On the Oracle database host, log in as oracle user.
  2. Run the following command to check the current primary group (gid) of the oracle owner.
    By default, the previous Oracle 12c installation used dba as the primary group and oinstall as the secondary group.
    $ id 
    
    uid=1002(oracle1) gid=1002(dba) groups=1002(dba),1003(oinstall)
    
    uid=102(oracle) gid=100(dba)
    uid=205(oracle) gid=203(dba) groups=204(oinstall)
  3. Log in as root user.
    1. Run the following command to swap the primary group to oinstall and the secondary group to dba.
      
      # usermod -g oinstall oracle
      
      # usermod -a -G dba   oracle
      
      # usermod -G+dba   oracle
      # usermod -Goinstall,dba  oracle
    2. Log in as oracle user and verify that the groups are updated.
      $ id -gn
      
      oinstall for primary group all operating systems.
      $ id -Gn
      
      oinstall dba both for secondary group on all operating systems.
      To summarize, each oracle group needs to be assigned to the specific user.
      Oracle group Oracle ID
      uid oracle
      gid oinstall
      groups oinstall, dba
    3. Changing the Oracle user group might cause some special permission on the Oracle 12c binary file to be lost. To reset it, run the following command:
      $ chmod 6751 <Oracle12c_Home>/bin/oracle
    4. To verify that the previous command is run successfully, run the following command:
      $ ls -al <Oracle12c_Home>/bin/oracle
      
      -rwsr-s--x   1 oracle   dba      381364280 Feb 26 13:14 /opt/oracle/product/12.1.0/bin/oracle
  4. Once the groups are successfully, startup the Oracle database.
    $ sqlplus / as sysdba
    SQL>startup
    
  5. Start the listener by using the following command: $ lsnrctl start