In this article, We will create an Oracle database home owner (oracle) and Oracle Grid Infrastructure home owner (grid). After that, we will perform user and group setup for Oracle RAC.
Table of Contents
1. Create Groups:
Create the below groups as a root user:
groupadd -g 1001 oinstall groupadd -g 1002 dba groupadd -g 1003 asmadmin groupadd -g 1004 asmdba groupadd -g 1005 asmoper groupadd -g 1006 oper
2. Create Users:
Create Oracle & grid users and assign the created groups:
useradd -u 2001 -g oinstall -G asmdba,asmadmin,asmoper,dba grid useradd -u 2002 -g oinstall -G asmdba,dba,oper oracle
3. Add users to vboxsf group:
If you have created the shared folder in Oracle VirtualBox then add Oracle and grid accounts to vboxsf group. The vboxsf group was created by VirtualBox Guest Additions and it allows its members to access the folders in the hosting machine. If you did not install VirtualBox Guest Additions in your virtual machine then follow the article Install VirtualBox Guest Additions.
usermod -a -G vboxsf oracle usermod -a -G vboxsf grid
4. Change the User password:
[root@localhost ~]# passwd grid Changing password for user grid. New password:grid123 BAD PASSWORD: The password contains the user name in some form Retype new password:grid123 passwd: all authentication tokens updated successfully. [root@localhost ~]# passwd oracle Changing password for user oracle. New password:oracle123 BAD PASSWORD: The password contains the user name in some form Retype new password:oracle123 passwd: all authentication tokens updated successfully. [root@localhost ~]#
5. Verify Users and Groups:
[root@localhost ~]# id oracle uid=2002(oracle) gid=1001(oinstall) groups=1001(oinstall),1002(dba),1004(asmdba),1006(oper) [root@localhost ~]# id grid uid=2001(grid) gid=1001(oinstall) groups=1001(oinstall),1002(dba),1003(asmadmin),1004(asmdba),1005(asmoper) [root@localhost ~]# ls -ld /home/oracle drwx------. 3 oracle oinstall 78 Mar 5 05:00 /home/oracle [root@localhost ~]# ls -ld /home/grid drwx------. 3 grid oinstall 78 Mar 5 05:00 /home/grid [root@localhost ~]# grep oracle /etc/passwd oracle:x:2002:1001::/home/oracle:/bin/bash [root@localhost ~]# grep grid /etc/passwd grid:x:2001:1001::/home/grid:/bin/bash
6. Create the directories for Oracle RAC:
We have to create the below directories for Oracle RAC:
ORACLE BASE:/u01/app/oracle
ORACLE HOME:/u01/app/oracle/product/19.3.0/dbhome_1
GRID BASE:/u01/app/grid
GRID HOME:/u01/app/19.3.0/grid
INVENTORY:/u01/app/oraInventory
mkdir -p /u01/app/oracle /u01/app/oraInventory /u01/app/grid /u01/app/19.3.0/grid /u01/app/oracle/product/19.3.0/dbhome_1
7. Change the ownership and permissions:
chown -R grid:oinstall /u01/app/grid /u01/app/19.3.0/grid /u01/app/oraInventory chown -R oracle:oinstall /u01/app/oracle /u01/app/oracle/product/19.3.0/dbhome_1 chmod -R 775 /u01/app/grid /u01/app/19.3.0/grid /u01/app/oraInventory /u01/app/oracle /u01/app/oracle/product/19.3.0/dbhome_1
8. Verify the Ownership and permissions:
ls -ld /u01/app/grid /u01/app/19.3.0/grid /u01/app/oraInventory /u01/app/oracle /u01/app/oracle/product/19.3.0/dbhome_1 drwxrwxr-x 2 grid oinstall 6 Feb 16 16:22 /u01/app/19.3.0/grid drwxrwxr-x 2 grid oinstall 6 Feb 16 16:22 /u01/app/grid drwxrwxr-x 3 oracle oinstall 21 Feb 16 16:22 /u01/app/oracle drwxrwxr-x 2 oracle oinstall 6 Feb 16 16:22 /u01/app/oracle/product/19.3.0/dbhome_1 drwxrwxr-x 2 grid oinstall 6 Feb 16 16:22 /u01/app/oraInventory
User and group setup for Oracle RAC is completed now. Also, we have created the directories for Oracle RAC.