Tuesday, November 28, 2017

Runlevel Change


$ runlevel 
$ vi /etc/inittab
$ reboot

Installation scripts

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.

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.

If oraInventory group i.e. oinstall doesn't exists then installer uses the primary group of the software owner who is installing software.

Creating oinstall group if oraInvenotry doesn't exists

/usr/sbin/groupadd -g 54321 oinstall

grep oinstall /etc/groups

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.

Can we have multiple owners for GI installations? No
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 seperation duties.

oracle : 54321
grid : 54331

oinstall:54321
dba:54322
oper:54323
backupdba:54324
dgdba:54325
kmdba:54326
racdba:54330
asmdba:54327
asmoper:54328
asmadmin:54329

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


$ grep "oinstall" /etc/group
oinstall:x:54321:grid,oracle

$ id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba), 
54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54327(asmdba),54330(racdba)
$ id grid
uid=54331(grid) gid=54321(oinstall) groups=54321(oinstall),54322(dba),
54327(asmdba),54328(asmoper),54329(asmadmin),54330(racdba)

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.


oracle preinstall RPM


Oracle 12c R1 and R2 is certified to install on Oracle Linux 6 or 7 and use Oracle RPM, This RPM installs all required packages, sets kernel parameters for the installation of Oracle database and grid infrastructure. oracle-database-server-12cR2-preinstall is the RPM configures server ready for the installation of database and grid infrastructure.

Steps to install  oracle preinstall RPM

Download the Oracle linux 6 or 7 from edelivery.oracle.com
Once downloaded, start the installation with the appropriate selections for your environment.
During the installation process, Select customize now option in the software selection window.
On Oracle Linux, Select servers on the left pane of the screen and system administration on the right pane of the screen and then packages in system tools window will open.
Select Oracle Preinstallation RPM package box from the package list.
For Oracle Linux 7 select package similar to oracle-database-server-12cR2-preinstall-1.0-4.el7.x86_64.rpm
Close the optional package window and go with next steps.