Disclaimer

Saturday 17 July 2021

Users and Groups for Oracle Database

 

Users and Groups

For Job Role Separation, groups and users will be created as follow :

DescriptionOS Group NameOS Users AssignedOracle PrivilegeOracle Group Name
Oracle Inventory/Software Group (mandatory)oinstallgrid, oracle  
Database Administrator (mandatory)dbaoracleSYSDBAOSDBA
Database OperatoroperoracleSYSOPEROSOPER
ASM Administration GroupasmadmingridSYSASMOSASM
ASM Database Administrator Groupasmdbagrid, oracleSYSDBA for ASMOSDBA for ASM
ASM Operator GroupasmopergridSYSOPER for ASMOSOPER for ASM
RMAN Management GroupbackupdbaoracleSYSBACKUPOSBACKUPDBA
Data Guard Management GroupdgdbaoracleSYSDGOSDGDBA
Encryption Key Management GroupkmdbaoracleSYSKMOSKMDBA
RAC Management Group (from 12.2)racdbaoracleSYSRACOSRACDBA



# Oracle inventory/software group
[root]$ groupadd -g 54321 oinstall
# Full admin database management group (mandatory)
[root]$ groupadd -g 54322 dba
# Operator database management group (subset of full admin privilege)
[root]$ groupadd -g 54323 oper
 
# RMAN management group
[root]$ groupadd -g 54324 backupdba
# DataGuard management group
[root]$ groupadd -g 54325 dgdba
# Encryption key management group
[root]$ groupadd -g 54326 kmdba
 
# ASM management groups
[root]$ groupadd -g 54327 asmdba
[root]$ groupadd -g 54328 asmoper
[root]$ groupadd -g 54329 asmadmin
 
# RAC management (available from 12.2.0)
[root]$ groupadd -g 54330 racdba


# Oracle user (mandatory)
[root]$ useradd -u 54321 -g oinstall -s /bin/bash -c "Oracle Software Owner" oracle
[root]$ usermod -aG oinstall,dba,oper,asmdba,backupdba,dgdba,kmdba,racdba oracle
[root]$ passwd oracle


Grid user
[root]$ useradd -u 54322 -g oinstall -s /bin/bash -c "Grid Infrastructure Owner" grid
[root]$ usermod -aG oinstall,asmdba,asmadmin,asmoper grid
[root]$ passwd grid


 
# Create Oracle Inventory directory
[root]$ mkdir -p /u01/app/oraInventory
[root]$ chown oracle:oinstall /u01/app/oraInventory
[root]$ chmod 775 /u01/app/oraInventory
 
# Create Grid Infrastructure directories
[root]$ mkdir -p /u01/app/grid                               ( ORACLE_BASE for GRID HOME )
[root]$ mkdir -p /u01/app/12.2.0/grid                        ( GRID_HOME )
[root]$  chown grid:oinstall /u01/app/grid                         (oinstall- ORACLE_BASE for GRID HOME )[root]$ chown grid:oinstall /u01/app/12.2.0/grid             (oinstall - GRID_HOME) 
[root]$ chmod 775 /u01/app/grid 
  [root]$ chmod 775 /u01/app/12.2.0/grid

# Create Oracle base directory
[root]$ mkdir -p /u01/app/oracle                             ( ORACLE_BASE for RDBMS HOME )
[root]$  mkdir -p /u01/app/oracle/product/12.2.0/db1            ( ORACLE_HOME ) [root]$ chown oracle:oinstall /u01/app/oracle                ( oinstall - ORACLE_BASE for RDBMS HOME
[root]$ chmod 775 /u01/app/oracle


If Oracle Installation is first time on the server then it creates /etc/oraInst.loc file which will be having information about oracle central inventory and it's group by default oinstall.

Note:- Do not put the oraInventory directory under the Oracle Base directory for a new installation, because that can result in user permission errors for other installations.

In Oracle documentation, a user created to own only Oracle Grid Infrastructure software installations is called the Grid user (grid). 

This user owns both the Oracle Clusterware and Oracle Automatic Storage Management binaries.

A user created to own either all Oracle installations, or one or more Oracle database installations, is called the Oracle user (oracle).

You can have only one Oracle Grid Infrastructure installation owner, but you can have different Oracle users to own different installations.

Q) Can we have multiple owners for GI installations? No

Q) Can we have multiple owners for DB installations? Yes, different versions of DB installations can be owned by different users.

Oracle software owners (grid and oracle) should have oinstall or Oracle Inventory group as their primary group so that each software installation , owner can able to write to the central inventory and OCR and Oracle clusterware resource permissions are set correctly.

The database software owner must also have osdba group and also osoper, osbackupdba, osdgdba, osracdba, oskmdba groups as secondary groups if they are created for role separation duties.

Oracle user can be in assigned with asmdba to manage asm instances.

For Oracle Restart installations, to successfully install Oracle Database, ensure that the grid user is a member of the racdba group.

We need to run the below scripts as root user.

/u01/app/oraInstroot.sh

It creates the oraInventory.
Revokes read, write and execute permissions on the inventory from the world.
Grants read and write permission to the group oinstall.
creates /etc/oraInst.loc file which will be having information about location of the inventory as well as it's group.

/u01/app/oracle/product/12.1.0/dbhome_1/root.sh

Copies oraenv, coraenv to local bin directory i.e. /usr/local/bin
Creates oratab file and entries will be added to it when database is created DBCA.
If we manually create a database then the database entry will not be added to oratab, We need to add the new database to oratab manually.

If Central inventory/Global inventory is lost/corrupted then we can recreate it by attachhome method.

If Oracle installation is first time on the server then there wouldn't be any Oracle Inventory until we run /u01/app/oraInstroot.sh script as root user. 
We can register any number installations with one Oracle central inventory, Lets say if a server is running with 10g, 11g and 12c installations there would be only one Oracle Inventory for multiple installations.

=========================================================================

1) Oracle 19c R3 Real Application Clusters (RAC) Installation Steps on Oracle Linux 7.7



2) Confirm Oracle ASM ‘grid’ account groups, click ‘Next’


Standalone Grid installation :-




selecting asmadmin, asmdba and asmoper option :-



19c installation Grid Infrastructure for a Standalone Server


18c RAC:-




Oracle RDBMS 19c Binaries In Linux 7.7:-


Install Grid Infrastructure 12c On Standalone Server:-



How to Install Oracle RAC 12c (12.1) on Linux with ASM:-


  • In this installation the same OS group is going to be used. This may not be suitable for all environments.
  • Set Oracle ASM Administrator (OSASM) Group to dba
  • Set Oracle ASM DBA (OSDBA for ASM) Group to dba
  • Leave Oracle ASM Operator (OSOPER for ASM) Group (Optional) blank
  • Click Next

=============NON RAC===================


Installing and running Oracle Database 19.2.0.0 on Oracle Linux 7




Install Oracle 18C on Oracle Linux 7 (OEL7)






















No comments:

Post a Comment

100 Oracle DBA Interview Questions and Answers

  Here are 100 tricky interview questions tailored for a Senior Oracle DBA role. These questions span a wide range of topics, including perf...