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]$
Step:-2 Click Next
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:-5 Select
Enterprise Edition and 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.
Run the root.sh script as a root user
from the location shown above [root@ranesh db_1]# sh root.sh
Performing root user
operation.
The following environment
variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/12.1.0.2/db_1
Enter the full pathname of
the local bin directory: [/usr/local/bin]:
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.
Entries will be added to the
/etc/oratab file as needed by
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 Advanced
option
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
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
+DATA/PRODASM/CONTROLFILE/current.261.1069004777
/u01/app/oracle/fast_recovery_area/PRODASM/controlfile/o1_mf_j6mcjk5j_.ctl
SQL> select member from v$logfile;
MEMBER
--------------------------------------------------------------------------------
+DATA/PRODASM/ONLINELOG/group_3.264.1069004785
/u01/app/oracle/fast_recovery_area/PRODASM/onlinelog/o1_mf_3_j6mcjvh3_.log
+DATA/PRODASM/ONLINELOG/group_2.263.1069004783
/u01/app/oracle/fast_recovery_area/PRODASM/onlinelog/o1_mf_2_j6mcjqwp_.log
+DATA/PRODASM/ONLINELOG/group_1.262.1069004781
/u01/app/oracle/fast_recovery_area/PRODASM/onlinelog/o1_mf_1_j6mcjom6_.log
[oracle@ranesh ~]$ . grid_env
[oracle@ranesh ~]$ asmcmd
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 20479 18753 0 18753 0 N DATA/
[oracle@ranesh ~]$ asmcmd
ASMCMD> cd data
ASMCMD> ls
ASM/
PRODASM/
orapwasm
ASMCMD> cd PRODASM/
ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
ASMCMD> cd DATAFILE/
ASMCMD> ls
SYSAUX.257.1069004377
SYSTEM.258.1069004527
UNDOTBS1.260.1069004717
USERS.259.1069004713
ASMCMD> pwd
+data/PRODASM/DATAFILE
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)