Sunday, August 16, 2020

Oracle Database Post Installation Root scripts

 

Oracle Database Post Installation Root scripts 


Introduction:


 when we install oracle Database standalone and RAC environment part of post installtion steps we execute two Root scripts oracle also suggest to backup the 'orainstroot.sh' and 'root.sh',these two scripts are executed as a root user in linux and it displays after the,oracle software installation complete 


Two scripts root.sh,orainstroot.sh


What is oratab file?

What are the contents of oratab file?

When the oratab file got created?


While installation, will execute two root scripts.

1. orainstroot.sh

will remove the permissions on inventory files from world(public).

Will change permissions to oinstall OS group.


 Importance of orainstroot.sh


 The first script that we run is  "orainstroot.sh" which is located in 


$ORACLE_BASE/oraInventory(/u01/app/oracle/orainventory)path we execute "orainstroot.sh " script for following purpose


 1)it creates the inventory pointer file(/etc/oraInst.loc) this file shows the inventory location and group is linked to 


 2)it changes the groupname of the oraInventory directory to oinstall group


 

2. root.sh

will create oratab file while installation using root script.


/etc/oratab

will read using

$more /etc/oratab


The contents are oratab file are the database entries.


Importance of root.sh


The second script that we run is "root.sh"  script which is located  in $ORACLE_HOME(/u01/app/oracle/product/11.2.0/db_1)path  we execute "root.sh" for the following purpose


1)it will creates /etc/oratab file.This is the file which we use to make automatic database shutdown and startup it is very important file


2)it sets the Oracle base and Home environments


3)it sets an appropriate permission to the OCR base directory


4) creates the OCR backup and network socket directories


5)modifies the ownership to "root" user on the Oracle base and Cluster home file systems


6)it configures the OCR and Voting disk (only on the first node )


7)starts the Clusterware daemons


8)it adds Clusterware daemons to the inittab file


9)It verifies the whether the Clusterware is up on all nodes


10)it verifies the super user priveliges


First Field | Second | third

ORACLE_SID : ORACLE_HOME : Y/N

prod : /u01/app/oracle/product/12.1.0/dbhome_1 : Y


Here ORACLE_SID is the db name

Y/N - represents - to start the db on server boot.



eg:

prod : /u01/app/oracle/product/12.1.0/dbhome_1 : Y

dev : /u01/app/oracle/product/11.1.0/dbhome_1 : N


In this case, How many databases are there?

Two Databases - prod,dev


Which will get start on boot ? prod

will not ?  dev



how many products are there on server?

12c

11g


-----------------------------------------------------------------------

How do we login to database?



Using tool sqlplus with sys user as sys admin with sysdba role


eg:

su - oracle ( using - will read bash_profile to locate the binary files)

$sqlplus '/as sysdba'


Here / represents sys user

or

$sqlplus sys/sys123 as sysdba

or

$sqlplus sys as sysdba

Paswd : sys123


SQL> select name,open_mode from v$database;



sql> is database prompt

# is root unix prompt




What is .bash_profile ?


is a hidden file for every unix user with dot as prefix.

To list the hidden file using

#ls -ltra


If its root user - /

If its for oracle user :- /home/oracle


Will configure variables to locate the binaries installed


eg:

ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1

ORACLE_SID=prod

Here the default database was set to prod to login.



Will execute the .bash_profile to set the environment variables for that session.


Can also use manually with export command

eg:

$export ORACLE_SID=dev

Now can verify using echo

$echo $ORACLE_SID



Note : Info on Post Installation root scripts it may be differ from your environment like prod,dev,test,and naming conventions ,directories etc


THANKS FOR VIEWING MY BLOG FOR MORE UPDATES FOLLOW ME



ITIL Process

ITIL Process Introduction In this Blog i am going to explain  ITIL Process, ITIL stands for Information Technology Infrastructure Library ...