Execute four scripts and their meanings during RAC Installation

Source: Internet
Author: User

Execute four scripts during RAC installation.

1) $ ORACLE_BASE/oraInventory/orainstRoot. sh (executed when clusterware ends)

2) $ CRS_HOME/root. sh (executed when clusterware ends)

3) $ CRS_HOME/bin/vipca. sh (this script is automatically called when $ CRS_HOME/root. sh is executed on the second node)

4) $ ORACLE_HOME/root. sh (executed after the database is installed)

1. orainstRoot. sh script

1.1 orainstRoot. sh Script Execution Process

Root @ node2 #/oracle/oraInventory/orainstRoot. sh

Changing permissions of/oracle/oraInventory to 770.

Changing groupname of/oracle/oraInventory to oinstall.

The execution of the script is complete

1.2 orainstRoot. sh script content

Root @ node1 # more/oracle/oraInventory/orainstRoot. sh

#! /Bin/sh

If [! -D "/var/opt/oracle"]; then

Mkdir-p/var/opt/oracle;

Fi

If [-d "/var/opt/oracle"]; then

Chmod 755/var/opt/oracle;

Fi

If [-f "/oracle/oraInventory/oraInst. loc"]; then

Cp/oracle/oraInventory/oraInst. loc/var/opt/oracle/oraInst. loc;

Chmod 644/var/opt/oracle/oraInst. loc;

Else

INVPTR =/var/opt/oracle/oraInst. loc

INVLOC =/oracle/oraInventory

GRP = oinstall

PTRDIR = "'dirname $ INVPTR '";

# Create the software inventory location pointer file

If [! -D "$ PTRDIR"]; then

Mkdir-p $ PTRDIR;

Fi

Echo "Creating the Oracle inventory pointer file ($ INVPTR )";

Echo inventory_loc = $ INVLOC> $ INVPTR

Echo inst_group = $ GRP >>$ INVPTR

Chmod 644 $ INVPTR

# Create the inventory directory if it doesn't exist

If [! -D "$ INVLOC"]; then

Echo "Creating the Oracle inventory directory ($ INVLOC )";

Mkdir-p $ INVLOC;

Fi

Fi

Echo "Changing permissions of/oracle/oraInventory to 770 .";

Chmod-R 770/oracle/oraInventory;

If [$? ! = 0]; then

Echo "OUI-35086: WARNING: chmod of/oracle/oraInventory to 770 failed! ";

Fi

Echo "Changing groupname of/oracle/oraInventory to oinstall .";

Chgrp oinstall/oracle/oraInventory;

If [$? ! = 0]; then

Echo "OUI-10057: WARNING: chgrp of/oracle/oraInventory to oinstall failed! ";

Fi

Echo "The execution of the script is complete"

From the script, we can see that this script mainly creates the/var/opt/oracle directory (if it does not exist), and then creates oraInst under this directory. loc file (this file records the location and group of orainventory ). And change the attributes of orainventory.

Root @ node2 # ls-rlt/var/opt/oracle/

Total 2

-Rw-r -- 1 root 55 Apr 2 oraInst. loc

Root @ node2 # more oraInst. loc

Inventory_loc =/oracle/oraInventory

Inst_group = oinstall

Run the script on another node.

Root @ node1 #/oracle/oraInventory/orainstRoot. sh

Changing permissions of/oracle/oraInventory to 770.

Changing groupname of/oracle/oraInventory to oinstall.

The execution of the script is complete

2. Root. sh script

2.1 root. sh Script Execution Process

Root @ node2 #/oracle/crs/root. sh

WARNING: directory '/oracle' is not owned by root

Checking to see if Oracle CRS stack is already configured

Checking to see if any 9i GSD is up

Setting the permissions on OCR backup directory

Setting up NS directories

Oracle Cluster Registry configuration upgraded successfully

WARNING: directory '/oracle' is not owned by root

Successfully accumulated necessary OCR keys.

Using ports: CSS = 49895 CRS = 49896 EVMC = 49898 and EVMR = 49897.

