A technical troubleshooting blog about Oracle with other Databases & Cloud Technologies.

What Are Root.sh And OrainstRoot.sh Scripts ?

2 min read
The orainstRoot.sh and root.sh scripts are created in the last phase of installation and stored in the locations /<path to oraInventory>/orainstRoot.sh and $ORACLE_HOME/root.sh.

After the installation is complete a prompt is diplayed to run these scripts as the root user. 
The following configuration scripts need to be executed as the "root" user

Scripts to be executed
1 /u01/app/oraInventory/orainstRoot.sh
2 /u01/app/oracle/product/190/db/root.sh

To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
4. Return to this window and click "OK" to continue

The following steps are performed by the orainstRoot.sh script:

1) Changes permissions of inventory directory denoted by inventory_loc in the inventory location pointer file:

    For Solaris, HP, LINUX Itanium: /var/opt/oracle/oraInst.loc
    For LINUX and IBM AIX : /etc/oraInst.loc

    Adds read,write permissions for group.

    Removes read,write,execute permissions for world to the inventory directory.

    Changes the permission of oraInventory to 770.

2) Change group of oraInventory directory to group desiginated during the installation, for example, oinstall.

3) If the inventory pointer file oraInst.loc does not exist. It creates oraInst.loc in the location 

The following steps are performed by the root.sh script:

1) Create the log file to store the output of the script root.sh . The format of log file created by root.sh is
   ${ORACLE_HOME}/install/root_`$UNAME -n`_`$DATE +%F_%H-%M-%S`.log  . 

With the permission of 600 ownership of oracle user and oinstall group

2) Check for the default directory /usr/local/bin.  If it does not exist it will create it with permissions of 755.

The default directory /usr/local/bin can be changed to  any other directory localtion.

3) Check for the existence of these three files:

    $ORACLE_HOME/bin/dbhome
    $ORACLE_HOME/bin/oraenv
    $ORACLE_HOME/bin/coraenv
 
Copies the above three files to /usr/local/bin or any other local binary location specified in step 2 and changes the permissions of the files to 755.

The script 'dbhome' is called to determine the ORACLE_HOME for that SID and set ORACLE_HOME to the corresponding value.

dbhome will also add "$ORACLE_HOME/bin" to the PATH environment variable setting.

When switching between databases, users can run the oraenv or coraenv script to set these environment variables.

4) Creates the oratab file. 

The ownership of the file would be oracle owner and os_dba group.
When creating subsequent databases via DBCA the entries of SID and ORACLE_HOME will be appended to oratab.

 5) Change the permissions to the folllowing so they are accessible by users from groups other than the  user group.

    $ORACLE_HOME/bin
    $ORACLE_HOME/lib
    $ORACLE_HOME/perl
    $ORACLE_HOME/jdk
    $ORACLE_HOME/bin/nmocat