Wednesday 11 November 2020

How to Installation Linux and Grid Infrastructure Installation with Database Creation in ASM Storage

Installation of Linux 7.5 64bit

Operating System : Oracle Enterprise Linux 7.564it
Database & Grid Software : 12.1.0.2.0 64Bit EE
Space for OS Installation: 100GB
RAM : 4.2 GB 

Note:
Minimum RAM is recommended for grid Infrastructure. 
 
Click:-  Create a New Virtual Machine

Click:- Next with Typical (Recommended) Option

Select :- I will install the operating system later. Option and Click:- Next 


Select :- Linux option with version there you will use. Click:- Next

Write:- Virtual Machine Name and Machine. Click:- Next

Name: grid_oda

Location: E:\grid_oda

Write: -Storage for Machine and Select: - Split virtual disk into multiple files Click: - Next

Storage: 100GB

Click: - Customize Hardware

Memory   : 4096 (4GB)

Processor : 2 and 1

Select:- ISO Image file I Selected Linux 7.5 64bit

Select: - Network and Display setting as per Images

Click: - Close and Finish 

Set Operation System Configuration Gird Infrastructure and Data

   

1- Disbale Selinux (selinux must disabled)

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

$ getenforce

$ getenforce 0

$ sestatus

$ vi /etc/selinux/config

 # This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#     enforcing - SELinux security policy is enforced.

#     permissive - SELinux prints warnings instead of enforcing.

#     disabled - No SELinux policy is loaded.

SELINUX=enforcing            ------------ Change it (SELINUX=disabled)

# SELINUXTYPE= can take one of these two values:

#     targeted - Targeted processes are protected,

#     mls - Multi Level Security protection.

SELINUXTYPE=targeted

$ reboot

2- Disbale Firewall

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

$ systemctl status  firewalld.service

$ systemctl stop firewalld.service

$ systemctl disable  firewalld.service

$ systemctl status  firewalld.service

 3- Set Host file  

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

 $ vi /etc/hosts

 192.168.10.10    oda12.oracle.com oda12

 :wq!

 4- Install RPM for Oracle Database and Grid ASM CRS/SRV

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

 $ su - root

$ cd /u01/binary/Drv7.5/drv7.5/

 $ mkdir /media/cdrom

 $ mount /dev/sr0 /media/cdrom

 $ cp media.repo /etc/yum.repos.d/

 $ cd /media/cdrom/Packages/

 $ yum --disablerepo=\* --enablerepo=media install oracle-database-server-12cR2-preinstall-1.0-3.el7.x86_64

 $ ls *.rpm

oracleasmlib-2.0.12-1.el7.x86_64.rpm  oracleasm-support-2.1.11-2.el7.x86_64.rpm

 $ cd /u01/binary

 $ rpm -ivh oracleasmlib-2.0.12-1.el7.x86_64.rpm

 $ rpm -ivh oracleasm-support-2.1.11-2.el7.x86_64.rpm

 Note:

when we Installed Oracle Database preinstall rpm, rpm create oracle user, grid user and dba and oinstall group.

 Grid recommendation: 

