Example of Creating Role-allocated Groups, Users, and Paths
Understand this example of how to create role-allocated groups and users that is compliant with an Optimal Flexible Architecture (OFA) deployment.
This example illustrates the following scenario:
-
An Oracle Grid Infrastructure installation
-
Two separate Oracle Database installations planned for the cluster,
DB1andDB2 -
Separate installation owners for Oracle Grid Infrastructure, and for each Oracle Database
-
Full role allocation of system privileges for Oracle ASM, and for each Oracle Database
-
Oracle Database owner
oracle1granted the right to start up and shut down the Oracle ASM instance
Create groups and users for a role-allocated configuration for this scenario using the following commands:
# mkgroup -'A' id='54321' adms='root' oinstall
# mkgroup -'A' id='54322' adms='root' dba1
# mkgroup -'A' id='54332' adms='root' dba2
# mkgroup -'A' id='54323' adms='root' oper1
# mkgroup -'A' id='54333' adms='root' oper2
# mkgroup -'A' id='54324' adms='root' backupdba1
# mkgroup -'A' id='54334' adms='root' backupdba2
# mkgroup -'A' id='54325' adms='root' dgdba1
# mkgroup -'A' id='54335' adms='root' dgdba2
# mkgroup -'A' id='54326' adms='root' kmdba1
# mkgroup -'A' id='54336' adms='root' kmdba2
# mkgroup -'A' id='54327' adms='root' asmdba
# mkgroup -'A' id='54328' adms='root' asmoper
# mkgroup -'A' id='54329' adms='root' asmadmin
# mkgroup -'A' id='54330' adms='root' racdba1
# mkgroup -'A' id='54340' adms='root' racdba2
# mkuser id='53322' pgrp='oinstall' groups='asmadmin,asmdba,racdba1,racdba2' home='/home/grid' grid
# mkuser id='53321' pgrp='oinstall' groups='dba1,backupdba1,dgdba1,kmdba1,asmdba,racdba1,asmoper' home='/home/oracle' oracle1
# mkuser id='53323' pgrp='oinstall' groups='dba2,backupdba2,dgdba2,kmdba2,asmdba,racdba2' home='/home/oracle' oracle1
# mkdir -p /u01/app/18.0.0/grid
# mkdir -p /u01/app/grid
# mkdir -p /u01/app/oracle1
# mkdir -p u01/app/oracle2
# chown -R grid:oinstall /u01
# chmod -R 775 /u01/
# chown oracle1:oinstall /u01/app/oracle1
# chown oracle2:oinstall /u01/app/oracle2
After running these commands, you have a set of administrative privileges groups and users for Oracle Grid Infrastructure, and for two separate Oracle databases (DB1 and DB2):
Example 5-1 Oracle Grid Infrastructure Groups and Users Example
The command creates the following Oracle Grid Infrastructure groups and users:
-
An Oracle central inventory group, or
oraInventorygroup (oinstall), whose members that have this group as their primary group. Members of this group are granted the OINSTALL system privileges, which grants permissions to write to theoraInventorydirectory, and other associated install binary privileges. -
An OSASM group (
asmadmin), associated with Oracle Grid Infrastructure during installation, whose members are granted the SYSASM privileges to administer Oracle ASM. -
An OSDBA for ASM group (
asmdba), associated with Oracle Grid Infrastructure storage during installation. Its members include grid and any database installation owners, such asoracle1andoracle2, who are granted access to Oracle ASM. Any additional installation owners that use Oracle ASM for storage must also be made members of this group. -
An OSOPER for ASM group for Oracle ASM (
asmoper), associated with Oracle Grid Infrastructure during installation. Members ofasmopergroup are granted limited Oracle ASM administrator privileges, including the permissions to start and stop the Oracle ASM instance. -
An Oracle Grid Infrastructure installation owner (
grid), with the oraInventory group (oinstall) as its primary group, and with the OSASM (asmadmin) group and the OSDBA for ASM (asmdba) group as secondary groups. -
/u01/app/oraInventory. The central inventory of Oracle installations on the cluster. This path remains owned bygrid:oinstall, to enable other Oracle software owners to write to the central inventory. -
An OFA-compliant mount point
/u01owned bygrid:oinstallbefore installation, so that Oracle Universal Installer can write to that path. -
An Oracle base for the grid installation owner
/u01/app/gridowned bygrid:oinstallwith 775 permissions, and changed during the installation process to 755 permissions. -
A Grid home
/u01/app/18.0.0/gridowned bygrid:oinstallwith 775 (drwxdrwxr-x) permissions. These permissions are required for installation, and are changed during the installation process toroot:oinstallwith 755 permissions (drwxr-xr-x).
Example 5-2 Oracle Database DB1 Groups and Users Example
The command creates the following Oracle Database (DB1) groups and users:
-
An Oracle Database software owner (
oracle1), which owns the Oracle Database binaries forDB1. Theoracle1user has the oraInventory group as its primary group, and the OSDBA group for its database (dba1) and the OSDBA for ASM group for Oracle Grid Infrastructure (asmdba) as secondary groups. In addition, theoracle1user is a member ofasmoper, granting that user privileges to start up and shut down Oracle ASM. -
An OSDBA group (
dba1). During installation, you identify the groupdba1as the OSDBA group for the database installed by the useroracle1. Members ofdba1are granted the SYSDBA privileges for the Oracle DatabaseDB1. Users who connect as SYSDBA are identified as user SYS onDB1. -
An OSBACKUPDBA group (
backupdba1). During installation, you identify the groupbackupdba1as the OSDBA group for the database installed by the useroracle1. Members ofbackupdba1are granted the SYSBACKUP privileges for the database installed by the useroracle1to back up the database. -
An OSDGDBA group (
dgdba1). During installation, you identify the groupdgdba1as the OSDGDBA group for the database installed by the useroracle1. Members ofdgdba1are granted the SYSDG privileges to administer Oracle Data Guard for the database installed by the useroracle1. -
An OSKMDBA group (
kmdba1). During installation, you identify the groupkmdba1as the OSKMDBA group for the database installed by the useroracle1. Members ofkmdba1are granted the SYSKM privileges to administer encryption keys for the database installed by the useroracle1. -
An OSOPER group (
oper1). During installation, you identify the groupoper1as the OSOPER group for the database installed by the useroracle1. Members ofoper1are granted the SYSOPER privileges (a limited set of the SYSDBA privileges), including the right to start up and shut down theDB1database. Users who connect as OSOPER privileges are identified as user PUBLIC onDB1. -
An Oracle base
/u01/app/oracle1owned byoracle1:oinstallwith 775 permissions. The useroracle1has permissions to install software in this directory, but in no other directory in the/u01/apppath.
Example 5-3 Oracle Database DB2 Groups and Users Example
The command creates the following Oracle Database (DB2) groups and users:
-
An Oracle Database software owner (
oracle2), which owns the Oracle Database binaries for DB2. Theoracle2user has the oraInventory group as its primary group, and the OSDBA group for its database (dba2) and the OSDBA for ASM group for Oracle Grid Infrastructure (asmdba) as secondary groups. However, theoracle2user is not a member of theasmopergroup, sooracle2cannot shut down or start up Oracle ASM. -
An OSDBA group (
dba2). During installation, you identify the groupdba2as the OSDBA group for the database installed by the useroracle2. Members ofdba2are granted the SYSDBA privileges for the Oracle Database DB2. Users who connect as SYSDBA are identified as user SYS on DB2. -
An OSBACKUPDBA group (
backupdba2). During installation, you identify the groupbackupdba2as the OSDBA group for the database installed by the useroracle2. Members ofbackupdba2are granted the SYSBACKUP privileges for the database installed by the useroracle2to back up the database. -
An OSDGDBA group (
dgdba2). During installation, you identify the groupdgdba2as the OSDGDBA group for the database installed by the useroracle2. Members ofdgdba2are granted the SYSDG privileges to administer Oracle Data Guard for the database installed by the useroracle2. -
An OSKMDBA group (
kmdba2). During installation, you identify the groupkmdba2as the OSKMDBA group for the database installed by the useroracle2. Members ofkmdba2are granted the SYSKM privileges to administer encryption keys for the database installed by the useroracle2. -
An OSOPER group (
oper2). During installation, you identify the groupoper2as the OSOPER group for the database installed by the useroracle2. Members ofoper2are granted the SYSOPER privileges (a limited set of the SYSDBA privileges), including the right to start up and shut down the DB2 database. Users who connect as OSOPER privileges are identified as user PUBLIC on DB2. -
An Oracle base
/u01/app/oracle2owned byoracle1:oinstallwith 775 permissions. The useroracle2has permissions to install software in this directory, but in no other directory in the/u01/apppath.