Node <nodenumber>: <nodename> <private interconnect name>

Node0: node2 node2-priv node2

Node 1: node1 node1-priv node1

Creating OCR keys for user 'root', privgrp 'root '..

Operation successful.

Now formatting voting device:/oracle/ocrcfg1

Format of 1 voting devices complete.

Startup will be queued to init within 30 seconds.

Adding daemons to inittab

Expecting the CRS daemons to be up within 600 seconds.

CSS is active on these nodes.

Node2

CSS is inactive on these nodes.

Node1

Local node checking complete.

Run root. sh on remaining nodes to start CRS daemons.

From the output, we can see that this script mainly implements crs configuration, formatting ocr disk, updating the/etc/inittab file, and starting the css process, you have created ocr in/var/opt/oracle. loc file and, scls_scr, oprocd folder.

2.2 view the crs process and the/etc/inittab file to see the node changes.

Root @ node2 # ps-ef | grep crs | grep-v grep

Oracle 18212 18211 0 14:47:28? 0: 00/oracle/crs/bin/ocssd. bin

Oracle 18191 18180 0 14:47:28? 0: 00/oracle/crs/bin/oclsmon. bin

Oracle 17886 1 0 14:47:27? 0: 00/oracle/crs/bin/evmd. bin

Oracle 18180 18092 0 14:47:28? 0: 00/bin/sh-c cd/oracle/crs/log/node2/cssd/oclsmon; ulimit-c unlimited;/ora

Root 17889 1 0 14:47:27? 0: 00/oracle/crs/bin/crsd. bin reboot

Oracle 18211 18093 0 14:47:28? 0: 00/bin/sh-c ulimit-c unlimited; cd/oracle/crs/log/node2/cssd;/oracle/crs

Root @ node2 # ls-rlt/var/opt/oracle/

Total 8

-Rw-r -- 1 root 55 Apr 2 oraInst. loc

Drwxrwxr-x 5 root 512 Apr 2 oprocd

Drwxr-xr-x 3 root 512 Apr 2 scls_scr

-Rw-r -- 1 root oinstall 48 Apr 2 ocr. loc

Note: ocr. loc, scls_scr, and oprocd are created, but/var/opt/oracle/oratab is not created.

Root @ node1 # more inittab

# Copyright 2004 Sun Microsystems, Inc. All rights reserved.

# Use is subject to license terms.

#

# The/etc/inittab file controls the configuration of init (1 M); for more

# Information refer to init (1 M) and inittab (4). It is no longer

# Necessary to edit inittab (4) directly; administrators shocould use

# Solaris Service Management Facility (SMF) to define services instead.

# Refer to smf (5) and the System Administration Guide for more

# Information on SMF.

#

# For modifying parameters passed to ttymon, use svccfg (1 m) to modify

# The SMF repository. For example:

#

# Svccfg

# Svc:> select system/console-login

# Svc:/system/console-login> setprop ttymon/terminal_type = "xterm"

# Svc:/system/console-login> exit

#

# Ident "@ (#) inittab 1.41 04/12/14 SMI"

Ap: sysinit:/sbin/autopush-f/etc/iu. ap

Sp: sysinit:/sbin/soconfig-f/etc/sock2path

Smf: sysinit:/lib/svc/bin/svc. startd>/dev/msglog 2 <>/dev/msglog </dev/console

P3: s1234: powerfail:/usr/sbin/shutdown-y-i5-g0>/dev/msglog 2 <>/dev/msglog

H1: 3: respawn:/etc/init. d/init. evmd run>/dev/null 2> & 1 </dev/null

H2: 3: respawn:/etc/init. d/init.css d fatal>/dev/null 2> & 1 </dev/null

H3: 3: respawn:/etc/init. d/init. crsd run>/dev/null 2> & 1 </dev/null

Root @ node1 # ls-rlt/etc/inittab *

-Rw-r -- 1 root 1072 Nov 2 inittab.css d

-Rw-r -- 1 root 1206 Mar 21 :15 inittab. pre10203

