Installation of Grid Infrastructure for a
Standalone server (Oracle Restart)
12c (12.1.0.2)
Stage-1 Oracle
Grid and DB Installation Prerequisites
yum install
oracle-rdbms-server-12cR1-preinstall –y
[root@ranesh
yum.repos.d]# yum install oracle-rdbms-server-12cR1-preinstall -y
Step:-2 Oracle ASM Prerequisites
yum install oracleasm-support
yum install kmod-oracleasm
The oracleasmlib package
cannot be downloaded from YUM repository:
# yum install oracleasmlib
Loaded plugins: security
ol6_latest | 1.4 kB 00:00
ol6_u3_base | 1.4 kB 00:00
ol6_u3_base/primary | 2.7 MB 00:07
ol6_u3_base 8452/8452
Setting up Install Process
No package oracleasmlib available.
Error: Nothing to do
#
However, we need to download oracleasmlib from
Oracle’s website and install it using rpm. To download it directly
within terminal using wget utility, we can use below command.
# wget http://download.oracle.com/otn_software/asmlib/oracleasmlib-2.0.12-1.el6.x86_64.rpm
After downloading we will have to install it using rpm.
( Or)
Download- Intel EM64T (x86_64) Architecture
https://www.oracle.com/linux/downloads/linux-asmlib-v6-downloads.html
[root@ranesh
yum.repos.d]# chmod -R 775 oracleasmlib-2.0.12-1.el6.x86_64.rpm
[root@ranesh
yum.repos.d]# rpm -ivh oracleasmlib-2.0.12-1.el6.x86_64.rpm
Preparing...
################################# [100%]
Updating
/ installing...
1:oracleasmlib-2.0.12-1.el6 #################################
[100%]
Step:-3 Set Static IP
Address and enter hosts file
After installation the
RPM’s using Yum.Change to static IP and restart
Go to System->Preferences-Network
Connections-IPV4-Change Manaul
Service network restart.
Hosts File
The
"/etc/hosts" file must contain a fully qualified name for the server.
[root@ranesh
yum.repos.d]# cat /etc/hosts
127.0.0.1
localhost localhost.localdomain localhost4 localhost4.localdomain4
::1
localhost localhost.localdomain localhost6 localhost6.localdomain4
192.168.145.134
ranesh.asm ranesh
[root@ranesh yum.repos.d]# service network restart
Restarting network (via systemctl): [
OK ]
Step:-4 Set the password for the
"oracle" user.
[root@ranesh
]# passwd oracle
Changing
password for user oracle.
New
password:
BAD
PASSWORD: it is based on a dictionary word
BAD
PASSWORD: is too simple
Retype
new password:
passwd:
all authentication tokens updated successfully.
Step:-5 Set secure
Linux to permissive by editing the "/etc/selinux/config" file, making
sure the SELINUX flag is set as follows.
SELINUX=permissive
[root@ranesh
yum.repos.d]# vi /etc/selinux/config
[root@ranesh
yum.repos.d]# cat /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=permissive
#
SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are
protected,
# minimum - Modification of targeted policy.
Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
Step:-6 If you have the Linux firewall
enabled, you will need to disable or configure it, as shown here or here. To
disable it, do the following.
#
systemctl disable firewall
Step:-7 Create the directory structures and set ownership and permissions for Grid and Oracle software will be installed.
[root@ranesh
~]# mkdir -p /u01/app/oracle/product/12.1.0.2/db_1
[root@ranesh
~]# chown -R oracle:oinstall /u01
[root@ranesh ~]# chmod -R 775 /u01
[root@ranesh
~]# su - oracle
[oracle@oracleasm
~]$ vi .bash_profile
[oracle@oracleasm ~]$ cat .bash_profile
export
TMP=/tmp
export
TMPDIR=$TMP
export
ORACLE_UNQNAME=prodasm
export
ORACLE_BASE=/u01/app/oracle
export
GRID_HOME=/u01/app/oracle/12.1.0.2/grid
export
DB_HOME=$ORACLE_BASE/product/12.1.0.2/db_1
export
ORACLE_HOME=$DB_HOME
export
ORACLE_SID=prodasm
export
ORACLE_TERM=xterm
export
BASE_PATH=/usr/sbin:$PATH
export
PATH=$ORACLE_HOME/bin:$BASE_PATH
export
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
alias
grid='. /home/oracle/grid_env'
alias
db='. /home/oracle/db_env'
Grid
Create a file called "/home/oracle/grid_env" with the
following contents.
export
ORACLE_SID=+ASM
export
ORACLE_HOME=$GRID_HOME
export
PATH=$ORACLE_HOME/bin:$BASE_PATH
export
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
Database
Create a file called "/home/oracle/db_env" with the
following contents.
export
ORACLE_SID=prodasm
export
ORACLE_HOME=$DB_HOME
export
PATH=$ORACLE_HOME/bin:$BASE_PATH
export
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
Once the "/home/oracle/.bash_profile" has been run, you
will be able to switch between environments as follows.
[oracle@oracleasm
~]$ . db_env
[oracle@oracleasm
~]$ echo $ORACLE_HOME
/u01/app/oracle/product/12.1.0.2/db_1
[oracle@oracleasm
~]$ . grid_env
[oracle@oracleasm
~]$ echo $ORACLE_HOME
/u01/app/oracle/12.1.0.2/grid
Add
Hardware Wizard and click next
Select
SCSCI and click Next
Select
create new virtual disk and click Next
Enter ASM Disk size and click Next
Click Finish to create
ASM Disk is creating now
After
disk is created click Advanced button
Select
Independent and click Ok
Login
in to Root User and check fdisk –l
[root@ranesh ~]# fdisk -l
Disk /dev/sda: 128.8 GB, 128849018880 bytes,
251658240 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: 0x00065635
Device
Boot Start End Blocks
Id System
/dev/sda1
* 2048 2099199
1048576 83 Linux
/dev/sda2 2099200 251658239
124779520 8e Linux LVM
Disk /dev/sdb: 21.5 GB, 21474836480 bytes,
41943040 sectors---------asm disk
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512
bytes
I/O size (minimum/optimal): 512 bytes / 512
bytes
Partition
the disks
[root@ranesh
~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.23.2).
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 0x9da6a785.
Command
(m for help): m
Command
action
a
toggle a bootable flag
b
edit bsd disklabel
c
toggle the dos compatibility flag
d
delete a partition
g
create a new empty GPT partition table
G
create an IRIX (SGI) partition table
l
list known partition types
m
print this menu
n
add a new partition
o
create a new empty DOS partition table
p
print the partition table
q
quit without saving changes
s
create a new empty Sun disklabel
t
change a partition's system id
u
change display/entry units
v
verify the partition table
w
write table to disk and exit
x
extra functionality (experts only)
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-41943039, default 2048):
Using
default value 2048
Last
sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039):
Using
default value 41943039
Partition
1 of type Linux and of size 20 GiB is set
Command
(m for help): w
The
partition table has been altered!
Calling
ioctl() to re-read partition table.
Syncing
disks.
Check
fdisk –l
Stage 2 Grid Installation ----
One
by one
unzip
p17694377_121020_Linux-x86-64_1of8.zip
unzip
p17694377_121020_Linux-x86-64_2of8.zip
unzip
p17694377_121020_Linux-x86-64_3of8.zip
unzip
p17694377_121020_Linux-x86-64_4of8.zip
[oracle@ranesh
12102]$ ls -ltr
drwxr-xr-x.
7 oracle oinstall 4096 Jul 11 2014 grid
drwxrwxr-x.
7 oracle oinstall 4096 Apr 3 17:44
database
Step:-2 Run precheck utility
[root@ranesh ~]# rpm -iv
/u01/app/12102/grid/rpm/cvuqdisk-1.0.9-1.rpm
Preparing
packages...
Using
default group oinstall to install package
cvuqdisk-1.0.9-1.x86_64
[oracle@ranesh
app]$ cd grid/
[oracle@ranesh
grid]$ ls
install response
runcluvfy.sh sshsetup welcome.html
readme.html rpm
runInstaller stage
[oracle@ranesh grid]$ ./runcluvfy.sh stage
-pre hacfg
Performing
pre-checks for Oracle Restart configuration
Total
memory check passed
Available
memory check passed
Swap
space check failed
Check
failed on nodes:
ranesh
Free
disk space check passed for
"ranesh:/usr,ranesh:/var,ranesh:/etc,ranesh:/sbin,ranesh:/tmp"
Check
for multiple users with UID value 54321 passed
User
existence check passed for "oracle"
Group
existence check passed for "oinstall"
Group
existence check passed for "dba"
Membership
check for user "oracle" in group "oinstall" [as Primary]
passed
Membership
check for user "oracle" in group "dba" passed
Run
level check passed
Hard
limits check passed for "maximum open file descriptors"
Soft
limits check passed for "maximum open file descriptors"
Hard
limits check passed for "maximum user processes"
Soft
limits check passed for "maximum user processes"
System
architecture check passed
Kernel
version check passed
Kernel
parameter check passed for "semmsl"
Kernel
parameter check passed for "semmns"
Kernel
parameter check passed for "semopm"
Kernel
parameter check passed for "semmni"
Kernel
parameter check passed for "shmmax"
Kernel
parameter check passed for "shmmni"
Kernel
parameter check passed for "shmall"
Kernel
parameter check passed for "file-max"
Kernel
parameter check passed for "ip_local_port_range"
Kernel
parameter check passed for "rmem_default"
Kernel
parameter check passed for "rmem_max"
Kernel
parameter check passed for "wmem_default"
Kernel
parameter check passed for "wmem_max"
Kernel
parameter check passed for "aio-max-nr"
Kernel
parameter check passed for "panic_on_oops"
Package
existence check passed for "binutils"
Package
existence check passed for "compat-libcap1"
Package
existence check passed for "compat-libstdc++-33(x86_64)"
Package
existence check passed for "libgcc(x86_64)"
Package
existence check passed for "libstdc++(x86_64)"
Package
existence check passed for "libstdc++-devel(x86_64)"
Package
existence check passed for "sysstat"
Package
existence check passed for "gcc"
Package
existence check passed for "gcc-c++"
Package
existence check passed for "ksh"
Package
existence check passed for "make"
Package
existence check passed for "glibc(x86_64)"
Package
existence check passed for "glibc-devel(x86_64)"
Package
existence check passed for "libaio(x86_64)"
Package
existence check passed for "libaio-devel(x86_64)"
Package
existence check passed for "nfs-utils"
Check
for multiple users with UID value 0 passed
Current
group ID check passed
Starting
check for consistency of primary group of root user
Check
for consistency of root user's primary group passed
Pre-check
for Oracle Restart configuration was unsuccessful.
Step:-3 Configuring ASM
At this point ASMLib and its support packages
are now installed, however not configured yet. Before we start to configure
ASMLib, ensure following os user and os groups are created. In our case, it's
already done.
[oracle@ranesh ~]$ rpm -qa | grep oracleasm
oracleasmlib-2.0.12-1.el6.x86_64
oracleasm-support-2.1.11-2.el7.x86_64
kmod-oracleasm-2.0.8-28.0.1.el7.x86_64
If we’ve all three packages installed, then
we’re good to proceed further with configuration of ASM
Driver. We’ll have to perform below action as a root user.
[root@ranesh ~]# 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 []: oracle
Default
group to own the driver interface []: oinstall
Start
Oracle ASM library driver on boot (y/n) [n]: y
Scan
for Oracle ASM disks on boot (y/n) [y]: y
Writing
Oracle ASM library driver configuration: done
[root@ranesh ~]# /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
[root@ranesh ~]# /usr/sbin/oracleasm createdisk DISK1 /dev/sdb1
Writing
disk header: done
Instantiating
disk: done
[oracle@ranesh ~]$ cd /dev/oracleasm/disks
[oracle@ranesh
disks]$ ls -lrt
total
0
brw-rw----.
1 oracle oinstall 8, 17 Apr 4 12:51
DISK1
Now we’re good to initiate Database‘s and Grid Infrastructure‘s installation. We’ll install Grid Infrastructure first and then Database. From oracle user
[oracle@ranesh
grid]$ pwd
/u01/app/grid
[oracle@ranesh
app]$ cd grid/
[oracle@ranesh grid]$ ./runInstaller
Starting
Oracle Universal Installer...
Checking
Temp space: must be greater than 415 MB.
Actual 5401 MB Passed
Checking
swap space: must be greater than 150 MB.
Actual 4607 MB Passed
Checking
monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing
to launch Oracle Universal Installer from /tmp/OraInstall2021-04-04_03-21-45PM.
Please wait ...[oracle@ranesh grid]$
Click next
Step:-3 Set the redundancy to "External", click the
"Change Discovery Path" button and set the path to
"/dev/oracleasm/disks*". Return the main screen and select all disks
and click the "Next" button.
Note : If your created disks are not visible, Select Show All
Disks from drop down or you can also try changing Discovery Path. Changing ASM
Disks’ discovery path. Enter path of your oracleasm disk and click
OK.
Step:-4 Provide password for sysasm and asmsnmp user, in my
case I’m setting same password for both users. set your password and click
NEXT.
Step:-5 Enterprise Manager Cloud Control setup, leave it
unchecked and click Next.
Step:-6 Select groups and click NEXT.
Note : Users of the selected group will be able to perform
dba operations and will be able to connect as sysasm.
Note : You’ll be prompted with warning saying you
have selected same group for OSOPER and OSASM, as we’ve selected same group.
here we can click and Yes and ignore this warning.
Step:-7 Select ORACLE_BASE and ORACLE_HOME for Grid
Infrastructure and click NEXT.
Note : If you notice here, you’ve no remedy to
change ORACLE_HOME for Grid Infrastructure, and it’s the location where we have
placed setup of Grid Infrastructure.
Step:-8 If you want the root scripts to run automatically, enter the relevant credentials. I prefer to run them manually. Click the "Next" button.
Note: Supply root password to Automatically run configuration script or leave it unchecked to run script manually and click NEXT
Step:-9 Wait while the prerequisite checks complete. If you
have any issues use the "Fix & Check Again" button
Click Install
We’ve Successfully Installed Oracle Grid Infrastructure 12c.
[oracle@ranesh grid]$ crsctl
stat res -t
--------------------------------------------------------------------------------
Name Target
State Server
State details Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg ONLINE ONLINE
ranesh STABLE ora.LISTENER.lsnr
ONLINE ONLINE
ranesh STABLE
ora.asm
ONLINE ONLINE
ranesh Started,STABLE
ora.ons
OFFLINE OFFLINE ranesh STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1
ONLINE ONLINE ranesh STABLE
ora.diskmon
1
OFFLINE OFFLINE STABLE
ora.evmd
1
ONLINE ONLINE ranesh STABLE
--------------------------------------------------------------------------------
We’ve Successfully Installed Oracle Grid Infrastructure 12c.
Stage-3 Continue with Oracle DB installation….
[oracle@ranesh
~]$ ls
db_env grid_env
[oracle@ranesh
~]$ . db_env
[oracle@ranesh app]$ cd database/
[oracle@ranesh
database]$ ls
install readme.html
response rpm runInstaller
sshsetup stage welcome.html
[oracle@ranesh
database]$ ./runInstaller
Starting
Oracle Universal Installer...
Checking Temp space: must be greater than 500 MB. Actual 3602 MB Passed
Checking
swap space: must be greater than 150 MB.
Actual 4603 MB Passed
Checking
monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to
launch Oracle Universal Installer from /tmp/OraInstall2021-04-04_04-24-34PM.
Please wait ...
Install
the Database Software
Step:-1 Uncheck
the security updates checkbox and click the "Next" button and
"Yes" on the subsequent warning dialog.
Step:-2 Select
the "Install database software only" option, then click the
"Next" button.
Step:-3
Select Single
instance database installation and
click NEXT.
Step:-4
Click NEXT.
Step:-6 Select the directory for Oracle base and Oracle Home
in software location field, which we have created and click NEXT.
Step:-7 Select group as oracle and click NEXT.
Step;-8 For
any prerequisite failure click on Fix & check Again button. and run the
fixup script from the given location as a root user. Failures which says yes in Fixable column will be fixed.
Step:-9 Installation Summary, verify your selections and click on Install.
[root@ranesh db_1]# sh root.sh
Performing root user
operation.
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/12.1.0.2/db_1
The contents of
"dbhome" have not changed. No need to overwrite.
The contents of
"oraenv" have not changed. No need to overwrite.
The contents of
"coraenv" have not changed. No need to overwrite.
Database Configuration
Assistant when a database is created
Finished running generic
part of root script.
Now product-specific root
actions will be performed.
Continue
Stage-4 Creating ASM Diskgroup and Database….
[oracle@ranesh ~]$ . grid_env
[oracle@ranesh ~]$ asmca
SQL>
SELECT name, free_mb, total_mb, total_mb-free_mb "USED_MB",
free_mb/total_mb*100 "%FREE" FROM v$asm_diskgroup;
NAME FREE_MB TOTAL_MB USED_MB %FREE
------------------------------
---------- ---------- ---------- ----------
DATA 20417
20479 62 99.6972508
SQL> select name,path,mount_status,header_status,mode_status,state,total_mb,free_mb from v$asm_disk;
NAME PATH MOUNT_S HEADER_STATU MODE_ST STATE TOTAL_MB FREE_MB
------------------------------ ---------------------------------------- ------- ------------ ------- -------- ---------- ----------
DATA_0000 /dev/oracleasm/disks/DISK1 CACHED MEMBER ONLINE NORMAL 20479 20417
Database creation Using DBCA.
[oracle@ranesh ~]$ . db_env
[oracle@ranesh ~]$ cd $ORACLE_HOME
[oracle@ranesh db_1]$ dbca
Select the General Purpose option
SID: This is the short name for your database. It equates
to your environment variable ORACLE_SID.
Enterprise Manager Cloud
Control setup, leave it unchecked and click Next.
Provide password for sys and
system user, in my case I’m setting same password for both users. set your
password and click NEXT.
In the Specify Network Configuration Details
window, select already created Grid listener and click Next
In the Select Database
Storage Option window, select Database file location as +DATA and click Next
In the Select Oracle Data Vault Config option
window, select default uncheck all and click Next
In the Specify Configuration Options window,
specify appropriate SGA and PGA values and click Next
leave it checked create Database and click Next.
Once Prerequisite checks complete click Next
In the Summary
window, review summary and click Finish
ASM
Database Creation is Progress..
ASM Database Creation is Completed
[oracle@ranesh ~]$ . db_env
[oracle@ranesh ~]$
[oracle@ranesh ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Sun Apr 4 17:55:40 2021
Copyright (c) 1982, 2014, Oracle. All rights reserved.Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
+DATA/PRODASM/DATAFILE/system.258.1069004527
+DATA/PRODASM/DATAFILE/sysaux.257.1069004377
+DATA/PRODASM/DATAFILE/undotbs1.260.1069004717
+DATA/PRODASM/DATAFILE/users.259.1069004713
Listener Status
[oracle@ranesh ~]$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 04-APR-2021 18:04:14
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ranesh.asm)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 04-APR-2021 16:12:28
Uptime 0 days 1 hr. 51 min. 47 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/12.1.0.2/grid/network/admin/listener.o ra
Listener Log File /u01/app/oracle/diag/tnslsnr/ranesh/listener/alert/log .xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ranesh.asm)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "prodasm" has 1 instance(s).
Instance "prodasm", status READY, has 1 handler(s) for this service...
Service "prodasmXDB" has 1 instance(s).
Instance "prodasm", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@ranesh db_1]$ tnsping prodasm
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS
= (PROTOCOL = TCP)(HOST = ranesh.asm)(PORT = 1521)) (CONNECT_DATA = (SERVER =
DEDICATED) (SERVICE_NAME = prodasm)))
OK (70 msec)
No comments:
Post a Comment