You will create groups with fix IDs that`s why we will delete all users and groups and we will create all users and groups manually with fix Ids. 

 5- Users Delete on

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

 userdel oracle

userdel grid

 6- Group delete on both Machine or Node

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

 groupdel dba

groupdel oinstall

 7- User Drictory delete on both Machine or Node

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

 rm -rf /home/oracle

rm -rf /home/grid

 8- Add Group on both Machine or Node

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

 groupadd -g 1000 oinstall

groupadd -g 1100 asmadmin

groupadd -g 1200 dba

groupadd -g 1201 oper

groupadd -g 1300 asmdba

groupadd -g 1301 asmoper

9- Add user on both machine or node

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

useradd -u 1100 -g oinstall -G dba,asmadmin,asmdba,asmoper -d /home/grid -s /bin/bash -c "GI Owner" grid

useradd -u 1101 -g oinstall -G dba,asmdba,oper -d /home/oracle -s /bin/bash -c "OR Owner" oracle

10- Show Error (We can igrnore this error because of pervious oracle user some file available in "bin/bash"

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

 Creating mailbox file: File exists

 11- Create Directory for Oracle & Grid on OS

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

 mkdir -p /u01/app/grid

mkdir -p /u01/app/grid/product/12.1.0/home

mkdir -p /u01/app/oracle/product/12.1.0/db_1

mkdir -p /u01/app/oraInventory

 12- Set Users Password Oracle,Grid on OS

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

 passwd grid        (password=grid)

passwd oracle   (password=oracle)

 13- Change Ownership on Directories

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

 chown -R grid:oinstall /u01/app/grid

chown -R grid:oinstall /u01/app/oraInventory

chown -R grid:oinstall /u01/app/grid

chown -R oracle:oinstall /u01/app/oracle

chmod -R 775 /u01

 14- Write Bash_Profile for "GRID USER"

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

 vi /home/grid/.bash_profile

 # for Grid

 TMP=/tmp;

TMPDIR=/tmp;

 ORACLE_BASE=/u01/app/grid;

ORACLE_HOME=/u01/app/grid/product/12.1.0/home;

ORACLE_SID=+ASM;

PATH=$ORACLE_HOME/bin:$PATH;

EDITOR=vi;

 export TMP TMPDIR ORACLE_BASE ORACLE_HOME ORACLE_SID PATH EDITOR

export PATH

 :wq!

 15- Write Bash_Profile for "ORACLE USER"

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

vi /home/oracle/.bash_profile

 # for oracle

 TMP=/tmp;

TMPDIR=/tmp;

 ORACLE_BASE=/u01/app/oracle;

ORACLE_HOME=/u01/app/oracle/product/12.1.0/db_1;

ORACLE_SID=orcl;

ORACLE_HOSTNAME=oda12.oracle.com;

ORACLE_UNQNAME=orcl;

TZ=Etc/GMT-5;

LD_LIBRARY_PATH=$ORACLE_PATH/lib:/lib:/usr/lib;

PATH=$ORACLE_HOME/bin:$PATH;

EDITOR=vi;

CLASS_PATH=$ORACLE_HOME/Jre;

 export TMP TMPDIR ORACLE_BASE ORACLE_HOME ORACLE_SID ORACLE_HOSTNAME ORACLE_UNQNAME TZ PATH EDITOR LD_LIBRARY_PATH CLASS_PATH

export PATH

 :wq!

 16- Add New Limit for Grid "limits.conf" (oracle preinstall rpm alredy set Limit for Oracle DBS)

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

vi /etc/security/limits.conf

 grid soft nproc 2047

grid hard nproc 16384

grid soft nofile 1024

grid hard nofile 65536

VM Tab -> Settings... 

Click: Add...

Select: Hard Disk

Click: Next

Click: SCSI (Recommended)

Click: Next

Select: Create a new virtual disk

Click: Next

Maximum disk size (GB): 10

Select: Allocate all disk space now.

Select: Split virtual disk into multiple files

Click: Next

Click: Finish

1) Two Disks add 10 10 GB for CRS (AMS Cluster Installation)

2) Two Disks add 10 10 GB for FRA (Archive log and Backup)

3) Two Disks Add 20 20 GB for DATA (Database Only)

OS Disk Partition Formatting for Ready to Use

Note:  Perform All steps on ROOT User

1- Disk Formatting

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

$  fdisk -l

fdisk /dev/sdb

Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.

Device does not contain a recognized partition table

Building a new DOS disklabel with disk identifier 0x63812638.

Command (m for help): n

Partition type:

   p   primary (0 primary, 0 extended, 4 free)

   e   extended

Select (default p): p

Partition number (1-4, default 1): 1

First sector (2048-20971519, default 2048):

Using default value 2048

Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519):

Using default value 20971519

Partition 1 of type Linux and of size 10 GiB is set

Command (m for help): w

The partition table has been altered!

$ fdisk /dev/sdc

$ fdisk /dev/sdd

$ fdisk /dev/sde

$ fdisk /dev/sdf

$ fdisk /dev/sdg

Note:  All disks format as per above practice.

2- Listing Of Format Disk

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

$ fdisk -l

Disk /dev/sdb: 10.7 GB, 10737418240 bytes, 20971520 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x63812638

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1            2048    20971519    10484736   83  Linux

Note: All Disk show like this.

3- Configuring the Oracle ASM library

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

$ oracleasm configure -i

Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library

driver.  The following questions will determine whether the driver is

loaded on boot and what permissions it will have.  The current values

will be shown in brackets ('[]').  Hitting <ENTER> without typing an

answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: grid

Default group to own the driver interface []: asmadmin

Start Oracle ASM library driver on boot (y/n) [n]: y

Scan for Oracle ASM disks on boot (y/n) [y]:

Writing Oracle ASM library driver configuration: done

3- Start Oracle ASM library

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

$ /etc/init.d/oracleasm start

/etc/init.d/oracleasm is deprecated in favor of userspace tool: /usr/sbin/oracleasm

############# OR #############

$ /usr/sbin/oracleasm init

Creating /dev/oracleasm mount point: /dev/oracleasm

Loading module "oracleasm": oracleasm

Configuring "oracleasm" to use device physical block size

Mounting ASMlib driver filesystem: /dev/oracleasm

4- Create Disk Label for AMS

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

/usr/sbin/oracleasm createdisk DISK1 /dev/sdb1

Writing disk header: done

Instantiating disk: done

$ /usr/sbin/oracleasm createdisk DISK2 /dev/sdc1

$  /usr/sbin/oracleasm createdisk DISK3 /dev/sdd1

$ /usr/sbin/oracleasm createdisk DISK4 /dev/sde1

$  /usr/sbin/oracleasm createdisk DISK5 /dev/sdf1

$  /usr/sbin/oracleasm createdisk DISK6 /dev/sdg1

$ cd /dev/oracleasm/disks/

$ ls -lrt

total 0

brw-rw---- 1 grid asmadmin 8, 17 Oct  1 19:47 DISK1

brw-rw---- 1 grid asmadmin 8, 33 Oct  1 19:48 DISK2

brw-rw---- 1 grid asmadmin 8, 49 Oct  1 19:48 DISK3

brw-rw---- 1 grid asmadmin 8, 65 Oct  1 19:48 DISK4

brw-rw---- 1 grid asmadmin 8, 81 Oct  1 19:49 DISK5

brw-rw---- 1 grid asmadmin 8, 97 Oct  1 19:50 DISK6

Installation of Grid Infrastructure

Select :- Install and Configure Oracle Grid Infrastructure for a Standalone Server  Click :- Next

Click: - Next

Disk group name: CRS

Redundancy: Normal [O]

 High      :  Three disk mirroring with the same size of disk.  

Normal :  Two disk mirroring with the same size of disk.

External: Single disk no mirroring.

Candidate Disks [O]

Click: - Next

Note:  We are just installing cluster service with sprite group this disk group dedicated for ASM Configuration    

Select: - Use same passwords for these accounts [o]

Select: - sys password option [Admin_6677] Click: - Next

Note: 

Sys Password option and write sys password there with strong character [Admin_6677] we use this password when we will install DBS ASM SYS password and DBS sys password would be same.

Click: - Next

Click:- Next

Click :- Next

Click:- Next

Click:- Next

Click:- Install

Run on ROOT USER terminal

$ /u01/app/oraInventory/orainstRoot.sh 

$ /u01/app/grid/product/12.1.0/home/root.sh

ADD Disk Group Through ASMCA Utility

Note:

We will add two disk group for Database and Archive log both groups are same size with normal redundancy. Disk groups add on grid user with ASMCA utility.

Click:- Create     (For Disk Group Creation)

Disk Group Name: FRA

Redundancy : Normal

Select: Two Disks  

Note:

This group for FRA with the same Size (Flush Recovery Area).This group contain archivelog and backups. 

Click:- OK 

Click:- OK

Disk Group Name: DATA

Redundancy : Normal

Select: Two Disks 

Note:

This group for DATA with the same Size (Database Files).This group contain dbs file,redolog ,controlfile .

Click:- OK 

Click:-OK

Note:

We can see three disk group for deferent purpose.

CRS Disk Group : Standalone ASM Cluster Configuration ASM spfile and etc..

DATA Disk Group: For Datafile, Controlfile, redolog files etc...

FRA Disk Group: For Archivelog file and Backup.

Click:- Exit and Yes 

Oracle Database Software Installation

Click: Next and Yes

Select : Install database software only

Click: Next

Select : Single instance database installation

Click: Next

Click: Next

Click: Next

Click: Next

Click: Next

Click: Install

Click: OK 

Click: Close

Database Creation

Select: Create Database

Click: Next

Global Database Name: orcl

 Database Files Location: +DATA

 Fast Recovery Area: +FRA

 Database Character Set: AL32UTF8

 Administrator Password: Admin_6677

 Confirm Password: Admin_6677

 [Uncheck] Create As Container Database

Click:  Next

Click: - OK and Close

 
Completed.

Note: My Future Post Will Linked with this Post


No comments:

Post a Comment