-Rw-r -- 1 root 1006 Mar 21 17:15 inittab. nocrs10203

-Rw-r -- 1 root 1040 Apr 2 14:50 inittab. orig

-Rw-r -- 1 root 1040 Apr 2 inittab. no_crs

-Rw-r -- 1 root 1240 Apr 2 14:50 inittab

-Rw-r -- 1 root 1240 Apr 2 inittab. crs

This script copies the inittab as inittab. no_crs, and the modified inittab copies the inittab as inittab. crs.

2.3 run $ CRS_HOME/root. sh on another node

Root @ node1 #/oracle/crs/root. sh

WARNING: directory '/oracle' is not owned by root

Checking to see if Oracle CRS stack is already configured

Checking to see if any 9i GSD is up

Setting the permissions on OCR backup directory

Setting up NS directories

Oracle Cluster Registry configuration upgraded successfully

WARNING: directory '/oracle' is not owned by root

Clscfg: EXISTING configuration version 3 detected.

Clscfg: version 3 is 10G Release 2.

Successfully accumulated necessary OCR keys.

Using ports: CSS = 49895 CRS = 49896 EVMC = 49898 and EVMR = 49897.

Node <nodenumber>: <nodename> <private interconnect name>

Node0: node2 node2-priv node2

Node 1: node1 node1-priv node1

Clscfg: Arguments check out successfully.

No keys were written. Supply-force parameter to override.

-Force is destructive and will destroy any previous cluster configuration.

Oracle Cluster Registry for cluster has already been initialized

Startup will be queued to init within 30 seconds.

Adding daemons to inittab

Expecting the CRS daemons to be up within 600 seconds.

CSS is active on these nodes.

Node2

Node1

CSS is active on all nodes.

Waiting for the Oracle CRSD and EVMD to start

Oracle CRS stack installed and running under init (1 M)

Running vipca (silent) for processing nodeapps

Creating VIP application resource on (2) nodes...

Creating GSD application resource on (2) nodes...

Creating ONS application resource on (2) nodes...

Starting VIP application resource on (2) nodes...

Starting GSD application resource on (2) nodes...

Starting ONS application resource on (2) nodes...

Done.

3. When running on the second node, it will run more than one task on the first node.

------- Run $ CRS_HOME/bin/vipca. sh


VIPCA. sh is mainly used to configure the vip and start the default resources of crs (6 by default when no database is created), and three background processes are started.

Root @ node1 # ps-ef | grep crs | grep-v grep

Oracle 18347 17447 0 14:51:06? 0: 00/oracle/crs/bin/evmlogger. bin-o/oracle/crs/evm/log/evmlogger.info-l/oracle/

Oracle 17447 1 0 14:50:47? 0: 00/oracle/crs/bin/evmd. bin

Oracle 17763 17756 0 14:50:48? 0: 00/oracle/crs/bin/ocssd. bin

Oracle 17756 17643 0 14:50:48? 0: 00/bin/sh-c ulimit-c unlimited; cd/oracle/crs/log/node1/cssd;/oracle/crs

Oracle 21216 1 0 14:52:28? 0: 00/oracle/crs/opmn/bin/ons-d

Oracle 21217 21216 0 14:52:28? 0: 00/oracle/crs/opmn/bin/ons-d

Oracle 17771 17642 0 14:50:48? 0: 00/bin/sh-c cd/oracle/crs/log/node1/cssd/oclsmon; ulimit-c unlimited;/ora

Oracle 17773 17771 0 14:50:48? 0: 00/oracle/crs/bin/oclsmon. bin

Root 17449 1 0 14:50:47? 0: 01/oracle/crs/bin/crsd. bin reboot

Root @ node2 # ps-ef | grep crs | grep-v grep

Oracle 18212 18211 0 14:47:28? 0: 00/oracle/crs/bin/ocssd. bin

Oracle 27467 27466 0 14:52:25? 0: 00/oracle/crs/opmn/bin/ons-d

Oracle 25252 17886 0 14:51:16? 0: 00/oracle/crs/bin/evmlogger. bin-o/oracle/crs/evm/log/evmlogger.info-l/oracle/

Oracle 27466 1 0 14:52:25? 0: 00/oracle/crs/opmn/bin/ons-d

Oracle 18191 18180 0 14:47:28? 0: 00/oracle/crs/bin/oclsmon. bin

Oracle 17886 1 0 14:47:27? 0: 00/oracle/crs/bin/evmd. bin

Oracle 18180 18092 0 14:47:28? 0: 00/bin/sh-c cd/oracle/crs/log/node2/cssd/oclsmon; ulimit-c unlimited;/ora

Root 17889 1 0 14:47:27? 0: 00/oracle/crs/bin/crsd. bin reboot

Oracle 18211 18093 0 14:47:28? 0: 00/bin/sh-c ulimit-c unlimited; cd/oracle/crs/log/node2/cssd;/oracle/crs

From the process on node2, we can see that after vipca. sh is executed, there will be three more background processes.

Root @ node1 # crs_stat-t

Name Type Target State Host

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

Ora... c03.gsd application ONLINE node1

Ora... c03.ons application ONLINE node1

Ora... c03.vip application ONLINE node1

Ora... c04.gsd application ONLINE node2

Ora... c04.ons application ONLINE node2

Ora... c04.vip application ONLINE node1

4. When installing the database software (binary), run $ ORACLE_HOME/root. sh In the last step.

Root @ node2 # $ ORACLE_HOME/root. sh

Running Oracle10 root. sh script...

The following environment variables are set:

ORACLE_OWNER = oracle

ORACLE_HOME =/oracle/10g

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The file "dbhome" already exists in/usr/local/bin. Overwrite it? (Y/n) [n]: y

Copying dbhome to/usr/local/bin...

The file "oraenv" already exists in/usr/local/bin. Overwrite it? (Y/n) [n]: y

Copying oraenv to/usr/local/bin...

The file "coraenv" already exists in/usr/local/bin. Overwrite it? (Y/n) [n]: y

Copying coraenv to/usr/local/bin...

Creating/var/opt/oracle/oratab file...

Entries will be added to the/var/opt/oracle/oratab file as needed

Database Configuration Assistant when a database is created

Finished running generic part of root. sh script.

Now product-specific root actions will be saved med.

This script is used to create dbhome, oraenv, and coraenv in the specified directory (/usr/local/bin by default) and create the oratab file in/var/opt/oracle.

Root @ node2 # ls-rlt/usr/local/bin

Total 18

-Rwxr-xr-x 1 oracle root 2428 Apr 2 dbhome

-Rwxr-xr-x 1 oracle root 2560 Apr 2 oraenv

-Rwxr-xr-x 1 oracle root 2857 Apr 2 coraenv

Root @ node2 # ls-rlt/var/opt/oracle/

Total 10

-Rw-r -- 1 root 55 Apr 2 oraInst. loc

Drwxrwxr-x 5 root 512 Apr 2 oprocd

Drwxr-xr-x 3 root 512 Apr 2 scls_scr

-Rw-r -- 1 root oinstall 48 Apr 2 ocr. loc

-Rw-r -- 1 oracle root 678 Apr 2 oratab

Root @ node1 #/oracle/10g/root. sh

Running Oracle10 root. sh script...

The following environment variables are set:

ORACLE_OWNER = oracle

ORACLE_HOME =/oracle/10g

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The file "dbhome" already exists in/usr/local/bin. Overwrite it? (Y/n) [n]: y

Copying dbhome to/usr/local/bin...

The file "oraenv" already exists in/usr/local/bin. Overwrite it? (Y/n) [n]: y

Copying oraenv to/usr/local/bin...

The file "coraenv" already exists in/usr/local/bin. Overwrite it? (Y/n) [n]: y

Copying coraenv to/usr/local/bin...

Creating/var/opt/oracle/oratab file...

Entries will be added to the/var/opt/oracle/oratab file as needed

Database Configuration Assistant when a database is created

Finished running generic part of root. sh script.

Now product-specific root actions will be saved med.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.